A method for extracting trigger enable signals from FPGA synthesis tools
By extracting the trigger enable signals from the FPGA synthesis tool using a recursive search method, the problem of high logic resource overhead in existing technologies is solved, thereby reducing logic resources and improving performance.
Patent Information
- Application Number
- CN202411073809.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-07
AI Technical Summary
Existing technologies lack efficient methods to extract trigger enable signals from FPGA synthesis tools, resulting in excessive logic resource overhead and affecting the area and performance of the synthesized FPGA.
A recursive search method is used to traverse each flip-flop unit in the flip-flop set, obtain the input signal, and obtain the feedback signal path through the multiplexer output signal mapping set. The logic and reduction type of the clock enable signal are generated, the flip-flop logic unit type is modified, and the input port enable signal is added.
Accurate and comprehensive extraction of the clock enable signal of the flip-flop unit reduces the number of logic resources used after synthesis, and improves the resource utilization and timing performance of FPGA synthesis.
Smart Images

Figure CN118586337B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of programmable logic device applications, and in particular relates to a method for extracting a trigger enable signal of an FPGA synthesis tool. Background Art
[0002] Logic synthesis is an important step in the FPGA EDA software design process. It converts the Verilog / VHDL circuit files at the behavioral level or register transfer level (RTL) input by the user into a netlist file composed of FPGA basic logic units such as lookup tables (LUTs) and flip-flops (FFs). FPGA logic synthesis includes two stages: synthesis and mapping. Synthesis is to convert the circuit files at the behavioral level or RTL into a logic netlist composed of gate circuits; mapping is to map the logic netlist composed of gate circuits into a netlist file composed of FPGA basic logic units.
[0003] Area, or the number of resources, is an important indicator of FPGA logic synthesis tools. Reducing the number of resources after FPGA logic synthesis plays a very important role in improving the routing rate and timing performance of FPGA software.
[0004] The trigger unit is one of the most basic logic units in the FPGA synthesis netlist, and the clock enable signal is one of the basic control signals to realize the synchronous logic function of the trigger. Extracting the clock enable signal for the trigger unit is not only a necessary process for correctly realizing the trigger function, but also extracting the control signal for the trigger helps to reduce other logic resource overhead, which is also important for reducing the area after FPGA synthesis.
[0005] However, in the prior art, there is a lack of an efficient method for extracting an FPGA trigger enable signal. Summary of the invention
[0006] The present invention provides a method for extracting a trigger enable signal of an FPGA synthesis tool, which can efficiently realize the extraction of the trigger enable signal.
[0007] Other purposes and advantages of the present invention can be further understood from the technical features disclosed in the present invention.
[0008] To achieve one or part or all of the above purposes or other purposes, a technical solution of the present invention provides a method for extracting trigger enable signals of an FPGA synthesis tool, including obtaining a trigger set, a NOT gate signal mapping set and a multiplexer output signal mapping set; traversing each trigger unit in the trigger set and obtaining the trigger unit input signal; if the trigger unit input signal exists in the multiplexer signal mapping set, obtaining the multiplexer logic unit of the trigger unit input signal source from the multiplexer output signal mapping set, and obtaining the path set of the feedback signal of the trigger unit input signal; based on the path set of the feedback signal, generating a logic unit of a logic and reduction type that generates a clock enable signal, modifying the type of the trigger logic unit, and adding an input port enable signal as the output signal of the logic unit of the logic and reduction type; if the trigger unit input signal does not exist in the multiplexer signal mapping set, executing processing on the next trigger unit; until all trigger unit input signals are no longer in the multiplexer signal mapping set, stopping processing on the trigger unit.
[0009] The beneficial effect of this technical solution is that by accurately and quickly extracting the clock enable signal of the trigger unit, the logic unit on the path of the trigger unit feedback signal can be eliminated, thereby reducing the number of logic resources used after synthesis.
[0010] Obtain a path set of the feedback signal of the trigger unit input signal, including obtaining the input S-end signal of the multiplexer logic unit, and traversing the path of the current feedback signal; if the path of the current feedback signal includes the input S-end signal, and path[sig_s]=true, find the input B-end signal of the multiplexer logic unit, and perform a search on the input B-end signal of the multiplexer logic unit; if the path of the current feedback signal does not include the input S-end signal, insert the (sig_s, true) key value into the path of the current feedback signal, and perform a search on the input B-end signal of the multiplexer logic unit.
[0011] The input B-end signal search of the multiplexer logic unit includes comparing the input B-end signal of the multiplexer logic unit with the trigger output Q-end signal, and when the comparison result is the same, inserting the path of the current feedback signal into the path set of the feedback signal.
[0012] When the input B-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, the input B-end signal of the multiplexer logic unit is added to the indeterminate input end signal set of the multiplexer logic unit, and the feedback signal search of the trigger unit input signal is exited.
[0013] When the input B-end signal of the multiplexer logic unit is different from the trigger output Q-end signal, if the input B-end signal of the multiplexer logic unit is the output signal of a certain multiplexer unit, a recursive feedback signal search process is performed on the input B-end signal of the multiplexer logic unit, and the feedback signal path of the recursive feedback signal search result is inserted into the path set of the feedback signal.
[0014] Obtaining the path set of the trigger unit input signal also includes processing the input A-end signal of the multiplexer logic unit, and inserting the (sig_s, false) key value into the path of the current feedback signal; if the input A-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, inserting the path of the current feedback signal into the path set of the feedback signal.
[0015] If the input A-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, the input A-end signal of the multiplexer logic unit is added to the indeterminate input end signal set of the multiplexer logic unit.
[0016] If the input A-end signal of the multiplexer logic unit is different from the output Q-end signal of the trigger, if the input A-end signal of the multiplexer logic unit is the output signal of a certain multiplexer unit, a recursive feedback signal search process is performed on the input A-end signal of the multiplexer logic unit, and the feedback signal path of the recursive feedback signal search result is inserted into the path set of the feedback signal, and the feedback signal search of the trigger unit input signal is exited.
[0017] Generate a logic unit of a logic and reduction type for generating a clock enable signal, including establishing a logic unit of a logic and reduction type and traversing each path in the path set of the feedback signal; newly establishing a logic unit of a logic or reduction type or traversing each key-value pair (sig, value) in the path set of the feedback signal, if value=true, then determine whether there is a negated signal of the sig signal in the NOT gate signal mapping set, if there is a negated signal of the sig signal, insert the negated signal of the sig signal into the input signal of the logic unit or; if there is no negated signal of the sig signal, then rebuild a NOT gate unit to obtain the negated signal of the sig signal, and insert the obtained negated signal of the sig signal into the input signal of the logic unit or; if value=false, then directly insert the sig signal into the input signal of the logic unit or; insert the obtained output signal of the logic unit or into the input signal of the logic unit and.
[0018] Each signal in the indeterminate input terminal signal set of the multiplexer logic unit is traversed, and each traversed signal is set as an indeterminate signal.
[0019] The method for obtaining the trigger set, NOT gate signal mapping set and multiplexer signal mapping set is to traverse the logic units in the circuit netlist, store the logic units of the trigger type into the trigger set; store the mapping relationship from the input signal to the output signal of the logic unit of the NOT gate type into the NOT gate signal mapping set; store the mapping relationship from the output signal of the logic unit of the multiplexer type to the logic unit into the multiplexer output signal mapping set.
[0020] When all trigger unit input signals are not in the multiplexer signal mapping set, stop processing the trigger unit, modify the type of the trigger logic unit, and add the input port enable signal as the output signal of the above logic and reduction type logic unit.
[0021] Compared with the prior art, the beneficial effects of the present invention mainly include: the present invention extracts the trigger enable signal of the FPGA synthesis tool through a recursive search method, which is more comprehensive than the path from analysis to feedback signal used in the prior art, so that the clock enable unit of the trigger unit can be accurately and comprehensively obtained, so that fewer logic resources are used after synthesis.
[0022] In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the specific embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 The present invention is a flowchart of the FPGA integrated trigger enable signal extraction method.
[0025] Figure 2 This is a processing flow chart of the present invention when the current feedback path includes sig_s and path[sig_s]=true.
[0026] Figure 3 This is a flowchart of processing sig_b when the current feedback path of the present invention does not include sig_s.
[0027] Figure 4This is a flow chart of the processing of the input A-end signal sig_a according to the present invention.
[0028] Figure 5 The present invention is a flowchart of a reduce_and type unit method for generating a clock enable signal. DETAILED DESCRIPTION
[0029] The above and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the drawings. The directional terms mentioned in the following embodiments, such as up, down, left, right, front or back, etc., are only referenced to the directions of the attached drawings. Therefore, the directional terms used are used to illustrate and not to limit the present invention.
[0030] Embodiment 1
[0031] Embodiment 1 provides a method for extracting trigger enable signals of FPGA synthesis tools based on recursive search, see Figure 1 , including the following steps:
[0032] (1) First, traverse the logic cells c in the circuit netlist, store the logic cells c of the trigger type into the set dffs (trigger set); store the mapping relationship between the input A-end signal and the output Y-end signal of the logic cells c of the NOT gate type into the set not2y (NOT gate signal mapping set); store the mapping relationship between each bit output Y-end signal of the logic cells c of the multiplexer (Mux) type and the logic cells c into the set y2mux (multiplexer output signal mapping set).
[0033] (2) Traverse each trigger unit d in the set dffs, perform a recursive search process for the feedback signal for the input D-end signal sig_d of the trigger unit d, and obtain the path set paths of the feedback signal (hereinafter referred to as the feedback path). If sig_d exists in y2mux, obtain the Mux unit c from which sig_d comes from y2mux, and perform the following process to obtain the path set paths of the feedback signal; otherwise, exit the processing of sig_d.
[0034] (3) Get the path set paths of the feedback signal, see Figure 2-4, first obtain the input S-end signal sig_s of the Mux unit c. If the current feedback path includes sig_s and path[sig_s]=true, find the input B-end signal sig_b of the Mux unit c. If sig_b is equal to the output Q-end signal sig_q of the trigger unit d, record sig_b in the set undefs that needs to be set to the indeterminate signal Sx; insert the current feedback path path into the feedback path set paths, and exit the feedback signal search for sig_d;
[0035] Otherwise, if sig_b is the output signal of a certain Mux unit, the feedback signal search process is recursively executed, the returned feedback signal path path1 is inserted into the feedback path set paths, and the feedback signal search for sig_d is exited.
[0036] (4) See Figure 3 , if the current feedback path does not include sig_s, process the c input B terminal signal sig_b. Find the Mux unit c input B terminal signal sig_b, and insert the (sig_s, true) key-value pair into the current feedback path; if sig_b is equal to sig_q, then record sig_b into the set undefs that needs to be set to the indeterminate signal Sx, and insert the current feedback path path with the inserted key-value pair into the feedback path set paths; otherwise, if sig_b is the output signal of a Mux unit, recursively perform the feedback signal search process for sig_b, and insert the returned feedback signal path path1 into the feedback path set paths.
[0037] (5) See Figure 4 Next, find the input A-side signal sig_a of Mux unit c and process the input A-side signal sig_a of Mux unit c. Insert the key-value pair (sig_s, false) into the current feedback path path; if sig_a is equal to sig_q, record sig_a into the set undefs that needs to be set to the indeterminate state Sx, and insert the current feedback path path into the feedback path set paths; otherwise, if sig_a is the output signal of a Mux unit, recursively perform the feedback signal search process for sig_a, insert the returned feedback signal path path1 into the feedback path set paths, and exit the feedback signal path search for sig_d.
[0038] (6) When the path set of the feedback signal of the trigger unit input signal is obtained, a logic unit of the logic and reduction type that generates the clock enable signal is generated according to the path set of the feedback signal, the type of the trigger logic unit is modified, and the input port enable signal is added as the output signal of the above logic and reduction type logic unit. For the specific operation process, see Figure 5 , after the feedback path set of the input D-end signal sig_d of each trigger unit d is obtained, each path path in the feedback path set paths is traversed, a new reduce_or (logical or reduction) type logic unit or is created, and each key-value pair (sig, value) in each path path is traversed. If value=true, it is determined whether there is a negative signal sig1 of sig in not2y (not gate signal mapping set). If so, sig1 is inserted into the input signal of or; otherwise, a new not gate unit is created to obtain the negative signal sig1 of sig, and then sig1 is inserted into the input signal of or;
[0039] If value=false, sig is directly inserted into the input signal of or.
[0040] Finally, create a reduce_and (logical and reduction) type logical unit and, insert the output signal of each or obtained above into the input signal of and.
[0041] (7) Modify the logic unit type of each trigger unit d to dffe, and add the signal of the clock enable input port EN as the output signal of and.
[0042] (8) Finally, traverse each signal sig in the set undefs and set sig to the indeterminate signal Sx.
[0043] In step (2), if sig_d does not exist in y2mux, reselect the trigger unit d, obtain the input D-end signal sig_d of the trigger unit d, and repeat the above steps (2) to (8) until each trigger unit d in the traversed set dffs has been processed, then execute the above step (7) to modify the logic unit type of each trigger unit d to dffe, and add the signal of the clock enable input port EN to the output signal of and.
[0044] The above is a detailed introduction to a method for extracting a trigger enable signal of an FPGA synthesis tool provided by the present invention. In this article, a specific example is used to illustrate the structure and working principle of the present invention. The description of the above embodiment is only used to help understand the method and core idea of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for extracting trigger enable signals from an FPGA synthesis tool, characterized in that: Including obtaining a trigger set, a NOT gate signal mapping set and a multiplexer output signal mapping set; Traverse each trigger unit in the trigger set and obtain the trigger unit input signal; If the trigger unit input signal exists in the multiplexer signal mapping set, the multiplexer logic unit of the trigger unit input signal source is obtained from the multiplexer output signal mapping set, and a path set of the feedback signal of the trigger unit input signal is obtained; According to the path set of the feedback signal, a logic unit of a logic and reduction type for generating a clock enable signal is generated, and the type of the trigger logic unit is modified, including establishing a logic unit of a logic and reduction type and traversing each path in the path set of the feedback signal; creating a logic unit of a logic or reduction type or and traversing each key-value pair (sig, value) in the path set of the feedback signal; if value=true, determining whether there is a negated signal of the sig signal in the NOT gate signal mapping set; if there is a negated signal of the sig signal, inserting the negated signal of the sig signal into the input signal of the logic unit or; if there is no negated signal of the sig signal, reconstructing a NOT gate unit to obtain the negated signal of the sig signal, and inserting the obtained negated signal of the sig signal into the input signal of the logic unit or; if value=false, directly inserting the sig signal into the input signal of the logic unit or; inserting the obtained output signal of the logic unit or into the input signal of the logic unit and; and adding a clock enable input port signal as an output signal of the logic unit of the logic and reduction type; If the trigger unit input signal does not exist in the multiplexer signal mapping set, the processing of the next trigger unit is executed; until all trigger unit input signals are no longer in the multiplexer signal mapping set, the processing of the trigger unit is stopped.
2. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 1, wherein: Obtaining a path set of the feedback signal of the trigger unit input signal, including obtaining the input S-end signal of the multiplexer logic unit, and traversing the path of the current feedback signal, if the path of the current feedback signal includes the input S-end signal, and path[sig_s]=true, then finding the input B-end signal of the multiplexer logic unit, and performing a search on the input B-end signal of the multiplexer logic unit; If the path of the current feedback signal does not include the input S-terminal signal, the key value (sig_s, true) is inserted into the path of the current feedback signal, and a search is performed on the input B-terminal signal of the multiplexer logic unit.
3. A method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 2, characterized in that: The input B-end signal search of the multiplexer logic unit includes comparing the input B-end signal of the multiplexer logic unit with the trigger output Q-end signal, and when the comparison result is the same, inserting the path of the current feedback signal into the path set of the feedback signal.
4. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 3, wherein: When the input B-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, the input B-end signal of the multiplexer logic unit is added to the indeterminate input end signal set of the multiplexer logic unit, and the feedback signal search of the trigger unit input signal is exited.
5. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 3, wherein: When the input B-end signal of the multiplexer logic unit is different from the output Q-end signal of the trigger, If the input B-end signal of the multiplexer logic unit is the output signal of a certain multiplexer unit, a recursive feedback signal search process is performed on the input B-end signal of the multiplexer logic unit, and the path of the feedback signal of the recursive feedback signal search result is inserted into the path set of the feedback signal.
6. A method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 2, characterized in that: Acquiring a path set of the trigger unit input signal, further comprising processing the input A-end signal of the multiplexer logic unit, and inserting the key value (sig_s, false) into the path of the current feedback signal; If the input A-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, the path of the current feedback signal is inserted into the path set of the feedback signal.
7. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 6, characterized in that: If the input A-end signal of the multiplexer logic unit is the same as the trigger output Q-end signal, the input A-end signal of the multiplexer logic unit is added to the indeterminate input end signal set of the multiplexer logic unit.
8. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 6, characterized in that: If the input A-terminal signal of the multiplexer logic unit is different from the output Q-terminal signal of the trigger, If the input A-end signal of the multiplexer logic unit is the output signal of a certain multiplexer unit, a recursive feedback signal search process is performed on the input A-end signal of the multiplexer logic unit, and the path of the feedback signal of the recursive feedback signal search result is inserted into the path set of the feedback signal, and the feedback signal search of the trigger unit input signal is exited.
9. A method for extracting a trigger enable signal of an FPGA synthesis tool according to any one of claims 4 or 7, characterized in that: Each signal in the indeterminate input terminal signal set of the multiplexer logic unit is traversed, and each traversed signal is set as an indeterminate signal.
10. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 1, characterized in that: The method for obtaining the trigger set, the NOT gate signal mapping set and the multiplexer signal mapping set is to traverse the logic units in the circuit netlist and store the logic units of the trigger type into the trigger set; The mapping relationship from the input signal to the output signal of the logic unit of the NOT gate type is stored in the NOT gate signal mapping set; The mapping relationship between the output signal of the logic unit of the multiplexer type and the logic unit is stored in the multiplexer output signal mapping set.
11. The method for extracting a trigger enable signal of an FPGA synthesis tool according to claim 1, characterized in that: When all trigger unit input signals are not in the multiplexer signal mapping set, the processing of the trigger unit is stopped, the type of the trigger logic unit is modified, and the input port enable signal is added as the output signal of the logic unit of the logic and reduction type.
Citation Information
Patent Citations
Dynamic switching method, device and system for multiple clocks
CN113504809A
Clock diagnosis and repair method, device and equipment in integrated circuit test mode
CN118364781A
