Circuit layout method, device, equipment and medium based on simulated annealing algorithm

By obtaining circuit wiring information and using simulated annealing algorithm to optimize module position and rotation, the problem of poor wiring effect in the existing technology is solved, more efficient circuit layout optimization is achieved, and the routing rate and practicality are improved.

CN118070732BActive Publication Date: 2025-09-16EMPYREAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410249689.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-05
Publication Date
2025-09-16
Estimated Expiration
2044-03-05

AI Technical Summary

Technical Problem

Existing circuit layout methods based on simulated annealing algorithms ignore the actual wiring conditions during the optimization process, resulting in poor wiring effects and making it difficult to meet the performance and manufacturability requirements of circuit design.

Method used

By obtaining the wiring information of the circuit, including congestion information and crossing information, the circuit layout is updated, and the temperature parameter control of the simulated annealing algorithm is used to optimize the movement and rotation of the module until the temperature threshold is reached. The target layout is determined, the number of unreasonable wiring is reduced, and the routing rate is improved.

Benefits of technology

It improves the wiring effect and practicality of the circuit layout, reduces the number of unreasonable wiring, enhances the routing rate, and meets the actual wiring needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118070732B_ABST
    Figure CN118070732B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a circuit layout method, apparatus, device and medium based on a simulated annealing algorithm. The method includes: obtaining first wiring information of a first layout of a circuit; the first wiring information includes congestion information and / or crossover information; updating the first layout based on the first wiring information to obtain an updated first layout; determining a second layout of the circuit based on the first layout and the updated first layout; when the temperature parameter in the simulated annealing algorithm does not reach a temperature threshold, updating the second layout based on the second wiring information of the second layout, and determining a third layout of the circuit based on the second layout and the updated second layout, until the temperature parameter reaches the temperature threshold, and determining the layout determined in the last update as the target layout of the circuit. Updating the layout based on the layout wiring information is conducive to reducing the number of unreasonable wirings, making the updated layout more in line with actual wiring requirements, and improving the wiring effect and practicality of the layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of analog circuit design, and in particular to a circuit layout method, apparatus, device, and medium based on a simulated annealing algorithm. Background Art

[0002] In analog circuit design, layout refers to the relative placement and connections of circuit components on a chip or circuit board. A good layout ensures circuit performance, reliability, and manufacturability. Due to the rapid increase in circuit size, complexity, and design constraints, manual layout design has become difficult and time-consuming. Consequently, automated layout methods have become necessary, but they often produce inferior layout results.

[0003] To address this issue, layout optimization becomes essential. Layout optimization aims to achieve specific goals by changing the placement and connection methods of circuit components, typically minimizing circuit area and reducing wire length. Related art layout optimization methods based on simulated annealing often use metrics like area and wire length as optimization targets. While this method is relatively simple, it ignores actual wiring conditions, resulting in poor wiring performance. Summary of the Invention

[0004] To overcome the problems existing in the related art, the present disclosure provides a circuit layout method, apparatus, device and medium based on a simulated annealing algorithm.

[0005] According to a first aspect of an embodiment of the present disclosure, a circuit layout method based on a simulated annealing algorithm is provided, the method comprising:

[0006] Obtaining first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information including module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information including module indexes of second modules connected by at least two crossing wires in the first layout;

[0007] updating the first layout based on the first wiring information to obtain an updated first layout;

[0008] determining a second layout of the circuit based on the first layout and the updated first layout;

[0009] When the temperature parameter in the simulated annealing algorithm does not reach the temperature threshold, the second layout is updated based on the second wiring information of the second layout, and a third layout of the circuit is determined based on the second layout and the updated second layout until the temperature parameter reaches the temperature threshold, and the layout determined in the last update is determined as the target layout of the circuit.

[0010] In some embodiments, the first routing information includes the congestion information, and updating the first layout based on the first routing information to obtain an updated first layout includes:

[0011] determining a moving direction and a moving distance of each of the two first modules based on the congestion information;

[0012] Based on the moving direction and the moving distance, at least one of the first modules is moved to obtain the updated first layout; wherein the distance between the two first modules in the updated first layout is greater than the distance between the two first modules in the first layout.

[0013] In some embodiments, determining the moving direction and moving distance of each of the two first modules based on the congestion information includes:

[0014] determining a moving direction of each of the two first modules based on the relative positions of the two first modules in the first layout;

[0015] The moving distance is determined based on the required number of additional wires; wherein the required number of additional wires is positively correlated with the moving distance.

[0016] In some embodiments, the moving at least one of the first modules based on the moving direction and the moving distance to obtain the updated first layout includes:

[0017] Moving at least one of the first modules based on the moving direction and the moving distance, and determining a module position of each first module after the movement;

[0018] When the module position of each first module after the movement satisfies a first condition, the layout after the movement is determined as the updated first layout, wherein the module position of each first module after the movement satisfies the first condition means that: the module position of each first module after the movement does not overlap with the module positions of other modules except the moved first module, and the module position of each first module after the movement does not exceed the boundary position of the circuit; or

[0019] When the module position of at least one first module after movement does not satisfy the first condition, the at least one first module is moved based on the opposite direction of the movement direction until the module position of each first module satisfies the first condition, and the layout when the module position of each first module satisfies the first condition is determined as the updated first layout, wherein the module position of the at least one first module after movement does not satisfy the first condition means that: the module position of the at least one first module after movement overlaps with the module positions of other modules except the moved first module, or the module position of the at least one first module after movement exceeds the boundary position of the circuit.

[0020] In some embodiments, the first wiring information includes the crossing information, and updating the first layout based on the first wiring information to obtain the updated first layout includes:

[0021] Determining, based on the crossing information, a second module to which the at least two crossed wires are connected;

