A layout method for ultra-large-scale heterogeneous FPGAs considering clock constraints
By employing connection-aware and type-balanced clustering methods, combined with multi-level module placement using hybrid penalized augmented Lagrangian and Adam optimizers, the clock constraint problem in FPGA placement is solved, improving placement quality and performance.
Patent Information
- Application Number
- CN202210116830.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-07
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-02-07
AI Technical Summary
Existing FPGA placement algorithms fail to effectively consider clock constraints, resulting in unsatisfactory timing convergence and power consumption, making it difficult to meet the complex clock architecture requirements of modern FPGAs.
A connection-aware and type-balanced clustering method is adopted, combined with a hybrid penalized augmented Lagrangian method and the Adam optimizer, to perform multi-level module placement and multi-stage encapsulation, ensuring layout legality. Clock-aware IP block legalization and global layout optimization are also implemented.
It significantly improves the layout quality of ultra-large scale heterogeneous FPGAs, reduces wiring length, and improves FPGA performance and design efficiency.
Smart Images

Figure CN114492274B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an ultra-large-scale heterogeneous FPGA layout method considering clock constraints, and belongs to the technical field of FPGA physical design automation. Background Art
[0002] Field Programmable Gate Array (FPGA) is a logic device that can be reprogrammed to achieve user customization. As an integrated circuit, FPGA has the advantages of low risk and high design flexibility. Compared with ASIC, FPGA can enter the market quickly at a lower cost and is suitable for high-end control applications. FPGA is one of the fastest growing areas in the semiconductor industry and has become a research hotspot in academia and industry.
[0003] To meet the emerging circuit design requirements, FPGAs have achieved innovative evolution in architecture. In order to improve the integration of circuits, the logic blocks of modern FPGAs are large-scale and heterogeneous. The CLB architecture has also become more complex, consisting of multiple BLEs, which are logic units composed of LUTs and FFs. A large number of heterogeneous blocks are also embedded in modern FPGAs, including RAM, DSP, and other IP.
[0004] In addition, modern FPGAs usually introduce complex clock architectures to achieve higher performance requirements. Since the ASIC-like clock architecture of modern FPGAs has strict clock constraints, meeting all clock constraints becomes a severe challenge. Traditional FPGA layout algorithms rarely consider the legitimacy of the clock, which often leads to unsatisfactory timing closure and power consumption. Therefore, it is necessary to consider heterogeneity and clock constraints in the layout stage.
[0005] The classic FPGA design process starts with logic synthesis of HDL source code, and finally generates a bitstream after physical design (including process mapping, logic packaging, wiring layout, etc.). Physical design is a complex optimization process that directly affects circuit performance, area, reliability, power, and manufacturing yield. As chips enter the million-gate era, the structural complexity and chip size of FPGAs continue to expand, which undoubtedly brings huge challenges to physical design.
[0006] Layout is one of the most important and time-consuming optimization steps in physical design. It is closely related to subsequent wiring operations and can significantly affect the efficiency and quality of FPGA design. With the continuous development of integrated circuits, FPGAs have shown the characteristics of ultra-large scale and heterogeneity, which has brought severe challenges to the improvement of layout technology. Summary of the invention
[0007] The purpose of the present invention is to provide a very large-scale heterogeneous FPGA layout method considering clock constraints, so as to solve the problem of poor FPGA layout results in the prior art.
[0008] To achieve the above object, the technical solution adopted by the present invention is:
[0009] A method for placing a very large-scale heterogeneous FPGA considering clock constraints includes the following steps:
[0010] Step S1, based on the given FPGA netlist and architecture, a connection-aware and type-balanced clustering method is used to construct a hierarchical structure;
[0011] Step S2: In each level, a hybrid penalty augmented Lagrangian method is used to model the heterogeneous and clock-aware placement as a series of unconstrained optimization subproblems, and an Adam optimizer is used to solve each unconstrained optimization subproblem.
[0012] Step S3, after de-clustering, repeat step S2 until the last level;
[0013] Step S4, performing matching clock-aware IP block legalization to legalize the DSP and RAM;
[0014] Step S5, using a multi-stage packaging strategy to obtain a HCLB-level netlist;
[0015] Step S6, performing clock-driven HCLB-level global placement to further improve placement quality;
[0016] Step S7: Using a history-based CLB legalization method to ensure layout legality.
[0017] In step S1, the two modules / clusters b i and b j The clustering score S ctc (b i ,b j ) is defined as
[0018]
[0019] where η 1 and η 2 are two constants, the internal connection term w int 、External connection item w ext and type balance term w bal The specific definition is as follows:
[0020]
[0021]
[0022]
[0023] where n ext It contains bi or b j But there is no number of networks, and n bal Yes i and b j The difference between the number of LUTs and FFs in the image.
[0024] The step S2 needs to solve the constrained optimization problem
[0025]
[0026] Where T = {FF, LUT, DSP, RAM} is a set of module types, is a smoothed line length function that approximates the half-period line length (HPWL), and F(x,y) is the clock fence region cost function
[0027] F(x i ,y i )=F H (x i )+F V (y i ) (6)
[0028] where F H (x i ) and F V (y i ) give the horizontal and vertical fence area costs respectively, and F H (x i ) is defined as:
[0029]
[0030] where x iL and x iR are the left and right boundary coordinates of the fence area of module i, respectively. We can similarly obtain the vertical cost function F V (y i ). is a smoothed density function that computes the total area of modules of type t∈T in bin b, while is the maximum allowable area of a module of type t∈T in bin b. Converting equation (5) into an unconstrained optimization problem
[0031]
[0032] where λ C is the penalty parameter of the fence area function, λ t is the penalty parameter of the modular density function of type t, is the Lagrange multiplier of the module of type t in bin b, ω t is the smoothing factor parameter of the module of type t;
[0033] And use the following method to solve this problem
[0034]
[0035] In the above formula, o t is the overflow rate of module type t, which is used to measure the uniformity of module distribution. 0 and ω 1 are two constants, and ω t Will decrease as the modules are dispersed (i.e. as o t decrease and reduce).
[0036] The multi-stage packaging in step S5 is divided into the following steps:
[0037] (1) LUT-FF pairing based on 2-pin nets. We check all 2-pin nets one by one, and if a LUT only fans out to one FF and they are close to each other, we pair them together.
[0038] (2) LUT-FF pairing based on multi-pin networks. In this stage, a matching-based method is proposed to form LUT-FF pairs with strong connectivity in multi-pin networks. We first take each LUT or FF as a vertex and check the multi-pin networks one by one. If a LUTb in the multi-pin network e i and a FFb j The Manhattan distance between them is less than the two units of the FPGA, then b i and b j There is an edge between them, and the edge weight is set to Where |e| is the number of modules the net is connected to. After traversing all multi-pin nets, a weighted graph is constructed. By solving the maximum weighted matching problem, some LUT-FF pairs can be further formed to reduce the wire length of the external wire net.
[0039] (3) Clock-aware BLE packaging. A LUT-FF pair, a single LUT, or a single FF is considered as a BLE. Then, a clock-aware BLE packaging algorithm based on the best choice clustering is used to form a BLE that is friendly to HCLB packaging. Merge two BLEs b i and b j The affinity function of is defined as:
[0040]
[0041] Where E i,j is the connection b i and b j is the collection of networks of , |e| is the number of modules in network e, dist(b i,b j ) is b i and b j The distance between 1 is a defined parameter. We empirically set k 1 =0.0001, so dist(b i ,b j ) is only to avoid equal affinity.
[0042] (4) Affinity-aware HCLB encapsulation. Apply best choice clustering to encapsulate HCLBs connected on the same wire network. Merge two HCLBs. i and b j The affinity function of is defined as:
[0043]
[0044] Where area(b i ) means b i This step ensures that each HCLB contains at most four BLEs, which share the same CLK and SR signals and have at most two different CE signals. In addition, long-distance HCLB merging is prohibited.
[0045] (5) Distance-driven HCLB encapsulation: The Manhattan distance between two HCLBs is used as affinity, and the best choice clustering is applied to encapsulate the HCLBs.
[0046] (6) HCLB packing post-processing. If the number of HCLBs still exceeds the target HCLB site capacity, this step will be performed to further reduce the final number of HCLBs. First, a weighted graph is constructed in which a vertex represents a HCLB and an edge represents a legal HCLB merger. The edge weight between two HCLBs is the number of networks that contain them. HCLB packing based on maximum weighted matching is performed iteratively and the maximum distance constraint is gradually relaxed until the HCLB site capacity constraint is met.
[0047] In step S7, the cost of each overflow site and the clock cost of the overflow half-column are iteratively increased, and the corresponding module is removed and re-placed at the position with the minimum cost. The search radius is increased every certain number of cycles, and finally all modules are placed in legal positions.
[0048] Beneficial effect: The ultra-large-scale heterogeneous FPGA layout method considering clock constraints provided by the present invention can effectively improve the layout quality of ultra-large-scale heterogeneous FPGA considering clock constraints and reduce the wiring line length. Especially for a large design scale and a large number of clocks, it can significantly improve the layout quality and thus improve the FPGA performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A flowchart of a method for placing ultra-large-scale heterogeneous FPGAs taking clock constraints into consideration according to the present invention;
[0050] Figure 2 It is the history-based legalization algorithm of the present invention. DETAILED DESCRIPTION
[0051] The technical solution of the invention is described in detail below with reference to the accompanying drawings.
[0052] The present invention provides a method for ultra-large-scale heterogeneous FPGA layout considering clock constraints. The method first performs clustering based on connection awareness and type balance according to a given netlist and architecture, then uses a hybrid penalty augmented Lagrangian method considering heterogeneity and clock awareness and an Adam-based optimizer to perform multi-level module placement, then performs IP legalization and multi-stage packaging, and finally performs CLB-level global layout and CLB legalization. Figure 1 As shown, the method comprises the following steps:
[0053] 101, based on the given FPGA netlist and architecture, a connection-aware and type-balanced clustering method is used to construct a hierarchical structure;
[0054] 102, in each level, a hybrid penalty augmented Lagrangian method is used to model the heterogeneous and clock-aware placement as a series of unconstrained optimization subproblems, and the Adam optimizer is used to solve each unconstrained optimization subproblem;
[0055] 103, after de-clustering, repeat step S2 until the last level;
[0056] 104, performing matching clock-aware IP block legalization to legalize the DSP and RAM;
[0057] 105, adopting a multi-stage packaging strategy to obtain the HCLB-level netlist;
[0058] 106, performing clock-driven HCLB-level global placement to further improve placement quality;
[0059] 107, adopting a history-based CLB legalization approach to ensure layout legality.
[0060] Two modules / cluster b in 101 i and b j The clustering score S ctc (b i ,b j ) is defined as
[0061]
[0062] where η 1 and η 2 are two constants, the internal connection term w int 、External connection item w ext and type balance term w bal The specific definition is as follows:
[0063]
[0064]
[0065]
[0066] where n ext It contains b i or b j But there is no number of networks, and n bal Yes i and b j The difference between the number of LUTs and FFs in the image.
[0067] 102 constrained optimization problems to be solved
[0068]
[0069] Where T = {FF, LUT, DSP, RAM} is a set of module types, is a smoothed line length function that approximates the half-period line length (HPWL), and F(x,y) is the clock fence region cost function
[0070] F(x i ,y i )=F H (x i )+F V (y i ) (6)
[0071] where F H (x i ) and F V (y i ) give the horizontal and vertical fence area costs respectively, and F H (x i ) is defined as:
[0072]
[0073] where x iL and x iR are the left and right boundary coordinates of the fence area of module i, respectively. We can similarly obtain the vertical cost function F V (y i ). is a smoothed density function that computes the total area of modules of type t∈T in bin b, while is the maximum allowed area of a module of type t∈T in bin b. By converting equation (5) into an unconstrained optimization problem
[0074]
[0075] And use the following method to solve this problem
[0076]
[0077] In the above formula, o t is the overflow rate of module type t, which is used to measure the uniformity of module distribution. 0 and ω 1 are two constants, and ω t Will decrease as the modules are dispersed (i.e. as o t decrease and reduce).
[0078] The multi-stage encapsulation in 105 is divided into the following steps:
[0079] (1) LUT-FF pairing based on 2-pin nets. We check all 2-pin nets one by one, and if a LUT only fans out to one FF and they are close to each other, we pair them together.
[0080] (2) LUT-FF pairing based on multi-pin networks. In this stage, a matching-based method is proposed to form LUT-FF pairs with strong connectivity in multi-pin networks. We first take each LUT or FF as a vertex and check the multi-pin networks one by one. If a LUTb in the multi-pin network e i and a FFb j The Manhattan distance between them is less than the two units of the FPGA, then b i and b j There is an edge between them, and the edge weight is set to Where |e| is the number of modules the net is connected to. After traversing all multi-pin nets, a weighted graph is constructed. By solving the maximum weighted matching problem, some LUT-FF pairs can be further formed to reduce the wire length of the external wire net.
[0081] (3) Clock-aware BLE packaging. A LUT-FF pair, a single LUT, or a single FF is considered as a BLE. Then, a clock-aware BLE packaging algorithm based on the best choice clustering is used to form a BLE that is friendly to HCLB packaging. Merge two BLEs b i and b j The affinity function of is defined as:
[0082]
[0083] Where E i,j is the connection b i and b j is the collection of networks of , |e| is the number of modules in network e, dist(b i ,b j ) is b i and b j The distance between 1 is a defined parameter. We empirically set k 1 =0.0001, so dist(b i ,b j ) is only to avoid equal affinity.
[0084] (4) Affinity-aware HCLB encapsulation. Apply best choice clustering to encapsulate HCLBs connected on the same wire network. Merge two HCLBs. i and b j The affinity function of is defined as:
[0085]
[0086] This step ensures that each HCLB contains at most four BLEs, which share the same CLK and SR signals and have at most two different CE signals. In addition, long-distance HCLB merging is prohibited.
[0087] (5) Distance-driven HCLB encapsulation: The Manhattan distance between two HCLBs is used as affinity, and the best choice clustering is applied to encapsulate the HCLBs.
[0088] (6) HCLB packing post-processing. If the number of HCLBs still exceeds the target HCLB site capacity, this step will be performed to further reduce the final number of HCLBs. First, a weighted graph is constructed in which a vertex represents a HCLB and an edge represents a legal HCLB merger. The edge weight between two HCLBs is the number of networks that contain them. HCLB packing based on maximum weighted matching is performed iteratively and the maximum distance constraint is gradually relaxed until the HCLB site capacity constraint is met.
[0089] In 107, by iteratively increasing the cost of each overflow site and the clock cost of the overflow half column, and removing and replaying, all modules are finally placed in the legal position. The specific steps are as follows Figure 2 As shown, B is the set of all HCLBs in the entire FPGA, S is the set of CLB sites (i.e., slices); HC is the set of half columns; CLK bis the set of all nets connected to module b, CLK hc is the set of all nets connected to the half column hc, CL b is the set of all candidate positions of module b, is the initial position of module b, Line 1 initializes the unplaced block UB, the current iteration number iter, and the search radius sr. In lines 3-8, we expand sr and update the candidate locations of the module every 100 iterations. The function in line 6 Not only determine the initial position At the candidate position within the distance sr, it also meets the CLK b The corresponding clock fence area. Therefore, we can ensure that each clock area contains at most 24 clock nets. In line 10, the function getMinCostPos(CL b )From CL b The location with the smallest total cost is selected. The total cost of placing module b at site s is defined as follows:
[0090] cost(b,s)=η 3 cost wl (b,s)+η 4 cost d (b,s)+η 5 cost lr (s)+η 6 cost cr (b,s)(12)
[0091] Where cost wl (b,s) is the HPWL cost of placing module b at site s. d (b,s) is the calculation of the initial position Manhattan distance to site s, cost lr (s) is the logic resource cost, cost cr (b,s) is the clock resource cost, η 3 , η 4 , η 5 and η 6 is the weight.
[0092] The logical resource cost of site s is defined as:
[0093] cost lr (s) = h s ·p s (13)
[0094] where h s and ps Represent the historical and current penalty values of site s. Their specific definitions are as follows:
[0095] h s =h s +(usg s -cap s ) + (14)
[0096]
[0097] where η 7 is a constant, usg s is the number of modules in site s, and the capacity cap s Set to 2 because each site can contain at most two HCLBs. s is related to the violation history of site s. If s violated frequently in previous iterations, h s will increase quickly enough to prevent us from allocating modules to site s, thereby preserving site s's logical resources for the less selected blocks.
[0098] Since we have ensured that every candidate site cl ∈ CL b All are located within the corresponding clock fence area, so we only need to further consider the half-column constraint. Therefore, we define the clock resource cost as follows:
[0099]
[0100] where hc s is the half-column to which site s belongs. In addition, the cost of adding clock net c to half-column hc is defined as follows:
[0101]
[0102] Among them, c is the ordinal number of clock c, which is obtained by arranging all clocks in descending order according to the number of modules connected to clock c in the half column hc. is in hc and ordinal O c The number of modules connected to the clock, and n 11 is the corresponding value of ordinal number 11. For c∈CLK hc If |CLK hc |≤12, then Set to 0, because adding c to hc does not require additional clock resources; otherwise, we will tend to move the clock with fewer connected modules in hc out of hc. |CLK hc |<12 means there are enough clock resources to add c to hc, so is set to 1; if |CLK hc |≥12, we will Set to ∞ because there are no additional clock resources for c to add to hc.
[0103] exist Figure 2 Lines 13-18, we update the cost lr (s) and collect modules that violate each site's logical resources. Figure 2 Line 16, function rmBlkInSite(s) collects and removes modules placed in site s. Figure 2 Lines 19-26, we update And collect the modules in each semi-column that violate the semi-column constraints. Figure 2 Line 24, function rmBlkWithClockV(hico) collects and removes modules connected to clocks with ordinal number O>11.
[0104] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for placing ultra-large-scale heterogeneous FPGAs considering clock constraints, characterized in that: The following steps are involved: Step S1, based on the given FPGA netlist and architecture, a connection-aware and type-balanced clustering method is used to construct a hierarchical structure; Step S2, in each level, a hybrid penalty augmented Lagrangian method is used to model the heterogeneous and clock-aware placement as a series of unconstrained optimization subproblems, and an Adam optimizer is used to solve each unconstrained optimization subproblem; Step S3, after de-clustering, repeat step S2 until the last level; Step S4, performing matching clock-aware IP block legalization to legalize the DSP and RAM; Step S5, using a multi-stage packaging strategy to obtain a HCLB-level netlist; Step S6, performing clock-driven HCLB-level global placement to further improve placement quality; Step S7, using a history-based CLB legalization method to ensure layout legality; The step S2 needs to solve the constrained optimization problem Where T = {FF, LUT, DSP, RAM} is a set of module types, is a smooth line length function that approximates the half-circle line length, and F(x,y) is the clock fence area cost function F(x i ,y i )=F H (x i )+F V (y i ) (2) where F H (x i ) and F V (y i ) give the horizontal and vertical fence area costs respectively, and F H (x i ) is defined as: where x iL and x iR are the left and right boundary coordinates of the fence area of module i, and the vertical cost function F can be obtained similarly. V (y i ); is a smoothed density function that computes the total area of modules of type t∈T in bin b, while is the maximum allowable area of a module of type t∈T in bin b; transform equation (1) into an unconstrained optimization problem where λ C is the penalty parameter of the fence area function, λ t is the penalty parameter of the modular density function of type t, is the Lagrange multiplier of the module of type t in binb, ω t is the smoothing factor parameter of the module of type t; use the following method to solve this problem In the above formula, o t is the overflow rate of module type t, which is used to measure the uniformity of module distribution; ω0 and ω1 are two constants, and ω t Will decrease as modules are dispersed.
2. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 1, characterized in that: In step S1, the two modules / clusters b i and b j The clustering score S ctc (b i ,b j ) is defined as Where η1 and η2 are two constants, and the internal connection term w int 、External connection item w ext and type balance term w bal The specific definition is as follows: Where n ext It contains b i or b j But there is no number of networks, and n bal Yes i and b j The difference between the number of LUTs and FFs in the image.
3. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 2, characterized in that: The multi-stage packaging in step S5 is divided into the following steps: (1) LUT-FF pairing based on 2-pin wire network; (2) LUT-FF pairing based on multi-pin network; (3) clock-aware BLE packaging; (4) affinity-aware HCLB packaging; (5) distance-driven HCLB packaging; (6) HCLB packaging post-processing.
4. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 3 is characterized in that: In step (2), each LUT or FF is first treated as a vertex and the multi-pin network is checked one by one; if a LUT b in the multi-pin network e i and a FFb j The Manhattan distance between them is less than the two units of the FPGA, then b i and b j There is an edge between them, and the edge weight is set to Where |e| is the number of modules the network is connected to; after traversing all multi-pin networks, a weighted graph is constructed; by solving the maximum weighted matching problem, some LUT-FF pairs can be further formed to reduce the wire length of the external wire net.
5. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 3, characterized in that: In step (3), a LUT-FF pair, a single LUT or a single FF is regarded as a BLE, and then a clock-aware BLE packaging algorithm based on the best choice clustering is used to form a BLE that is friendly to HCLB packaging; merging two BLEs b i and b j The affinity function of is defined as: Where E i,j is the connection b i and b j is the collection of networks of , |e| is the number of modules in network e, dist(b i ,b j ) is b i and b j The distance between them, and k1 is a defined parameter.
6. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 5, characterized in that: In step (4), the best choice clustering is applied to encapsulate the HCLBs connected on the same wire network; merge two HCLBs i and b j The affinity function of is defined as: Where area(b i ) means b i This step ensures that each HCLB contains at most four BLEs, which share the same CLK and SR signals and have at most two different CE signals; in addition, long-distance HCLB merging is prohibited.
7. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 3, characterized in that: In step (5), the Manhattan distance between two HCLBs is used as the affinity, and the best choice clustering is applied to encapsulate the HCLBs.
8. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 3, characterized in that: In step (6), if the number of HCLBs still exceeds the target HCLB site capacity, this step will be performed to further reduce the final number of HCLBs. First, a weighted graph is constructed, in which a vertex represents a HCLB and an edge represents a legal HCLB merger. The edge weight between two HCLBs is the number of networks containing them. HCLB packing based on maximum weighted matching is iteratively performed and the maximum distance constraint is gradually relaxed until the HCLB site capacity constraint is met.
9. The ultra-large-scale heterogeneous FPGA layout method considering clock constraints according to claim 1, characterized in that: In step S7, the cost of each overflow site and the clock cost of the overflow half-column are iteratively increased, and the corresponding module is removed and re-placed at the position with the minimum cost. The search radius is increased every certain number of cycles, and finally all modules are placed in the legal position.
