Circuit structure optimization method and system based on FPGA carry chain

文档序号:1889873 发布日期:2021-11-26 浏览:17次 中文

阅读说明:本技术 基于fpga进位链的电路结构优化方法及系统 (Circuit structure optimization method and system based on FPGA carry chain ) 是由 邓波 孔彪 张敏 于 2021-07-20 设计创作,主要内容包括:本发明提出一种基于FPGA进位链的电路结构优化方法及系统,该方法包括:通过逻辑综合工具对目标逻辑运算进行逻辑综合,得到综合网表;获取所述综合网表中关键路径;若所述关键路径上查位表的实际输入个数不大于预设阈值,且所述关键路径上参考路径两端的相邻元件为进位链,则将所述关键路径上的查位表转换为进位链,所述参考路径为连续相邻的查找表所组成的路径。本发明实施例通过查找关键路径上符合变换要求的查找表,并将查找变转换为进位链,由于进位链和查找表两个元件之间的时延较大,而进位链和进位链之间的时延较小,将相邻的进位链和查找变转换为两个相邻的进位链,从而减小了电路时延,增加了电路频率,提高了FPGA芯片的性能。(The invention provides a circuit structure optimization method and a system based on an FPGA carry chain, wherein the method comprises the following steps: performing logic synthesis on the target logic operation through a logic synthesis tool to obtain a synthesis netlist; acquiring a critical path in the synthesized netlist; and if the actual input number of the bit lookup tables on the key path is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path on the key path are carry chains, converting the bit lookup tables on the key path into carry chains, wherein the reference path is a path formed by the continuous adjacent lookup tables. According to the embodiment of the invention, the lookup table which meets the conversion requirement on the key path is searched, and the search conversion is converted into the carry chain, and because the time delay between the carry chain and the lookup table is larger and the time delay between the carry chain and the carry chain is smaller, the adjacent carry chain and the search conversion are converted into two adjacent carry chains, so that the circuit time delay is reduced, the circuit frequency is increased, and the performance of the FPGA chip is improved.)

1. A circuit structure optimization method based on an FPGA carry chain is characterized by comprising the following steps:

performing logic synthesis on the target logic operation through a logic synthesis tool to obtain a synthesis netlist;

acquiring a critical path in the synthesized netlist;

and if the actual input number of the bit lookup tables on the key path is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path on the key path are carry chains, converting the bit lookup tables on the key path into carry chains, wherein the reference path is a path formed by the continuous adjacent lookup tables.

2. The FPGA carry chain-based circuit structure optimization method of claim 1, wherein the preset threshold is determined according to a target FPGA chip, and the target FPGA chip is used for realizing the target logical operation.

3. The FPGA carry chain-based circuit structure optimization method according to claim 2, wherein the preset threshold is the theoretical input number of the lookup table in the carry chain of the target FPGA chip plus 1.

4. The method according to claim 1, wherein the critical path is one or more than one.

5. The method for optimizing a circuit structure based on an FPGA carry chain according to claim 4, wherein the critical path comprises a path with the largest delay in the synthesized netlist.

6. The method for optimizing the circuit structure based on the FPGA carry chain according to any one of claims 1 to 5, wherein the converting the bit lookup table on the critical path into the carry chain comprises:

and replacing the carry chain with a bit lookup table on the critical path, wherein an input pin of the carry chain replaces an actual signal input pin of the bit lookup table on the critical path, and an output pin of the carry chain replaces an actual signal output pin of the bit lookup table on the critical path.

7. The FPGA carry chain-based circuit structure optimization method of any one of claims 1 to 5, wherein the logic synthesis tool is Design Compiler.

8. The utility model provides a circuit structure optimization system based on FPGA carry chain which characterized in that includes:

the comprehensive module is used for carrying out logic synthesis on the target logic operation through a logic synthesis tool to obtain a comprehensive netlist;

the path module is used for acquiring a critical path in the synthesized netlist;