[0022] Rotate at least one of the second modules to obtain the updated first layout.

[0023] In some embodiments, rotating at least one of the second modules comprises:

[0024] Rotate the lower left corner of the second module counterclockwise or clockwise by a first angle; or,

[0025] Rotate the lower right corner of the second module counterclockwise or clockwise by a second angle; or

[0026] The second module is rotated counterclockwise or clockwise around a third angle along the center point of the second module.

[0027] In some embodiments, rotating at least one of the second modules to obtain the updated first layout includes:

[0028] rotating at least one of the second modules and determining a module position of each second module after rotation;

[0029] When the module position of each second module after rotation satisfies a second condition, the rotated layout is determined as the updated first layout, wherein the module position of each second module after rotation satisfies the second condition means that the module position of each second module after rotation does not overlap with the module positions of other modules except the rotated second module, and the module position of each second module after rotation does not exceed a boundary position of the circuit; or

[0030] When the module position of the at least one second module after rotation does not satisfy the second condition, the module position of the at least one second module after rotation is restored to the module position before rotation, and the restored layout is determined as the updated first layout, wherein the module position of the at least one second module after rotation does not satisfy the second condition means that: the module position of the at least one second module after rotation overlaps with the module positions of other modules except the rotated second module, or the module position of the at least one second module after rotation exceeds the boundary position of the circuit.

[0031] In some embodiments, determining the second layout of the circuit based on the first layout and the updated first layout includes:

[0032] When the first routing rate of the first layout is less than or equal to the second routing rate of the updated first layout, determining the updated first layout as the second layout; or

[0033] When the first routability is greater than the second routability, an acceptance probability of the updated first layout is determined based on the first routability, the second routability, and a current temperature parameter of the simulated annealing algorithm, and the second layout is determined based on the acceptance probability.

[0034] In some embodiments, determining the second layout based on the acceptance probability includes:

[0035] When the acceptance probability is less than a probability threshold, determining the first layout as the second layout; or,

[0036] When the acceptance probability is greater than or equal to the probability threshold, the updated first layout is determined as the second layout.

[0037] In some embodiments, when the temperature parameter in the simulated annealing algorithm does not reach the temperature threshold, updating the second layout based on the second wiring information of the second layout includes:

[0038] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter does not reach the number threshold corresponding to the temperature parameter, the number of iterations corresponding to the temperature parameter is increased by 1, and the second layout is updated based on the second wiring information; or

[0039] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter reaches the number threshold corresponding to the temperature parameter, the temperature parameter is updated; when the number of iterations corresponding to the updated temperature parameter does not reach the number threshold corresponding to the updated temperature parameter, the number of iterations corresponding to the updated temperature parameter is increased by 1, and the second layout is updated based on the second wiring information.

[0040] In some embodiments, a module is used to represent a circuit element in the circuit, and the module is rectangular or L-shaped.

[0041] According to a second aspect of an embodiment of the present disclosure, there is provided a circuit layout device based on a simulated annealing algorithm, the device comprising:

[0042] a wiring information acquisition module configured to acquire first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information including module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information including module indexes of second modules connected by at least two crossing wires in the first layout;

[0043] a layout updating module, configured to update the first layout based on the first wiring information to obtain an updated first layout;

[0044] a layout determining module configured to determine a second layout of the circuit based on the first layout and the updated first layout;

[0045] The layout determination module is further configured to, when a temperature parameter in the simulated annealing algorithm does not reach a temperature threshold, update the second layout based on the second wiring information of the second layout, and determine a third layout of the circuit based on the second layout and the updated second layout, until the temperature parameter reaches the temperature threshold, and determine the layout determined in the last update as the target layout of the circuit.

[0046] In some embodiments, the first routing information includes the congestion information, and the layout update module is configured to:

[0047] determining a moving direction and a moving distance of each of the two first modules based on the congestion information;

[0048] Based on the moving direction and the moving distance, at least one of the first modules is moved to obtain the updated first layout; wherein the distance between the two first modules in the updated first layout is greater than the distance between the two first modules in the first layout.

[0049] In some embodiments, the layout update module is configured to:

[0050] determining a moving direction of each of the two first modules based on the relative positions of the two first modules in the first layout;

[0051] The moving distance is determined based on the required number of additional wires; wherein the required number of additional wires is positively correlated with the moving distance.

[0052] In some embodiments, the layout update module is configured to:

[0053] Moving at least one of the first modules based on the moving direction and the moving distance, and determining a module position of each first module after the movement;

[0054] When the module position of each first module after the movement satisfies a first condition, the layout after the movement is determined as the updated first layout, wherein the module position of each first module after the movement satisfies the first condition means that: the module position of each first module after the movement does not overlap with the module positions of other modules except the moved first module, and the module position of each first module after the movement does not exceed the boundary position of the circuit; or

[0055] When the module position of at least one first module after movement does not satisfy the first condition, the at least one first module is moved based on the opposite direction of the movement direction until the module position of each first module satisfies the first condition, and the layout when the module position of each first module satisfies the first condition is determined as the updated first layout, wherein the module position of the at least one first module after movement does not satisfy the first condition means that: the module position of the at least one first module after movement overlaps with the module positions of other modules except the moved first module, or the module position of the at least one first module after movement exceeds the boundary position of the circuit.

[0056] In some embodiments, the first routing information includes the crossing information, and the layout update module is configured to:

[0057] Determining, based on the crossing information, a second module to which the at least two crossed wires are connected;

[0058] Rotate at least one of the second modules to obtain the updated first layout.

[0059] In some embodiments, the layout update module is configured to:

[0060] Rotate the lower left corner of the second module counterclockwise or clockwise by a first angle; or,

[0061] Rotate the lower right corner of the second module counterclockwise or clockwise by a second angle; or

