A multi-channel VDMA control method and its application
Through the multi-channel VDMA control method, the VDMA interface, data processing module, arbiter and other components are used to solve the problem of large resource occupation and low efficiency of the existing multi-channel DMA controller, achieve resource saving and read and write efficiency improvement, and simplify the MCU control.
Patent Information
- Application Number
- CN201910973037.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-10-14
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2039-10-14
AI Technical Summary
Existing multi-channel DMA controllers occupy large resources and are inefficient in video applications, cannot effectively share modules, increase memory and logic resource overhead, and require frequent MCU intervention in DMA operations.
Using a multi-channel VDMA control method, including VDMA interface, data processing module, channel arbiter and bus driver control module, real-time monitoring and processing of data flow is realized through FIFO control and data sorting module. The arbiter scans instructions through preset priority index and Data queue, omitting bus conversion, realizes the multiplexing of data bus.
It saves logic resources and improves data access efficiency. The resources occupied by a single channel are reduced by about 3/4. The read and write efficiency is close to the existing solution. The control parameters of the MCU are simplified, and the data is transmitted automatically without additional intervention.
Smart Images

Figure CN112732603B
Abstract
Description
Technical Field
[0001] The present invention relates to a video direct memory access (VDMA) control, and more specifically, to a multi-channel VDMA control method and application thereof. Background Art
[0002] AXI VDMA is an IP core provided by Xilinx, which is used to convert data streams in AXI Stream format into MemoryMap format or vice versa, so as to achieve communication with DDR. Many video applications require frame buffers to handle frame rate changes or image scaling, cropping and other size transformation operations. The original intention of AXI VDMA design is to efficiently realize data transmission between AXI4-Stream video stream interface and AXI4 interface.
[0003] Figure 1 This is the VDMA architecture officially announced by Xilinx. As can be seen from the block diagram, VDMA is mainly composed of four parts: Control and Status, Registers, Data Mover, and Line Buffer, and its resource usage is relatively large.
[0004] Currently, they all use IP cores provided by manufacturers (such as Figure 1 as shown) as the basis for construction. Figure 2 This is a schematic diagram of a multi-channel DMA solution built on the basis of the existing VDMA architecture. Figure 2 As shown in the figure, it mainly includes bus conversion, VDMA, control bus arbiter and data bus arbiter circuit. Since each channel needs to occupy a bus conversion and VDMA. VDMA also includes four parts: control and status, registers, data handling module (DataMover), and line buffer. It consumes a lot of resources. When multiplexing is required, the modules cannot be shared, which increases the memory and logic resource overhead to a certain extent. Summary of the invention
[0005] In order to solve the above problems in the prior art, the present invention provides a multi-channel VDMA control method and application thereof.
[0006] The first aspect of the present application is to provide a multi-channel VDMA control method, having a write channel and a read channel, comprising:
[0007] Write and read data streams via the VDMA interface;
[0008] The VDMA interface controls the address sequence generator to generate a command queue for the data stream;
[0009] The FIFO control monitors the FIFO of the data stream in real time to control the writing and reading of the data stream;
[0010] The data streams are combined into required data queues by a data sorting module;
[0011] The arbitrator scans the instruction queue and the data queue through a preset priority index.
[0012] A second aspect of the present application is to provide a multi-channel VDMA controller having a write channel and a read channel, comprising:
[0013] A VDMA interface module, used for writing data to the write channel or reading data from the read channel;
[0014] A data processing module, used for processing the video stream data read or written;
[0015] A channel arbiter module is used to scan the input and output of the read and written video stream data, wherein:
[0016] The VDMA interface module is connected to the video stream and the data processing module respectively;
[0017] The data processing module is connected to the VDMA interface module and the data channel arbiter module respectively;
[0018] The channel arbiter module is connected to the data processing module and the bus drive control module respectively.
[0019] The present application provides a multi-channel VDMA control method and application, which is built based on the multi-channel VDMA controller, omitting the following steps: Figure 2 The bus conversion shown enables multiple video sources to enter the multi-channel VDMA at the same time, thus saving logic resources. In addition, the reuse of the data bus improves the access efficiency to a certain extent. For example, under the same FPGA platform (such as XILINX-zynq7020), the existing solution occupies about 1.5K logic resources per channel, while this solution occupies about 0.35K, saving about 3 / 4 of the resources, and the read and write efficiency of the two are almost the same. The test on the platform (microsime-M2S060) has reduced about 1 / 2 of the resources, and the test on the intel-ep4ce40 has also reduced about 1 / 2 of the resources.
[0020] In addition, the multi-channel VDMA controller of the present invention is different from the existing multi-channel DMA controller in the following advantages: first, the VDMA of the present invention involves DMA of images and videos, while the existing multi-channel DMA is not targeted at a certain field, but is only direct memory access of data; second, the data of the VDMA of the present invention conforms to the video stream format. After setting the image size and the number of buffered frames and turning it on, the MCU does not need additional control parameters, and the data can be transferred between the video port and the DDR by itself, and no subsequent intervention is required. The existing DMA does not have a fixed data format. Each DMA operation requires the MCU to calculate the starting address, set the burst length, etc. before starting the DMA, and intervention is required again before each DMA operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is the VDMA architecture officially announced by Xilinx;
[0022] Figure 2 It is a schematic diagram of using the existing VDMA architecture as a basis for construction;
[0023] Figure 3 is a flow chart of a multi-channel VDMA control method of an exemplary embodiment of the present application;
[0024] Figure 4 is a schematic diagram of a process flow of processing channel selection of a write channel arbiter provided by an exemplary embodiment of the present application;
[0025] Figure 5 It is a flowchart of command queue splitting of a write channel arbiter provided by an exemplary embodiment of the present application;
[0026] Figure 6 is a schematic diagram of a process flow of processing channel selection of a read channel arbiter provided by an exemplary embodiment of the present application;
[0027] Figure 7 is a flowchart of instruction queue splitting of a read channel arbiter provided by an exemplary embodiment of the present application; and
[0028] Figure 8 It is a structural diagram of a multi-channel VDMA controller provided by an exemplary embodiment of the present application.
[0029] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. The various implementations in the present application may be implemented separately or in combination without conflict.
[0031] Figure 3 1 is a flow chart of a multi-channel VDMA control method of an exemplary embodiment of the present application. The multi-channel VDMA control method may include:
[0032] Step 1: Write and read data streams of multiple channels via the VDMA interface.
[0033] In this embodiment, the data stream complies with the AXIS basic protocol, that is, it includes signals such as tdata, tvalid, tid, and tready.
[0034] The VDMA interface includes a write channel VDMA interface and a read channel VDMA interface.
[0035] It should be noted that the write channel is a slave device, while the read channel is a master device. The channel type of the master and slave devices cannot be changed.
[0036] Step 2: The VDMA interface controls the address sequence generator to generate a VDMA data instruction queue for the data stream. (hereinafter referred to as "command queue") .
[0037] In this embodiment, the instruction queue includes but is not limited to the following parameters: burst first address, burst length, burst request, channel ID, and queue validity.
[0038] Step 3: The FIFO control monitors the FIFO of the data stream in real time to control the writing and reading of the data stream.
[0039] In this step, the FIFO control includes different processes for write channel FIFO control and read channel FIFO control.
[0040] In the write channel, FIFO control receives the write data from the external device and performs clock domain conversion. FIFO control monitors FIFO in real time and controls the inflow and outflow of data. w When the amount of data is less than the preset number N, stop writing to the channel w When M is turned on, the channel is written. w The value range: FIFO depth>M w >One row of data capacity; N w The value range is: (FIFO depth - one line of data capacity)>N w ≧0.
[0041] In the write channel, the FIFO control monitors the FIFO of the write data in real time and controls the triggering of the ready signal of the write channel. When the amount of the write data is greater than the burst length preset by the AXIS, a ready signal is generated, otherwise the ready signal is 0.
[0042] In the read channel, the FIFO control receives the sorted data read back by the data sorting circuit, and the FIFO performs clock domain conversion. The FIFO control monitors the FIFO in real time and controls the inflow and outflow of data. r When the channel is turned on for reading, the amount of data is less than N r When the channel is closed, the reading is turned off, where the value range of N is: N r >FIFO depth.
[0043] In this embodiment, the FIFO capacity can be greater than the capacity of a row of data, the write channel input clock is the local clock, and the output clock is the bus clock; the read channel input clock is the bus clock, and the output clock is the local clock.
[0044] Step 4: The data sorting module combines the data stream into the required data sequence.
[0045] In this step, the processes of the write channel data sorting module and the read channel data sorting module are different.
[0046] In the write channel, the write channel data arrangement module combines the data written through the write channel FIFO control into a data queue required by the write channel arbiter through a preset data arrangement method.
[0047] In the read channel, the read channel data sorting module sorts the data sequence transmitted by the read channel arbiter into the data queue required by the read channel through a preset data arrangement method, and then enters the read channel FIFO control.
[0048] It should be noted that the data queues required by the write channel arbiter and the read channel arbiter must include the bit width and burst length, and these two parameters can be changed according to the timing requirements.
[0049] It is further noted that, whether in the write channel or the read channel, when data overflows or the data is empty, the FIFO control sends an error message and transmits the error message to the MCU through the control bus, thereby resetting or starting the VDMA controller.
[0050] Step 5: The arbitrator scans the instruction queue or the data queue through a preset priority index.
[0051] Specifically, the instruction queue / data queue of the write channel is scanned and selected for output, and the instruction queue / data queue of the read channel is scanned and selected for reading.
[0052] In this step, the arbitrator includes a write channel arbitrator and a read channel arbitrator.
[0053] In addition, the arbiter includes a matching bus for matching the bus required in the bus driver control module. The bus required by the bus driver control module is consistent with the bus of the memory controller, including but not limited to AXI / OPB and other buses.
[0054] Will be combined later Figure 4-Figure 7 The scanning, selecting, outputting and reading of the instruction queue / data queue by the write channel arbiter and the read channel arbiter are described in detail and will not be repeated here.
[0055] Step 6: The bus driver control module encapsulates the internal data stream into the bus required by the memory external device.
[0056] For example, if a DDR3 memory is used, a DDR3 controller with an AXI bus is mounted outside the memory, and the VDMA controller is connected to the DDR3 controller via the AXI bus to implement reading and writing of the DDR3.
[0057] In this step, the bus driver control module includes: a write instruction buffer, a write data buffer, a read instruction buffer, a read data buffer and a bus driver circuit.
[0058] 1) Write instruction buffer and write data buffer are used for write channel.
[0059] The write instruction buffer is used to buffer the instruction queue output by the write channel arbiter. When the memory is idle, the instruction queue is sent to the memory controller. At the same time, the release quantity of the write data buffer is controlled according to the burst length in the instruction queue.
[0060] 2) The read instruction buffer and the read data buffer are used for the read channel.
[0061] The read instruction buffer is used to buffer the instruction queue output by the read channel arbiter. When the memory is idle, the instruction queue is sent to the memory controller. At the same time, the read data buffer receives the data read back by the controller and compares whether it corresponds to the burst length in the instruction queue.
[0062] 3) The bus driver control module also monitors in real time whether each buffer has overflow or empty read status, and informs the microcontroller unit (MCU) to handle the exception.
[0063] In this embodiment, the bus protocol from the bus driver control module to the memory controller is not limited and depends on the controller, and can be AXI, AXI-lite, AXI-STREAM, AHB, OPB, etc.
[0064] It should be noted that throughout the entire multi-channel VDMA control method process, the control bus can be connected to various modules inside the VDMA controller, and the MCU configures the parameters inside the entire VDMA controller through the control bus. For example, it includes:
[0065] 1) Configure the frame buffer quantity, data bit width, address bit width, data arrangement, resolution, redundant filling method, line buffer size, etc. of the read channel and write channel;
[0066] 2) Configure the priority index, data burst mode, channel delay, etc. in the arbitrator; configure the buffer size, bus burst mode, address bit width, data bit width, etc. of the bus driver control module.
[0067] 3) Optionally, the bus protocol from the control bus to the MCU is not limited and can be AXI, AXI-lite, PCI, etc.
[0068] The multi-channel VDMA control method provided in this embodiment can omit the following steps: Figure 2 The bus conversion shown in the figure allows multiple video sources to enter the multi-channel VDMA at the same time, saving logic resources. In addition, the multiplexing access efficiency of the data bus is also improved to a certain extent. For example, under the same FPGA platform (such as XILINX-zynq7020), the existing solution occupies about 1.5K logic resources per channel, while this solution occupies about 0.35K, saving about 3 / 4 of the resources, and the read and write efficiency of the two are almost the same. The test on the platform (microsime-M2S060) has reduced about 1 / 2 of the resources, and the test on the intel-ep4ce40 has also reduced about 1 / 2 of the resources.
[0069] As described in step 5 above, the write channel arbitrator scans and selects outputs for each write channel using a preset priority index. Figure 4 and Figure 5 The operation of the write channel arbiter is described.
[0070] Figure 4 1 is an operational flow chart of a write channel arbiter processing channel selection according to an embodiment of the present invention. Figure 4 As shown, the processing channel selection of the write channel arbiter may include the following steps:
[0071] Step S401, reading a preset priority index;
[0072] Step S402, extracting the priority list Pi;
[0073] Step S403, mapping is performed according to the priority list Pi, and the next channel Wi to be processed is designated;
[0074] Step S404, scan the ready signal of channel Wi, if ready is true, execute step S405, otherwise execute step S409;
[0075] Step S405, the arbitrator switches the address and data bus of the selected channel Wi;
[0076] Step S406, enable the address and data output of channel Wi;
[0077] Step S407, monitoring the data output of channel Wi, and determining whether it is completed, if so, executing step S408, otherwise continuing to execute step S406;
[0078] Step S408, turn off the address and data output enable of channel Wi;
[0079] Step S409, determine whether i is the maximum value N allowed by the channel, if yes, set i=0, otherwise i=i+1, and then execute step S402.
[0080] Figure 5 1 is an operational flow chart of the instruction queue splitting of the write channel arbiter according to an embodiment of the present invention. Figure 5 As shown, the instruction queue splitting of the write channel arbiter may include the following steps:
[0081] Step S501, after the system is started, it enters a standby state and initializes the cycle value n=0;
[0082] Step S502: When step S407 is completed, execute step S503; otherwise, wait in this state;
[0083] Step S503, channel initialization, obtaining the starting address of channel Wi;
[0084] Step S504, latching the address and the total amount of data written BN;
[0085] Step S505, generating a quotient N of BN and burst according to the maximum burst requirement of the memory control bus:
[0086] Step S506, determine whether the loop value n is equal to N, if yes, execute step S511, otherwise execute step S507;
[0087] Step S507, generating a start address;
[0088] Step S508, outputting burst data in sequence;
[0089] Step S509, monitoring whether the data output is completed, if not, proceed to step S508, otherwise, proceed to step S510;
[0090] Step S510, loop value n=n+1, and execute step S506;
[0091] Step S511, generating a start address according to the remainder of BN and burst;
[0092] Step S512, calculating the redundant filling amount burst-(BN%burst);
[0093] Step S513, outputting the burst data of the tail packet of the data packet in sequence;
[0094] Step S514, monitor whether the data output is completed, if not, continue to step S513, otherwise, execute step S502.
[0095] As described in step 5 above, the read channel arbitrator scans and selects each read channel for reading through a preset priority index. Figure 6 and Figure 7 The operation of the read channel arbiter is described.
[0096] Figure 6 FIG. 1 is an operation flow chart of a processing channel selection of a read channel arbiter according to an embodiment of the present invention. Figure 6 As shown, the processing channel selection of the read channel arbiter may include the following steps:
[0097] Step S601, reading a preset priority index;
[0098] Step S602, extracting the priority list Pi;
[0099] Step S603, mapping is performed according to the priority list Pi, and the next channel Ri to be processed is designated;
[0100] Step S604, scan the ready signal of channel Ri, if ready is true, execute step S605, otherwise execute step S609;
[0101] Step S605, the arbiter switches the address and data bus of the selected channel Ri;
[0102] Step S606, enable the address and data output of channel Ri;
[0103] Step S607, monitoring whether the data output of channel Ri is completed, and executing step S608 after completion;
[0104] Step S608, turn off the address and data output enable of channel Ri;
[0105] Step S609, determine whether i is the maximum value N allowed by the channel, if yes, set i=0, otherwise i=i+1, and then execute step S602.
[0106] Figure 7 FIG. 1 is an operation flow chart of splitting the instruction queue of the read channel arbiter according to an embodiment of the present invention. Figure 7 As shown, the instruction queue splitting of the read channel arbiter may include the following steps:
[0107] Step S701, after the system is started, it enters a standby state and initializes the cycle value n=0;
[0108] Step S702: When step S407 is completed, execute step S703; otherwise, wait in this state;
[0109] Step S703, channel initialization, obtaining the starting address of channel Wi;
[0110] Step S704, latching the address and the total amount of data written BN;
[0111] Step S705, generating a quotient N of BN and burst according to the maximum burst requirement of the memory control bus:
[0112] Step S706, determine whether the loop value n is equal to N, if yes, execute step S711, otherwise execute step S707;
[0113] Step S707, generating a start address;
[0114] Step S708, outputting burst data in sequence;
[0115] Step S709, monitoring whether the data output is completed, if not, proceed to step S708, otherwise, proceed to step S710;
[0116] Step S710, loop n=n+1, and execute step S706;
[0117] Step S711, generating a start address according to the remainder of BN and burst;
[0118] Step S712, calculating the redundant filling amount burst-(BN%burst);
[0119] Step S713, outputting the tail packet burst data of the data packet in sequence;
[0120] Step S714, monitor whether the data output is completed, if not, continue to step S713, otherwise, execute step S702.
[0121] Figure 8 is a schematic diagram of the structure of a multi-channel VDMA controller according to an embodiment of the present invention. Figure 8 As shown, this embodiment provides a multi-channel VDMA controller for implementing Figure 3-7The multi-channel VDMA controller includes:
[0122] 1. VDMA interface module.
[0123] Used to write data to or read data from multiple channels, connected to the video stream and data processing modules respectively.
[0124] According to this embodiment, the VDMA interface module includes:
[0125] A VDMA write channel interface, used for writing the data stream to the write channel;
[0126] The VDMA read channel interface is used to read the data stream from the read channel.
[0127] 2. Data processing module.
[0128] It is used to process the read or written video stream data and is connected to the VDMA interface module and the data channel arbitrator module respectively.
[0129] According to this embodiment, the data processing module includes:
[0130] An address sequence generator configured to generate an address sequence for the read or written data stream and send the address sequence to the channel arbiter module;
[0131] A data sorting module, configured to sort the received receipts based on a preset queue arrangement method to generate a data queue required for the next step;
[0132] The FIFO control module is configured to perform FIFO control on the video stream data.
[0133] 3. Channel arbitrator module.
[0134] It is used for scanning input and output of the read and written video stream data, and is connected to the data processing module and the bus drive control module respectively.
[0135] According to this embodiment, the channel arbitrator module includes:
[0136] The write channel arbiter module is configured to scan and select outputs of each write channel according to a preset priority index.
[0137] The read channel arbiter module is configured to scan and select inputs for each read channel according to a preset priority index.
[0138] Furthermore, the channel arbiter module also includes a bus matching module configured to match the bus required in the bus drive data control module.
[0139] In the present invention, the bus required by the bus driving control module is consistent with the bus of the memory controller.
[0140] 4. Bus drive control module.
[0141] Used for real-time monitoring and encapsulation of data streams, connected to the data channel arbitration module and the memory controller respectively.
[0142] The bus driver control module encapsulates the internal data stream into the bus required by the memory external device. For example, if DDR3 memory is used, a DDR3 controller with an AXI bus is mounted outside the memory. The VDMA controller is connected to the DDR3 controller through the AXI bus to implement the reading and writing of DDR3.
[0143] The bus driver control module includes a write instruction buffer, a read instruction buffer, a write data buffer, a read data buffer and a bus driver circuit. The write instruction buffer and the write data buffer are used for the write channel, and the read instruction buffer and the read data buffer are used for the read channel. The write instruction buffer is used to buffer the instruction queue output by the write channel arbitrator. When the memory is idle, the instruction queue is sent to the memory controller, and the number of write data buffers released is controlled according to the burst length in the instruction queue. The read instruction buffer is used to buffer the instruction queue output by the read channel arbitrator. When the memory is idle, the instruction queue is sent to the memory controller. At the same time, the read data buffer receives the data read back by the controller and compares whether it corresponds to the burst length in the instruction queue.
[0144] The bus driver control module monitors in real time whether each buffer has overflow or empty read status, and informs the microcontroller unit (MCU) to perform abnormal processing.
[0145] The bus protocol from the bus driver control module to the memory controller is not limited and depends on the controller, and can be AXI, AXI-lite, AXI-STREAM, AHB, OPB, etc.
[0146] 5. Control bus parsing module.
[0147] The MCU sets the parameters required for the process via the control bus parsing module.
[0148] It should be noted that the control bus can be electrically connected to other modules inside the VDMA controller.
[0149] The MCU sets the internal parameters of the entire VDMA controller by controlling the bus analysis module, including:
[0150] 1) Configure the frame buffer quantity, data bit width, address bit width, data arrangement, resolution, redundant filling method, line buffer size, etc. of the read channel and write channel;
[0151] 2) Configure the priority index, data burst mode, channel delay, etc. in the arbitrator;
[0152] 3) Configure the buffer size, bus burst mode, address bit width, data bit width, etc. of the bus driver control module.
[0153] The bus protocol between the control bus parsing module and the MCU is not limited and can be AXI, AXI-lite, PCI, etc.
[0154] The multi-channel VDMA controller provided in this embodiment can be used to implement Figure 3-7 The implementation principle of the control method shown is similar to that of the aforementioned embodiment, and will not be repeated here.
[0155] The above is only a preferred embodiment of the present invention, and does not limit the invention in other forms. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A multi-channel VDMA control method having a write channel and a read channel, include: Write and read data streams via the VDMA interface; The VDMA interface controls the address sequence generator to generate a command queue for the data stream; The FIFO control monitors the FIFO of the data stream in real time to control the writing and reading of the data stream; The data streams are combined into required data queues by a data sorting module; The arbitrator scans the instruction queue and the data queue through a preset priority index; The bus driver control module encapsulates all internal data flows into the bus required by the memory controller. The MCU configures the parameters required for the entire process by controlling the bus parsing module; The arbiter scanning the instruction queue and the data queue comprises: The arbitrator includes a write channel arbitrator and a read channel arbitrator, The write channel arbiter scans the instruction queue / the data queue of the write channel to select output, The read channel arbiter scans and selects the instruction queue / data queue of the read channel for reading; The write channel arbiter processes the channel selection output, which is implemented by the following steps: Step S401, reading a preset priority index; Step S402, extracting the priority list Pi; Step S403, mapping according to the priority list Pi, specifying the next channel Wi to be processed; Step S404, scanning channel Wi ready signal, if ready is true, execute step S405, otherwise execute step S409; Step S405, the arbitrator switches the address and data bus of the selected channel Wi; Step S406, enable the address and data output of channel Wi; Step S407, monitoring the data output of channel Wi, and determining whether it is completed, if so, executing step S408, otherwise continuing to execute step S406; Step S408, turn off the address and data output enable of channel Wi; Step S409, determine whether i is the maximum value N allowed by the channel, if yes, set i=0, otherwise i=i+1, and then execute step S402.
2. The control method according to claim 1, Features The data stream complies with the AXIS base protocol.
3. The control method according to claim 1, Features The instruction queue includes but is not limited to the following parameters: burst first address, burst length, burst request, channel ID, and queue validity.
4. The control method according to claim 1, Features The FIFO control includes write channel FIFO control and read channel FIFO control, and the write channel FIFO control and the read channel FIFO control have different processing flows.
5. The control method according to claim 4, Features The write channel FIFO control also includes: The write channel FIFO controls receiving write data, and the write channel FIFO performs clock domain conversion; The write channel FIFO control monitors the FIFO of the write data in real time, and controls the inflow and outflow of the write data; The write channel FIFO control monitors the write data FIFO in real time and controls the triggering of the write channel ready signal.
6. The control method according to claim 5, Features The controlling the inflow and outflow of the write data further comprises: When the amount of write data is greater than the preset number M w When , stop writing to the channel; When the amount of write data is less than the preset number N w When , the channel is opened for writing, where: M w The value range is: FIFO depth>M w >One row of data capacity; N w The value range is: (FIFO depth - one line of data capacity)>N w ≧0.
7. The control method according to claim 5, Features The triggering of the control of the write channel ready signal also includes: When the amount of write data is greater than the burst length preset by AXIS, a ready signal is generated, otherwise the ready signal is 0.
8. The control method according to claim 4, Features: The input clock of the write channel is the local clock, and the output clock is the bus clock; The input clock of the read channel is the bus clock, and the output clock is the local clock.
9. The control method according to claim 4, Features The step of combining the data streams into the required data sequence by the data sorting module further includes: The data sorting module includes a write channel data sorting module and a read channel data sorting module.
10. The control method according to claim 9, further comprising: include: The write channel data arrangement module combines the data written by the write channel FIFO control into a data queue required by the write channel arbiter through a preset data arrangement mode; The read channel data sorting module sorts the data sequence transmitted from the read channel arbiter into a data queue required by the read channel FIFO control through a preset data arrangement method, and then enters the read channel FIFO control.
11. The control method according to claim 10, Features: The data queues required by the write channel arbiter and the read channel arbiter include: The bit width and burst length can be changed according to the timing requirements.
12. The control method according to claim 1, Features Further including: When the data stream overflows or the data stream is empty, the FIFO control sends an error message, and transmits the error message to the MCU through the control bus to reset or restart the multi-channel VDMA controller.
13. The control method according to claim 1, further comprising the write channel arbiter splitting the instruction queue, which is achieved by the following steps: Step S501, after the system is started, it enters the standby state and initializes the cycle value n=0; Step S502: When step S407 is completed, execute step S503; otherwise, wait in this state; Step S503, channel initialization, obtaining the starting address of channel Wi; Step S504, latching the address and the total amount of data written BN; Step S505, generating a quotient N of BN and burst according to the maximum burst requirement of the memory control bus: Step S506, determine whether the loop value n is equal to N, if yes, execute step S511, otherwise execute step S507; Step S507, generating a start address; Step S508, outputting burst data in sequence; Step S509, monitoring whether the data output is completed, if not, proceed to step S508, otherwise, proceed to step S510; Step S510, loop value n=n+1, and execute step S506; Step S511, generating a start address according to the remainder of BN and burst; Step S512, calculating the redundant filling amount burst-(BN%burst); Step S513, outputting the burst data of the tail packet of the data packet in sequence; Step S514, monitor whether the data output is completed, if not, continue to step S513, otherwise, execute step S502.
14. A multi-channel VDMA control method having a write channel and a read channel, include: Write and read data streams via the VDMA interface; The VDMA interface controls the address sequence generator to generate a command queue for the data stream; The FIFO control monitors the FIFO of the data stream in real time to control the writing and reading of the data stream; The data streams are combined into required data queues by a data sorting module; The arbitrator scans the instruction queue and the data queue through a preset priority index; The bus driver control module encapsulates all internal data flows into the bus required by the memory controller. The MCU configures the parameters required for the entire process by controlling the bus parsing module; The arbiter scanning the instruction queue and the data queue comprises: The arbitrator includes a write channel arbitrator and a read channel arbitrator, The write channel arbiter scans the instruction queue / the data queue of the write channel to select output, The read channel arbiter scans and selects the instruction queue / data queue of the read channel for reading; The processing channel selection of the read channel arbiter is implemented by the following steps: Step S601, reading a preset priority index; Step S602, extracting the priority list Pi; Step S603, mapping according to the priority list Pi, specifying the next channel Ri to be processed; Step S604, scanning channel Ri ready signal, if ready is true, execute step S605, otherwise execute step S609; Step S605, the arbiter switches the address and data bus of the selected channel Ri; Step S606, enable the address and data output of channel Ri; Step S607, monitoring whether the data output of channel Ri is completed, and executing step S608 after completion; Step S608, turn off the address and data output enable of channel Ri; Step S609, determine whether i is the maximum value N allowed by the channel, if yes, set i=0, otherwise i=i+1, and then execute step S602.
15. The control method according to claim 14, Features The data stream complies with the AXIS base protocol.
16. The control method according to claim 14, Features The instruction queue includes but is not limited to the following parameters: burst first address, burst length, burst request, channel ID, and queue validity.
17. The control method according to claim 14, Features The FIFO control includes write channel FIFO control and read channel FIFO control, and the write channel FIFO control and the read channel FIFO control have different processing flows.
18. The control method according to claim 17, Features The write channel FIFO control also includes: The write channel FIFO controls receiving write data, and the write channel FIFO performs clock domain conversion; The write channel FIFO control monitors the FIFO of the write data in real time, and controls the inflow and outflow of the write data; The write channel FIFO control monitors the write data FIFO in real time and controls the triggering of the write channel ready signal.
19. The control method according to claim 18, Features The controlling the inflow and outflow of the write data further includes: When the amount of write data is greater than the preset number M w When , stop writing to the channel; When the amount of write data is less than the preset number N w When , the channel is opened for writing, where: M w The value range is: FIFO depth>M w >One row of data capacity; N w The value range is: (FIFO depth - one line of data capacity)>N w ≧0.
20. The control method according to claim 17, Features: The input clock of the write channel is the local clock, and the output clock is the bus clock; The input clock of the read channel is the bus clock, and the output clock is the local clock.
21. The control method according to claim 17, Features The step of combining the data streams into the required data sequence by the data sorting module further includes: The data sorting module includes a write channel data sorting module and a read channel data sorting module.
22. The control method according to claim 21, further comprising: include: The write channel data arrangement module combines the data written by the write channel FIFO control into a data queue required by the write channel arbiter through a preset data arrangement mode; The read channel data sorting module sorts the data sequence transmitted from the read channel arbiter into a data queue required by the read channel FIFO control through a preset data arrangement method, and then enters the read channel FIFO control.
23. The control method according to claim 22, Features: The data queues required by the write channel arbiter and the read channel arbiter include: The bit width and burst length can be changed according to the timing requirements.
24. The control method according to claim 14, Features Further including: When the data stream overflows or the data stream is empty, the FIFO control sends an error message, and transmits the error message to the MCU through the control bus to reset or restart the multi-channel VDMA controller.
25. The control method according to claim 14, further comprising the read channel arbiter splitting the instruction queue, which is achieved by the following steps: Step S701, after the system is started, it enters the standby state and initializes the cycle value n=0; Step S702: When step S407 is completed, execute step S703; otherwise, wait in this state; Step S703, channel initialization, obtaining the starting address of channel Wi; Step S704, latching the address and the total amount of data written BN; Step S705, generating the quotient N of BN and burst according to the maximum burst requirement of the memory control bus: Step S706, determine whether the loop value n is equal to N, if yes, execute step S711, otherwise execute step S707; Step S707, generating a start address; Step S708, outputting burst data in sequence; Step S709, monitoring whether the data output is completed, if not, proceed to step S708, otherwise, proceed to step S710; Step S710, loop n=n+1, and execute step S706; Step S711, generating a start address according to the remainder of BN and burst; Step S712, calculating the redundant filling amount burst-(BN%burst); Step S713, outputting the tail packet burst data of the data packet in sequence; Step S714, monitor whether the data output is completed, if not, continue to step S713, otherwise, execute step S702.
26. A multi-channel VDMA controller, comprising a write channel and a read channel, for implementing the method according to any one of claims 1 to 25, It is characterized in that include: VD An MA interface module, used for writing data to the write channel or reading data from the read channel; A data processing module, used for processing the video stream data read or written; A channel arbiter module is used to scan the input and output of the read and written video stream data, wherein: The VDMA interface module is connected to the video stream and the data processing module respectively; The data processing module is connected to the VDMA interface module and the data channel arbiter module respectively; The channel arbiter module is connected to the data processing module and the bus drive control module respectively.
27. The controller of claim 26, further comprising: include: A bus driver control module, used for real-time monitoring and encapsulation of the data stream; The control bus analysis module, through which the MCU sets the parameters required for the process, wherein: The bus drive control module is connected to the data channel arbitration module and the memory controller respectively; The control bus analysis module is connected to the MCU and other modules.
28. The controller of claim 26, Features The VDMA interface module also includes: A VDMA write channel interface, used for writing the data stream to the write channel; The VDMA read channel interface is used to read the data stream from the read channel.
29. The controller of claim 26, Features The data processing module also includes: An address sequence generator configured to generate an address sequence for the read or written data stream and send the address sequence to the channel arbiter module; A data sorting module, configured to sort the received receipts based on a preset queue arrangement method to generate a data queue required for the next step; The FIFO control module is configured to perform FIFO control on the data stream.
30. The controller of claim 26, Features The channel arbiter module also includes: A bus matching module, configured to match a bus required in the bus drive data control module; A write channel arbiter module configured to scan and select outputs of the write channel by a preset priority index; The read channel arbiter module is configured to scan the select input of the read channel through a preset priority index.
31. The controller of claim 26, Features The bus drive control module also includes: A write instruction buffer and a write data buffer, used for the write channel; Read instruction buffer and read data buffer for read channel; Bus driver circuit.
32. The controller of claim 27, Features The MCU sets the parameters required for the process via the control bus parsing module, further including but not limited to the following: Configure the frame buffer quantity, data bit width, address bit width, data arrangement mode, resolution size, redundant filling mode, and line buffer size of the read channel and the write channel; Configure the priority index, data burst mode, and channel delay in the arbitrator module; Configure the buffer size, bus burst mode, address bit width, and data bit width of the bus driver control module.