and the conversion module is used for converting the bit lookup table on the key path into a carry chain if the actual input number of the bit lookup table on the key path is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path on the key path are carry chains, wherein the reference path is a path formed by continuous adjacent lookup tables.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the method for optimizing a circuit structure based on an FPGA carry chain according to any one of claims 1 to 7.

10. A computer storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method for optimizing a circuit structure based on an FPGA carry chain according to any one of claims 1 to 7.

Technical Field

The invention relates to the technical field of electronic circuits, in particular to a circuit structure optimization method and system based on an FPGA carry chain.

Background

With the development of digitization and intellectualization, a Field Programmable Gate Array (FPGA) chip component becomes an indispensable core device in the fields of communication, aerospace, military industry and the like, and is an important support foundation for guaranteeing national strategic safety. The logic synthesis tool in FPGA software maps digital design into a gate-level table and optimizes a redundant circuit structure, the performance level of the result greatly affects subsequent layout and wiring results, and even directly affects key performances such as time sequence power consumption and the like when a final chip is applied.

In the synthesis process of the synthesizer of the FPGA chip, due to the characteristics and the limitations of the hardware structure of the synthesizer, one or more function libraries containing target technologies need to be introduced, and the function libraries comprise a multi-bit adder, a register, a memory and the like. The synthesizer generates RTL description through a compiler by analyzing a hardware description language, and effectively synthesizes a design part into an actual gate-level netlist. The synthesizer can not only convert the high-level abstract description into a lower-level description, but also optimize the logic structure in the design, such as removing redundant circuit structures or multiplexing circuit modules with the same function.

Generally, a small Look-Up Table (Look Up Table, abbreviated as LUT) is used in an FPGA to implement logic functions, and any n logic functions with inputs and outputs of 1 can be implemented by storing a truth Table, and the range of the inputs is generally 4 to 6, and one of the key steps of FPGA logic synthesis is to decompose a large multi-input logic block into small logic functions with 4 to 6 inputs, and implement these small logic functions with the LUT.

However, in the process of implementing a logic function by using an LUT, a large time delay is generated, and therefore, a circuit structure optimization method based on an FPGA carry chain is needed.

Disclosure of Invention

The invention provides a circuit structure optimization method and system based on an FPGA carry chain, and mainly aims to reduce time delay of a circuit time sequence key path, effectively improve the maximum frequency of the whole circuit and enhance the performance of a target FPGA chip.

In a first aspect, an embodiment of the present invention provides a circuit structure optimization method based on an FPGA carry chain, including:

performing logic synthesis on the target logic operation through a logic synthesis tool to obtain a synthesis netlist;

acquiring a critical path in the synthesized netlist;

and if the actual input number of the bit lookup tables on the key path is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path on the key path are carry chains, converting the bit lookup tables on the key path into carry chains, wherein the reference path is a path formed by the continuous adjacent lookup tables.

Preferably, the preset threshold is determined according to a target FPGA chip, and the target FPGA chip is used for implementing the target logical operation.

Preferably, the preset threshold is the theoretical input number of the lookup table in the carry chain of the target FPGA chip plus 1.

Preferably, the critical path is one or more.

Preferably, the critical path includes a most delayed path in the synthesized netlist.

Preferably, the converting the bit lookup table on the critical path into a carry chain includes:

and replacing the carry chain with a bit lookup table on the critical path, wherein an input pin of the carry chain replaces an actual signal input pin of the bit lookup table on the critical path, and an output pin of the carry chain replaces an actual signal output pin of the bit lookup table on the critical path.

Preferably, the logic synthesis tool is Design Compiler.

In a second aspect, an embodiment of the present invention provides a circuit structure optimization system based on an FPGA carry chain, including:

the comprehensive module is used for carrying out logic synthesis on the target logic operation through a logic synthesis tool to obtain a comprehensive netlist;

the path module is used for acquiring a critical path in the synthesized netlist;

and the conversion module is used for converting the bit lookup table on the key path into a carry chain if the actual input number of the bit lookup table on the key path is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path on the key path are carry chains, wherein the reference path is a path formed by continuous adjacent lookup tables.

In a third aspect, an embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the above method for optimizing a circuit structure based on an FPGA carry chain when executing the computer program.

