A multi-channel video signal cache control method and system based on FPGA

Through data reorganization and priority processing of video signals in FPGA, FIFO and DDR are used to realize multi-channel video signal cache control, which solves the problem of low cache efficiency in the existing technology, improves resource utilization and data transmission quality, and meets the requirements of meet the demand for high computing performance.

CN114302089BActive Publication Date: 2024-09-27NO 709 RES INST OF CHINA SHIPBUILDING IND CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111479431.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2024-09-27
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

In existing FPGA multi-channel video signal processing, cache granules based on line cache and frame cache methods have low utilization, resulting in high resource consumption and being unable to meet the needs of high computing performance and functional performance.

Method used

By converting the video bit width of multiple groups of video sources into 2k bits, data reorganization and prioritization are performed, FIFO and DDR are used to implement cache control of multi-channel video signals, AXI4 Stream bus format is used for data transmission, and cache operations are optimized to improve Resource utilization.

Benefits of technology

It improves DDR storage resource utilization and data transmission quality, reduces FPGA resource consumption, and achieves efficient multi-channel video signal processing and video control under the AXI4 Stream bus architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114302089B
    Figure CN114302089B
Patent Text Reader

Abstract

The invention provides a multi-channel video signal cache control method and system based on FPGA, belonging to the field of video signal processing, the method comprising: reorganizing data of multiple video sources to generate multiple groups of input data packets and counting them; prioritizing the input data packets and encoding the input data packets; if the data cache amount of the input data packets reaches the burst amount, starting a DDR write request signal; converting into an AXI4 Stream bus format to perform a DDR write operation; setting a FIFO_OUT output priority; if the FIFO_OUT data cache amount is less than or equal to an output data packet of twice the burst bandwidth, starting a read request signal, combining with a read completion signal, reading the output data packet, decoding it, and writing it into a corresponding FIFO_OUT to output video data; the invention effectively realizes the cache control of multiple video signals, and simplifies the timing control of converting the video signal into the AXI4 Stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of video signal processing, and more specifically, relates to a multi-channel video signal cache control method and system based on FPGA. Background Art

[0002] Development and design based on SoC embedded systems is a major trend in the field of video processing. In 2010, Xilinx launched the first Znyq series embedded system prototype, combining ARM processors with traditional FPGAs. The chips are interconnected through the AXI4 standard bus, thus achieving development and design with high flexibility, high configurability and high computing performance. After nearly 10 years of development, the Znyq SoC platform has effectively improved many bottleneck problems in the field of video processing, such as video signal computing performance and display processing configurability, and has developed into a relatively mature solution in the field of video signal processing.

[0003] In the field of military and industrial video processing, in order to meet the needs of customized video processing functions and high computing performance in different scenarios, video equipment supports multiple sets of video signal processing and widely adopts FPGA solutions. On the one hand, SoC embedded video processing solutions such as MPsoc and Znyq are based on AXI4 standard bus interconnection and flexible configuration, which can effectively solve the problems of single function and poor configuration performance of video equipment based on traditional FPGA chip platforms. Therefore, combining traditional FPGA video equipment with embedded platforms such as MPsoc and Znyq can greatly improve the functional performance of video processing equipment products; on the other hand, the calculation of a large amount of video data puts forward high requirements on FPGA computing resources. The conversion of video data and AXI bus data based on Xilinx official IP consumes a lot of FPGA resources. The utilization rate of cache particles based on the line cache video method is low, and the cache efficiency based on the frame cache method is low. Therefore, multi-channel video processing based on FPGA urgently needs to develop an architecture with high data processing efficiency and low resource consumption to meet the growing functional performance requirements. Summary of the invention

[0004] In view of the defects of the prior art, the purpose of the present invention is to provide a multi-channel video signal cache control method and system based on FPGA, aiming to solve the problems that the existing multi-channel video signal cache requires additional configuration of IP cores Video TimingController, Video to AXIs, AXIS to Video IP cores, the row cache video method has low cache particle utilization, and the frame cache method has low cache efficiency.

[0005] To achieve the above object, on the one hand, the present invention provides a multi-channel video signal buffer control method based on FPGA, comprising the following steps:

[0006] (1) According to the input video source resolution, the video bit width of multiple video sources is converted into 2 k Reorganize multiple groups of data to generate multiple groups of input data packets, and count the data in each data packet;

