A Multiplexer Process Mapping Method for FPGA
Through the FPGA-oriented multiplexer process mapping method, preset templates and splitting and recombination technology are used to optimize the multiplexers in heterostructure FPGAs, solve the problem of performance gaps in the existing technology, and achieve performance improvements. and logic unit reduction.
Patent Information
- Application Number
- CN202111469894.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-12-03
AI Technical Summary
The existing technology lacks an effective process mapping method to optimize multiplexers in heterostructure FPGAs, which makes it difficult to narrow the gap between performance and ASIC, affecting the expansion of FPGAs in various application fields.
This paper proposes a multiplexer process mapping method for FPGA. It identifies the selector units to be mapped by parsing RTL-level description files, uses preset basic structure templates for process mapping, and disassembles selector units that do not have preset structures. Split and recombine for optimized process mapping.
This method provides a technical basis for the development of heterostructure FPGA, realizes the optimized mapping of multiplexers, reduces the total number of logic units, and integrates the inverters related to the multiplexers into the mapping structure to optimize the inverters. Phaser, improving overall performance.
Smart Images

Figure CN114169274B
Abstract
Description
Technical Field
[0001] The invention relates to the field of FPGA, and in particular to a multiplexer process mapping method oriented to FPGA. Background Art
[0002] Field-Programmable Gate Array (FPGA) is widely used in artificial neural networks, prototype verification, algorithm acceleration and other fields due to its flexible configuration and short development cycle. The design process of FPGA is implemented by electronic design automation (EDA) tools, which mainly includes logic synthesis, binning, layout, routing, timing analysis and bit stream generation. Process mapping is the last step of logic synthesis. It is the key to physically realize digital systems by binding the units in the logic netlist with various devices on the chip to obtain the process netlist.
[0003] Early FPGAs were simple homogeneous structures, consisting only of basic logic devices such as LUTs (Look-Up Tables) and registers. LUTs are indispensable logic devices in FPGAs, and each K-input LUT can implement any logic function of K variables through programming configuration. For homogeneous structure FPGAs, there are many effective structured process mapping methods. Generally, the logic netlist is covered with K-feasible cone sets through steps such as partition enumeration, partition sorting, and optimal partition selection, and finally each K-feasible cone is bound to a K-input LUT.
[0004] However, the performance of homogeneous FPGAs is far from that of ASICs. Therefore, with the continuous improvement of FPGA design level, FPGAs are gradually developing towards heterogeneous structures, and high-performance special functional devices such as memory (Block RAM), digital signal processor (DSP), and multiplexers will be gradually embedded on the chip to narrow the performance gap with ASICs and expand the application field of FPGAs. However, there is currently no effective process mapping method for heterogeneous FPGAs. Multiplexers are the most basic data path in digital systems. In view of multiple application fields of FPGAs, some researchers have selected typical user designs for analysis and pointed out that multiplexers account for more than 1 / 4 of the total number of logic units on average. Therefore, as the scale of user designs increases, how to efficiently use special functional devices, especially how to achieve optimized mapping of multiplexers, is a significant issue, and there is currently no good solution. Summary of the invention
[0005] In view of the above problems and technical requirements, a multiplexer process mapping method for FPGA is proposed. The technical solution of the present invention is as follows:
[0006] A multiplexer process mapping method for FPGA, the method comprising:
[0007] Parse the RTL level description file and identify the selector units to be mapped. Each selector unit to be mapped includes N signals to be selected and Bit selection signal, symbol Indicates rounding up;
[0008] For a selector unit to be mapped having a preset basic structure, a template corresponding to the preset basic structure of the selector unit to be mapped is instantiated to complete process mapping of the selector unit to be mapped, wherein the template corresponding to each preset basic structure is a process netlist saved after process mapping is completed for the selector unit having the preset basic structure in advance;
[0009] For the selector unit to be mapped that does not have a preset basic structure, the structure of the selector unit to be mapped is split based on the preset basic structure to obtain several sub-units with a signal cascade relationship, and the selected signal and the selection signal of the selector unit to be mapped are connected to the corresponding sub-units according to a predetermined logic allocation, and the templates corresponding to the preset basic structure of the sub-unit are instantiated respectively to complete the process mapping of the selector unit to be mapped.
[0010] The beneficial technical effects of the present invention are:
[0011] The present application discloses a multiplexer process mapping method for FPGA, which provides a practical method for realizing optimized mapping of multiplexers and provides a technical basis for the development and performance optimization of heterogeneous structure FPGAs.
[0012] In addition, the method can also integrate the inverters having a driving relationship with the multiplexer into the mapping structure of the multiplexer, which is conducive to optimizing the inverters and reducing the total number of logic units. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is the main flow chart of the FPGA-oriented multiplexer process mapping method of this application.
[0014] Figure 2 The diagram is a schematic diagram of three templates pre-saved in one embodiment.
[0015] Figure 3 The main flow chart of process mapping for a selector unit to be mapped in one embodiment is shown.
[0016] Figure 4is any 2 K Schematic diagram of splitting the unit to be split based on the recursive principle in the form of option 1.
[0017] Figure 5 It is a schematic diagram of splitting the selector unit to be mapped with N=16384 into sub-units.
[0018] Figure 6 For unformed K Select 1 to split the unit to be split.
[0019] Figure 7 It is a schematic diagram of splitting the selector unit to be mapped with N=20 into sub-units.
[0020] Figure 8 FIG. 1 is a schematic diagram of a processing flow for uncovered conditional branches in an embodiment where log2N is not an integer. DETAILED DESCRIPTION
[0021] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0022] This application discloses a multiplexer process mapping method for FPGA, which includes the following steps, please refer to Figure 1 :
[0023] S1, parse the RTL level description file and identify the selector unit to be mapped.
[0024] Optionally, the RTL-level description file in the present application is written in any one of the description languages of Verilog, System Verilog and VHDL.
[0025] The selector unit is represented by at least two description statements with predetermined associations and / or at least one description statement that meets the predetermined statement characteristics. By parsing the description statements in the RTL level description file and identifying these description statements, all selector units can be identified and recorded as selector units to be mapped. At least one description statement that meets the predetermined statement characteristics, such as a case statement, at least two description statements with predetermined associations, such as if / else statements and finite state machines, etc.
[0026] And the number of to-be-selected signals, the number of selected signals, and the connection relationship between each signal and other units of the to-be-mapped selector unit can be identified. Each to-be-mapped selector unit forming an N-to-1 selector unit structure includes N to-be-selected signals and Bit selection signal, N is a parameter greater than or equal to 2, the symbol Indicates rounding up. For example, when the selector unit to be mapped is a 2-to-1 selector unit, the selector unit to be mapped includes 2 to-be-selected signals and 1-bit selection signal. For example, when the selector unit to be mapped is a 3-to-1 selector unit, the selector unit to be mapped includes 3 to-be-selected signals and 2-bit selection signals.
[0027] S2, for a selector unit to be mapped having a preset basic structure, instantiate a template corresponding to the preset basic structure of the selector unit to be mapped, and complete process mapping of the selector unit to be mapped.
[0028] Each preset basic structure is a predetermined structure of a multiple-select selector unit, such as a 2-selector unit, a 3-selector unit, a 4-selector unit, an 8-selector unit, and the like. The template corresponding to each preset basic structure is a process netlist saved after completing process mapping for a selector unit having the preset basic structure, that is, a process netlist is obtained by pre-binding the selector unit of the preset basic structure with the LUT (lookup table) and the multiplexer hard core in the configurable logic unit (CLB), which can be considered as the optimal process mapping result of the selector unit to be mapped having the preset basic structure. For a selector unit to be mapped that has a corresponding template, the template is directly instantiated to achieve the optimal mapping of the selector unit to be mapped.
[0029] For example, the preset basic structure is a 4-to-1 selector unit structure, and the template corresponding to the preset basic structure is pre-saved as template 0. Then, for the selector unit to be mapped including 4 to-be-selected signals and 2-bit selection signals, template 0 is directly instantiated to achieve the optimal mapping of the selector unit to be mapped.
[0030] S3, for the selector unit to be mapped that does not have a preset basic structure, the structure of the selector unit to be mapped is split based on the preset basic structure to obtain several sub-units with signal cascade relationship, and the selected signal and the selection signal of the selector unit to be mapped are connected to the corresponding sub-units according to a predetermined logic allocation, and the templates corresponding to the preset basic structure of the sub-unit are respectively instantiated to complete the process mapping of the selector unit to be mapped.
[0031] As mentioned above, the process mapping method of the present application needs to use the template corresponding to the preset basic structure. Before the method of the present application is applied, it is usually necessary to save the templates corresponding to several different preset basic structures. In theory, any structure of a multi-select selector unit can be selected as the preset basic structure, and any number of templates can be saved. However, the structures of the 2-select-1 selector unit and the 3-select-1 selector unit are relatively simple. If they are saved as templates, it is easy to reduce the optimization space, and they are generally not used as preset basic structures. In order to make the operation of splitting based on the preset basic structure in the above step S3 more convenient and more effective, the structure of the N-select-1 selector unit with log2N as an integer is generally selected as the preset basic structure, such as the structure of the 4-select-1 selector unit, the structure of the 8-select-1 selector unit, the structure of the 16-select-1 selector unit, the structure of the 32-select-1 selector unit, etc. as the preset basic structure. If the number of saved templates is too large, the space occupied is large and the final effect may not be better. Therefore, considering the operational complexity of the actual application and the balance of the realization effect, the number of saved templates is generally not too many, usually around 3 to 5.
[0032] Based on the above considerations, in one embodiment, the structures corresponding to the 4-to-1 selector unit, the 8-to-1 selector unit, and the 16-to-1 selector unit are used as preset basic structures. After completing the process mapping for the selector units of the three preset basic structures, the corresponding templates are saved. Specifically:
[0033] (1) Bind the 4-to-1 selector unit to the lookup table to form a corresponding template, which is recorded as template 0. Since the 4-to-1 selector unit has 4 to-be-selected signals and 2-bit selection signals, a 6-bit signal is required. Therefore, the 4-to-1 selector unit is generally bound to the six-input lookup table LUT6. The six inputs of LUT6 are respectively connected to the four to-be-selected signals i0~i3 and the two-bit selection signals s0 and s1 to form template 0, as shown in Figure 2 shown.
[0034] (2) Bind the 8-to-1 selector unit with the lookup table and its connected first-level multiplexer hard core MUX0 to form a corresponding template, which is recorded as Template 1. Since the 8-to-1 selector unit has 8 to-be-selected signals and 3-bit selection signals, an 11-bit signal is required. Therefore, the 8-to-1 selector unit is generally bound to two six-input lookup tables LUT6 and one MUX0: the six inputs of one LUT6 are connected to four to-be-selected signals i0-i3 and two-bit selection signals s0 and s1, the six inputs of another LUT6 are connected to another four to-be-selected signals i4-i7 and the same two-bit selection signals s0 and s1, the outputs of the two LUT6s are connected to the two inputs of MUX0, and the remaining one-bit selection signal s2 is used as the selection signal of MUX0, thereby forming Template 1, as shown in FIG. Figure 2 shown.
[0035] (3) Bind the 16-to-1 selector unit with the lookup table and the first-level multiplexer hard core MUX0 and the second-level multiplexer hard core MUX1 connected in sequence to form a corresponding template. The first-level multiplexer hard core MUX0 is the multiplexer hard core directly connected to the lookup table, and the second-level multiplexer hard core MUX1 is the multiplexer hard core connected to the first-level multiplexer hard core MUX0. Since the 16-to-1 selector unit has 16 to-be-selected signals and 4-bit selection signals, a 20-bit signal is required. Therefore, the 16-to-1 selector unit is generally bound to four six-input lookup tables LUT6 and two MUX0s and one MUX1: the six inputs of the four LUT6s are connected to the four to-be-selected signals and the two-bit selection signals s0 and s1, respectively, the outputs of the first LUT6 (connecting i0~i3 and s0 and s1) and the second LUT6 (connecting i4~i7 and s0 and s1) are connected to the two inputs of a MUX0, and the outputs of the third LUT6 (connecting i8~i9 and s0 and s1) are connected to the two inputs of a MUX0. 11 and s0 and s1) and the fourth LUT6 (connecting i 12 ~i 15 The outputs of s0 and s1 are connected to the two inputs of another MUX0. The outputs of the two MUX0 are connected to the two inputs of MUX1. The selection signal s2 is used as the selection signal of the two MUX0s, and the selection signal s3 is used as the selection signal of MUX1, thereby forming a template 2, such as Figure 2 shown.
[0036] The to-be-selected signals and the selected signals in the connection relationship of the above templates have a predetermined coding order. The three templates use the same coding order. Taking template 2 containing the largest number of signals as an example, the selected signals s0 to s3 are in the order from the lowest bit to the highest bit, and the to-be-selected signals i0 to i 15 It is the order of the selected signals in ascending order according to the size of the binary numbers formed by the selection signals corresponding to each selected signal. For example, taking a 4-bit selection signal as an example, i0 is the selected signal corresponding to the selection signal 0000, i1 is the selected signal corresponding to the selection signal 0001, and so on. 15 That is, the signal to be selected corresponding to the selection signal 1111.
[0037] Based on this embodiment, when template 0, template 1, and template 2 are pre-saved, for a selector unit to be mapped that includes 4 signals to be selected and 2-bit selection signals, template 0 is directly instantiated to complete the process mapping. For a selector unit to be mapped that includes 8 signals to be selected and 3-bit selection signals, template 1 is directly instantiated to complete the process mapping. For a selector unit to be mapped that includes 16 signals to be selected and 4-bit selection signals, template 2 is directly instantiated to complete the process mapping. The subsequent embodiments will be illustrated by taking the case where template 0, template 1, and template 2 are pre-saved as an example.
[0038] In one embodiment, the splitting process for executing the to-be-mapped selector unit without a preset basic structure specifically includes the following steps. Figure 3 :
[0039] 1. If the number of to-be-selected signals of the selector unit to be mapped is less than the number of to-be-selected signals of the minimum preset basic structure, it will be processed separately without splitting. In one embodiment, based on the above-mentioned pre-stored templates 0, 1, 2, when the to-be-selected signals of the selector unit to be mapped are 2 or 3, it will be processed separately without splitting. Specifically: If the number of to-be-selected signals of the selector unit to be mapped N=2, this method skips the processing of the selector unit to be mapped. If the number of to-be-selected signals of the selector unit to be mapped N=3, the selector unit to be mapped is directly bound to the corresponding lookup table to complete the process mapping. Specifically, since the 3-to-1 selector unit to be mapped needs to use a 5-bit signal, it is generally bound to the five-input lookup table LUT5 to complete the process mapping.
[0040] 2. If the number of to-be-mapped signals of the selector unit to be mapped reaches the minimum number of to-be-mapped signals of the preset basic structure and does not have the preset basic structure, the structure of the selector unit to be mapped is split based on the preset basic structure to obtain several sub-units with signal cascade relationships. Based on the above-mentioned pre-stored templates 0, 1, 2, that is, for the selector units to be mapped with N≥4 and N≠4, 8, 16, splitting is performed based on the preset basic structure.
[0041] 1. The general principle of splitting the structure of the selector unit to be mapped based on the preset basic structure is: the selector unit to be mapped is used as the unit to be split and split into several layers, and each unit to be split is split into several first-level selection units and one second-level selection unit. Among them, the second-level selection unit is a sub-unit obtained based on the preset basic structure, and the template can be directly instantiated later. There are two cases: (1) The structure of the second-level selection unit is one of the preset basic structures. For example, based on the above example, the second-level selection unit is any one of the 4-to-1 selector unit, the 8-to-1 selector unit and the 16-to-1 selector unit. (2) The number of to-be-selected signals of the second-level selection unit is less than the number of to-be-selected signals of the smallest preset basic structure. Although the template cannot be directly instantiated, there is no need to split it again, and the process mapping can be completed directly. For example, in an example, the second-level selection unit can be a 2-to-1 selector unit or a 3-to-1 selector unit as described in the above case one. Therefore, based on the pre-saved template 0, template 1, and template 2, each subunit obtained by this step of splitting includes at least one of: a subunit forming a 4-to-1 selector unit structure, a subunit forming an 8-to-1 selector unit structure, and a subunit forming a 16-to-1 selector unit structure. It may further include: a subunit forming a 2-to-1 selector unit structure and a subunit forming a 3-to-1 selector unit structure.
[0042] Each first-level selection unit obtained by splitting may, like the second-level selection unit, meet the above characteristics and reach the sub-unit level, but may also not meet the above characteristics and fail to reach the sub-unit level and need to be further split.
[0043] The outputs of each first-level selection unit obtained by splitting are used as the selected signals of the second-level selection unit. All the selected signals of the entire unit to be split are divided into several groups according to the first coding order, and each group is used as the selected signals of a first-level selection unit obtained by splitting. The selection signals of the unit to be split are divided into several groups according to the second coding order and used as the selection signals of the first-level selection unit and the second-level selection unit obtained by splitting. Among them, the second coding order of the selection signal is the order of the R-bit selection signal from the lowest bit to the highest bit, recorded as s0, s1, ...s R-1 The first coding order of the candidate signals is the order obtained by arranging the candidate signals in ascending order according to the size of the binary numbers composed of the selection signals corresponding to the candidate signals, which are recorded as i0, i1, ...i N-1 .
[0044] After the above splitting is completed, the first-level selection units that have not reached the sub-unit level are taken as new units to be split and continue to be split according to the above splitting principles.
[0045] 2. In one embodiment, under the general principle of splitting mentioned above, different specific splitting methods are adopted for selector units to be mapped with different characteristics, mainly including two categories:
[0046] The first type is formed when log2N is an integer. K Select the selector unit to be mapped in the form of 1, and split the selector unit to be mapped in turn based on the recursive principle. K is a parameter with any value. That is, the selector unit to be mapped is directly used as a 2 K Select the unit to be split in form 1 to start splitting. In the embodiment of pre-storing the above template 0, template 1 and template 2, for details, please refer to Figure 4 :
[0047] (1.1) If K%4=0, the unit to be split directly forms 16 n Choose 1 unit and add 16 n The select 1 unit is split into 1 select 16 unit and 16 select 16 units n-1 Select 1 unit and add each 16 n-1 Select unit 1 as the new unit to be split and continue splitting until n=2, where: and n≥2, Indicates rounding down.
[0048] (1.2) If K%4=1, the unit to be split is split into one 2-choose-1 unit and two 16-choose-1 units. n Select unit 1, and n = (K-1) / 4. K The candidate signals are divided into 2 groups, with 2 K-1 The selected signals are respectively used as a 16 n Select the signal to be selected for unit 1, 2 16 n The output of the select 1 unit is used as the selected signal of the 2-to-1 unit. The K-1 bits s0, s1, ...s K-2 As two 16 n Select the selection signal of unit 1, the highest bit s K-1 As the selection signal of the 2-to-1 unit. n The 1-choose-units are split one by one, and the 2-choose-1-units form a subunit.
[0049] (1.3) If K%4=2, the unit to be split is split into one 4-choice-1 unit and four 16-choice units. n Select unit 1, at this time n = (K-2) / 4. K The candidate signals are divided into 4 groups, with 2 K-2 The selected signals are respectively used as a 16 nSelect the signal to be selected for unit 1, 4 16 n The output of the select 1 unit is used as the to-be-selected signal of the 4-to-1 unit. The K-2 bits s0, s1, ...s K-3 As 4 16 n Select the selection signal of unit 1, the highest two bits K-2 ,s K-1 As the selection signal of the 4-to-1 unit. n The 1-choose-units are split one by one, and the 4-choose-1-units form a subunit.
[0050] (1.4) If K%4=3, the unit to be split is split into one 8-choose-1 unit and eight 16-choose-1 units. n Select unit 1, at this time n = (K-3) / 4. K The candidate signals are divided into 8 groups, with 2 K-3 The selected signals are respectively used as a 16 n Select the signal to be selected for unit 1, 8 16 n The output of the select 1 unit is used as the to-be-selected signal of the 8-to-1 unit. The K-3 bits s0, s1, ...s K-4 As 8 16 n Select the selection signal of unit 1, the highest three bits K-3 ,s K-2 ,s K-1 As the selection signal of 8-to-1 unit. n The 1-choose-units are split one by one, and the 8-choose-1-units form a subunit.
[0051] In the above cases (1.2), (1.3) and (1.4), continue to n The process of selecting 1 unit and splitting it one by one is the same as the process of case (1.1). n The select 1 unit is split into 1 select 16 unit and 16 select 16 units n-1 When selecting 1 unit, 16 for any parameter n n Choose 1 unit including 2 K The candidate signals and K=4n selection signals are denoted as s0, s1, ...s 4n-1 , then 2 K The candidate signals are divided into 16 groups according to the first coding order, and the candidate signals of each group are connected to a 16 n-1 Select each input of 1 unit, 16 16 n-1 The output of the select 1 unit is connected to each input of the 16 select 1 unit. nThe K=4n selection signals of the select 1 unit are divided into two groups, of which the 4(n-1) bits s0, s1, ...s 4(n-1)-1 At the same time as 16 16 n-1 Select the selection signal of unit 1, the highest 4 bits of which are 4n-4 、s 4n-3 、s 4n-2 、s 4n-1 As the selection signal of the 16-to-1 unit. If n-1≥2, then continue to select 16 n-1 The select 1 unit is split in sequence according to the above process until several sub-units of the 16-to-1 selector unit structure are finally obtained.
[0052] For example, for N = 2 12 = 4096 units to be split. Since log2N is 12, which is an integer, the selector unit to be mapped will form 2 12 Select a unit to be split in the form of 1, and K%4=0, n=K / 4=3, then the unit to be split directly forms 16 3 Select 1 unit. (a) First, 3 The select 1 unit is split into 1 select 16 unit and 16 select 16 units 2 Choose 1 unit and add 16 3 The 4096 candidate signals of the select 1 unit are divided into 16 groups, and the 256 candidate signals in each group are used as a 16 2 Select the signal to be selected for unit 1, 16 16 2 The output of the select 1 unit is used as the selected signal of the 16 select 1 unit. 3 The 12 selection signals of the select 1 unit are divided into two groups, and the lowest 8 bits s0, s1, ... s7 are used as 16 16 2 Select the selection signal of unit 1, the highest 4 bits are s8, s9, s 10 ,s 11 As the selection signal of the 16-to-1 unit. (b) Then for each 16 2 According to the above process, the 1-selection unit is split into 17 16-selection units, of which 16 16-selection units are used as the first-level selection units and one 16-selection unit is used as the second-level selection unit. 2 The 256 selected signals of the select 1 unit are divided into 16 groups, and the 16 selected signals in each group are used as the selected signals of the 16-select 1 unit of the first-level selection unit. The outputs of these 16 16-select 1 units are used as the selected signals of the 16-select 1 unit of the last second-level selection unit. 2The 8 selection signals of the select 1 unit are divided into two groups, the lowest 4 bits s0, s1, s2, s3 are used as the selection signals of the 16 first-level selection units at the same time, and the highest 4 bits s4, s5, s6, s7 are used as the selection signals of the second-level selection units. Thus, the splitting of the unit to be split is completed.
[0053] For example, for N = 2 14 = 16384 units to be split. Since log2N is 14, which is an integer, the selector unit to be mapped will form 2 14 If you select the unit to be split in the form of 1 and K%4=2, please refer to Figure 5 , (a) First split the unit to be split into one 4-choice-1 unit and four 16-choice units 3 Select unit 1, divide the 16384 candidate signals of the split unit into four groups, and use the 4096 candidate signals in each group as a 16 3 Select the signal to be selected for unit 1, 4 16 3 The output of the select 1 unit is used as the selected signal of the 4-to-1 unit. The 14 selection signals of the unit to be split are divided into two groups, and the lowest 12-bit selection signals s0, s1, ...s 11 As 4 16 3 Select the selection signal of unit 1, the highest 2 bits selection signal s 12 ,s 13 As the selection signal of the 4-to-1 unit. (b) For each 16 3 Select unit 1 and complete the split according to the process in the previous example.
[0054] The second category: for log2N is a non-integer and does not have 2 K The selector unit to be mapped in the select 1 form is split into several 2 select 1 units connected by 2 select 1 units. K In the process of splitting the selector unit with N signals to be selected, it is possible to get 2 by splitting once. K The unit to be split in the form of 1 may still not have 2 after being split once. K The form of option 1 needs to be split further, and after multiple splits, 2 is finally obtained. K Select 1 form of the unit to be split, so except for the initial selector unit to be mapped, there is no 2 K In addition to the units to be split in the form of option 1, the units obtained in the intermediate process may also not have option 2. K Select the unit to be split in the form of 1. For any N F The candidate signals do not have 2 K The splitting process of the unit to be split in the form of option 1 includes: Figure 6 :
[0055] (2.1) If Then we will have N F The to-be-split unit of the selected signal is split into a 2-to-1 unit as the second-level selection unit and a 1-to-2 unit as the first-level selection unit. Select 1 for the unit to be split.
[0056] The original with N F N of the units to be split for the selected signal F The candidate signals are divided into two groups according to the first coding order. Candidate signal Connect to Select 1 to split the unit. The highest bit of the selected signal among the output of the unit to be split that selects 1 and the selected signal of the original unit to be split They are respectively used as the selected signals of the 2-to-1 unit.
[0057] The original with N F K of the units to be split for the selected signals F The lowest K among the selected signals F -1 bit As Select 1 for the selection signal of the unit to be split, and set the highest bit As the selection signal of the 2-to-1 unit. The unit to be split in option 1 can continue to be split based on the recursive principle according to the first type of situation mentioned above.
[0058] (2.2) If Then we will have N F The to-be-split unit of the selected signal is split into a 2-to-1 unit as a second-level selection unit, and includes Select 1 to split the unit and Select 1 as the first level selection unit for the intermediate unit.
[0059] will have N F N of the units to be split for the selected signal F The candidate signals are divided into two groups according to the first coding order. Candidate signal As Select the signal to be selected for the unit to be split 1, then Candidate signal As The signal to be selected for the intermediate unit of Select 1. Select 1 to split the unit and The outputs of the intermediate unit for selecting 1 are respectively used as two to-be-selected signals of the unit for selecting 2 from 1.
[0060] The original with N F K of the units to be split for the selected signals F The selection signals are divided into three groups, one of which includes the lowest K F -1 bit selection signal As Select 1 to split the unit selection signal, the second group includes the lowest Bit select signal As The selection signal of the unit to be split is selected as 1, and the third group includes the highest selection signal As the selection signal of 2-to-1 unit.
[0061] For the split For the cells to be split in option 1, the splitting can be continued based on the recursive principle according to the first case mentioned above. For the intermediate units selected in option 1, there are three main types of situations:
[0062] (2.2.1) The intermediate unit of option 1 reaches the subunit level, that is, one of the preset basic structures can be directly instantiated, or the number of selected signals is less than the number of selected signals of the minimum preset basic structure and can be directly operated. In a specific embodiment, it also includes In these cases, there is no need to Select 1 and continue splitting the middle unit. If it is 2 or 3, then directly The intermediate unit selected in option 1 is bound to the corresponding lookup table to complete the process mapping. For 4, 8, or 16, directly instantiate the corresponding template.
[0063] (2.2.2) The intermediate unit of option 1 has not reached the sub-unit level and needs to be further split, and The middle unit of option 1 also forms 2 K Choose 1, that is, if and is an integer, then The units to be split in option 1 are similar, and the splitting is continued based on the recursive principle according to the first category mentioned above.
[0064] (2.2.3) The intermediate unit of option 1 has not reached the sub-unit level and needs to be further split, and The intermediate unit of option 1 has not yet formed 2 K Choose 1, that is, if and If it is not an integer, Select the middle unit of 1 as the new unit with N F The candidate signals do not have 2 K Select 1 form of the unit to be split and update Split according to the above method (2.1) or (2.2).
[0065] For example, please refer to Figure 7 , for N = 20 units to be split, log2 N is not an integer, Then (a) firstly split the to-be-split unit with 20 to-be-selected signals into one 2-to-1 unit as the second-level selection unit, and the 4 The first level selection unit of the split unit of the 1-choose-1 and the intermediate unit of the 4-choose-1. 4 There are candidate signals i0,i1,…i 15 As 2 4 The signal to be selected for the unit to be split that selects 1, and the next 4 signals to be selected i 16 ,i 17 ,i 18 ,i 19 As the selected signal of the intermediate unit of 4-to-1 selection. 4 The outputs of the 1-selection split unit and the 4-selection 1 intermediate unit are used as the two selected signals of the 2-selection 1 unit. The lowest 4-bit selection signals s0, s1, s2, s3 are used as the 2 4 The selection signal of the unit to be split is selected as 1. The lowest 2-bit selection signal s0 and s1 are used as the selection signal of the middle unit of 4-selection-1, and the highest 1-bit selection signal s4 is used as the selection signal of the 2-selection-1 unit. 4 The unit to be split in the selection 1 and the intermediate unit in the selection 1 of 4 already have a preset basic structure reaching the sub-unit level, so there is no need to continue splitting.
[0066] The above embodiment introduces the splitting process performed on a selector unit to be mapped that does not have a preset basic structure. After splitting a selector unit to be mapped that does not have a preset basic structure into several sub-units, the templates corresponding to the preset basic structure of the sub-units are respectively instantiated to complete the process mapping of the selector unit to be mapped.
[0067] In one embodiment, the sub-units obtained by splitting a selector unit to be mapped that does not have a preset basic structure are all sub-units of a preset basic structure, such as (1.1), (1.3) and (1.4) in the first type of case mentioned above. Then, the process mapping of the selector unit to be mapped can be completed by instantiating the templates corresponding to the preset basic structures of the sub-units respectively.
[0068] In another embodiment, a subunit obtained by splitting a selector unit to be mapped that does not have a preset basic structure includes, in addition to a subunit with a preset basic structure, a subunit whose number of to-be-selected signals is less than the number of to-be-selected signals of the minimum preset basic structure, that is, in the example, it is specifically manifested as also including a 2-to-1 unit or a 3-to-1 unit. For example, (1.2) in the first category of cases mentioned above and the second category of cases mentioned above. At this time, for the subunits with the preset basic structure, the corresponding templates are instantiated respectively. In addition, the subunits that do not have the preset basic structure need to be mapped in order to complete the process mapping of the entire selector unit to be mapped. They are introduced as follows:
[0069] (3.1) For (1.2) in the first case above, that is, for any one with 2 K For a unit to be split in the form of 1 selection, when K%4=1, the sub-units obtained by splitting the structure of the unit to be split also include 2-selection 1 units. At this time, the 2-selection 1 unit can be first bound to the three-input lookup table LUT3. And in the structure finally obtained by splitting the unit to be split, the second highest bit s of the selection signal of the unit to be split K-2 The two units driven will be bound to two second-level multiplexer hard cores MUX1 respectively, and the highest bit s of the unit to be split K-1 The driven unit will be bound to a three-input lookup table LUT3. At this time, the three devices will be interconnected to realize the 4-to-1 logic function, and the method also includes: merging the units driven by the highest two bits of the selection signal of the unit to be split, and merging to obtain a sub-unit forming a 4-to-1 selector unit structure.
[0070] (3.2) For the second case mentioned above, during the splitting process of the selector unit to be mapped, a selector chain with priority formed by several 2-to-1 units will be obtained, and the final sub-unit may also include a 3-to-1 unit, then the 3-to-1 unit is bound to LUT5. And for each 2-to-1 unit obtained by splitting, the 2-to-1 unit needs to be mapped based on the mapping results of the unit connected to the selected signal and the selection signal:
[0071] (3.2.1) If all fan-in units of a 2-to-1 unit are bound to the first-stage multiplexer hard core MUX0, then the 2-to-1 unit is bound to the second-stage multiplexer hard core MUX1. The fan-in unit is a unit that drives the selected signal of the 2-to-1 unit.
[0072] (3.2.2) If all fan-in units of a 2-to-1 unit are bound to a lookup table and at least one is not a three-input lookup table LUT3, then the 2-to-1 unit is bound to the first-stage multiplexer hard core MUX0.
[0073] (3.2.3) If a 2-to-1 unit does not satisfy the conditions (3.2.1) and (3.2.2), the 2-to-1 unit is bound to the three-input lookup table LUT3.
[0074] In the selector chain, the 2-in-1 unit with the lowest priority is the end of the chain, and the 2-in-1 unit with the highest priority is the head of the chain. From the end of the chain to the head of the chain, each 2-in-1 unit is initially bound in turn according to the above logic. After that, for the 2-in-1 units that meet the predetermined conditions, a further optimization process is also included. The predetermined conditions that need to be met include:
[0075] (3.2.4) If there is a single 2-to-1 cell bound to the three-input lookup table LUT3 but its fan-out unit is not bound to LUT3, and the 2-to-1 cell has at least one fan-in unit bound to one of LUT3, the first-stage multiplexer hard core MUX0, or the second-stage multiplexer hard core MUX1, a predetermined optimization mapping operation is performed on the 2-to-1 cell. The fan-out unit of the 2-to-1 cell is a unit that takes the output of the 2-to-1 cell as input.
[0076] (3.2.5) If there are multiple 2-to-1 cells that are all bound to the three-input lookup table LUT3 and are interconnected to form a selector chain, obtain each 2-to-1 cell on the selector chain and its corresponding fan-in cell and fan-out cell to form a subnet table. And remove the cells in the subnet table that have been bound to the five-input lookup table LUT5 or the six-input lookup table LUT6 or the multiplexer hard core, calculate the timing of the external input signal of the subnet table after the removal operation, and call the existing structured process mapping algorithm to optimize the mapping of the subnet table based on area and timing, and replace the original mapping results of each cell. For the 2-to-1 cells that are still bound to the three-input lookup table LUT3 after optimization, and there is at least one fan-in cell bound to one of LUT3, MUX0 or MUX1, perform the predetermined optimization mapping operation.
[0077] In (3.2.4) and (3.2.5) above, the predetermined optimization mapping operation performed on any one of the 2-choice-1 units that meets the conditions includes:
[0078] (3.2.6) If the 2-to-1 unit has only one fan-in unit bound to one of LUT3, MUX0 or MUX1, a five-input lookup table LUT5 is used to replace the original mapping result and merge the mapping of the 2-to-1 unit and its fan-in unit.
[0079] (3.2.7) If the two fan-in units of the 2-to-1 unit are bound to one of LUT3, MUX0 or MUX1 respectively, the optimization is as follows:
[0080] (a) When the selection signals of the two fan-in units of the 2-to-1 unit are the same, a six-input lookup table LUT6 is used to replace the original mapping result, and the mapping of the 2-to-1 unit and the two fan-in units is combined to achieve.
[0081] (b) When the selection signals of the two fan-in units of the 2-to-1 unit are different and there is at least one fan-in unit bound to LUT3, a five-input lookup table LUT5 is used to replace the original mapping result to merge the mapping of the 2-to-1 unit and a fan-in unit bound to LUT3.
[0082] (c) When the selection signals of the two fan-in units of the 2-to-1 unit are different and both fan-in units are not bound to LUT3, a five-input lookup table LUT5 is used to replace the original mapping result, and the mapping of the 2-to-1 unit and the fan-in unit with a larger selection signal is merged to achieve the mapping. The larger selection signal means that the encoding value of the selection signal in the second encoding order is larger.
[0083] Through the above method, the mapping and optimization of each sub-unit can be completed, and finally the process mapping of a selector unit to be mapped can be completed.
[0084] In addition, for any selector unit to be mapped with N signals to be selected, it uses R bits to select signals to form 2 R There are N conditional branches, and N of them are used to select N candidate signals. When log2N is an integer, all 2 R All the conditional branches are covered and used, and the conditional branch statement is complete. However, when log2N is a non-integer, the N conditional branches are only 2 R In some of the conditional branches, there may be conditional branches that are not covered and used, and the conditional branch statement is incomplete. For example, for the selector unit to be mapped with N=3, only the three conditional branches 00, 01, and 10 may be used, and the conditional branch 11 is not used. Then this embodiment also includes the following steps, please refer to Figure 8 :
[0085] (4.1) When the no_latch flag of the selector unit to be mapped is not detected when parsing the RTL level description file, the uncovered conditional branches are processed according to the predetermined method. The uncovered conditional branches are all 2 R Other conditional branches among the N conditional branches except the N conditional branches used to select the N signals to be selected.
[0086] (4.2) When the no_latch flag of the selector unit to be mapped is detected during parsing of the RTL-level description file, the uncovered conditional branch is not processed.
[0087] The above identifiers can be configured by the user to a specific selector unit to be mapped as needed. By default, the uncovered conditional branches need to be processed. The user can configure the corresponding identifiers as needed to ignore the uncovered conditional branches. In the above (4.1), the method for processing the uncovered conditional branches includes:
[0088] (4.1.1) Determine the logic function to be implemented Combinatorial logic unit. Logical function F(s0,s1,…s R-1 ) is expressed in the form of the sum of minimum terms, the logic function F(s0,s1,…s R-1 ) includes N minimum terms, each of which corresponds to a conditional branch for selecting a signal to be selected, that is, the conditional branches that have been covered. s0,s1,…s R-1 They are respectively the signal bits from low to high in the R bit selection signal of the selector unit to be mapped, which serve as input variables of the constructed logic function.
[0089] Any i-th product term m i is the product of R input variables. Each input variable appears in a product term and only appears once. Each input variable appears in the product term in the form of the original variable or the inverse variable. On the basis that it represents 1 when it appears in the form of the original variable and represents 0 when it appears in the form of the inverse variable, the product term m is i The R input variables in the selection signal are arranged in order from high to low to obtain a set of binary numbers corresponding to the decimal number i, that is, The symbol * represents the logical AND operation, and the symbol + represents the logical OR operation.
[0090] For example, when R=3, the logic function can be expressed as:
[0091]
[0092] Among them, the three input variables in m0 are arranged in order from high to low of the selection signal to obtain 000, the three input variables in m1 are arranged to obtain 001, and the three input variables in m2 are arranged to obtain 010.
[0093] (4.1.2) When no latch mark is detected and the output default signal mark is detected when parsing the RTL level description file, the default signal i x , the output i of the combinational logic unit F , the output i of the selector unit to be mapped G An additional 2-to-1 unit is created for the selector unit to be mapped to handle the uncovered conditional branches, and the additionally created 2-to-1 unit is directly bound to the three-input lookup table LUT3.
[0094] Specifically, an additional 2-to-1 unit is created for the selector unit to be mapped, and the output i of the selector unit to be mapped G And the default signal i x As two selected signals of the 2-to-1 unit, the output i of the combinational logic unit F As the selection signal of the 2-to-1 unit; when the output of the combinational logic unit i F When it is 1, the 2-to-1 unit outputs the output i of the selector unit to be mapped G , otherwise the default signal i is output x .
[0095] The additionally created 2-to-1 unit is directly bound to the three-input lookup table LUT3. And the 2-to-1 unit also needs to participate in the optimization according to the above-mentioned method.
[0096] (4.1.3) When no_latch is detected and the output default signal flag is not detected when parsing the RTL level description file, the output i based on the combinational logic unit F and the output i of the selector unit to be mapped G Additional register units are created for the selector units to be mapped to handle uncovered conditional branches.
[0097] Specifically, an additional register unit is created for the selector unit to be mapped, and the output i of the combinational logic unit is F As the enable signal connected to the enable end of the register unit, the output i of the selector unit to be mapped G Connect the data input terminal of the register unit as an input signal.
[0098] The additionally created register unit is bound to the dedicated register in the FPGA chip. If the selector unit to be mapped is in the combinatorial logic block and its data output is not controlled by the clock signal, the register unit is bound to the dedicated latch. If the selector unit to be mapped is in the sequential logic block and its data output is controlled by the clock signal, the register unit is bound to the dedicated trigger. Subsequently, the existing structured process mapping algorithm can be called to realize the multi-objective optimization mapping of the combinatorial logic unit that takes into account both area and delay.
[0099] Optionally, in one embodiment, in addition to completing the process mapping of each multiplexer according to the methods provided in the various embodiments of the present application, the function of the inverter connected to the multiplexer can also be directly integrated into the process mapping result of the multiplexer to optimize the inverter and reduce the total number of logic units. Then this embodiment also includes the following steps: parsing the RTL-level description file and identifying the inverter, similar to the method of identifying the selector unit to be mapped, the inverter can be identified by identifying a predetermined description statement. If the output signal of the inverter only drives the selector unit to be mapped and drives at least one selector unit to be mapped, the corresponding information of the chip device bound to the selector unit to be mapped driven by it is modified according to the connection relationship of the inverter, and the inverter is deleted from the global logic netlist. There are mainly two situations:
[0100] (5.1) The output signal of the inverter is the selected signal of the selected selector unit to be mapped driven by it. The chip device bound to the unit connected to the selected signal is generally a lookup table. Modifying the corresponding information of the chip device bound to the selected selector unit to be mapped driven by it includes: in the logic function implemented by the lookup table bound to the unit connected to the selected signal, modifying the variable corresponding to the selected signal to an inverted form to obtain a new logic function, and modifying the configuration information of the lookup table according to the new logic function.
[0101] (5.2) The output signal of the inverter is the selection signal of the selector unit to be mapped. The chip device bound to the unit connected to the selection signal is a lookup table or a multiplexer hard core. In combination with the above embodiment, the chip device bound to the unit connected to the selection signal is any one of the lookup table or the first-level multiplexer hard core MUX0 or the second-level multiplexer hard core MUX1. The corresponding information of the chip device bound to the selector unit to be mapped driven by the modification includes:
[0102] (5.2.1) If the chip device bound to the unit connected by the selection signal is a lookup table, then in the logic function implemented by the lookup table bound to the unit connected by the selection signal, the variable corresponding to the selection signal is modified to an inverted form to obtain a new logic function, and the configuration information of the lookup table is modified according to the new logic function.
[0103] (5.2.2) If the chip device bound to the unit connected by the selection signal is a multiplexer hard core, the to-be-selected signals on the two ports of the 2-to-1 multiplexer hard core bound to the unit connected by the selection signal are exchanged.
Claims
1. A multiplexer process mapping method for FPGA, characterized in that: The method comprises: Parse the RTL level description file and identify the selector units to be mapped. Each selector unit to be mapped includes The candidate signals and Bit selection signal, symbol Indicates rounding up; For a selector unit to be mapped having a preset basic structure, instantiate a template corresponding to the preset basic structure of the selector unit to be mapped, and complete the process mapping of the selector unit to be mapped, wherein the template corresponding to each preset basic structure is a process netlist saved after completing the process mapping of the selector unit having the preset basic structure in advance; For a selector unit to be mapped that does not have the preset basic structure, the structure of the selector unit to be mapped is split based on the preset basic structure to obtain a plurality of sub-units with a signal cascade relationship, and the to-be-selected signal and the selection signal of the selector unit to be mapped are connected to the corresponding sub-units according to a predetermined logic allocation, and the templates corresponding to the preset basic structure of the sub-units are respectively instantiated to complete the process mapping of the selector unit to be mapped; The structure of the selector unit to be mapped is split based on a preset basic structure to obtain a plurality of sub-units having a signal cascade relationship, and the to-be-selected signal and the selection signal of the selector unit to be mapped are connected to the corresponding sub-units according to a predetermined logic distribution, including: The selector unit to be mapped is used as a unit to be split and then several layers of splitting are performed. Each unit to be split is split into several first-level selection units and one second-level selection unit. The second-level selection unit is a sub-unit obtained based on a preset basic structure. The output of each first-level selection unit is used as each to-be-selected signal of the second-level selection unit. The to-be-selected signal of the unit to be split is divided into several groups according to a first coding order and each group is used as a to-be-selected signal of a first-level selection unit obtained by splitting; the selection signal of the unit to be split is divided into several groups according to a second coding order and used as the selection signal of the first-level selection unit and the second-level selection unit obtained by splitting respectively; the first-level selection unit that has not reached the sub-unit level is used as a new unit to be split and continues to be split; wherein the second coding order of the selection signal is The first coding order of the selected signals is the order obtained by arranging the selected signals in ascending order according to the size of the binary numbers constituted by the selection signals corresponding to the selected signals; for Formed for integers Select the selector unit to be mapped in the form of 1, and split the selector unit to be mapped in sequence based on the recursive principle, is the parameter; for is a non-integer without The selector unit to be mapped in the form of 1-selection is split into a plurality of selectors connected by 2-selection-1 units. Select the unit to be split in the form of 1, and The units to be split in the select-1 form are split in turn based on the recursive principle, and the 2-to-1 units obtained by the splitting are mapped based on the mapping results of the units connected with the select signal and the select signal; The selector units of the preset basic structure include: a 4-to-1 selector unit, an 8-to-1 selector unit, and a 16-to-1 selector unit, and the 4-to-1 selector unit is bound to the lookup table to form a corresponding template, the 8-to-1 selector unit is bound to the lookup table and its connected first-level multiplexer hard core MUX0 to form a corresponding template, and the 16-to-1 selector unit is bound to the lookup table and its sequentially connected first-level multiplexer hard core MUX0 and second-level multiplexer hard core MUX1 to form a corresponding template; Then for the selector unit to be mapped that does not have the preset basic structure: If the number of to-be-selected signals of the to-be-mapped selector unit N=2, the processing of the to-be-mapped selector unit is skipped; if the number of to-be-selected signals of the to-be-mapped selector unit N=3, the to-be-mapped selector unit is directly bound to the corresponding lookup table to complete the process mapping; If the number N of signals to be selected of the selector unit to be mapped is greater than 4, the step of splitting the structure of the selector unit to be mapped based on a preset basic structure to obtain several sub-units with a signal cascade relationship is executed, and the sub-units obtained by splitting include at least: a sub-unit forming a 4-to-1 selector unit structure, a sub-unit forming an 8-to-1 selector unit structure, and at least one of the sub-units forming a 16-to-1 selector unit structure.
2. The process mapping method according to claim 1, characterized in that: In the process of splitting the selector unit to be mapped, when splitting any one having When selecting the unit to be split in form 1: like , then the unit to be split directly forms Choose Unit 1 and The select 1 unit is split into 1 select 16 unit and 16 Select 1 unit and Select unit 1 as the new unit to be split and continue splitting until ,in, and , Indicates rounding down; like , then the unit to be split is split into 1 2-choose-1 unit and 2 Select 1 unit and increase the selection signal of the unit to be split from low to high Bit acts as 2 The highest bit is used as the selection signal of the 2-to-1 unit, and the highest bit is used as the selection signal of the 2-to-1 unit. Select 1 unit and split it one by one; like , then the unit to be split is split into 1 4-choice-1 unit and 4 Select 1 unit and increase the selection signal of the unit to be split from low to high Bit simultaneously as 4 The selection signal of the 1-selection unit is used as the selection signal of the 4-selection unit. Select 1 unit and split it one by one; like , then the unit to be split is split into 1 8-choose-1 unit and 8 Select 1 unit and increase the selection signal of the unit to be split from low to high Bits are used as 8 The selection signal of the select 1 unit is used as the selection signal of the 8-select 1 unit. Select 1 unit and split it one by one.
3. The process mapping method according to claim 2, characterized in that: For any parameter value of The select 1 unit is split into 1 select 16 unit and 16 When selecting Unit 1, Select 1 unit's selection signal from low to high Bits are used as 16 The selection signal of 1 unit is selected, and the highest 4 bits of the selection signal are used as the selection signal of 16-to-1 unit.
4. The process mapping method according to claim 2, characterized in that: For any one with Select the unit to be split in the form of 1. When the sub-units obtained by splitting the structure of a unit to be split also include 2-select-1 units, and in the structure finally obtained by splitting the unit to be split, the second highest bit of the selection signal of the unit to be split The two units driven are respectively bound to two second-level multiplexer hard cores MUX1, and the highest bit of the selection signal of the selector unit to be mapped The driven unit is bound to a three-input lookup table LUT3, and the method further comprises: merging the units driven by the highest two bits of the selection signal of the unit to be split, and merging to obtain a sub-unit forming a 4-to-1 selector unit structure.
5. The process mapping method according to claim 1, characterized in that: For any Candidate signals and do not have The splitting process of the unit to be split in the form of option 1 includes: : like , then it will have The to-be-split unit of the selected signal is split into a 2-to-1 unit as the second-level selection unit and a 1-to-2 unit as the first-level selection unit. Select 1 to be split unit, and convert the selected signal of the to-be-split unit into the first coding sequence according to the first coding sequence The selected signal is connected to Select 1 for the unit to be split. The output of the unit to be split that selects 1 and the highest bit of the selected signal of the unit to be split are respectively used as the selected signal of the 2-to-1 unit, and the lowest bit of the selected signal of the unit to be split is used as the selected signal of the 2-to-1 unit. As The highest bit of the selection signal of the unit to be split that selects 1 is used as the selection signal of the unit that selects 2 from 1; like , then it will have The to-be-split unit of the selected signal is split into a 2-to-1 unit as a second-level selection unit, and includes Select 1 to split the unit and The first level selection unit of the intermediate unit of the selection 1 selects the selected signal of the unit to be split according to the first coding sequence. The candidate signal is Select the signal to be selected for the unit to be split 1, then The candidate signal is The signal to be selected for the unit to be split is selected as 1. Select 1 to split the unit and The outputs of the intermediate units that select 1 are used as two to-be-selected signals of the 2-to-1 unit; the lowest of the selection signals of the unit to be split is used as the As Select 1, the selection signal of the unit to be split, the lowest As The selection signal of the unit to be split is selected 1, and the highest selection signal is used as the selection signal of the unit to be split 2-selected 1; Based on the recursive principle, the split Select 1 to split the unit to be split; For the split Choose the middle unit of 1, if If it is 2 or 3, then directly The intermediate unit selected in 1 is bound to the corresponding lookup table to complete the process mapping; if and is an integer, then based on the recursive principle The middle unit of option 1 is split in sequence; if and If it is not an integer, Select the middle unit of 1 as the new Candidate signals and no Select the unit to be split in form 1 and update .
6. The process mapping method according to claim 5, characterized in that: The mapping of each 2-to-1 unit obtained by splitting the 2-to-1 unit based on the mapping result of the unit connected with the to-be-selected signal and the selection signal comprises: If all the fan-in units of the 2-to-1 unit are bound to the first-level multiplexer hard core MUX0, the 2-to-1 unit is bound to the second-level multiplexer hard core MUX1; if all the fan-in units of the 2-to-1 unit are bound to a lookup table and at least one is not a three-input lookup table LUT3, the 2-to-1 unit is bound to the first-level multiplexer hard core MUX0; otherwise, the 2-to-1 unit is bound to the three-input lookup table LUT3; The fan-in unit is a unit that drives the selected signal of the 2-to-1 unit.
7. The process mapping method according to claim 6, characterized in that: The method further comprises: If there is a single 2-to-1 cell bound to the three-input lookup table LUT3 but the fan-out unit is not bound to the three-input lookup table LUT3, and the 2-to-1 cell has at least one fan-in unit bound to one of the three-input lookup table LUT3, the first-stage multiplexer hard core MUX0, or the second-stage multiplexer hard core MUX1, then a predetermined optimization mapping operation is performed on the 2-to-1 cell; Alternatively, if there are multiple 2-to-1 cells that are all bound to the three-input lookup table LUT3 and are interconnected to form a selector chain, each 2-to-1 cell on the selector chain and the corresponding fan-in cell and fan-out cell are obtained to form a subnet table, and the cells in the subnet table that have been bound to the five-input lookup table LUT5 or the six-input lookup table LUT6 or the multiplexer hard core are removed, the timing of the external input signal of the subnet table is calculated, and the structured process mapping algorithm is called to perform area- and timing-based optimization mapping on the subnet table, and then a predetermined optimization mapping operation is performed for the 2-to-1 cells that are still bound to the three-input lookup table LUT3 and have at least one fan-in cell bound to one of LUT3, MUX0 or MUX1; Among them, the fan-out unit is a unit that uses the output of the 2-to-1 unit as input.
8. The process mapping method according to claim 7, characterized in that: The predetermined optimized mapping operations performed on the 2-to-1 unit include: If only one fan-in unit of the 2-to-1 unit is bound to one of LUT3, MUX0 or MUX1, a five-input lookup table LUT5 is used to replace the original mapping result to realize the mapping of the 2-to-1 unit and the fan-in unit; If the two fan-in units of the 2-to-1 unit are respectively bound to one of LUT3, MUX0 or MUX1: when the selection signals of the two fan-in units are the same, a six-input lookup table LUT6 is used to replace the original mapping results and merge to achieve mapping of the 2-to-1 unit and the two fan-in units; when the selection signals of the two fan-in units are different and there is at least one fan-in unit bound to LUT3, a five-input lookup table LUT5 is used to replace the original mapping results and merge to achieve mapping of the 2-to-1 unit and a fan-in unit bound to LUT3; when the selection signals of the two fan-in units are different and both fan-in units are not bound to LUT3, a five-input lookup table LUT5 is used to replace the original mapping results and merge to achieve mapping of the 2-to-1 unit and a fan-in unit with a larger selection signal, and a larger selection signal means that the encoding value of the selection signal in the second encoding order is larger.
9. The process mapping method according to claim 1, characterized in that: for A selector unit to be mapped that is not an integer, the selector unit being based on The bit selection signal is formed by In the conditional branch Conditional branch pair The method further comprises: When no latch-unnecessary flag of the to-be-mapped selector unit is detected during parsing of the RTL-level description file, the uncovered conditional branch is processed according to a predetermined method; When the latch-free flag of the to-be-mapped selector unit is detected during parsing of the RTL-level description file, the uncovered conditional branch is not processed; Among them, the uncovered conditional branches are all In addition to the conditional branch used to select The signal to be selected Other conditional branches besides this conditional branch.
10. The process mapping method according to claim 9, characterized in that: The processing of uncovered conditional branches according to a predetermined method includes: Determine the logic function used to implement Combinational logic units, They are Each signal bit from low to high in the bit selection signal is used as the input variable of the logic function. Product Term for The product of input variables, each input variable appears in a product term and only appears once, each input variable appears in the product term in the form of the original variable or the inverse variable; and when it appears in the form of the original variable, it represents 1, and when it appears in the form of the inverse variable, it represents 0. In A set of binary and decimal numbers obtained by arranging the input variables from high to low correspond; common Minimum terms, each of which corresponds to a conditional branch for selecting a signal to be selected; When no latch mark is detected and an output default signal mark is detected when parsing the RTL level description file, the default signal , the output of the combinational logic unit , the output of the selector unit to be mapped Creating an additional 2-to-1 unit for the to-be-mapped selector unit to process uncovered conditional branches, and directly binding the additionally created 2-to-1 unit to the three-input lookup table LUT3; When no latch mark is detected and no output default signal mark is detected when parsing the RTL level description file, based on the output of the combinational logic unit and the output of the selector unit to be mapped An additional register unit is created for the to-be-mapped selector unit to handle uncovered conditional branches, and the additionally created register unit is bound to a dedicated register.
11. The process mapping method according to claim 10, characterized in that: The default signal , the output of the combinational logic unit , the output of the selector unit to be mapped An additional 2-to-1 unit is created for the selector unit to be mapped to handle the uncovered conditional branches, including: Create an additional 2-to-1 unit for the selector unit to be mapped, the output of the selector unit to be mapped And the default signal As two selected signals of the 2-to-1 unit, the output of the combinational logic unit As the selection signal of the 2-to-1 unit; when the output of the combinational logic unit When it is 1, the 2-to-1 unit outputs the output of the selector unit to be mapped Otherwise, the default signal is output. .
12. The process mapping method according to claim 10, characterized in that: The output of the combinational logic unit and the output of the selector unit to be mapped Creating an additional register unit for the to-be-mapped selector unit to handle uncovered conditional branches, including: Create an additional register unit for the selector unit to be mapped, and the output of the combinational logic unit The output of the selector unit to be mapped is connected to the enable end of the register unit as an enable signal. The data input terminal of the register unit is connected as an input signal; if the selector unit to be mapped is in a combinational logic block and its data output is not controlled by a clock signal, the register unit is bound to a dedicated latch; if the selector unit to be mapped is in a sequential logic block and its data output is controlled by a clock signal, the register unit is bound to a dedicated trigger.
13. The process mapping method according to claim 1, characterized in that: The method further comprises: Parse the RTL level description file and identify the inverter. If the output signal of the inverter only drives the selector unit to be mapped and drives at least one selector unit to be mapped, modify the corresponding information of the chip device bound to the selector unit to be mapped according to the connection relationship of the inverter, and delete the inverter from the global logic netlist.
14. The process mapping method according to claim 13, characterized in that: If the output signal of the inverter is a signal to be selected of a selector unit to be mapped, the chip device bound to the unit connected with the signal to be selected is a lookup table; Then, in the logic function implemented by the lookup table bound to the unit connected to the signal to be selected, the variable corresponding to the signal to be selected is modified to an inverted form to obtain a new logic function, and the configuration information of the lookup table is modified according to the new logic function.
15. The process mapping method according to claim 13, characterized in that: If the output signal of the inverter is a selection signal of a selector unit to be mapped, the chip device bound to the unit connected with the selection signal is a lookup table or a multiplexer hard core; Then, in the logic function implemented by the lookup table bound to the unit connected to the selection signal, the variable corresponding to the selection signal is modified to an inverted form to obtain a new logic function, and the configuration information of the lookup table is modified according to the new logic function; Alternatively, the signals to be selected on two ports of a 2-to-1 multiplexer hard core bound to the unit connected by the selection signal are exchanged.
Citation Information
Patent Citations
Logical unit packing method for performing electronic design automation in FPGA (Field Programmable Gate Array)
CN103745057A
Multiple output constrained input lookup table generation
US10943043B1