In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the method for optimizing a circuit structure based on an FPGA carry chain are implemented.

According to the circuit structure optimization method and system based on the FPGA carry chain, the search table which meets the conversion requirement on the key path is searched, the search transformation is converted into the carry chain, and the adjacent carry chain and the search transformation are converted into the two adjacent carry chains due to the fact that the time delay between the carry chain and the search table is large and the time delay between the carry chain and the carry chain is small, so that the circuit time delay is reduced.

Drawings

Fig. 1 is a flowchart of a circuit structure optimization method based on an FPGA carry chain according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of the comprehensive utilization of logic in the embodiment of the present invention;

FIG. 3 is a diagram illustrating a structure of a carry chain according to an embodiment of the present invention;

FIG. 4 is a diagram illustrating a reference path according to an embodiment of the present invention;

FIG. 5 is a further schematic diagram of a reference path in an embodiment of the present invention;

FIG. 6 is a schematic diagram of the basic structure of a carry chain element in an embodiment of the present invention;

FIG. 7 is a schematic diagram of the structure of sum logic in carry chain element according to an embodiment of the present invention;

FIG. 8 is a schematic diagram illustrating a structure of a logic synthesis operation according to an embodiment of the present invention;

FIG. 9 is a schematic diagram of a circuit structure after conversion of logic operation according to an embodiment of the present invention;

fig. 10 is a schematic structural diagram of a circuit structure optimization system based on an FPGA carry chain according to an embodiment of the present invention;

fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Fig. 1 is a flowchart of a circuit structure optimization method based on an FPGA carry chain according to an embodiment of the present invention, and as shown in fig. 1, the method includes:

s110, carrying out logic synthesis on the target logic operation through a logic synthesis tool to obtain a synthesis netlist;

firstly, when a certain target logic algorithm is to be subjected to logic synthesis, a logic synthesis tool is generally adopted, the logic synthesis tool is generally software integrating various operation functions, the target logic algorithm is generally logic operation, the logic synthesis refers to a process of converting an RTL code into a gate-level netlist by using a tool, a common logic synthesis tool is a Design Compiler of synopsys, the process of synthesizing one logic operation is started from reading the RTL code, and a gate-level netlist file is generated by applying a time sequence constraint relationship through mapping, and the logic synthesis tool can be divided into three steps:

1. and (3) translation: the RTL level description of the circuit is read in and the language description is translated into the corresponding functional blocks and the topology between the functional blocks. The result of this process is the generation of a boolean function expression of the circuit inside the synthesizer without any logical reorganization and optimization.

2. Optimizing: and logically recombining and optimizing the translation result according to a certain algorithm according to the applied time sequence and area constraints.

3. Mapping: and searching units meeting the conditions from the target process library according to the applied time sequence and area constraints to form a logic synthesis netlist of the actual circuit, wherein the logic synthesis netlist is the synthesis netlist in the embodiment of the invention.

For example, in order to implement the following design, the target logic algorithm is ten-bit input and, the synthesis result of the logic synthesis tool is to use two connected lookup tables to implement the logic function, fig. 2 is a schematic diagram of logic synthesis use in the embodiment of the present invention, as shown in fig. 2.

The design is as follows:

module and_test

(

input[9:0]I,

output Z

);

assign Z=&I;

endmodule

the basic hardware structure of the FPGA further includes a fast carry chain (CARRY CHIAN), and fig. 3 is a schematic diagram of a carry chain structure in the embodiment of the present invention, and as shown in fig. 3, the fast carry chain structure is generally a carry chain structure of a ripple carry adder, and is used for implementing arithmetic operations such as addition and subtraction with large bit width. The basic structure of the hardware structure carry chain is generally other logic gates such as a dual-output LUT plus selector with an input range of 4-6.

S120, obtaining a critical path in the comprehensive netlist;

and then, performing time sequence analysis on the generated comprehensive netlist by using a static time sequence analysis tool to find out a critical path in the comprehensive netlist.

In the embodiment of the present invention, the critical path may be any path having a large influence on the circuit delay.