[0007] (2) After the multiple groups of input data packets are prioritized, the multiple groups of input data packets are cached separately through multiple groups of FIFO_IN;

[0008] (3) When the data buffer of the input data packet in FIFO_IN reaches the burst amount of AXI4 Stream, the write request signal of DDR is started; at the same time, the input data packet of this burst and the corresponding video source are encoded;

[0009] (4) Convert the encoded input data packet, write request signal and effective write address into AXI4 Stream bus format for DDR write operation to complete the caching of multiple video sources;

[0010] (5) Buffering and outputting multiple video sources through multiple FIFO_OUTs, setting FIFO_OUT output priorities, and counting the amount of data buffered by the multiple FIFOs separately;

[0011] (6) When the data buffer size of any group of FIFO_OUT is less than or equal to twice the burst bandwidth of the output data packet, the DDR read request signal is started, and combined with the Rd_last instruction, the output data packet data is read from the DDR in sequence and decoded and written to the corresponding FIFO_OUT. The output video bit width is 2 k bits of video data;

[0012] (7) From video bit width 2 k The effective video information is read out from the 10-bit video data and displayed to realize the cache control of multi-channel video signals; wherein k is a positive integer; and the bit width of the input data packet is an exponential power of 2.

[0013] Further preferably, the conversion method of the AXI4 Stream bus format in step (4) is:

[0014] Set DDR to Packet mode. When DDR write request is turned on, DDR write enable is started. The write address is declared valid. DMA lock signal Dma_lock is pulled high to occupy DMA operation.

[0015] The encoded input data packet, video line signal, video field signal, write request signal and effective write address are converted into AXI4 Stream bus format for transmission.

[0016] Further preferably, the acquisition and update method of the input data packet of this burst is:

[0017] After starting the DDR write request signal, according to the priority of the video channel in FIFO_IN where the video signal is located, the current output data packet in FIFO_IN is used as the input data packet of this AXI4 Stream burst;

[0018] When the write operation of the current output data packet in FIFO_IN is completed, the write completion signal Wr_last is received, and then the output data packets of other video channels in FIFO_IN are read to update the input data packets of this AXI4 Stream burst;

[0019] For simultaneously input video signals, the output data packets of the high priority channel are used as the input data packets of this AXI4Stream burst.

[0020] Further preferably, step (6) specifically comprises the following steps:

[0021] (6.1) When the amount of data in any group of FIFO_OUT buffers is less than or equal to twice the output data packet burst bandwidth, set DDR to Packet mode, start DDR read enable, the read address is valid and declared, and the DMA lock signal Dma_lock is pulled high;

[0022] (6.2) Combined with the read completion signal Rd_last, read the highest priority output data packet from DDR and write it to FIFO_OUT after decoding, and the output video bit width is 2 k bits of video data.

[0023] Further preferably, step (6.2) specifically comprises the following steps:

[0024] When the read operation of the highest priority output data packet is completed, a read completion signal Rd_last is issued to read the highest priority input data packet among other output data packets.

[0025] Further preferably, when DDR is set to Packet mode, each time a write request is valid, the video source channel number wr_pointer of the current input data packet is determined, and an initial address is generated for the input data packet written for the first time; multiple groups of input data packets are continuously written through the offset address.

[0026] The write address is valid during the write enable period and is released when the write completion signal Wr_last is valid.

[0027] Further preferably, in the stage of writing the input data packet, the encoding method for the input data packet and each video channel is:

[0028] Set the write address of the input data packet to wr_addr = {wr_pointer, burst_number}; where wr_addr is the write address of the data packet; wr_pointer represents the video source channel ID; burst_number is the number of data packet bursts, which is 0 for the first burst; after adding the offset address, the burst address is burst_addr = burst_number*burstLegeth; burstLegeth is the AXI burst length; burst_number is the number of bursts.

[0029] On the other hand, the present invention provides a multi-channel video signal cache control system based on FPGA, comprising:

[0030] A plurality of video source receiving modules, whose output terminals are connected to the input terminals of the plurality of input FIFO IN modules, are used to provide multi-channel video sources;

[0031] The multiple input FIFO IN modules are bidirectionally connected to the TV Controller FSM module and are used to reorganize the multiple input video signals according to the minimum data bit width and data packet length of the AXI4Stream transmission data packet to generate multiple input data packets and count the data of the input data packets. The multiple input video signals are converted into 2 bit widths according to the resolution of the input video source. k bit video signal;