[0062] The second module is rotated counterclockwise or clockwise around a third angle along the center point of the second module.

[0063] In some embodiments, the layout update module is configured to:

[0064] rotating at least one of the second modules and determining a module position of each second module after rotation;

[0065] When the module position of each second module after rotation satisfies a second condition, the rotated layout is determined as the updated first layout, wherein the module position of each second module after rotation satisfies the second condition means that the module position of each second module after rotation does not overlap with the module positions of other modules except the rotated second module, and the module position of each second module after rotation does not exceed a boundary position of the circuit; or

[0066] When the module position of the at least one second module after rotation does not satisfy the second condition, the module position of the at least one second module after rotation is restored to the module position before rotation, and the restored layout is determined as the updated first layout, wherein the module position of the at least one second module after rotation does not satisfy the second condition means that: the module position of the at least one second module after rotation overlaps with the module positions of other modules except the rotated second module, or the module position of the at least one second module after rotation exceeds the boundary position of the circuit.

[0067] In some embodiments, the layout determination module is configured to:

[0068] When the first routing rate of the first layout is less than or equal to the second routing rate of the updated first layout, determining the updated first layout as the second layout; or

[0069] When the first routability is greater than the second routability, an acceptance probability of the updated first layout is determined based on the first routability, the second routability, and a current temperature parameter of the simulated annealing algorithm, and the second layout is determined based on the acceptance probability.

[0070] In some embodiments, the layout determination module is configured to:

[0071] When the acceptance probability is less than a probability threshold, determining the first layout as the second layout; or,

[0072] When the acceptance probability is greater than or equal to the probability threshold, the updated first layout is determined as the second layout.

[0073] In some embodiments, the layout determination module is further configured to:

[0074] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter does not reach the number threshold corresponding to the temperature parameter, the number of iterations corresponding to the temperature parameter is increased by 1, and the second layout is updated based on the second wiring information; or

[0075] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter reaches the number threshold corresponding to the temperature parameter, the temperature parameter is updated; when the number of iterations corresponding to the updated temperature parameter does not reach the number threshold corresponding to the updated temperature parameter, the number of iterations corresponding to the updated temperature parameter is increased by 1, and the second layout is updated based on the second wiring information.

[0076] In some embodiments, a module is used to represent a circuit element in the circuit, and the module is rectangular or L-shaped.

[0077] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0078] processor;

[0079] a memory for storing processor-executable instructions;

[0080] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.

[0081] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method described in the first aspect of the embodiment of the present disclosure.

[0082] The above method of the present disclosure has the following beneficial effects:

[0083] The method provided by the embodiment of the present disclosure updates the layout based on the layout's wiring information. The wiring information describes the connection relationship between the modules in the layout, which helps to reduce the number of unreasonable wirings, improve the routing rate, and make the updated layout more in line with actual wiring requirements, thereby improving the layout's wiring effect and practicality.

[0084] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0086] Figure 1 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment;

[0087] Figure 2 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment;

[0088] Figure 3 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment;

[0089] Figure 4 is a schematic diagram showing an initial layout according to an exemplary embodiment;

[0090] Figure 5 is a wiring diagram showing an initial layout according to an exemplary embodiment;

[0091] Figure 6 is a schematic diagram showing a target layout according to an exemplary embodiment;

[0092] Figure 7 is a wiring diagram of a target layout according to an exemplary embodiment;

[0093] Figure 8 is a block diagram showing a circuit layout device based on a simulated annealing algorithm according to an exemplary embodiment;

[0094] Figure 9 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0095] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0096] The simulated annealing algorithm is a metaheuristic algorithm inspired by the crystallization process in metallurgy. Based on a probabilistic search strategy, it accepts the possibility of inferior solutions within the search space to avoid being stuck in local optima. By gradually decreasing the temperature during the search process, simulating the cooling process, the simulated annealing algorithm finds the global optimal solution or a near-optimal solution. Its global search capability and randomness make it an excellent choice for layout optimization. Simulated annealing can conduct a global search within the search space, avoiding being stuck in local optima. The introduction of randomness increases algorithmic diversity, thus helping to discover better solutions. Furthermore, the simulated annealing algorithm is flexible and can adapt to different problem domains and objective functions, allowing for tailored adjustments and optimizations. In summary, the simulated annealing algorithm can improve circuit layouts, enhancing performance and effectiveness through global search and randomness. This algorithm has broad application prospects in the field of analog circuit layout automation.

[0097] The disclosed embodiment is based on a simulated annealing algorithm and optimizes the layout according to the wiring information of the layout to reduce the number of unreasonable wirings, improve the routing rate, and make the updated layout more in line with actual wiring requirements, thereby improving the wiring effect and practicality of the layout.

[0098] The method provided in the embodiment of the present disclosure is executed by an electronic device, which may be a mobile phone, tablet computer, laptop computer, smart device, wearable device, or other device that can be used for analog circuit design.

[0099] Figure 1 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment, which is executed by an electronic device, see Figure 1 , the method comprises the following steps:

[0100] Step S101, obtaining first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information includes module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information includes module indexes of second modules connected by at least two crossing wires in the first layout.

[0101] The first layout is the initial layout of the circuit or an updated layout of the initial layout. The first wiring information is used to characterize the wiring conditions between modules in the first layout. The first wiring information includes congestion information and / or crossing information. The congestion information includes the module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules. The crossing information includes the module indexes of second modules connected by at least two crossing wires in the first layout. The first module and the second module can be the same or different.

[0102] The module index is used to uniquely identify a module, and the module is used to represent a circuit element in a circuit. Optionally, the module has a rectangular or L-shaped shape.

[0103] Step S102 : updating the first layout based on the first wiring information to obtain an updated first layout.

