Low-latency data processing method based on FPGA
By implementing low-latency data processing with software and hardware collaboration on FPGA, using interrupt and timing transmission mechanisms, the problem of miniaturized and low-power chip processing exceeding the threshold in a demanding environment is solved, and high real-time data processing is achieved performance.
Patent Information
- Application Number
- CN202010777683.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-05
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-08-05
AI Technical Summary
In demanding aerospace environments, high-performance processors cannot meet the real-time data processing requirements of miniaturized and low-power chips due to their large size and high power consumption, resulting in the processing time often exceeding the specified time threshold.
The low-latency data processing method based on FPGA is adopted, and through software and hardware collaboration and flow segmentation, it realizes frame reception/transmission, timing transmission and instruction transmission, and uses interrupt transmission and timing transmission mechanisms to improve data processing speed.
It realizes high real-time processing performance, ensures that data processing is completed in a short time, avoids the situation where processing time exceeds the threshold, and improves the system's real-time processing capability.
Smart Images

Figure CN114064528B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electronic information and communication technology, and in particular relates to a low-latency data processing method based on FPGA. Background Art
[0002] In modern communication systems, in order to ensure the real-time performance of data communication, the system integrated control module often has strict time threshold limits for the data processing of each sub-module in the system. If a sub-module exceeds the time threshold during data processing, the system integrated control module considers that the sub-module is faulty. In some harsh use environments (such as aviation and aerospace environments), the sub-modules are required to be small in size, low in power consumption, and high in real-time data processing. Therefore, it is impossible to select a high-performance processor (large in size and high in power consumption) for data processing, and only a miniaturized and low-power chip can be selected. Miniaturized and low-power chips often have certain bottlenecks in processing performance. If large amounts of data need to be processed, there will be a situation where the processing time is critical or even exceeds the specified time threshold. Summary of the invention
[0003] An object of the present invention is to provide a low-latency data processing method based on FPGA and provide at least the advantages to be described below.
[0004] Another object of the present invention is to provide a low-latency data processing method based on FPGA, with software and hardware collaboration and pipeline segmentation, using FPGA to implement receive / transmit frame segmentation, timed transmission, instruction transmission and software data parallel processing, thereby improving the data processing speed as much as possible.
[0005] The technical solution of the present invention is as follows:
[0006] The low-latency data processing method based on FPGA includes the following steps:
[0007] The FPGA processing unit detects whether the receiving enable signal is valid, writes a frame synchronization symbol SYN into the receiving FIFO memory when the receiving enable signal is valid, and writes data into the receiving FIFO memory;
[0008] The FPGA processing unit detects whether the receiving enable signal is valid, and when the receiving enable signal is invalid, writes a frame end character END into the receiving FIFO memory and records it as a frame;
[0009] A frame number threshold is preset, and when the number of received data frames reaches the frame number threshold, the data processing unit reads and processes the data in the receiving FIFO storage period, and writes the processed data into the sending FIFO memory through the FPGA processing unit;
[0010] When the FPGA processing unit detects the sending identifier SEND_EN in the processed data, it retrieves the processed data from the sending FIFO memory for sending; or when the FPGA processing unit writes a frame synchronization symbol to the receiving FIFO memory, it starts the timer and uses it as the processing time; a processing time threshold is set in advance, and when the processing time reaches the processing time threshold, the FPGA processing unit retrieves the processed data from the sending FIFO processor for sending.
[0011] Preferably, in the FPGA-based low-latency data processing method, when the FPGA processing unit writes data into the receive FIFO memory, the highest bit of the read and write data bit width of the receive FIFO memory is used to indicate the validity of the data, 1 is invalid, and 0 is valid; the second highest bit and the lower 8 bits are combined to indicate SYN and END; when the highest bit and the second highest bit are both 0, the lower 8 bits indicate data.
[0012] Preferably, in the FPGA-based low-latency data processing method, the read and write data bit width of the receive FIFO memory is 16 bits, SYN is defined as 0x40FF, END is defined as 0x4000, invalid data is defined as 0x8000, and valid data is defined as 0x00XX.
[0013] Preferably, in the FPGA-based low-latency data processing method, the data processing unit processes data including:
[0014] Read data from the receiving FIFO memory, discard invalid data between SYN and END, copy valid data to the buffer BUF memory for processing, and write to the sending FIFO memory after processing;
[0015] After writing the last data, write the send identifier SEND_EN to the FPGA processing unit.
[0016] The present invention has the following beneficial effects:
[0017] By adopting two simultaneous working mechanisms of interrupt sending and timed sending, very high real-time processing performance can be achieved.
[0018] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A data receiving and processing block diagram in one embodiment of a low-latency data processing method based on FPGA provided by the present invention;
[0020] Figure 2 A diagram of a received data structure in one embodiment of a low-latency data processing method based on FPGA provided by the present invention;
[0021] Figure 3 A timing diagram of sending data processing instructions in one embodiment of a low-latency data processing method based on FPGA provided by the present invention;
[0022] Figure 4 A diagram of a sending data structure in one embodiment of a low-latency data processing method based on FPGA provided by the present invention;
[0023] Figure 5 A data transmission processing block diagram of an embodiment of a low-latency data processing method based on FPGA provided by the present invention;
[0024] Figure 6 A timing diagram of a data processing instruction timeout sending in one embodiment of a low-latency data processing method based on FPGA provided by the present invention. DETAILED DESCRIPTION
[0025] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.
[0026] It should be understood that terms such as “having”, “including” and “comprising” used herein do not specify the existence or addition of one or more other elements or combinations thereof.
[0027] When the processing algorithm of the data processor and the performance of the receiving / transmitting interface are determined, in order to speed up the data processing speed as much as possible, in the process of receiving / transmitting data, the software and hardware work in coordination, and the data processing process is designed to be pipelined, so that the transmission of a complete data frame reaches the maximum performance. The present invention provides a method for using FPGA to realize receiving / transmitting frame division, timed transmission, instruction transmission and software data parallel processing, and processing data in a pipeline manner.
[0028] like Figure 1 As shown, in the low-latency data processing method based on FPGA provided by the present invention, the FPGA receiving process:
[0029] After detecting that the receive enable is valid (synchronous interface) or the frame synchronization header (asynchronous interface), the FPGA writes the frame synchronization symbol SYN to the receive FIFO to indicate the start of a frame. After detecting that the receive enable is invalid or the frame end symbol (asynchronous interface), the FPGA writes the frame end symbol END to the receive FIFO. During the receiving process, if the received data count reaches the receive interrupt threshold set by the user, an interrupt signal is generated to the data processing unit to notify the data processing unit to read data from the receive FIFO for processing.
[0030] When the FPGA writes data to the receive FIFO, the highest bit of the FIFO is used to indicate the validity of the data (1 is invalid, 0 is valid); the second highest bit and the lower 8 bits are combined to indicate SYN and END; when the highest bit and the second highest bit are both 0, the lower 8 bits indicate data. The functions of the above bits can be customized according to the hardware platform. For example, if the FIFO read and write data width is 16 bits, then SYN can be defined as 0x40FF, END can be defined as 0x4000, invalid data indication is 0x8000, and valid data can be defined as 0x00XX. The structure is as follows Figure 2 shown.
[0031] During the initialization process of the data processing unit, the FPGA's timeout sending time TIME_OUT_VAL and receiving interrupt threshold INTR_VAL need to be set. The specific parameters of TIME_OUT_VA and INTR_VAL need to be set according to the latency requirements of the indicator.
[0032] After the data processing unit receives the receive interrupt generated by the FPGA, it reads data from the receive FIFO, discards the invalid data (0x8000) between SYN and END, and copies the valid data (0x00XX) to the cache BUF. When reading data, it processes the processable data immediately and writes it to the FPGA send FIFO after processing. Figure 4 After the data processing unit writes the last data, it writes the send enable control symbol SEND_EN (0x2A00) to the FPGA send enable register to notify the FPGA that the send operation can be performed.
[0033] The FPGA sending process is:
[0034] When FPGA is processing data transmission, it uses two transmission modes: interrupt transmission and scheduled transmission.
[0035] Data processing unit instruction sending: This situation is applicable to the case where the data processing unit processes short frame data. Figure 5As shown, the data processing unit writes the processed data into the FPGA transmit FIFO, and finally writes the transmit flag SEND_EN. After the FPGA detects that SEND_EN is valid, it does not wait for the timer timeout interrupt and directly starts the data operation.
[0036] Timer timeout transmission: This situation is applicable to the case where the data processing unit processes long frame data. Figure 6 As shown in the figure, after the FPGA detects that the receive data synchronization signal is valid, it enables the send timer. If the timer count reaches the time threshold set by the user, it immediately takes out the data from the transmit FIFO for transmission without waiting for the SEND_EN signal to be valid.
[0037] By using two simultaneous working mechanisms, interrupt transmission and scheduled transmission, high real-time processing performance can be achieved. For example, the system requires that the processing delay should not exceed 15ms, and the user can set the timeout threshold to 13ms. When the data processing unit processes a shorter data frame, it can be completed within 13ms, so as long as the data processing unit issues a transmission instruction, the FPGA will immediately perform the transmission operation. For long data frames, the data processing unit may take more than 13ms to process. Through reasonable software design, the data is segmented and processed, and the processed data is written into the transmission FIFO in time to ensure that the FPGA transmission FIFO is not empty. By using the timeout transmission mechanism, data transmission as required can be achieved.
[0038] The traditional software data processing method includes a series of operations such as receiving data, judging data integrity, processing data, and sending data. This method divides the above process into pipelines, greatly improving the data processing speed. Users can freely configure the timeout period according to actual conditions.
[0039] This method has been applied in the engineering practice of various types of equipment, effectively improving the real-time processing capability of the equipment and has a high reference value.
[0040] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.
Claims
1. A low-latency data processing method based on FPGA, characterized in that: The following steps are involved: The FPGA processing unit detects whether the receiving enable signal is valid, writes a frame synchronization symbol SYN into the receiving FIFO memory when the receiving enable signal is valid, and writes data into the receiving FIFO memory; The FPGA processing unit detects whether the receiving enable signal is valid, and when the receiving enable signal is invalid, writes a frame end character END into the receiving FIFO memory and records it as a frame; A frame number threshold is preset, and when the number of received data frames reaches the frame number threshold, the data processing unit reads and processes the data in the receiving FIFO storage period, and writes the processed data into the sending FIFO memory through the FPGA processing unit; When the FPGA processing unit detects the sending identifier SEND_EN in the processed data, the processed data is retrieved from the sending FIFO memory for sending; or when the FPGA processing unit writes the frame synchronization symbol into the receiving FIFO memory, the timer is started to count and the timer is used as the processing time; A processing time threshold is preset, and when the processing time reaches the processing time threshold, the FPGA processing unit retrieves the processed data from the transmit FIFO processor for transmission; in; When the FPGA processing unit writes data into the receiving FIFO memory, the highest bit of the read / write data bit width of the receiving FIFO memory is used to indicate the validity of the data, 1 is invalid, and 0 is valid; the second highest bit and the lower 8 bits are combined to indicate SYN and END; when the highest bit and the second highest bit are both 0, the lower 8 bits indicate data; The read and write data bit width of the receiving FIFO memory is 16 bits, SYN is defined as 0x40FF, END is defined as 0x4000, invalid data is defined as 0x8000, and valid data is defined as 0x00XX.
2. The low-latency data processing method based on FPGA according to claim 1, characterized in that: The data processing unit processes data including: Read data from the receiving FIFO memory, discard invalid data between SYN and END, copy valid data to the buffer BUF memory for processing, and write to the sending FIFO memory after processing; After writing the last data, write the send identifier SEND_EN to the FPGA processing unit.
Citation Information
Patent Citations
Method and configuration for transmitting digital data
US7000058B1
Method and apparatus for source-synchronous capture using a first-in-first-out unit
US8775701B1
Single chip ONU of FPGA transceiver facing multi-application PON
WO2020015201A1