[0032] The TV Controller FSM module is bidirectionally connected to multiple groups of output FIFO OUT modules, and transmits data streams with DMA and control streams with AXI transfer modules; it is used to prioritize FIFO_OUT and FIFO_IN, and monitor the data cache amounts of multiple groups of FIFO_OUT and FIFO_IN, and generate a DDR read enable signal and start the DDR read request signal when the storage amount of any FIFO_OUT is less than or equal to the output data of twice the burst bandwidth; it starts the DDR write request signal when the data cache amount of FIFO_IN reaches the AXI4 Stream burst amount; and it is used to send a write completion signal and a read completion signal;

[0033] DMA, whose output end is connected to the AXI transfer module, encodes the received input data packets and output data packets with each video channel respectively;

[0034] AXI transfer module, whose output end is connected to AXI mig, is used to convert read enable, write enable, effective write address, effective read address, input data packet and output data packet into AXI4 Stream bus format;

[0035] AXI mig module, used to provide the mig storage management interface of the AXI4 interface;

[0036] DDR memory module, which is in DDR memory particle format;

[0037] Multiple input FIFO OUT modules are bidirectionally connected to the TV Controller FSM module to restore the output data packets to the video display line field. The required video bit width is 2 k bits of video data; and count the storage volume of the output data packets;

[0038] Multiple video source sending modules are used to send video bit widths of 2 k The video data of bits is restored into multiple groups of video sources; wherein k is a positive integer.

[0039] Further preferably, the AXI transfer module includes an AXI transfer device in a write operation phase and an AXI transfer device in a read operation phase;

[0040] The AXI transfer device in the write operation phase is used to start the DDR write enable after the DDR write request is turned on when the DDR is set to Packet mode, the write address is declared valid, and the DMA lock signal Dma_lock is pulled high;

[0041] The AXI transfer device in the read operation phase is used to start the DDR read enable after the DDR read request is turned on when the DDR is set to Packet mode, the read address is declared valid, and the DMA lock signal Dma_lock is pulled high.

[0042] Further preferably, in the stage of DMA writing the input data packet, the encoding method for the input data packet and each video channel is:

[0043] Set the write address of the input data packet to wr_addr = {wr_pointer, burst_number}; where wr_addr is the write address of the data packet; wr_pointer represents the video source channel ID; burst_number is the number of data packet bursts, which is 0 for the first burst; after adding the offset address, the burst address is burst_addr = burst_number*burstLegeth; burstLegeth is the AXI burst length; burst_number is the number of bursts.

[0044] In general, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art:

[0045] The multi-group input FIFO IN module provided by the present invention reorganizes the data of the multi-group input video signal according to the data bit width and data packet length of the minimum transmission data packet of AXI4 Stream; at the same time, the multi-group input FIFO OUT module can restore the reorganized burst data packet into the output data packet required for the video display line field; different from the prior art AXI Transfer, which reorganizes or restores the data of the video signal, the complexity of the operation of AXI Transfer is reduced; the multi-group input FIFOIN module and the multi-group input FIFO OUT module of the present invention are combined with the TV Controller FSM to divide the data packet into two paths, namely, the data packet is encoded and the write or read operation instruction is generated or converted respectively; then the data and the instruction are converted into the AXI4 Stream bus format; DDR is used to realize the caching of multiple video signals; that is, the timing conversion of video hs, vs and video data with AXI4 stream signals such as AXI_AWADDR and AXI_WDATA is realized through storage resources such as FIFO and DDR; it can run independently of the FPGA PS end, the FPGA resource consumption is small, and the video signal to AXI4 is effectively realized Stream timing control can realize the migration of conventional video signals (such as DVI, HDMI signals, etc.) to video control signals under the Soc ZYNQ AXI4 bus architecture.

[0046] The present invention provides a method for storing multi-channel video data on a single set of DDR particles, combining AXI4 stream data packet Buad=2 m (Burst bit width)×2 n (burst packet length) size, and reorganizes and packages the video stream data into data blocks for storage, effectively realizing the row caching method of multiple video sources through a single set of DDR resources. The video data is transmitted and controlled according to the AXI4 Stream data packet bandwidth. Since the storage size is much smaller than the video row cache resource consumption, and the data transmission specifications are stable under the AXI4 Stream protocol, this method can finely control the DDR cache resources and improve the DDR storage resource utilization and data transmission quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a block diagram of the principle of AXI stream caching of multiple video sources provided by an embodiment of the present invention;

