Method and device for optimizing layout of dead space, storage medium and product
Optimizing the layout in integrated circuit design through clustering algorithms and random search methods solves the problem of excessive dead space in traditional methods and achieves more efficient space utilization and layout compactness.
Patent Information
- Application Number
- CN202411745519.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-01-21
AI Technical Summary
In integrated circuit design, traditional layout methods are difficult to effectively deal with large-scale and high-density chip layout problems, resulting in the existence of a large amount of dead space.
The macro module group is used to use a cluster algorithm, and the size of the module group is sorted according to the size of the module group.
By efficiently organizing and arranging macro modules, the blank area in the layout area is significantly reduced, the area utilization is improved, and a compact and regular layout is formed.
Smart Images

Figure CN119337810A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of integrated circuit design automation technology, and in particular to a method, device, storage medium and product for optimizing layout dead space. Background Art
[0002] As the complexity of integrated circuit design continues to increase, chip layout becomes more and more challenging. How to reasonably arrange various functional modules on a limited chip area and minimize dead space (i.e., the area not occupied by any module) is a key issue in chip design.
[0003] Traditional layout methods are usually based on manual adjustments or simple automated algorithms, which are difficult to effectively handle large-scale, high-density chip layout problems. When the number of macro modules is large and the shapes are significantly different, traditional random search methods often have difficulty obtaining a layout solution with high area utilization, because the modules are too different to be seamlessly spliced together to form a high-utilization layout, so there will be a lot of blank areas inside.
[0004] Although the existing automated layout algorithms can reduce dead space to a certain extent, they still have some limitations. They usually use a random search algorithm to first generate an initial layout of multiple modules. Then, the algorithm randomly perturbs the current layout and decides whether to accept the new layout based on certain acceptance criteria. This iterative process will be repeated until the preset termination condition is reached, and the layout is finally optimized. However, the algorithm requires a large number of iterations to find the optimal solution, and when there are a large number of modules and the shapes vary greatly, it is difficult to form a compact and regular layout, which will generate more dead space.
[0005] Therefore, in the integrated circuit design automation process, especially in the related processes of optimizing layout dead space, a more efficient and intelligent layout optimization method is needed to solve the increasingly complex chip layout problems. Summary of the invention
[0006] In view of this, the embodiments of the present application provide a method, device, storage medium and product for optimizing the layout of dead space, first using a clustering algorithm to group macro modules of different sizes, and then placing larger modules first and then smaller modules according to the strategy, so as to efficiently reduce dead space and improve the regularity and compactness of the space. The embodiments of the present application provide the following technical solutions:
[0007] In one aspect, the present invention provides a method for optimizing layout dead space, comprising the following steps:
[0008] Receive information of a layout area and input of all macro modules in the layout area;
[0009] According to the size of the macromodule, the macromodule is divided into a number of module groups using a clustering algorithm;
[0010] According to the average size of the macromodules in the module group, the module groups are sorted from large to small;
[0011] Obtaining the occupancy of the layout area, and using a random search method based on sequence pairs to fix the macro modules in the module group with the largest average size along the selected corners of the layout area;
[0012] Executing the module moving step includes: based on the sorting order of the module groups, moving the macro modules of the next group of the module groups to the outer position of the selected corner, and recording them as the macro modules to be processed;
[0013] The step of fixing processing is performed, including: fixing the macro modules to be processed in sequence according to the principle of proximity;
[0014] Determining whether there is any module group that has not been fixed;
[0015] If yes, return to execute the moving module step; if no, output the layout plan of the layout area.
[0016] According to an embodiment of the present invention, the clustering algorithm includes K-means, density clustering or hierarchical clustering, and the parameters of the clustering algorithm are determined according to the number of the module groups when dividing the macro modules.
[0017] According to an embodiment of the present invention, the random search method based on sequence pairs includes randomly perturbing the macromodule placement order, and calculating the placement quality of each perturbation based on an objective function.
[0018] According to an embodiment of the present invention, after the module groups are sorted from large to small, the method further includes sorting the macro modules in the module groups according to their sizes.
[0019] According to an embodiment of the present invention, in the fixing process step, the macroblocks to be processed are fixed according to sizes from large to small.
[0020] According to an embodiment of the present invention, in the fixing processing step, the macroblock to be processed is firstly used to fill the available area inside the fixed module, and secondly placed in the outer area of the fixed module.
[0021] According to an embodiment of the present invention, the layout scheme takes minimizing the layout area and minimizing the length of the connection from each macro module to the selected corner as optimization goals.
[0022] On the other hand, the present invention also provides an electronic device, comprising: a processor; and a memory, coupled to the processor and comprising instructions stored thereon, wherein when the instructions are executed by the processor, the electronic device executes any one of the above-mentioned methods for optimizing layout dead space based on a clustering algorithm.
[0023] The present invention also provides a computer-readable storage medium having machine executable instructions stored thereon. When the machine executable instructions are executed by at least one processor, the at least one processor implements any of the above-mentioned methods for optimizing the layout of dead space based on a clustering algorithm.
[0024] The present invention also provides a computer program product, which is tangibly stored in a computer-readable storage medium and includes machine-executable instructions, which, when executed by a device, enable the device to perform any of the above-mentioned methods for optimizing layout dead space based on a clustering algorithm.
[0025] Compared with the prior art, the at least one technical solution adopted in the embodiment of the present application can achieve the following beneficial effects:
[0026] 1. The method for optimizing layout dead space of the present invention can significantly reduce the blank area in the layout area and improve the area utilization by efficiently organizing and arranging macro modules. First, macro modules of different sizes are classified by clustering algorithms such as K-means, density clustering or hierarchical clustering, and then sorted according to size. This helps to plan the position and size of the modules more reasonably, ensuring that large-sized modules occupy key positions first. Then, the layout quality is iteratively optimized using a random search method based on sequence pairs and an objective function, with the goal of minimizing the total layout area and the length of the connection from the macro module to the selected corner.
[0027] 2. The method of the present invention gives priority to filling the internal available area according to the principle of proximity, effectively utilizing the fragmented space that might have been wasted, thereby greatly reducing the dead space in the layout and improving the overall space utilization. The filling of internal gaps makes the arrangement between modules more compact and reduces unnecessary blank areas in the layout. At the same time, it avoids the accumulation of fragmented space, reduces the difficulties caused by irregular space in the subsequent module placement process, and improves the overall efficiency of the layout. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 is a flow chart of a method for optimizing layout dead space of the present invention;
[0030] Figure 2 It is a schematic diagram of a clustering algorithm of a method for optimizing layout of dead space of the present invention;
[0031] Figure 3a This is a schematic diagram of the layout of the present invention after fixing the largest module group;
[0032] Figure 3b is a schematic diagram of the layout after the present invention performs the step of moving the module;
[0033] Figure 3c It is a schematic diagram of the layout after the present invention performs the fixed processing steps. DETAILED DESCRIPTION
[0034] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0035] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0036] It should be noted that the terms "include" and "have" and any variations thereof in the description and claims of the present invention are intended to cover non-exclusive inclusions.
[0037] The method, device, storage medium and product for optimizing layout dead space provided by the embodiments of the present application can be applied to scenarios where dead space caused by module filling is reduced in integrated circuit design automation. In recent years, clustering algorithms have been widely used in the fields of data analysis and pattern recognition. Applying clustering algorithms to chip layout can group modules of similar sizes, thereby simplifying the layout process and significantly improving layout efficiency.
[0038] On the one hand, the embodiments of the present application provide a method for optimizing the layout dead space, such as Figure 1 The present invention is a method for optimizing layout dead space as shown in a flowchart, comprising the following steps:
[0039] S1. Receive information about the layout area and inputs of all macromodules in the layout area; by inputting information such as the boundaries and shapes of the layout area and the size and position of the macromodules, the system can fully understand the initial state of the layout. This provides basic data support for subsequent optimization. Module data input obtains the size information of all modules to be laid out, such as length, width, etc. The data format can be a list, array, or other suitable data structure.
[0040] S2. Use clustering algorithms to divide macro modules into several module groups based on their sizes. Use clustering algorithms to group macro modules so that modules with similar sizes can be grouped into the same group. This can reduce layout complexity and reduce irregular dead space caused by large size differences between modules. It is necessary to predefine the "similar" standard, such as the size difference being within a certain ratio. This step requires determining appropriate clustering parameters, such as the K value or distance threshold.
[0041] S3. Sort the module groups from large to small according to the average size of the macro modules in the module group; sorting between groups can use sorting algorithms, such as quick sorting, merge sorting, etc., to ensure that large modules are laid out first. This allows large macro modules to occupy a relatively advantageous position in the layout, reducing the possibility of large modules being squeezed into irregular spaces.
[0042] S4. Obtain the occupancy of the layout area, use a random search method based on sequence pairs, fix the macro modules in the module group with the largest average size along the selected corners of the layout area; use a sequence pair representation to explore different layout orders through random perturbations, generate several candidate layout solutions, and evaluate their quality based on objective functions (such as minimizing area and shortest wiring). This method can avoid falling into local optimality and increase the possibility of finding the global optimal solution.
[0043] S5. Execute the module moving step, including: based on the sorting order of the module groups, move the macro modules of the next group of module groups to the outer position of the selected corner, and record them as the macro modules to be processed; in the layout process, preferentially fix the macro modules of the module group to be processed at the selected corners of the layout area (such as the upper left corner, the lower left corner, etc.). It should be understood that the present invention is based on different placement strategies such as corner priority, center priority, and edge priority, and can be combined with the dead space prediction model to select a placement position that can minimize the dead space. The dead space prediction model refers to predicting the size of the dead space that may be generated after placement before placing the module, and adjusting the placement strategy according to the prediction results to minimize the dead space. It is also possible to consider rotating or flipping large modules to obtain better layout effects.
[0044] S6. Execute the fixing processing step, including: fix the macro modules to be processed in sequence according to the principle of proximity; the subsequent modules gradually fill the surrounding space according to the principle of proximity, and adjust the moving path of the modules to be processed according to the position of the fixed modules to make full use of the fragmented space. During the process, conflict detection is required to check whether the current position overlaps with the placed modules or exceeds the boundary. If the position of the placed module is legal, the module is placed at the current position and the layout area occupancy is updated; if the current position is illegal, you can try to adjust the position, such as moving away from the selected corner, until a legal position is found or all possible positions are tried.
[0045] S7. Determine whether there are any module groups that have not been fixed; if so, return to execute the module moving step; if not, output the layout plan of the layout area. The optimization process is controlled by determining whether there are any module groups that have not been laid out. If all module groups have been laid out, the final layout plan is output; otherwise, continue to process the next group of modules. Layout result output Output the final layout result, including the position and size information of each module. It can be displayed graphically or output in the form of a data structure. In some embodiments, it also includes outputting evaluation indicators of the layout results, such as dead space rate, module utilization, etc., for evaluating the layout effect.
[0046] According to one embodiment of the present invention, the clustering algorithm includes K-means, density clustering or hierarchical clustering, and the parameters of the clustering algorithm are determined according to the number of module groups when dividing the macro modules. The clustering algorithm (such as K-means) needs to determine parameters such as the number of groups (K value) or density threshold when dividing the module groups. Dynamically adjusting parameters according to the number of modules, size distribution characteristics, etc., helps to improve the rationality of grouping, thereby improving layout efficiency. In addition, suitable clustering algorithms and parameters can also be selected according to the characteristics of the module shape, function, connection relationship, etc. to obtain the best layout effect. For example, weighted clustering can be performed according to the connection relationship between modules, so that closely connected modules are more easily grouped into the same group. Through reasonable module grouping, the hierarchy and orderliness of the layout are guaranteed. The priority layout of large modules reduces the complexity of subsequent adjustments, while avoiding the waste of dead space caused by excessive differences in module size.
[0047] like Figure 2 The present invention is a clustering algorithm schematic diagram of a method for optimizing the layout of dead space. Example 1 uses the k-means clustering algorithm to cluster all modules in the area into two categories according to their size (module area), namely, a large module group and a small module group. First, the cluster number k=2 is set, and the size information (area) of all modules in the area is input. ); randomly select k initial center points; assign each module to the nearest center point according to its size data to form k groups; recalculate the center point of each group, that is, the average value of the size data of all modules in the group, and repeat the above process until the center point no longer changes significantly or reaches a predetermined number of iterations. In the final output grouping result, the size of the modules in each group is roughly the same, and the modules in each group are sorted by size.
[0048] In addition, compared with the K-means clustering in Example 1, Example 2 uses DBSCAN to better handle the situation of uneven module size distribution, especially when the module sizes vary greatly, and the division accuracy is higher.
[0049] According to one embodiment of the present invention, the random search method based on sequence pairs includes random perturbations of the macromodule layout order, and the layout quality of each perturbation is calculated based on the objective function. During the random search process, the layout order of the macromodule is perturbed to generate different candidate sequences, and the pros and cons of different sequences are evaluated based on the objective function (such as minimizing the dead space area, minimizing the module connection, etc.). This process can introduce strategies such as annealing algorithms to avoid falling into local optimality. Random perturbations combined with objective function optimization can explore multiple layout possibilities, increase the probability of finding the global optimal solution, and at the same time improve the flexibility of the layout to adapt to different regional shapes and module distribution characteristics.
[0050] According to one embodiment of the present invention, after the module groups are sorted from large to small, the macro modules in the module groups are sorted within the group according to their sizes. Each macro module can be sorted according to the average size or maximum size of the modules in the group. This makes the layout of the same module group more efficient, avoiding large-size modules from being randomly distributed to irregular areas, which affects the overall layout quality. The sorting within the module group further optimizes the layout process, allowing large modules to occupy regular spaces first, reducing the complexity of subsequent adjustments, and improving the utilization and compactness of the layout.
[0051] According to one embodiment of the present invention, in the fixing process step, the macro modules to be processed are fixed according to the size from large to small. When fixing the macro modules, they are preferably fixed according to the size from large to small. This strategy ensures that large modules can occupy regular areas, while small modules can flexibly fill the remaining fragmented space. Prioritizing the fixing of large modules reduces the scattered space remaining in the layout, improves the space utilization, and reduces the possibility that large modules are forced to squeeze into irregular areas.
[0052] According to one embodiment of the present invention, in the fixing process step, the macro modules to be processed are firstly filled with the available areas inside the fixed modules, and secondly placed in the outer areas of the fixed modules. During the layout process, due to the different sizes and shapes of the macro modules, some irregular internal available areas (i.e., fragmented areas) may appear between the fixed modules. These areas are usually small, but for the macro modules to be processed later, if these spaces can be reasonably filled, not only can the overall dead space be reduced, but also the layout can be made more compact.
[0053] The layout of smaller module groups is based on different distance calculation methods such as Manhattan distance, Euclidean distance, and Chebyshev distance, and combined with obstacle avoidance algorithms to quickly search for legal positions with the smallest moving distance. Sort the macro modules in the group by size, search for all legal positions where macro modules can be placed, that is, free areas that do not overlap with placed modules and do not exceed the boundaries, calculate the "moving distance" from each legal position to the macro module, select the legal position with the smallest moving distance to place the macro module, and update the layout area occupancy.
[0054] In general, if Figure 3a As shown in the layout diagram of the present invention after the module group with the largest size is fixed, after the grouping is completed, the large modules are optimized first, and the random search algorithm based on sequence pairs is used to layout the large modules in the corners; Figure 3b As shown in the layout diagram after the present invention executes the module moving step, when the large module is placed, the small module is first moved to the outside of the corner; Figure 3c As shown in the layout diagram after the present invention executes the fixed processing steps, the small modules are placed according to the strategy of "proximity principle".
[0055] Specifically, for the fixed modules, calculate the gap areas around them, especially the internal gaps between modules. These areas may be regular shapes (such as rectangles) or irregular shapes (such as L-shaped). The size and shape of these gaps are determined by geometric analysis algorithms. According to the size and shape of the internal available area, the macro modules to be processed with similar sizes are given priority to fill them. For example, if an internal gap is a long strip, the module with a longer single side is given priority. If the macro module to be processed cannot completely match the internal gap, it is placed in the outer area of the fixed module. When placing it outside, certain rules need to be followed, such as being as close to the selected corner of the layout area as possible, or arranging it along the straight line boundary to maintain the integrity and compactness of the layout. When filling the internal area and placing it outside, a dynamic adjustment mechanism can be introduced: evaluate in real time whether the placement position will introduce new dead space based on the current layout situation, and choose a solution that minimizes the dead space.
[0056] By using the proximity principle to fill the internal available area first, the fragmented space that might have been wasted is effectively utilized, thereby greatly reducing the dead space in the layout and improving the overall space utilization. The filling of internal gaps makes the arrangement between modules more compact and reduces unnecessary blank areas in the layout. At the same time, it avoids the accumulation of fragmented space, reduces the difficulties caused by irregular space in the subsequent module placement process, and improves the overall efficiency of the layout. The external placement strategy provides flexible placement options for modules that are not suitable for internal filling, ensuring that all modules can be reasonably laid out within a limited space.
[0057] According to one embodiment of the present invention, the layout scheme minimizes the layout area and minimizes the length of the connection from each macro module to the selected corner as the optimization goal. By optimizing the layout area and the length of the connection from the module to the selected corner, the compactness and performance of the layout can be comprehensively improved. The layout of the module needs to consider its functional connectivity. Usually, there is a need for interconnection between macro modules, and the starting point of these connections is often the selected corner (such as the location of the I / O interface of the chip). Minimizing the length of the connection from the module to the selected corner can reduce the signal transmission distance, thereby reducing latency, improving performance, and reducing wiring resource consumption. By optimizing the position of the module so that its distance relative to the selected corner is as short as possible, the complexity of the interconnection between modules can be reduced, and the interference and energy consumption problems introduced by long connections can be avoided.
[0058] According to one embodiment of the present invention, the legalization process of the small module adopts an optimization method based on heuristic search. Specifically, after moving the small module to the corner, a heuristic algorithm is used to find the local optimal legalization position according to the spacing constraints between modules, the distance between the module and the boundary, and the relative position between the module and the large module. Compared with the legalization strategy that directly adopts the "proximity principle", this method further improves the regularity of the layout and reduces the occurrence of conflicts.
[0059] The present invention also provides an electronic device, comprising: a processor; and a memory, coupled to the processor and comprising instructions stored thereon, which, when executed by the processor, enable the electronic device to execute any of the above methods for optimizing layout dead space based on a clustering algorithm.
[0060] The present invention also provides a computer-readable storage medium having machine-executable instructions stored thereon. When the machine-executable instructions are executed by at least one processor, the at least one processor implements any of the above-mentioned methods for optimizing the layout of dead space based on a clustering algorithm.
[0061] The present invention also provides a computer program product, which is tangibly stored in a computer-readable storage medium and includes machine-executable instructions. When the machine-executable instructions are executed by a device, the device executes any of the above methods for optimizing layout dead space based on a clustering algorithm.
[0062] In this specification, the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments described later, the description is relatively simple, and the relevant parts can be referred to the partial description of the previous embodiments.
[0063] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for optimizing layout dead space, characterized in that: The following steps are involved: Receive information of a layout area and input of all macro modules in the layout area; According to the size of the macromodule, the macromodule is divided into a number of module groups using a clustering algorithm; According to the average size of the macromodules in the module group, the module groups are sorted from large to small; Obtaining the occupancy of the layout area, and using a random search method based on sequence pairs to fix the macro modules in the module group with the largest average size along the selected corners of the layout area; Executing the module moving step includes: based on the sorting order of the module groups, moving the macro modules of the next group of the module groups to the outer position of the selected corner, and recording them as the macro modules to be processed; The step of fixing processing is performed, including: fixing the macro modules to be processed in sequence according to the principle of proximity; Determining whether there is any module group that has not been fixed; If yes, return to execute the moving module step; if no, output the layout plan of the layout area.
2. The method for optimizing layout dead space according to claim 1, characterized in that: The clustering algorithm includes K-means, density clustering or hierarchical clustering, and the parameters of the clustering algorithm are determined according to the number of the module groups when dividing the macro modules.
3. The method for optimizing layout dead space according to claim 1, characterized in that: The random search method based on sequence pairs includes randomly perturbing the macromodule placement order, and calculating the placement quality of each perturbation based on an objective function.
4. The method for optimizing layout dead space according to claim 1, characterized in that: After the module groups are sorted from large to small, the method further includes sorting the macro modules in the module groups according to their sizes.
5. The method for optimizing layout dead space according to claim 4, characterized in that: In the fixing process step, the macroblocks to be processed are fixed according to sizes from large to small.
6. The method for optimizing layout dead space according to claim 5, characterized in that: In the fixing process step, the macroblock to be processed is firstly used to fill the available area inside the fixed module, and secondly placed in the outer area of the fixed module.
7. The method for optimizing layout dead space according to claim 1, characterized in that: The layout scheme takes minimizing the layout area and minimizing the length of the connection from each macro module to the selected corner as optimization goals.
8. An electronic device, characterized in that: include: processor; and a memory coupled to the processor and comprising instructions stored thereon, wherein when the instructions are executed by the processor, the electronic device executes the method for optimizing layout dead space based on a clustering algorithm according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine executable instructions, and when the machine executable instructions are executed by at least one processor, the at least one processor implements the method for optimizing layout dead space based on a clustering algorithm according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product is tangibly stored in a computer-readable storage medium and includes machine-executable instructions, which, when executed by a device, cause the device to perform the method for optimizing layout dead space based on a clustering algorithm according to any one of claims 1-7.