[0104] The first wiring information represents the wiring conditions between the modules in the first layout. Therefore, the first layout can be updated according to the wiring conditions. For example, the first layout can be updated according to the congestion information to reduce congestion caused by too many wires, or the first layout can be updated according to the crossing information to reduce crossings between wires.

[0105] Wherein, updating the first layout includes: moving modules in the first layout, or rotating modules in the first layout.

[0106] Step S103 : determining a second layout of the circuit based on the first layout and the updated first layout.

[0107] Since it is possible that the updated first layout is better than the first layout before the update, but it is also possible that the updated first layout is worse than the first layout before the update, therefore, based on the actual conditions of the first layout and the updated first layout, it is determined whether to use the first layout as the second layout or the updated first layout as the second layout.

[0108] Step S104: When the temperature parameter in the simulated annealing algorithm does not reach the temperature threshold, the second layout is updated based on the second wiring information of the second layout, and a third layout of the circuit is determined based on the second layout and the updated second layout, until the temperature parameter reaches the temperature threshold, and the layout determined in the last update is determined as the target layout of the circuit.

[0109] In the embodiment of the present disclosure, a simulated annealing algorithm is used to update the layout. The above steps S101-S103 constitute a single update process. After the second layout is determined, it is necessary to first determine whether the current temperature parameter reaches the temperature threshold. When the temperature parameter does not reach the temperature threshold, the second layout is updated. The implementation method for updating the second layout is similar to that of the above steps S101-S103 until the temperature parameter reaches the temperature threshold. The layout determined in the last update is determined as the target layout of the circuit. When the temperature parameter reaches the temperature threshold, the second layout is determined as the target layout.

[0110] The method provided by the embodiment of the present disclosure updates the layout based on the layout's wiring information. The wiring information describes the connection relationship between the modules in the layout, which helps to reduce the number of unreasonable wirings, improve the routing rate, and make the updated layout more in line with actual wiring requirements, thereby improving the layout's wiring effect and practicality.

[0111] Figure 2 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment, which is executed by an electronic device, see Figure 2 , the method comprises the following steps:

[0112] Step S201 : obtaining first wiring information of a first layout of a circuit, where the first wiring information includes congestion information and crossing information.

[0113] The congestion information includes module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information includes module indexes of second modules connected by at least two crossed wires in the first layout.

[0114] In some embodiments, in analog circuit design, the layout of the circuit can be designed through a preset application, which includes a router. After the first layout design of the circuit is completed, the router is run on the first layout to collect first wiring information through the router.

[0115] In the embodiment of the present disclosure, congestion information is used to characterize a situation where wires in the first layout are congested, and crossing information is used to characterize a situation where wires in the first layout are crossed. Hereinafter, the situation where wires are congested is optimized through steps S202 and S203, and the situation where wires are crossed is optimized through steps S204 and S205.

[0116] Step S202 : determining a moving direction and a moving distance of each of the two first modules based on the congestion information.

[0117] The moving direction is the moving direction of the first module in the first layout, for example, the moving direction is left, right, upward, downward, etc., and the moving distance is the distance the first module moves in the first layout.

[0118] In some embodiments, the movement direction of each of the two first modules is determined based on the relative position of the two first modules in the first layout. The relative position refers to the position of one of the two first modules relative to the other first module. For example, if the relative position is module 1 to the left of module 2 (or module 1 to the right of module 2), the movement direction of module 2 is determined to be the left direction, and the movement direction of module 1 is determined to be the right direction.

[0119] Optionally, layout information is pre-stored in the electronic device. This layout information includes the known module position, module size, and module index of each module in the initial layout. When the layout is updated, the layout information is synchronously updated, that is, the module position of each module in the layout information is updated. Therefore, when the congestion information includes the module index of two first modules, the module position of the first module corresponding to the module index in the first layout can be determined based on the module index and the current layout information. Thus, based on the module positions of the two first modules, the relative positions of the two first modules can be determined. The module position can be represented by coordinates.

[0120] In some embodiments, the moving distance is determined based on the number of additional wires required, wherein the number of additional wires required is positively correlated with the moving distance, that is, the more wires there are, the longer the moving distance is, and the fewer wires there are, the shorter the moving distance is.

[0121] In one example, the following formula is used to determine the travel distance:

[0122] Moving distance = required number of additional wires * wire width + (required number of additional wires + 1) * wire spacing

[0123] Optionally, the determined moving distance is the total moving distance. When one of the two first modules needs to be moved, the distance that the first module can move is the moving distance. When both first modules need to be moved, the sum of the distances that the two first modules can move is the moving distance.

[0124] Step S203: moving at least one first module based on the moving direction and the moving distance to obtain an updated first layout.

[0125] In the disclosed embodiments, during the movement process, at least one of the two first modules may be moved. For example, when moving one first module, the first module is moved based on the movement direction and movement distance of the first module to obtain an updated first layout. When moving two first modules, the two first modules are moved based on the movement direction and movement distance of each of the two first modules to obtain an updated first layout. The distance between the two first modules in the updated first layout is greater than the distance between the two first modules in the first layout.

[0126] In some embodiments, considering that the first module may overlap or cross the border after being moved, it is also necessary to determine whether overlapping or crossing the border occurs. If overlapping or crossing the border occurs, the module position of the first module needs to be corrected.