[0048] Figure 2 A method for recombining video sources to generate cache data packets provided by an embodiment of the present invention;

[0049] Figure 3A multi-channel video cache control state machine provided by an embodiment of the present invention;

[0050] Figure 4 is a timing of writing data packets into a cache provided by an embodiment of the present invention;

[0051] Figure 5 is a data packet read cache timing provided by an embodiment of the present invention;

[0052] Figure 6 This is the AXI4 Stream data conversion timing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0054] The explanations of the English abbreviations used in the present invention are as follows:

[0055] FPGA: Field Programmable Gate Array;

[0056] PS: FPGA software side;

[0057] TVI: TV INPUT input video;

[0058] TVO: TV OUTPUT output video;

[0059] FIFO: First-in-first-out stacker;

[0060] FSM: finite state machine;

[0061] RGB: red, green, and blue pixels;

[0062] DDR: Dynamic Random Access Memory;

[0063] AXI: ARM bus protocol.

[0064] Example

[0065] like Figure 1 As shown, the present invention discloses a multi-channel video signal cache control system based on FPGA, comprising: a plurality of video source TVI1~n receiving modules 1, a plurality of video source TVO1~n sending modules 2, an input FIFO IN1~n module 3, a plurality of output FIFO OUT1~n modules 4, a cache control state machine TV Controller FSM module 5, a storage controller DMA module 6, an AXI protocol converter AXI transfer module 7, an AXI mig module 8 and a DDR3 storage device module 9;

[0066] The multiple video source TVI1~n receiving module 1 and the multiple video source TVO1~n sending module 2 can process video source signals of different resolutions; the video signal input format of the multiple video source TVI1~n receiving module 1 is a 24-bit RGB video signal. Since the AXI4 burst bandwidth is an exponential power of 2, in order to better process other modules, the output of the multiple video source TVI1~n receiving module 1 is padded with 0, and the bit width is 32 bits; similarly, the multiple video source TVO1~n sending module 2 receives a video bit width of 32 bits, and the output video format is a 24-bit RGB video signal;

