A FPGA hardware implementation method for high-bandwidth and low-latency algorithm processing
By adopting the FPGA hardware implementation method of high-bandwidth and low-latency algorithm processing in the sonar system, the problems of large data transmission congestion and low real-time performance in the sonar system are solved, marginal calculation and conflict management are realized, and the transmission is improved. Efficiency and bandwidth, supporting multiple algorithm processing.
Patent Information
- Application Number
- CN202111322676.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-09
AI Technical Summary
Large-scale data transmission in sonar systems leads to array data transmission congestion and low real-time performance, which affects the development of sonar technology.
FPGA hardware implementation method using high-bandwidth and low-latency algorithm processing, through algorithm classification and pipeline design algorithm processing unit, combined with counters and RAM storage modules, to achieve marginal calculation and conflict management, reduce computing pressure and data bandwidth, and improve transmission bandwidth and real-time.
It improves sonar data transmission efficiency, reduces transmission delay, reduces computing resources, improves transmission bandwidth and real-time performance, and supports multiple algorithm processing and flexible conflict management.
Smart Images

Figure CN114153763B
Abstract
Description
Technical field:
[0001] The invention belongs to the field of electronic information technology and can be applied to the research and development of sonar transmission processing equipment. Specifically, it is an FPGA hardware implementation method for high-bandwidth and low-latency algorithm processing. Background technology:
[0002] With the development of sonar system engineering and detection technology, the accuracy requirements for sonar detection are getting higher and higher at home and abroad, so there is a large-scale data transmission in sonar system engineering. Large amounts of sonar data will have performance and latency issues, resulting in array data transmission congestion and low real-time performance, which affects the development of sonar technology. Summary of the invention:
[0003] The technical problem to be solved by the present invention is to provide an FPGA hardware implementation method for high-bandwidth and low-latency algorithm processing, which solves the problems of low latency in base array transmission performance and is suitable for FPGA implementation of data processing with large amounts of data and specific algorithms. The method implements edge computing in the computing architecture, which can reduce the computing pressure of the processing platform and the data bandwidth of the transmission link. The computing method involved also has the advantages of high real-time performance, improved transmission bandwidth and reduced computing resources.
[0004] The technical solution of the present invention is to provide an FPGA hardware implementation method for high-bandwidth and low-latency algorithm processing, comprising the following steps:
[0005] First, the algorithms are classified according to their characteristics, and each type of algorithm processing unit is designed in a pipeline to complete the input data processing.
[0006] Then the algorithm processing module calculates and outputs the write RAM enable, address and data; uses a counter to count the input data of the algorithm processing module (counts when the input enable is valid, and clears the counter after a frame ends); according to the data rules of each type of algorithm, uses a counter to input data into the calculation unit, and outputs the enable signal, address information and data after algorithm processing;
[0007] And according to the enable signal output by each type of algorithm, it is judged whether the RAM has a write conflict. If the RAM has no write conflict (the output enable signals are data at different times), one RAM is used for storage; if the RAM has a write conflict, the number of algorithm classifications is judged, and the appropriate write conflict management mode is selected according to the number of algorithm classifications combined with the above two write conflict management modes.
[0008] As a preferred technical solution, the FPGA hardware architecture includes an algorithm processing module and a storage module. The algorithm processing module designs the algorithm operators in a pipeline according to the algorithm characteristics to meet the data processing bandwidth while saving computing resources. The storage module matches the bandwidth between data input and output, while ensuring the output of the entire frame of the data packet to reduce output delay.
[0009] As a preferred technical solution, the input data passes through the algorithm processing module, hardens the specific algorithm, and writes to the corresponding storage module through address control according to the output structure, and finally outputs the whole frame. The data flow of this method is that the input data passes through the algorithm processing module, hardens the specific algorithm, and writes to the corresponding storage module through address control according to the output structure, and finally outputs the whole frame, such as Figure 1 If the data is stored first and then calculated, the data output bandwidth is reduced, the data transmission time is extended, and the entire frame cannot be processed. Therefore, the FPGA architecture of this method can increase the bandwidth and reduce the transmission delay.
[0010] The characteristics of the algorithm are consistent with the fact that the output data has a certain pattern within a certain period of time. This method supports algorithms whose output data has one or more patterns. If the algorithms all follow the same pattern, operators such as multiplication, addition, and division are extracted according to the algorithm, and the operator pipeline processing unit is designed; if the algorithms follow different patterns, they are classified, and each category is used as an algorithm processing unit. Each processing unit extracts operators according to the same pattern of the algorithm, and designs a pipeline processing method.
[0011] As a preferred technical solution, there are two write conflict management modes, and one or a combination of two write conflict management modes is selected according to the number of algorithm classifications. When the storage module processes multiple categories of algorithms, the RAM may be written simultaneously according to the algorithms, causing write conflicts. According to different conflict management, the present invention proposes two processing methods.
[0012] One of the write conflict management modes is as follows: by analyzing the timing rules of each type of algorithm, the conflicting algorithms are classified, and the corresponding number of storage units are selected according to the number of classified categories to use the same number of RAMs for storage. Each type of algorithm storage controls a RAM read and write respectively, and finally the above RAMs are spliced and output through depth. If it can be divided into two categories, the storage unit uses two RAMs for storage, and each type of algorithm storage controls the RAM read and write respectively. Finally, the two RAMs are spliced and output through depth; if it can be divided into four categories, the storage unit uses four RAMs for storage, and the same method is used for storage and splicing output. There are two ways to splice RAM, one is RAM depth splicing, and the other is RAM width splicing. Different splicing modes are selected according to different application scenarios.
[0013] If there are fewer types of data storage conflicts, the above conflict management method can be used. However, if there are more types of conflicts, the above method will waste BRAM resources.
[0014] Furthermore, the present invention proposes another write conflict management mode, which is a conflict management mode for read / write enable and address. Specifically, according to the conflict timing of each type of algorithm, for the timing that needs to be written to RAM at the same time, the principle of giving priority to a specific algorithm is set, and the data of this algorithm is written to RAM, and then the subsequent algorithm address is written with a delay to perform conflict management. In this way, it is ensured that there is no read / write conflict problem in RAM. After all data is written to RAM, the RAM data is read out sequentially, and the calculation completion data is output.
[0015] The conflict management modes of the above two storage modules can be flexibly combined during use. One of them or a combination of them can be used to achieve the optimal solution.
[0016] Compared with the prior art, the present invention has the following advantages after adopting the above technical scheme: it provides a high-bandwidth and low-latency data transmission method to improve the sonar data transmission efficiency; it provides an edge computing structure to reduce the transmission data bandwidth; it also provides a variety of operator processing schemes to improve the breadth of scheme support; and it proposes storage module conflict management and RAM splicing diversity to improve the flexibility of the scheme; at the same time, it designs the operator unit in a pipeline to reduce design resources and optimize the running time of the wiring algorithm. Description of the drawings:
[0017] Figure 1 It is the FPGA design block diagram of the present invention.
[0018] Figure 2 It is in the data calculation RAM splicing diagram of the present invention.
[0019] Figure 3 It is a data timing diagram of the present invention.
[0020] Figure 4 It is a flow chart of the method for realizing data calculation by FPGA hardware of the present invention. Specific implementation method:
[0021] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments:
[0022] Example
[0023] A device inputs 1 channel of data, with a clock frequency of 624KHZ, a bit width of 16bit, a total number of frames (channels) of 96, and a data input sequence of X1, X25, X49, X73, X2, X26, X50, X74...X24, X48, X72, X96;
[0024] The data processing output is
[0025] Channel 1-24: CH1 = (X1 + X2) / 2, CH2 = (X3 + X4) / 2... CH24 = (X47 + X48) / 2;
[0026] Channel 25-48: CH25=X49, CH26=X50...CH48=X72;
[0027] Channel 49-60: CH49 = (X1 + X2 + X3 + X4) / 4, CH50 = (X5 + X6 + X7 + X8) / 4... CH60 = (X45 + X46 + X47 + X48) / 4;
[0028] Channel 61-72: CH61 = (X49 + X50) / 2, CH62 = (X51 + X52) / 2 ... CH72 = (X71 + X72) / 2;
[0029] Channel 73-96: CH73=X73, CH74=X74...CH96=X96.
[0030] According to the high-bandwidth, low-latency FPGA design architecture, data first passes through the algorithm calculation module and then enters the storage module. This example divides the algorithms into 5 categories, and designs a calculation unit for each algorithm. The first category of algorithms is channels CH1-CH24, and the calculation unit includes an adder and a shifter; the second category of algorithms is channels CH25-CH48, and the calculation unit is a group of registers; the third category of algorithms is channels CH49-CH60, and the calculation unit includes three adders and a shifter; the fourth category of algorithms is channels CH61-CH72, and the calculation unit includes an adder and a shifter; the fifth category of algorithms is channels CH73-CH96, and the calculation unit is a group of registers. After the classification is completed, the algorithm calculation unit is designed and the calculation results are written into the storage module. The key issue of data storage is conflict management. One is to manage from the time of input data, and the other is to manage from the storage unit of input data. Storage unit management can be achieved by splicing RAM, including bit width splicing and depth splicing. Figure 2 (a) is a deep splicing RAM. The input is the write port of two groups of RAM to control RAM respectively. When reading data, the data is read from top to bottom according to the address sequence, that is, RAM1 is read first and then RAM2. Figure 2 (b) is a wide splicing RAM. The input control is the same as the deep splicing RAM, but when reading data, it is read from RAM1 and RAM2 separately according to the address sequence, that is, even addresses read RAM1 and odd addresses read RAM2 in sequence. According to the timing diagram of the five types of algorithms, as shown below: Figure 3, Category 1 and Category 3, Category 2 and Category 4 need to be written to RAM at the same time, so the deep splicing RAM method can be used. Category 1 and Category 2 are written to one RAM, and Category 3, Category 4 and Category 5 are written to another RAM. Therefore, the conflict management method of this instance is storage unit management, specifically the unit deep splicing RAM method. All data is calculated and written to the storage unit, and the whole frame is output to complete the calculation and storage processing.
[0031] According to the above embodiment, the processing flow of this solution is summarized as follows: Figure 4 First, the algorithms are classified according to the characteristics of the acoustic signal processing algorithms. Each type of algorithm processing unit is designed in a pipeline to complete the processing of the input data. Then the algorithm processing module calculates and outputs the write RAM enable, address and data. The input data of the algorithm processing module is counted using a counter (counting when the input enable is valid, and the counter is cleared after one frame ends). According to the data rules of each type of algorithm, a counter is used to input the data into the calculation unit, and the enable signal, address information and data after algorithm processing are output. According to the enable signal output by each type of algorithm, it is judged whether the RAM has a write conflict. If the RAM has no write conflict (the output enable signals are all data at different times), a RAM is used for storage. If the RAM has a write conflict, the number of algorithm classifications is determined, and the appropriate write conflict management mode is selected based on the number of algorithm categories and the two write conflict management modes. One of the methods can be used or a mixture of the two methods can be used.
[0032] One of the write conflict management modes is as follows: by analyzing the timing rules of each type of algorithm, the conflicting algorithms are classified, and the corresponding number of storage units are selected according to the number of classified categories to use the same number of RAMs for storage. Each type of algorithm storage controls a RAM read and write respectively, and finally the above RAMs are spliced and output through depth. If it can be divided into two categories, the storage unit uses two RAMs for storage, and each type of algorithm storage controls the RAM read and write respectively. Finally, the two RAMs are spliced and output through depth; if it can be divided into four categories, the storage unit uses four RAMs for storage, and the same method is used for storage and splicing output. There are two ways to splice RAM, one is RAM depth splicing, and the other is RAM width splicing. Different splicing modes are selected according to different application scenarios.
[0033] If there are fewer types of data storage conflicts, the above conflict management method can be used. However, if there are more types of conflicts, the above method will waste BRAM resources.
[0034] Furthermore, the present invention proposes another write conflict management mode, which is a conflict management mode for read / write enable and address. Specifically, according to the conflict timing of each type of algorithm, for the timing that needs to be written to RAM at the same time, the principle of giving priority to a specific algorithm is set, and the data of this algorithm is written to RAM, and then the subsequent algorithm address is written with a delay to perform conflict management. In this way, it is ensured that there is no read / write conflict problem in RAM. After all data is written to RAM, the RAM data is read out sequentially, and the calculation completion data is output.
[0035] The present invention proposes an FPGA hardware implementation method for high-bandwidth and low-latency algorithm processing, which solves the large-data bandwidth transmission and latency of base array data, and also has a specific algorithm calculation function. The present invention implements an edge computing method in the computing architecture, which can reduce the computing pressure of the processing platform and reduce the data bandwidth of the transmission link. The computing method involved in the present invention also has the advantages of high real-time performance, improved transmission bandwidth, and reduced computing resources.
[0036] The above is only an explanation of the preferred embodiments of the present invention, which should not be construed as a limitation on the claims. Any equivalent structure or equivalent process changes made using the contents of the present invention's specification and drawings are included in the patent protection scope of the present invention.
Claims
1. A method for implementing high-bandwidth and low-latency algorithm processing on an FPGA, characterized in that: The following steps are included: First, the algorithms are classified according to their characteristics, and each type of algorithm processing unit is designed in a pipeline to complete the input data processing. Then the algorithm processing module calculates and outputs the write RAM enable, address and data; uses a counter to count the input data of the algorithm processing module; according to the data rules of each type of algorithm, uses a counter to input the data into the calculation unit, and outputs the enable signal, address information and data after algorithm processing; And according to the enable signal output by each type of algorithm, it is judged whether there is a write conflict in the RAM. If there is no write conflict in the RAM, one RAM is used for storage; If there is a write conflict in the RAM, the number of algorithm categories is determined, and the appropriate write conflict management mode is selected according to the number of algorithm categories; There are two write conflict management modes. One or a combination of two write conflict management modes is selected according to the number of algorithm classifications. One of the write conflict management modes is as follows: by analyzing the timing rules of each type of algorithm, the conflicting algorithms are classified, and the corresponding number of storage units are selected according to the number of classification categories to use the same number of RAM for storage. Each type of algorithm storage controls the reading and writing of a RAM respectively, and finally the above RAM is spliced and output through depth. The other write conflict management mode is as follows: according to the conflict timing of each type of algorithm, for the timing that needs to be written to RAM at the same time, the principle of giving priority to a specific algorithm is set, and the data of this algorithm is written to RAM, and then the subsequent algorithm address is written with a delay to perform conflict management.
2. The FPGA hardware implementation method of high-bandwidth and low-latency algorithm processing according to claim 1 is characterized in that: The FPGA hardware architecture includes an algorithm processing module and a storage module. The algorithm processing module pipeline designs the algorithm operators according to the algorithm characteristics to meet the data processing bandwidth while saving computing resources. The storage module matches the bandwidth between data input and output, while ensuring the output of the entire frame of the data packet to reduce output latency.
3. The FPGA hardware implementation method of high-bandwidth and low-latency algorithm processing according to claim 2 is characterized in that: The input data passes through the algorithm processing module, hardens the specific algorithm, and is written into the corresponding storage module through address control according to the output structure, and finally the entire frame is output.