[0127] At least one first module is moved based on a moving direction and a moving distance, and a module position of each first module after the movement is determined; when the module position of each first module after the movement satisfies a first condition, the layout after the movement is determined as an updated first layout, wherein the module position of each first module after the movement satisfies the first condition means that: the module position of each first module after the movement does not overlap with the module positions of other modules except the moved first module, and the module position of each first module after the movement does not exceed the boundary position of the circuit; or, when the module position of at least one first module after the movement does not satisfy the first condition, at least one first module is moved based on a direction opposite to the moving direction until the module position of each first module satisfies the first condition, and the layout when the module position of each first module satisfies the first condition is determined as the updated first layout, wherein the module position of at least one first module after the movement does not satisfy the first condition means that: the module position of at least one first module after the movement overlaps with the module positions of other modules except the moved first module, or the module position of at least one first module after the movement exceeds the boundary position of the circuit.

[0128] Optionally, whether the first module overlaps with other modules is determined based on the module position and size of the first module and the module positions and sizes of other modules adjacent to the first module; and whether the module position of the first module exceeds the boundary position is determined based on the module position, size, and boundary position of the first module. In the embodiments of the present disclosure, there is no limitation on the implementation method for determining whether the first module overlaps or exceeds the boundary.

[0129] Step S204: determining a second module to which the at least two crossed wires are connected based on the crossing information.

[0130] A module corresponding to the module index included in the cross information is determined as the second module.

[0131] Step S205: Rotate at least one second module to obtain an updated first layout.

[0132] In the embodiment of the present disclosure, since many wire crossings in actual wiring are caused by winding caused by unreasonable pin directions of the module, the wire crossings are reduced by rotating the module.

[0133] In some embodiments, rotating at least one second module includes: rotating counterclockwise or clockwise around the lower left corner of the second module by a first angle; or rotating counterclockwise or clockwise around the lower right corner of the second module by a second angle; or rotating counterclockwise or clockwise around the center point of the second module by a third angle. The first, second, and third angles are preset angles, and can be the same or different. For example, the first, second, and third angles are all 90°. Of course, in some embodiments, rotation can also be performed around other points in the second module.

[0134] In some embodiments, considering that the rotated second module may overlap or go beyond the boundary, it is also necessary to determine whether overlap or go beyond the boundary occurs. If overlap or go beyond the boundary occurs, the module position of the second module needs to be reset.

[0135] Rotate at least one second module and determine the module position of each second module after rotation; when the module position of each second module after rotation meets the second condition, determine the rotated layout as the updated first layout, wherein the module position of each second module after rotation meets the second condition means that: the module position of each second module after rotation does not overlap with the module positions of other modules except the rotated second module, and the module position of each second module after rotation does not exceed the boundary position of the circuit; or, when the module position of the at least one second module after rotation does not meet the second condition, restore the module position of the at least one second module after rotation to the module position before rotation, and determine the restored layout as the updated first layout, wherein the module position of the at least one second module after rotation does not meet the second condition means that: the module position of the at least one second module after rotation overlaps with the module positions of other modules except the rotated second module, or the module position of the at least one second module after rotation exceeds the boundary position of the circuit.

[0136] It should be noted that the above steps S202-S203 and steps S204-S205 are respectively used to handle the two situations of congestion and intersection in the first layout. In some embodiments, when congestion and intersection exist at the same time, that is, the first routing information includes congestion information and intersection information, the first layout can be updated based on the congestion information first, and then based on this update, the first layout can be updated again based on the intersection information to obtain an updated first layout, that is, first perform steps S202 and S203, and then perform steps S204 and S205; alternatively, the first layout can be updated based on the intersection information first, and then based on this update, the first layout can be updated again based on the congestion information to obtain an updated first layout, that is, first perform steps S204 and S205, and then perform steps S203 and S204.

[0137] Another point to note is that the second module can be the same as or different from the first module, and this is not limited in the present embodiment. In some embodiments, when the second module is the same as the first module, the first module (second module) can be moved, the first module (second module) can be rotated, or the first module (second module) can be moved and rotated simultaneously.

[0138] Step S206 : determining a second layout of the circuit based on the first layout and the updated first layout.

[0139] In some embodiments, the first routing information includes a first routing rate of the first layout; and a router is run on the updated first layout to obtain a second routing rate of the updated first layout.

[0140] When the first routability is less than or equal to the second routability, the updated first layout is determined as the second layout. That is, when the routability increases, the new layout is accepted. When the first routability is greater than the second routability, the acceptance probability of the updated first layout is determined based on the first routability, the second routability, and the current temperature parameter of the simulated annealing algorithm. Based on the acceptance probability, the second layout is determined. That is, when the routability decreases, the new layout is accepted with a certain acceptance probability. In other words, the new layout may or may not be accepted.

[0141] Optionally, when the acceptance probability is less than a probability threshold, the first layout is determined as the second layout; or when the acceptance probability is greater than or equal to the probability threshold, the updated first layout is determined as the second layout, where the probability threshold is a preset value.

[0142] In one example, the probability of acceptance is calculated using the following formula:

[0143]

[0144] Where p represents the acceptance probability, rout represents the difference between the second pass rate and the first pass rate, and temp represents the current temperature parameter.

[0145] As can be seen from the above formula, when the temperature parameter is high, the acceptance probability is more likely to be greater than the probability threshold, allowing layout optimization to break away from local optimization and achieve global optimization. When the temperature parameter is low, the acceptance probability is less likely to be greater than the probability threshold, allowing layout optimization to converge to the optimal solution faster, that is, the optimization can be completed faster and the final optimization result can be obtained.

[0146] Step S207 : when the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter does not reach the number threshold corresponding to the temperature parameter, the number of iterations corresponding to the temperature parameter is increased by 1, and the second layout is updated based on the second wiring information.

[0147] In the embodiment of the present disclosure, for the simulated annealing algorithm, parameters such as the initial temperature parameter, the number of iterations corresponding to each temperature parameter, the cooling rate, and the temperature threshold are pre-set.