And S130, if the actual input number of the bit lookup tables on the key path is not greater than a preset threshold value, and the adjacent elements at the two ends of the reference path on the key path are carry chains, converting the bit lookup tables on the key path into carry chains, wherein the reference path is a path formed by continuous adjacent lookup tables.

If the number of the key paths is multiple, for each key path, if a bit-checking table exists on the key path, calculating the number of signals actually input by the bit-checking table, and if the number of the signals actually input is not greater than a preset threshold value and the adjacent elements at the two ends of the reference path where the bit-checking table is located are carry chains, indicating that the bit-checking table meets the requirement of conversion, and converting the bit-checking table.

In this embodiment of the present invention, fig. 4 is a schematic diagram of a reference path in the embodiment of the present invention, as shown in fig. 4, the reference path may only include one bit lookup table, and when the reference path only includes one bit lookup table, if at least one of two adjacent elements of the bit lookup table is a carry chain, which indicates that the bit lookup table meets the conversion requirement, the bit lookup table is converted.

Additionally, fig. 5 is another schematic diagram of the reference path in the embodiment of the present invention, as shown in fig. 5, the reference path may also include a plurality of consecutive adjacent bit lookup tables, and at least one adjacent element at both ends of the reference path is a carry chain, so that all the bit lookup tables on the reference path are converted into carry chains.

According to the circuit structure optimization method based on the FPGA carry chain, the search table which meets the conversion requirement on the key path is searched, the search transformation is converted into the carry chain, and the carry chain and the search transformation are converted into two adjacent carry chains due to the fact that the time delay between two elements of the carry chain and the search table is large, and the time delay between the carry chain and the carry chain is small, so that the adjacent carry chain and the search transformation are converted into the two adjacent carry chains, and the circuit time delay is reduced.

In addition, in the embodiment of the invention, better time sequence optimization effect can be obtained only by carrying out conversion operation on a small number of lookup tables on the key path, and the composition of the software running time is extremely small; and the used carry chain resources are few, and the carry chain resources in the FPGA chip are extremely rich, so that the use of the resources of the chip is not influenced.

On the basis of the above embodiment, preferably, the preset threshold is determined according to a target FPGA chip, and the target FPGA chip is configured to implement the target logical operation.

Specifically, the preset threshold is determined according to the target FPGA chip, and the specific pin number and the using method of different chip signals are different, so that the preset thresholds corresponding to different target FPGA chips are different.

On the basis of the foregoing embodiment, preferably, the preset threshold is the theoretical input number of the lookup table in the carry chain of the target FPGA chip plus 1.

Specifically, the preset threshold is the theoretical input number of the target FPGA chip carry chain lookup table plus 1.

Specifically, the theoretical input number of the carry chain in the FPGA chip is the sum of the theoretical input number of the LUT and the cin pin, and 1 represents the cin pin.

The input pins of the carry chain in the target FPGA chip are sufficient only if the number of actual input pins of the lookup table in the reference path is not greater than the preset threshold.

On the basis of the above embodiment, preferably, the critical path is one or more.

Specifically, in the embodiment of the present invention, the number of the critical paths may be one or multiple. Since the frequency of the circuit is determined by the worst delay, i.e., the path with the largest delay, optimizing the timing of the other paths does not greatly increase the frequency of the circuit, but can still be optimized.

When the critical path is one, the critical path is the most delayed path, that is, the path that is decisive for the timing performance of the design; when the critical path is multiple, the critical path must include the path with the largest delay.

On the basis of the foregoing embodiment, preferably, the converting the bit lookup table on the critical path into a carry chain includes:

and replacing the carry chain with a bit lookup table on the critical path, wherein an input pin of the carry chain replaces an actual signal input pin of the bit lookup table on the critical path, and an output pin of the carry chain replaces an actual signal output pin of the bit lookup table on the critical path.

Specifically, logic functions of the FPGA chip are normally implemented by the bit-checking tables that are interconnected in a programmable manner, so that cascaded bit-checking tables often appear on a designed critical path, and if the delay under the condition can be reduced, a direct and effective optimization effect can be achieved on the designed timing performance.