[0067] The multiple input FIFO IN1-n modules 3 and the multiple output FIFO OUT1-n modules 4 are also the reverse process; according to the calculated AXI4 Stream minimum transmission data packet data bit width and data packet length (such as the minimum burst bandwidth Buad = 2 m ×2 n , of which 2 m AXI4 Stream burst width, 2 n The input FIFO IN1~n module 3 reorganizes the data of multiple input videos. The input bit width of the input FIFO IN1~n module 3 is 32 bits, and the output bit width is 2 m ; And calculate the size of the data packet buffer in the input FIFO IN1~n module 3. Typically, the FIFO's own wr_data_count signal can be used as a monitor, or the FIFO_IN read and write enable can be used for counting; on the contrary, the input bit width of multiple output FIFOOUT1~n modules 4 is 2 m , the output bit width is 32 bits, which is designed to restore the reorganized burst data packets into the video data required for the video display line field, and calculate the size of the data packet buffer in the multiple output FIFO OUT1~n modules 4. Typically, the rd_data_count signal provided by the FIFO can be used as a monitor, or the FIFO_OUT read and write enable can be used for counting;

[0068] The cache control state machine TV Controller FSM module 5 is capable of receiving and processing multiple groups of video source data packets simultaneously;

[0069] like Figure 3 As shown in the figure, taking a group of video writing as an example, the data stream storage size of TVI1 in FIFO_IN1 is calculated. When the data storage size of FIFO_IN1 reaches the AXI4 Stream burst width 2 mWhen required, start the DDR3 write request signal Wr_req1, which is a pulse signal; set multiple groups of FIFO_IN1, FIFO_IN2, ..., FIFO_INm priorities. When the highest priority FIFO is reading data, other FIFOs are waiting to be read. Only when the highest priority Wr_last (output by DMA module 6) comes, the next group of FIFO read signals is turned on;

[0070] Taking a group of video reading as an example, the difference from the writing process is that the data storage capacity in FIFO_OUT1 is calculated, and when the storage capacity is less than or equal to two times the burst bandwidth, the First_req1~n signal is turned on, which is a pulse signal, and the FIFO OUT data is written; when the data storage capacity in FIFO_OUT1 is greater than two times the burst bandwidth, the writing is stopped; according to the FIFO IN1~n data processing priority in the input FIFO IN1~n module 3, the priority of FIFO OUT1~n in multiple groups of output FIFO OUT1~n modules 4 is set; when the highest priority FIFO OUT is being written, other FIFOs are waiting to be written, and only when the DMA module 6 outputs the highest priority FIFO writing and sends Rd_last, the writing of the next group of FIFOs is turned on; therefore, in the process of reading data packets, at the beginning of each frame of video source processing, FIFO OUT1~n has accumulated twice the amount of data of the AXI4 Stream burst size, preventing FIFO OUT1~n from being read empty;

[0071] The DMA cache control module 6 receives data from the cache control state machine TV Controller FSM module 5 and encodes the received data with each video channel, such as Figure 2 As shown, taking the write process as an example, the write address wr_addr = {wr_pointer, burst_number}, and the write address of each group of data packets is composed of wr_pointer and burst_number; wr_pointer represents the video source channel ID, that is, the video source from which the data packet is reassembled; burst_number is the number of data packet bursts, which is equal to the number of bursts of the data packet data in this AXI4Stream; since the total amount of a frame of video data is an integer multiple of the burst bandwidth, a frame of data can be completed through an integer number of burst transmissions; similarly, the read process only needs to fetch data from DDR3 according to the reassembly rules of the write process;

[0072] The AXI protocol converter AXI transfer module 7 is used to convert the read / write enable, address and data signals generated by the DMA module 6 and the TV Controller FSM module 5 into the AXI4 Stream bus format;

[0073] When the DDR3 write request Wr_req is turned on, the DDR write enable Wr_en is started, that is, the DMA lock signal Dma_lock is pulled high, and the write data packets are counted at the same time. When the count size is equal to the burst length burst size, that is, Wr_count = burst size = 2 n When Wr_last is enabled, the write completion signal Wr_last is enabled, indicating that an AXI4 Stream burst is completed; the write address valid Axi_awvald output by the AXItransfer module 7 should be declared during Wr_en, and the address occupation of AXI is not released until the AXI mig module 8 outputs Axi_wready and is declared, that is, Axi_awvald is valid at (Wr_req&(~Dma_lock)&~Axi_wready), which is a pulse signal; otherwise, it is invalid; when AXI mig sets DDR3 to Packet mode, it only needs to write the initial address of the data packet once each time Wr_req is valid, and enter the offset address Axi_awaddr+burstLength when the next Wr_req is valid, where the burstLength size is the burst bandwidth of the data packet, not less than 2 m ; The write address is valid. Axi_awvald should be asserted during Wr_en and will not be released until Wr_last is valid. It is a level signal.

[0074] The AXI mig module 8 is a mig storage management interface of the AXI4 interface provided by Xilinx; the DDR3 storage device module 9 is a DDR3 storage particle.

[0075] The cache control steps of multiple video signals based on AXI4 Stream bus in a single set of DDR3 memory are as follows:

[0076] Step 1: Calculate the minimum burst bandwidth of AXI4 Stream Buad=2 based on the video source resolution and video channel requirements m ×2 n , of which 2 m AXI4 Stream burst width; 2 n The burst length of AXI4 Stream;

[0077] Step 2: Scaling the video sources according to the resolutions P1, P2, and P3 of the multiple video sources, so that the single-frame data packet of each video signal after scaling is an integer multiple of the minimum burst bandwidth Buad (normal resolutions such as 3840*2160, 1920*1080, 1080*720, etc. do not need to be scaled);

[0078] Step 3: Reorganize the video source signal according to the AXI4 Stream burst width to generate the minimum data storage block; where the data packet write address is wr_addr = {wr_pointer, burst_addr}; wr_pointer is the video channel number where the data packet is located; the burst address is burst_addr = burst_number*burstLegeth; burstLegeth is the AXI burst length; burst_number is the number of bursts;

[0079] Step 4: Allocate a group of front-end input FIFO_IN1~n modules 3 and back-end output FIFO_OUT1~n modules 4 according to each video signal;

[0080] The specific method is: TVI1 enters FIFO_IN1 with AXI4 Stream burst bit width 2 m Output data, after being output by the video control state machine TV Controller FSM module 5, is bursted as AXI4 Stream with a bit width of 2 m Enter FIFO_OUT1 to restore video data TVO1; the same goes for other video signals;

[0081] Step 5: writing the reassembled data packet into the DDR3 storage module 9;

[0082] The specific steps are: calculate the data stream storage size of TVI1 in FIFO_IN1, when the data storage size of FIFO_IN1 reaches the AXI4 Stream burst width 2 m When required, start the DDR3 write request signal Wr_req1, which is a pulse signal;

[0083] Step 6: Set multiple groups of FIFO_IN1, FIFO_IN2...FIFO_INn priorities. When the highest priority FIFO IN is reading data, other FIFO INs are waiting to be read. Only when the highest priority Wr_last (output by DMA module 6) comes, the next group of FIFO IN reading signals is turned on.

[0084] Step 7: Read the reassembled data packet from the DDR3 storage module 9; different from the writing process, the data storage capacity in FIFO_OUT1 is calculated, and when the storage capacity is less than or equal to twice the burst bandwidth, the First_req1~n signal is turned on, which is a pulse signal, and the FIFO OUT data is written; when it is greater than twice the burst bandwidth, the writing is stopped;

[0085] Step 8: Set the priority of FIFO_OUT1~n in module 4 according to the data processing priority of FIFO_IN1~n in module 3; when the highest priority FIFO is being written, other FIFOs are waiting to be written, and only when the highest priority FIFO is written and Rd_last (sent by DMA module 7) is the writing of the next group of FIFOs started; therefore, during the process of reading data packets, at the beginning of each frame of video source processing, FIFO_OUT1~n has accumulated twice the amount of data of the AXI4 Stream burst size, preventing FIFO_OUT1~n from being read empty;

[0086] Step 9: Convert the video line signal hs, field signal vs and video data with AXI_AWADDR (bus write address and bus write data), AXI_WDATA and other AXI4 Stream signal timing; when the DDR3 write request Wr_req is turned on, start the DDR write enable Wr_en, that is, the DMA lock signal Dma_lock is pulled high, and the write data packets are counted at the same time. When the count size is equal to the burst length burst size, that is, Wr_count = burst size = 2 n When the write completion signal Wr_last is turned on, it indicates that an AXI4 Stream burst is finished;

[0087] Step 10: The write address is valid. Axi_awvald should be declared during Wr_en until Axi_wready is declared to release the address occupation of AXI, that is, Axi_awvald is valid at (Wr_req&(~Dma_lock)&~Axi_wready), which is a pulse signal, otherwise the write address is invalid; when DDR3 is set to Packet mode, it is only necessary to enter the initial address of the data packet write once each time Wr_req is valid; for this data packet, the offset address Axi_awaddr+burstLength is entered when the next Wr_req is valid; the burstLength size is the burst bandwidth of the data packet, not less than 2 m ; Write address valid Axi_wvalid should be declared in Wr_en device and will not be released until Wr_last is valid. It is a level signal, where Wr_req=Wr_req1||Wr_req2…||Wr_reqn. Wr_req1, Wr_req2,…, Wr_reqn are uniformly converted into DDR3 write requests when output.

[0088] Step 11: Similarly, the AXI_AWADDR and AXI_WDATA write process is repeated, and the AXI_ARADDR and AXI_RDATA signal conversion is completed in the same way.

[0089] In summary, compared with the prior art, the present invention has the following advantages:

[0090] The multi-group input FIFO IN module provided by the present invention reorganizes the data of the multi-group input video signal according to the data bit width and data packet length of the minimum transmission data packet of AXI4 Stream; at the same time, the multi-group input FIFO OUT module can restore the reorganized burst data packet into the output data packet required for the video display line field; different from the prior art AXI Transfer, which reorganizes or restores the data of the video signal, the complexity of the operation of AXI Transfer is reduced; the multi-group input FIFOIN module and the multi-group input FIFO OUT module of the present invention are combined with the TV Controller FSM to divide the data packet into two paths, namely, the data packet is encoded and the write or read operation instruction is generated or converted respectively; then the data and the instruction are converted into the AXI4 Stream bus format; DDR is used to realize the caching of multiple video signals; that is, the timing conversion of video hs, vs and video data with AXI4 stream signals such as AXI_AWADDR and AXI_WDATA is realized through storage resources such as FIFO and DDR; it can run independently of the FPGA PS end, the FPGA resource consumption is small, and the video signal to AXI4 is effectively realized Stream timing control can realize the migration of conventional video signals (such as DVI, HDMI signals, etc.) to video control signals under the Soc ZYNQ AXI4 bus architecture.

[0091] The present invention provides a method for storing multi-channel video data on a single set of DDR particles, combining AXI4 stream data packet Buad=2 m (Burst bit width)×2 n (burst packet length) size, and reorganizes and packages the video stream data into data blocks for storage, effectively realizing the row caching method of multiple video sources through a single set of DDR resources. The video data is transmitted and controlled according to the AXI4 Stream data packet bandwidth. Since the storage size is much smaller than the video row cache resource consumption, and the data transmission specifications are stable under the AXI4 Stream protocol, this method can finely control the DDR cache resources and improve the DDR storage resource utilization and data transmission quality.

[0092] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-channel video signal cache control method based on FPGA, It is characterized in that The following steps are involved: (1) According to the input video source resolution, convert the video bit width of multiple video sources into the minimum transmission data packet data bit width of AXI4 Stream 2 k Reorganize multiple groups of data to generate multiple groups of input data packets, and count the data in each data packet; (2) After the multiple groups of input data packets are prioritized, the multiple groups of input data packets are cached separately through multiple groups of FIFO_IN; (3) When the data buffer of the input data packet in FIFO_IN reaches the burst amount of AXI4 Stream, the write request signal of DDR is started; at the same time, the input data packet of this burst and the corresponding video source are encoded; (4) Convert the encoded input data packet, write request signal and valid write address into AXI4 Stream bus format for DDR write operation to complete the caching of multiple video sources; (5) Buffer and output multiple video sources through multiple FIFO_OUTs, set FIFO_OUT output priorities, and count the amount of data buffered by multiple FIFOs separately; (6) When the data buffer size of any group of FIFO_OUT is less than or equal to twice the output data packet of the AXI4 Stream bus burst bandwidth, the DDR read request signal is started, and combined with the Rd_last instruction, the output data packet data is read from the DDR in sequence and decoded and written to the corresponding FIFO_OUT. The output video bit width is 2 k bits of video data; (7) From video width 2 k The effective video information is read out from the 10-bit video data and displayed to realize the cache control of multi-channel video signals; wherein k is a positive integer; and the bit width of the input data packet is an exponential power of 2.

2. The multi-channel video signal buffer control method according to claim 1, It is characterized in that The conversion method of the AXI4 Stream bus format in step (4) is: Set DDR to Packet mode. When DDR write request is turned on, DDR write enable is started. The write address is declared valid. DMA lock signal Dma_lock is pulled high to occupy DMA operation. The encoded input data packet, video line signal, video field signal, write request signal and effective write address are logically controlled in timing order and finally converted into AXI4 Stream bus format for transmission.

3. The multi-channel video signal buffer control method according to claim 1 or 2, It is characterized in that The acquisition and update method of the input data packet of this burst is: After starting the DDR write request signal, according to the priority of the video channel in FIFO_IN where the video signal is located, the current output data packet in FIFO_IN is used as the input data packet of this AXI4 Stream burst; When the write operation of the current output data packet in FIFO_IN is completed, the write completion signal Wr_last is received, and then the output data packets of other video channels in FIFO_IN are read to update the input data packets of this AXI4 Stream burst; For simultaneously input video signals, the output data packets of the high priority channel are used as the input data packets of this AXI4 Stream burst.

4. The multi-channel video signal buffer control method according to claim 3, It is characterized in that The step (6) specifically includes the following steps: (6.1) When the amount of data in any group of FIFO_OUT buffers is less than or equal to twice the output data packet burst bandwidth, set DDR to Packet mode, start DDR read enable, the read address is valid and declared, and the DMA lock signal Dma_lock is pulled high; (6.2) Combined with the read completion signal Rd_last, read the highest priority output data packet from DDR and write it to FIFO_OUT after decoding, and the output video bit width is 2 k bits of video data.

5. The multi-channel video signal buffer control method according to claim 4, It is characterized in that The step (6.2) specifically includes the following steps: When the read operation of the highest priority output data packet is completed, a read completion signal Rd_last is issued to read the highest priority input data packet among other output data packets.

6. The multi-channel video signal buffer control method according to claim 2, It is characterized in that When DDR is set to Packet mode, each time a write request is valid, the video source channel number wr_pointer of the current input data packet is determined, and the initial address is generated for the first input data packet written; Continuously write multiple groups of input data packets through offset addresses; The write address is valid during the write enable period and is released when the write completion signal Wr_last is valid.

7. The multi-channel video signal buffer control method according to claim 1, It is characterized in that In the stage of writing the input data packet, the encoding method for the input data packet and each video channel is: Set the write address of the input data packet to wr_addr = {wr_pointer, burst_number}; wr_addr is the write address of the data packet; wr_pointer indicates the video source channel ID; burst_number is the burst number of data packets, and the value is 0 for the first burst; after adding the offset address, the burst address is burst_addr = burst_number burstLegeth; burstLegeth is the AXI burst length; burst_number is the number of bursts.

8. A multi-channel video signal cache control system based on FPGA, It is characterized in that include: A plurality of video source receiving modules, whose output terminals are connected to the input terminals of the plurality of input FIFO IN modules, are used to provide multi-channel video sources; The multiple input FIFO IN modules are bidirectionally connected to the TV Controller FSM module, and are used to reorganize the multiple input video signals according to the AXI4Stream minimum transmission data packet data bit width and data packet length to generate multiple input data packets; and count the data of the input data packets; wherein the multiple input video signals are converted into the video bit width of the multiple video sources according to the input video source resolution. k bit video signal; The TV Controller FSM module is bidirectionally connected with multiple groups of input FIFO IN modules and multiple groups of output FIFO OUT modules, and transmits data streams with DMA and transmits control streams with AXI transfer modules; it is used to divide processing priorities for video signals of different channels in FIFO_OUT and FIFO_IN, and monitor the data cache amounts of multiple groups of FIFO_OUT and FIFO_IN, and generate a DDR read enable signal and start a DDR read request signal when the storage amount of any FIFO_OUT is less than or equal to twice the output data of the AXI4 Stream bus burst bandwidth; it starts a DDR write request signal when the data cache amount of FIFO_IN reaches the AXI4 Stream burst amount; and it is used to send a write completion signal and a read completion signal; The DMA, whose output end is connected to the AXI transfer module, reorganizes and encodes the received input data packets and output data packets with each video source respectively; AXI transfer module, whose output end is connected to AXI mig, is used to convert video lines, video fields and DDR read enable, write enable, effective write address, effective read address, input data packet and output data packet into AXI4 Stream bus format; AXI mig module, used to provide the mig storage management interface of the AXI4 interface; DDR memory module, which is in DDR memory particle format; The multiple groups of input FIFO OUT modules are bidirectionally connected to the TV Controller FSM module to restore the output data packets to a video bit width of 2 k bits of video data; and count the storage volume of the output data packets; Multiple video source sending modules are used to send video bit widths of 2 k bits of video data to restore valid video information and display it; where k is a positive integer.

9. The multi-channel video signal buffer control system according to claim 8, It is characterized in that The AXI transfer module includes an AXI transfer device in a write operation phase and an AXI transfer device in a read operation phase; The AXI transfer device in the write operation phase is used to start DDR write enable after DDR write request is turned on when DDR is set to Packet mode, write address is declared valid, and DMA lock signal Dma_lock is pulled high; The AXI transfer device in the read operation phase is used to start the DDR read enable after the DDR read request is turned on when the DDR is set to Packet mode, the read address is declared valid, and the DMA lock signal Dma_lock is pulled high.

10. The multi-channel video signal buffer control system according to claim 8 or 9, It is characterized in that When the DMA is writing the input data packet, the encoding method for the input data packet and each video channel is as follows: Set the write address of the input data packet to wr_addr = {wr_pointer, burst_number}; wr_addr is the write address of the data packet; wr_pointer indicates the video source channel ID; burst_number is the burst number of data packets, and the value is 0 for the first burst; after adding the offset address, the burst address is burst_addr = burst_number burstLegeth; burstLegeth is the AXI burst length; burst_number is the number of bursts.