[0148] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter does not reach the number threshold corresponding to the temperature parameter, it means that the layout optimization under the current temperature parameter has not yet ended. Therefore, the number of iterations corresponding to the temperature parameter is increased by 1, and the second layout is updated based on the second wiring information.

[0149] Step S208, when the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter reaches the number threshold corresponding to the temperature parameter, update the temperature parameter; when the number of iterations corresponding to the updated temperature parameter does not reach the number threshold corresponding to the updated temperature parameter, add 1 to the number of iterations corresponding to the updated temperature parameter, and update the second layout based on the second wiring information.

[0150] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter reaches the number threshold corresponding to the temperature parameter, it is said that the layout optimization under the current temperature parameter has ended and the temperature parameter needs to be updated. Updating the temperature parameter includes: updating the temperature parameter based on the cooling rate to obtain the updated temperature parameter.

[0151] It should be noted that the implementation of updating the second layout based on the second wiring information is similar to the implementation of the above steps S202 to S205, and will not be repeated here.

[0152] Another point to note is that the embodiment of the present disclosure takes the case where the temperature parameter does not reach the temperature threshold as an example. In another embodiment, when the temperature parameter reaches the temperature threshold, the second layout is determined as the target layout of the circuit.

[0153] Step S209 , determining a third layout of the circuit based on the second layout and the updated second layout until the temperature parameter reaches a temperature threshold, and determining the layout determined by the last update as the target layout of the circuit.

[0154] The implementation of determining the third layout is the same as the implementation of determining the second layout in steps S206 and S207 , and will not be described in detail here.

[0155] After the third layout is determined, the system continues to determine whether the temperature parameter reaches a temperature threshold. If the temperature parameter reaches the temperature threshold, the third layout is determined as the target layout for the circuit. If the temperature parameter does not reach the temperature threshold, the third layout is updated and a new layout is determined. The implementation of updating the third layout is similar to the implementation of updating the first layout in steps S202-S205 above, and will not be repeated here. In other words, after each update to determine a new layout, similar operations to steps S201-S207 are repeated until the temperature parameter reaches the temperature threshold, at which point the layout determined by the last update is determined as the target layout for the circuit.

[0156] The method provided by the embodiment of the present disclosure updates the layout based on the layout's wiring information. The wiring information describes the connection relationship between the modules in the layout, which helps to reduce the number of unreasonable wirings, improve the routing rate, and make the updated layout more in line with actual wiring requirements, thereby improving the layout's wiring effect and practicality.

[0157] In addition, the embodiments of the present disclosure provide a variety of layout update methods. By introducing different layout update strategies, it is ensured that under the premise of layout constraints, the module position is better adjusted, the wiring congestion and the number of crossings are reduced, thereby providing more options through diversified update methods, making the layout optimization process more flexible and efficient.

[0158] Moreover, unlike the related art that only supports rectangular modules, the method provided by the embodiment of the present disclosure supports rectangular and L-shaped modules. Considering that there may be modules of different shapes in circuit design, supporting rectangular and L-shaped modules can flexibly handle this situation, making the layout scheme more flexible and diverse, and able to adapt to a wider range of circuit design requirements.

[0159] In one example, Figure 3 is a flow chart showing a circuit layout method based on a simulated annealing algorithm according to an exemplary embodiment. Figure 3 , including the following steps:

[0160] Step 1: Initialize various parameters of the simulated annealing algorithm and various parameters of the initial layout.

[0161] The parameters of the simulated annealing algorithm include the initial temperature parameter, the number of iterations corresponding to each temperature parameter, the cooling rate, and the temperature threshold (exit temperature). The parameters of the initial layout include the module position, size, and module index of each module.

[0162] Step 2: Determine whether the current temperature parameter reaches the exit temperature. If it has reached the exit temperature, end the process. If it has not reached the exit temperature, execute step 3.

[0163] Step 3: Update the temperature parameters.

[0164] Step 4, determine whether the number of iterations corresponding to the temperature parameter reaches the maximum number of iterations (number threshold) corresponding to the temperature parameter. If it has reached the corresponding maximum number of iterations, execute step 2; if it has not reached the corresponding maximum number of iterations, execute step 5.

[0165] Step 5: Add 1 to the number of iterations corresponding to the temperature parameter.

[0166] Step 6: Update the layout based on the routing information of the current layout.

[0167] Step 7, determine whether the updated layout is better than the layout before the update, if the updated layout is better than the layout before the update, execute step 8, if the updated layout is worse than the layout before the update, execute step 9.

[0168] In step 8, accept the updated layout as the new layout and execute step 4.

[0169] Step 9: Accept the updated layout as the new layout with a certain acceptance probability and execute step 4.

[0170] In one example, by Figure 4-Figure 7 The schematic diagram shown is used to illustrate the effects of the present disclosure.

[0171] Figure 4 is a schematic diagram showing an initial layout according to an exemplary embodiment, Figure 5 for Figure 4 The corresponding wiring diagram of the initial layout, Figure 6 is a schematic diagram showing a target layout according to an exemplary embodiment. Figure 7 for Figure 6 The corresponding wiring diagram of the target layout is compared Figure 4 and Figure 6 It can be seen that in Figure 6 The target layout in Figure 4 In the initial layout, module M14 was moved and rotated, and M28 was moved. Figure 5 and Figure 7 It can be clearly seen that the congestion between M28 and M21 and between M28 and M9 is significantly reduced. This is the effect of displacement decongestion. The routing effect of the optimized layout is better.

[0172] Figure 8 is a block diagram of a circuit layout device based on a simulated annealing algorithm according to an exemplary embodiment, which is configured in an electronic device, see Figure 8 , the device comprises:

[0173] The wiring information acquisition module 801 is configured to acquire first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information including module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information including module indexes of second modules connected by at least two crossing wires in the first layout;