Because the carry chain generally adopts a smart signal topological structure and a rapid technology, the internal transmission delay is extremely small, and the overall delay of the realized circuit is much lower than the total delay realized by the programmable interconnection of a conventional bit-checking table in an FPGA chip.

Fig. 6 is a schematic diagram of a basic structure of a CARRY chain element in an embodiment of the present invention, as shown in fig. 6, compared with a general LUT, a CARRY chain (CARRY chain) needs to implement a function of arithmetic operations such as addition and subtraction with CARRY, and includes logic such as a selector mux to complete operations of sum and CARRY cout in addition to a dual-output LUT.

The summation operation of addition can be simplified to sum ^ A ^ B ^ CIN, wherein ^ is exclusive-OR operation, the LUTn inside the CARRY can realize the logic function of A ^ B, FIG. 7 is a structural schematic diagram of the sum part logic in the CARRY chain element in the embodiment of the invention, the structure shown in FIG. 7 can realize the logic realization of sum in the CARRY chain element, the operation part of the sum logic in the figure is consistent with the LUT with n +1 bits as input, can realize the logic function of any n +1 inputs, and can also replace the logic function of the common LUT in the FPGA.

Therefore, as long as the input of the LUT in the FPGA device is less than or equal to the input number of the LUT in the CARRY chain element plus one, the CARRY resource in the chip can be used for replacing.

E.g., the calculation target logical operation Z ═ (a ═ B)? Fig. 8 is a schematic structural diagram of a logic synthesis operation in an embodiment of the present invention, where the actual input number of the LUT6 is 6, and the theoretical input number of the LUT6 in CARRY is 5, then the predictive threshold is 5+1 — 6, then the actual input number of the LUT6 is equal to the predictive threshold, then the LUT6 may be converted into one stage in the previous CARRY chain, and the connection delay between the CARRY chain and the LUT6 plus the delay of the LUT6 itself is converted into a very small delay inside the CARRY chain, fig. 9 is a schematic structural diagram of a circuit after the logic operation is converted in the embodiment of the present invention, as shown in fig. 9, the purpose of reducing the circuit delay is achieved.

Fig. 10 is a schematic structural diagram of a circuit structure optimization system based on an FPGA carry chain according to an embodiment of the present invention, and as shown in fig. 10, the system includes: an integration module 1010, a path module 1020, and a conversion module 1030, wherein:

the synthesis module 1010 is used for carrying out logic synthesis on the target logic operation through a logic synthesis tool to obtain a synthesis netlist;

the path module 1020 is configured to obtain a critical path in the synthesized netlist;

the converting module 1030 is configured to convert the bit lookup table on the critical path into a carry chain if the actual input number of the bit lookup table on the critical path is not greater than a preset threshold and the adjacent elements at the two ends of the reference path on the critical path are carry chains, where the reference path is a path formed by consecutive adjacent lookup tables.

All or part of each module in the circuit structure optimization system based on the FPGA carry chain can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In an embodiment, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where the computer device may be a server, and its internal structural diagram may be as shown in fig. 11. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the computer storage media. The database of the computer device is used for storing data generated or acquired in the process of executing the circuit structure optimization method based on the FPGA carry chain. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a circuit structure optimization method based on the FPGA carry chain.

In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the circuit structure optimization method based on the FPGA carry chain in the above embodiments are implemented. Or, the processor implements the functions of each module/unit in the embodiment of the circuit structure optimization system based on the FPGA carry chain when executing the computer program, and is not described herein again to avoid repetition.

In an embodiment, a computer storage medium is provided, and a computer program is stored on the computer storage medium, and when being executed by a processor, the computer program implements the steps of the circuit structure optimization method based on the FPGA carry chain in the above embodiments. Or, when being executed by the processor, the computer program implements the functions of each module/unit in the embodiment of the circuit structure optimization system based on the FPGA carry chain, and is not described herein again to avoid repetition.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种集成电路自动化逻辑综合系统、方法、装置及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类