Mixed height unit layout legalization algorithm based on window legalization
Through the hybrid height unit layout legalization algorithm based on window legalization, the problem of hybrid height unit layout legalization in integrated circuit design is solved, achieving more efficient layout legalization and shorter running time.
Patent Information
- Application Number
- CN202510190816.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-23
AI Technical Summary
In current mainstream integrated circuit design, it is difficult to generate near-optimal layout results for the legalization of hybrid height unit layout, and the existing algorithms have a long running time in large-scale cases.
A hybrid high-level unit layout legalization algorithm based on window legalization is adopted, and efficient layout legalization is achieved through steps such as LEF/DEF analysis, standard unit sorting, MGL algorithm, unit re-layout, fast maximum displacement optimization and MCF re-optimization.
This algorithm can generate better layout effects, reduce time complexity, shorten the running time of large-scale cases, and enhance the robustness of the algorithm through re-layout algorithms.
Smart Images

Figure CN120030975A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of algorithm technology, and in particular to a mixed height unit layout legalization algorithm based on window legalization. Background Art
[0002] The VLSI layout legalization problem originates from the layout design link in VLSI physical design, which has a significant impact on the performance indicators of integrated circuits such as power consumption, delay, routability and manufacturability. In order to simplify the design process, the layout design is mainly divided into three stages, namely global placement (GP), placement legalization (PL) and detailed placement (DP). Among them, the layout legalization problem is the second stage of layout design. The task of the layout legalization stage is to move several tiny unit devices to a reasonable position on the design layout based on the global layout results of the unit devices, and to meet various constraints (such as no unit overlap) and minimize the optimization target (such as minimizing the total unit displacement).
[0003] The Mixed Height Cell Placement Legalization (MHCPL) problem is a layout legalization problem that is suitable for current mainstream integrated circuit design. In advanced VLSI design technology, the design height of standard cells is often not unique. Higher cells can provide better routability and stronger driving capability, but at the cost of larger area and higher power consumption. In order to achieve a balance between power, area, routability and performance of integrated circuits, mixed height cell circuits have become mainstream in advanced technology design. The scale of the MHCPL problem is usually in the millions of cells, and a high-quality solution is required within an acceptable computing time. This problem has long received extensive attention and research, but the current solution algorithm still cannot generate near-optimal layout results. Summary of the invention
[0004] The technical problem to be solved by the present invention is, in response to the above-mentioned needs, to provide a window-based legalization method to implement an efficient mixed-height cell layout legalization algorithm, which is used to solve the mixed-height cell layout legalization problem in current mainstream integrated circuit design.
[0005] To solve the above technical problems, the present invention provides a technical solution: a mixed height unit layout legalization algorithm based on window legalization, characterized in that it includes the following steps:
[0006] Step 1: Perform LEF / DEF analysis using the open source LEF / DEF solver;
[0007] Step 2: Standard cell sorting, sorting according to the cell crowding level;
[0008] Step 3: MGL algorithm, the open source MGL algorithm performs initial row allocation and sequential allocation of cells;
[0009] Step 4: Re-layout the unit, and re-layout the illegal layout;
[0010] Step 5: Fast maximum displacement optimization, using the unit exchange method to perform fast optimization of the maximum unit displacement;
[0011] Step 6: MCF re-optimization, layout re-optimization based on Min Cost Flow algorithm;
[0012] Step 7: Output file, output the legalized out_def file.
[0013] Furthermore, the step 2 algorithm first sorts the standard cells according to the cell height from large to small weights to ensure that cells with large weights are given priority in obtaining layout resources. At the same time, cells with the same height are sorted from large to small according to the area to ensure that large cells are given priority in obtaining layout resources, avoiding the situation where large cells are placed late and cannot obtain legal layout solutions. For cells with the same weight and the same area, they are sorted from large to small according to the cell area density, and the neighborhood size is selected as W = 20*cell height and H = 4*cell height.
[0014] Furthermore, in the step three, when the MGL algorithm legalizes a unit, a certain window size around the global layout position of the current legalized unit is first selected and the legalized units within the window range are obtained. At this time, the units that are not completely in the window are treated as fixed units and do not move, and the units that are completely in the window can be moved left and right. At this time, the movable space of each row can be obtained. The MGL algorithm will exhaust all the insertable spaces and calculate the cost of all the insertable spaces. The cost is usually the displacement of the surrounding units and the displacement of the current unit caused by the inserted unit. When calculating the displacement, unlike the original MGL algorithm, the present invention sets different displacement weights for different units, so that MGL obtains the best legal solution. The MGL algorithm selects the space with the smallest value for insertion each time, and repeats the above operation until all units are legalized.
[0015] Furthermore, the step four is that the re-layout algorithm will collect all available gap spaces in the current layout. These spaces include gap combinations of different heights, which is convenient for judging whether the current unit can be re-layouted when the unit is re-layouted later. Store all gap combinations with a height of H, and sort these gap combinations. The space close to the global layout position of the legalized unit will be used first. Take out the gap closest to the global layout position of the legalized unit, and gradually judge whether the units on the left and right sides of the gap can be re-layouted. If re-layout is possible and the gap width is improved after re-layout, the unit is re-layouted. If re-layout is not possible or the gap width is not improved after re-layout, skip the current gap and take out the next gap for expansion until the required space size can be expanded.
[0016] Furthermore, the step five is to abstract the maximum displacement optimization problem into a pairing problem of all legalized positions lxy and all global layout positions oxy for the selected unit, sort lxy and oxy from small to large according to the y value, take out the lxy and oxy to be legalized for judgment, if the y value of lxy is greater than the y value of oxy, then pair oxy, otherwise pair lxy, assuming that pairing lxy is performed, first judge whether the standard unit displacement corresponding to lxy does not exceed 30% of the maximum displacement, if not, judge lxy Check whether the oxy of the standard cell corresponding to xy is occupied. If not, the oxy and lxy are directly paired, and there is no need to find the oxy closest to the lxy, that is, the standard cell does not undergo any displacement. If the above conditions are not met, it is necessary to find the unoccupied oxy closest to the lxy, and pair these two lxy and oxy until all oxy and lxy are paired. After the pairing of lxy and oxy is completed, the cells are exchanged in pairs to further reduce the average displacement without increasing the maximum displacement. If possible, the cells are exchanged in pairs. Finally, the cell corresponding to the maximum displacement is taken out, and the cell is re-layouted to determine whether the maximum displacement can be further reduced. If it can be, the cell is re-layouted until the cell with the current maximum displacement cannot be further optimized. If it cannot be further optimized, the algorithm ends.
[0017] After adopting the above algorithm, the present invention has the following advantages: the present application is added to the current optimal layout legalizer, and its layout effect is better, the time complexity is lower, and the running time in large-scale cases is shorter. At the same time, a re-layout algorithm is added, and the algorithm is highly robust and can adapt to more diverse layouts. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a mixed-height cell layout legalization algorithm based on window legalization;
[0019] Figure 2 It is a schematic diagram of layout results of different legalization orders of the mixed height unit layout legalization algorithm based on window legalization;
[0020] Figure 3 is a schematic diagram of a window legalization example of a mixed height unit layout legalization algorithm based on window legalization;
[0021] Figure 4 It is a schematic diagram of the re-layout process of the mixed height unit layout legalization algorithm based on window legalization;
[0022] Figure 5 It is a schematic diagram of the local legalization result of des_perf_b_md1 based on the mixed height unit layout legalization algorithm of window legalization;
[0023] Figure 6 It is a schematic diagram of a maximum displacement optimization example of a hybrid height unit layout legalization algorithm based on window legalization;
[0024] Figure 7 It is a flowchart of a fast maximum displacement optimization algorithm for a hybrid height unit layout legalization algorithm based on window legalization;
[0025] Figure 8 This is a schematic diagram of the comparison before and after of the fast maximum displacement optimization of the hybrid height unit layout legalization algorithm based on window legalization;
[0026] Fig. 9 This is a schematic diagram of the output lg.def file of the mixed height unit layout legalization algorithm based on window legalization;
[0027] Fig.10 This is a schematic diagram of the visualization results of the legalized layout of the mixed-height unit layout legalization algorithm based on window legalization. DETAILED DESCRIPTION
[0028] The operating environment of this algorithm is:
[0029] Hardware requirements: Processor frequency: 2.5GHz and above;
[0030] Memory: 16G and above;
[0031] Environmental requirements: System: Ubuntu 20.04 system;
[0032] Operating environment: gcc 11.3 and above.
[0033] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0034] Combined with Figure 1, a mixed-height cell layout legalization algorithm based on window legalization, which includes the following steps
[0035] Step 1: Perform LEF / DEF analysis using the open source LEF / DEF solver;
[0036] Step 2: Standard cell sorting, sorting according to the degree of cell crowding. The algorithm legalization method is a window-based sequential legalization method, so the order of legalization will have a certain impact on the quality of the solution. Figure 2 The effect of different legalization orders on the results is shown. Assuming that the height of each cell is 50, the total cell displacement of legalization order 1 is 250, and the total cell displacement of legalization order 2 is 150. Therefore, the algorithm needs to extract layout information from the global layout and sort the standard cells to obtain better legalization results. In order to ensure that the algorithm will not be unable to obtain a legal solution due to the legalization order, the algorithm first sorts the standard cells from large to small according to the area, ensuring that cells with large areas have priority in obtaining layout resources, and avoiding the situation where large cells are placed late and cannot obtain legal layout solutions. At the same time, in order to obtain better solution quality, for cells of the same area, they are sorted from large to small according to the density of the cell neighborhood. The neighborhood size W = 100*siteW, H = 4*siteH is selected.
[0037] Step 3: MGL algorithm, the open source MGL algorithm performs the initial row allocation and sequential allocation of cells. The MGL algorithm is based on the idea of window legalization and legalizes standard cells in a certain legalization order. When the MGL algorithm legalizes a cell, it first selects a certain window size around the global layout position of the current legalized cell and obtains the legalized cells within the window. At this time, the cells that are not completely in the window are treated as fixed cells and will not move. The cells that are completely inside the window can be moved left and right. At this time, the movable space of each row can be obtained. Figure 3 As shown in the figure, the gray cells in the window are movable cells. By moving these cells, the required layout space can be combined. Assuming that the current legalized cell height is 3, the possible space combinations include 135, 145, 235, 245, etc. The MGL algorithm will exhaust all the insertable spaces and calculate the cost of all the insertable spaces. The cost is usually the displacement of the surrounding cells and the displacement of the current cell caused by the inserted cell. The MGL algorithm selects the space with the smallest value for insertion each time and repeats the above operation until all cells are legalized.
[0038] Step 4: Re-layout of cells. Re-layout of illegal layouts. For the method of sequential layout legalization, the legalization order largely determines whether the program can finally run through and obtain the final result. When the program sorts the standard cells, the cell area is sorted from large to small, and the cell neighborhood density is sorted from large to small under the same area. This area-priority sorting method can ensure that large-area cells are laid out first, thereby ensuring that the program can run through as much as possible. However, for a fixed legalization order, there may be some corner cases that cannot run through. Therefore, it is necessary to design a re-layout algorithm that can ensure that the program is fully executed by re-layouting cells with as little disturbance as possible to enhance the robustness of the algorithm. Figure 4 It is the algorithm framework of the re-layout algorithm.
[0039] When a legalized unit with a height of H cannot obtain a legalized position in the current layout, the re-layout algorithm will be triggered. First, the re-layout algorithm will collect all available gap spaces in the current layout. These spaces include gap combinations of different heights, so that it can be convenient to judge whether the current unit can be re-layouted when the unit is re-layouted later. Store all gap combinations with a height of H, and sort these gap combinations. The space close to the global layout position of the legalized unit will be used first. Take out the gap closest to the global layout position of the legalized unit, and gradually judge whether the units on the left and right sides of the gap can be re-layouted. If re-layout is possible and the gap width is improved after re-layout, the unit will be re-layouted. If re-layout is not possible or the gap width is not improved after re-layout, skip the current gap and take out the next gap to expand until the required space size can be expanded.
[0040] Step 5: Fast maximum displacement optimization, using the cell exchange method to quickly optimize the maximum cell displacement, because the initial cell row allocation and sequence allocation method is based on the sequential legalization MGL algorithm, the row of legalized standard cells in the algorithm will not change, and the relative order of legalized cells in the same row will not change, so the order of legalization of a standard cell will greatly affect the position of cell allocation. For locally crowded areas, a standard cell with a smaller area will be placed at a later position for legalization. At this time, the space near the global layout position of the standard cell has been occupied by other standard cells, so the standard cell will be placed at a position far away from the global layout position, resulting in a larger displacement. Figure 5The layout results of the local crowded area of des_perf_b_md1 after MGL algorithm legalization are shown. The red cells in the figure are cells of the same type, and the red lines point to the legalized positions of the standard cells and the global layout positions of the standard cells, respectively. It can be seen that the latter legalized cells are far away from the global layout positions, resulting in a large displacement, which leads to a decrease in the quality of the legalized solution. Therefore, it is necessary to perform maximum displacement optimization on the layout solution after MGL algorithm legalization.
[0041] Aiming at the maximum displacement optimization problem, a fast maximum displacement optimization algorithm is designed. This algorithm can quickly perform maximum displacement optimization, and the time complexity of the algorithm in the worst case is O(n2). Figure 7 The algorithm flow chart of the fast maximum displacement optimization algorithm is shown.
[0042] For the optimization of the maximum displacement under a fixed layout, the maximum displacement can be optimized by using the same type of standard cells in the middle area between the current position of the standard cell and its global layout position. Figure 6 As shown in the figure, unit a has a large displacement due to post-legalization. At this time, the unit in the middle area between the global layout position of unit a and the current legalized position is selected. Assuming that unit b is selected for exchange, the maximum displacement of the legalized layout is optimized.
[0043] Therefore, for a legalized layout, the unit with the largest displacement is selected to obtain all units in the middle area (the number of selected units is limited to 2000). For the selected units, the maximum displacement optimization problem is abstracted into a pairing problem of all legalized positions lxy and all global layout positions oxy. Sort lxy and oxy from small to large according to the y value, take out the lxy and oxy to be legalized for judgment, if the y value of lxy is greater than the y value of oxy, then pair oxy, otherwise pair lxy. Assuming that lxy is paired, first determine whether the displacement of the standard unit corresponding to lxy does not exceed 30% of the maximum displacement. If it does not exceed 30%, determine whether the oxy of the standard unit corresponding to lxy is occupied. If it is not occupied, the oxy and lxy are directly paired, and there is no need to find the oxy closest to the lxy, that is, the standard unit does not undergo any displacement. If the above conditions are not met, it is necessary to find the unoccupied oxy closest to the lxy, and pair these two lxy and oxy until all oxy and lxy are paired. After completing the pairing of lxy and oxy, exchange the units in pairs to further reduce the average displacement without increasing the maximum displacement. If possible, exchange the units in pairs. Finally, take out the unit corresponding to the maximum displacement and re-layout the unit to determine whether the maximum displacement can be further reduced. If so, re-layout the unit until the unit with the current maximum displacement cannot be further optimized. If it cannot be further optimized, the algorithm ends.
[0044] Figure 8 The comparison of layout effects before and after algorithm optimization is shown. It can be seen that the maximum displacement of the unit layout is significantly improved after maximum displacement optimization.
[0045] Step 6: MCF re-optimization, layout re-optimization based on Min Cost Flow algorithm;
[0046] Step 7: Output file, output the legalized out_def file.
[0047] The time and space complexity analysis is as follows:
[0048] The following is an analysis of the time complexity and space complexity of each stage. Assuming that the number of standard cells is m, the row height of the layout space is n, the number of cells per row of the MGL selection window is c, and the height of the standard cell is h, after counting the running time of each stage of each design and analyzing the algorithm complexity, we can derive the overall time and space complexity as shown in Table 1.
[0049] Table 1 Overall time and space complexity analysis
[0050]
[0051] Run the effect test
[0052] The relevant information of the test set used is shown in Table 2.
[0053] Table 2 File content statistics, including the number of fixed Macros, the number of units at different heights, density, and HPWL
[0054]
[0055]
[0056] The results of running on various test sets are shown in Table 3.
[0057] Table 3 Number of registers in the example file and the number of timing paths from register to register
[0058]
[0059] This application uses a window-based legalization algorithm, which is similar to the multi-line local legalization algorithm. Compared with the MMSIM solution method, it will not cause the loss of part of the solution space due to the constraints of the global layout order. At the same time, compared with the ordinary multi-line high legalization algorithm, this algorithm introduces the sorting of standard cells to obtain a better layout solution, and designs a re-layout algorithm to enhance the robustness of the algorithm. For maximum displacement optimization, a fast maximum displacement optimization algorithm is designed to obtain better layout results while reducing the running time of the algorithm.
[0060] The present invention and its implementation methods are described above, and such description is not restrictive, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by it, and does not deviate from the purpose of the invention, and does not creatively design a structure and implementation method similar to the technical solution, they should all fall within the protection scope of the present invention.
Claims
1. A mixed height unit layout legalization algorithm based on window legalization, characterized by: It includes the following steps Step 1: Perform LEF / DEF analysis using the open source LEF / DEF solver; Step 2: Standard cell sorting, sorting according to the cell crowding level; Step 3: MGL algorithm, the open source MGL algorithm performs initial row allocation and sequential allocation of cells; Step 4: Re-layout the unit, and re-layout the illegal layout; Step 5: Fast maximum displacement optimization, using the unit exchange method to perform fast optimization of the maximum unit displacement; Step 6: MCF re-optimization, layout re-optimization based on Min Cost Flow algorithm; Step 7: Output file, output the legalized out_def file.
2. The mixed height unit layout legalization algorithm based on window legalization according to claim 1, characterized in that: The step 2 algorithm first sorts the standard cells according to the cell height from large to small weights to ensure that the cells with large weights are given priority in obtaining layout resources. At the same time, the cells with the same height are sorted from large to small according to the area to ensure that the large cells are given priority in obtaining layout resources to avoid the situation where the cells with large areas are placed late and the legal layout solution cannot be obtained. For the cells with the same weight and the same area, they are sorted from large to small according to the cell area density, and the neighborhood size is selected as W = 20*cell height and H = 4*cell height.
3. The mixed height unit layout legalization algorithm based on window legalization according to claim 1, characterized in that: The step three is that when the MGL algorithm legalizes a unit, first a certain window size around the global layout position of the current legalized unit is selected and the legalized units within the window range are obtained. At this time, the units that are not completely in the window are treated as fixed units and do not move, and the units that are completely inside the window can be moved left and right. At this time, the movable space of each row can be obtained. The MGL algorithm will exhaust all the insertable spaces and calculate the cost values of all the insertable spaces. The cost value is usually the displacement of the surrounding units and the displacement of the current unit caused by the inserted unit; when calculating the displacement, unlike the original MGL algorithm, the present invention sets different displacement weights for different units, so that MGL obtains the best legal solution; the MGL algorithm selects the space with the smallest value for insertion each time, and repeats the above operation until all units are legalized.
4. The mixed height unit layout legalization algorithm based on window legalization according to claim 1, characterized in that: The fourth step is that the re-layout algorithm will collect all available gap spaces in the current layout, which include gap combinations of different heights, so that it is convenient to judge whether the current cell can be re-layouted when the cell is re-layouted later; store all gap combinations with a height of H, and sort these gap combinations, and the space close to the global layout position of the legalized cell will be used first; take out the gap closest to the global layout position of the legalized cell, and gradually judge whether the cells on the left and right sides of the gap can be re-layouted. If re-layout is possible and the gap width is improved after re-layout, the cell is re-layouted; if re-layout is not possible or the gap width is not improved after re-layout, skip the current gap and take out the next gap for expansion until the required space size can be expanded.
5. The mixed height unit layout legalization algorithm based on window legalization according to claim 1, characterized in that: The step five is to abstract the maximum displacement optimization problem into a pairing problem of all legalized positions lxy and all global layout positions oxy for the selected unit, sort lxy and oxy according to the size of the y value from small to large, take out the lxy and oxy to be legalized for judgment, if the y value of lxy is greater than the y value of oxy, then pair oxy, otherwise pair lxy, assuming that pairing lxy is performed, first determine whether the standard unit displacement corresponding to lxy does not exceed 30% of the maximum displacement, if not, determine whether the oxy of the standard unit corresponding to lxy is occupied, if not, then pair oxy and lxy directly without looking for the distance from lxy. The oxy closest to xy, that is, the standard unit does not undergo any displacement. If the above conditions are not met, it is necessary to find the unoccupied oxy closest to the lxy. The two lxy and oxy are paired until all oxy and lxy are paired. After completing the pairing of lxy and oxy, the units are exchanged two by two to further reduce the average displacement without increasing the maximum displacement. If possible, the units are exchanged two by two. Finally, the unit corresponding to the maximum displacement is taken out and the unit is rearranged to determine whether the maximum displacement can be further reduced. If so, the unit is rearranged until the unit with the current maximum displacement cannot be further optimized. If it cannot be further optimized, the algorithm ends.