[0174] A layout updating module 802 is configured to update the first layout based on the first routing information to obtain an updated first layout;

[0175] a layout determining module 803 configured to determine a second layout of the circuit based on the first layout and the updated first layout;

[0176] The layout determination module 803 is further configured to update the second layout based on the second wiring information of the second layout when the temperature parameter in the simulated annealing algorithm does not reach the temperature threshold, and determine a third layout of the circuit based on the second layout and the updated second layout until the temperature parameter reaches the temperature threshold, and determine the layout determined in the last update as the target layout of the circuit.

[0177] In some embodiments, the first routing information includes congestion information, and the layout update module 802 is configured to:

[0178] determining a moving direction and a moving distance of each of the two first modules based on the congestion information;

[0179] At least one first module is moved based on the moving direction and the moving distance to obtain an updated first layout; wherein the distance between two first modules in the updated first layout is greater than the distance between two first modules in the first layout.

[0180] In some embodiments, the layout update module 802 is configured to:

[0181] determining a movement direction of each of the two first modules based on the relative positions of the two first modules in the first layout;

[0182] The moving distance is determined based on the number of additional wires required, wherein the number of additional wires required is positively correlated to the moving distance.

[0183] In some embodiments, the layout update module 802 is configured to:

[0184] Moving at least one first module based on the moving direction and the moving distance, and determining a module position of each first module after the movement;

[0185] When the module position of each first module after the movement satisfies a first condition, the layout after the movement is determined as the updated first layout, wherein the module position of each first module after the movement satisfies the first condition means that: the module position of each first module after the movement does not overlap with the module positions of other modules except the moved first module, and the module position of each first module after the movement does not exceed the boundary position of the circuit; or

[0186] When the module position of at least one first module after being moved does not satisfy the first condition, at least one first module is moved in the opposite direction of the moving direction until the module position of each first module satisfies the first condition, and the layout when the module position of each first module satisfies the first condition is determined as the updated first layout, wherein the module position of at least one first module after being moved does not satisfy the first condition means that: the module position of the at least one first module after being moved overlaps with the module positions of other modules except the moved first module, or the module position of the at least one first module after being moved exceeds the boundary position of the circuit.

[0187] In some embodiments, the first routing information includes crossing information, and the layout update module 802 is configured to:

[0188] determining, based on the crossing information, a second module to which the at least two crossed conductive lines are connected;

[0189] The at least one second module is rotated to obtain an updated first layout.

[0190] In some embodiments, the layout update module 802 is configured to:

[0191] Rotate the lower left corner of the second module counterclockwise or clockwise by a first angle; or

[0192] Rotate the lower right corner of the second module counterclockwise or clockwise by a second angle; or

[0193] The second module is rotated counterclockwise or clockwise around the center point of the second module by a third angle.

[0194] In some embodiments, the layout update module 802 is configured to:

[0195] rotating at least one second module and determining a module position of each second module after rotation;

[0196] When the module position of each second module after rotation satisfies the second condition, the rotated layout is determined as the updated first layout, wherein the module position of each second module after rotation satisfies the second condition means that the module position of each second module after rotation does not overlap with the module positions of other modules except the rotated second module, and the module position of each second module after rotation does not exceed the boundary position of the circuit; or

[0197] When the module position of the at least one second module after rotation does not satisfy the second condition, the module position of the at least one second module after rotation is restored to the module position before rotation, and the restored layout is determined as the updated first layout, wherein the module position of the at least one second module after rotation does not satisfy the second condition means that: the module position of the at least one second module after rotation overlaps with the module positions of other modules except the rotated second module, or the module position of the at least one second module after rotation exceeds the boundary position of the circuit.

[0198] In some embodiments, the layout determination module 803 is configured to:

[0199] When the first routing rate of the first layout is less than or equal to the second routing rate of the updated first layout, the updated first layout is determined as the second layout; or

[0200] When the first routability is greater than the second routability, an acceptance probability of the updated first layout is determined based on the first routability, the second routability and the current temperature parameter of the simulated annealing algorithm, and a second layout is determined based on the acceptance probability.

[0201] In some embodiments, the layout determination module 803 is configured to:

[0202] When the acceptance probability is less than the probability threshold, the first layout is determined as the second layout; or,

[0203] When the acceptance probability is greater than or equal to the probability threshold, the updated first layout is determined as the second layout.

[0204] In some embodiments, the layout determination module 803 is further configured to:

[0205] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter does not reach the number threshold corresponding to the temperature parameter, the number of iterations corresponding to the temperature parameter is increased by 1, and the second layout is updated based on the second wiring information; or

[0206] When the temperature parameter does not reach the temperature threshold and the number of iterations corresponding to the temperature parameter reaches the number threshold corresponding to the temperature parameter, the temperature parameter is updated; when the number of iterations corresponding to the updated temperature parameter does not reach the number threshold corresponding to the updated temperature parameter, the number of iterations corresponding to the updated temperature parameter is increased by 1, and the second layout is updated based on the second wiring information.

[0207] In some embodiments, a module is used to represent a circuit element in a circuit, and the module is rectangular or L-shaped.

[0208] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0209] The present disclosure also provides an electronic device, Figure 9 1 is a block diagram of an electronic device 900 according to an exemplary embodiment, the electronic device comprising: a processor 901; a memory 902 for storing processor-executable instructions; wherein the processor 901 is configured to execute the circuit layout method based on the simulated annealing algorithm in the above embodiment.

[0210] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the circuit layout method based on the simulated annealing algorithm in the above embodiment.

[0211] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.

[0212] It should be understood that the present invention is not limited to the exact construction described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A circuit layout method based on simulated annealing algorithm, characterized in that: The method comprises: Obtaining first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information including module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information including module indexes of second modules connected by at least two crossing wires in the first layout; updating the first layout based on the first wiring information to obtain an updated first layout; determining a second layout of the circuit based on the first layout and the updated first layout; When the temperature parameter in the simulated annealing algorithm does not reach the temperature threshold, updating the second layout based on the second wiring information of the second layout, and determining a third layout of the circuit based on the second layout and the updated second layout, until the temperature parameter reaches the temperature threshold, and determining the layout determined in the last update as the target layout of the circuit; The updating of the first layout based on the first wiring information to obtain an updated first layout includes: determining a moving direction and a moving distance of each of the two first modules based on the congestion information; The congestion information includes module indexes of the two first modules; and determining the moving direction and moving distance of each of the two first modules based on the congestion information includes: Determining module positions of the two first modules in the first layout based on the module index and the first wiring information; determining, according to the module positions of the two first modules, relative positions of the two first modules in the first layout; determining a moving direction of each of the two first modules based on the relative positions of the two first modules in the first layout; The moving distance is determined based on the required number of additional wires; wherein the required number of additional wires is positively correlated with the moving distance.

2. The method according to claim 1, characterized in that The updating of the first layout based on the first wiring information to obtain an updated first layout further includes: Based on the moving direction and the moving distance, at least one of the first modules is moved to obtain the updated first layout; wherein the distance between the two first modules in the updated first layout is greater than the distance between the two first modules in the first layout.

3. The method according to claim 2, characterized in that The moving at least one of the first modules based on the moving direction and the moving distance to obtain the updated first layout includes: Moving at least one of the first modules based on the moving direction and the moving distance, and determining a module position of each first module after the movement; When the module position of each first module after the movement satisfies a first condition, the layout after the movement is determined as the updated first layout, wherein the module position of each first module after the movement satisfies the first condition means that: the module position of each first module after the movement does not overlap with the module positions of other modules except the moved first module, and the module position of each first module after the movement does not exceed the boundary position of the circuit; or When the module position of at least one first module after movement does not satisfy the first condition, the at least one first module is moved based on the opposite direction of the movement direction until the module position of each first module satisfies the first condition, and the layout when the module position of each first module satisfies the first condition is determined as the updated first layout, wherein the module position of the at least one first module after movement does not satisfy the first condition means that: the module position of the at least one first module after movement overlaps with the module positions of other modules except the moved first module, or the module position of the at least one first module after movement exceeds the boundary position of the circuit.

4. The method according to claim 1, wherein The first wiring information includes the intersection information, and updating the first layout based on the first wiring information to obtain the updated first layout includes: Determining, based on the crossing information, a second module to which the at least two crossed wires are connected; Rotate at least one of the second modules to obtain the updated first layout.

5. The method according to claim 4, characterized in that The rotating at least one of the second modules to obtain the updated first layout includes: rotating at least one of the second modules and determining a module position of each second module after rotation; When the module position of each second module after rotation satisfies a second condition, the rotated layout is determined as the updated first layout, wherein the module position of each second module after rotation satisfies the second condition means that the module position of each second module after rotation does not overlap with the module positions of other modules except the rotated second module, and the module position of each second module after rotation does not exceed a boundary position of the circuit; or When the module position of the at least one second module after rotation does not satisfy the second condition, the module position of the at least one second module after rotation is restored to the module position before rotation, and the restored layout is determined as the updated first layout, wherein the module position of the at least one second module after rotation does not satisfy the second condition means that: the module position of the at least one second module after rotation overlaps with the module positions of other modules except the rotated second module, or the module position of the at least one second module after rotation exceeds the boundary position of the circuit.

6. The method according to claim 1, characterized in that The determining, based on the first layout and the updated first layout, a second layout of the circuit, comprises: When the first routing rate of the first layout is less than or equal to the second routing rate of the updated first layout, determining the updated first layout as the second layout; or When the first routability is greater than the second routability, an acceptance probability of the updated first layout is determined based on the first routability, the second routability, and a current temperature parameter of the simulated annealing algorithm, and the second layout is determined based on the acceptance probability.

7. A circuit layout device based on simulated annealing algorithm, characterized in that: The device comprises: a wiring information acquisition module configured to acquire first wiring information of a first layout of a circuit; wherein the first wiring information includes congestion information and / or crossing information, the congestion information including module indexes of two adjacent first modules in the first layout and the number of additional wires required between the two first modules, and the crossing information including module indexes of second modules connected by at least two crossing wires in the first layout; a layout updating module, configured to update the first layout based on the first wiring information to obtain an updated first layout; a layout determining module configured to determine a second layout of the circuit based on the first layout and the updated first layout; The layout determination module is further configured to, when a temperature parameter in the simulated annealing algorithm does not reach a temperature threshold, update the second layout based on the second wiring information of the second layout, and determine a third layout of the circuit based on the second layout and the updated second layout, until the temperature parameter reaches the temperature threshold, and determine the layout determined in the last update as the target layout of the circuit; The updating of the first layout based on the first wiring information to obtain an updated first layout includes: determining a moving direction and a moving distance of each of the two first modules based on the congestion information; The congestion information includes module indexes of the two first modules; and determining the moving direction and moving distance of each of the two first modules based on the congestion information includes: Determining module positions of the two first modules in the first layout based on the module index and the first wiring information; determining, according to the module positions of the two first modules, relative positions of the two first modules in the first layout; determining a moving direction of each of the two first modules based on the relative positions of the two first modules in the first layout; The moving distance is determined based on the required number of additional wires; wherein the required number of additional wires is positively correlated with the moving distance.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for implementing quick locating and wiring of field programmable gate array (FPGA)

    CN103886137A

  • Analog integrated circuit layout optimization method based on SA algorithm

    CN116151173A