A method for generating a power switch chain based on ant colony and neighborhood search algorithm
By generating power switch chains using ant colony and neighborhood search algorithms, the problem of time-consuming and labor-intensive connection of power switch chains in existing technologies is solved, achieving efficient and stable power switch chain generation that is adaptable to various chip architectures and processes, and shortening the development cycle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING HUAHANG RADIO MEASUREMENT & RES INST
- Filing Date
- 2024-12-12
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies require manual script modification when connecting Power Switch Chains, which is time-consuming and labor-intensive, and is difficult to adapt to different chip architectures and manufacturing processes, resulting in high design complexity and long development cycles.
A power switch chain is generated using ant colony and neighborhood search algorithms. The shortest path is searched by ant colony algorithm and anomalies are handled by neighborhood search, resulting in an efficient and stable power switch chain.
It achieves seamless adaptation to multiple chip architectures and processes, simplifies the connection process, significantly shortens the development cycle, and improves design efficiency.
Smart Images

Figure CN122113799A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of integrated circuit (IC) design technology, specifically relating to a method for generating power switch chains based on ant colony and neighborhood search algorithms. Background Technology
[0002] In current integrated circuit (IC) design, especially for scenarios requiring low power consumption and high performance, the power switch chain connection method plays a crucial role. With the continuous advancement of semiconductor process technology, the functional modules within chips are becoming increasingly complex, making power management a major challenge in the design process. PowerSwitch Chain is designed to address this challenge by achieving significant power reduction through precise control of the power switches of individual modules or regions.
[0003] 1. Low power consumption design requirements:
[0004] Low-power design has become indispensable in current applications such as mobile devices, data center servers, and IoT devices. These devices often need to provide high-performance operation for extended periods within limited battery life or energy budgets. Therefore, how to reduce power consumption without sacrificing performance has become a key focus for IC design engineers.
[0005] 2. The function of the Power Switch Cell:
[0006] Power switch cells (PSCs) are a key technology for achieving low-power design. They function like switches in a circuit, using CMOS circuitry to control power. Unlike traditional mechanical switches, PSCs, under the control of digital signals, can quickly and accurately cut off or restore power supply, thus enabling independent power management for various modules or regions within the chip.
[0007] 3. Power Switch Chain Connection Method:
[0008] To meet the low-power requirements of complex chips, power control cells (PSCs) typically do not operate independently but rather need to work collaboratively to form a chain. This chain structure ensures that when controlling the power switch, each module or area can disconnect and restore power in a predetermined sequence and logic. Common connection methods include daisy chains, where the output of each PSC is connected to the control input of the next cell, forming a series link.
[0009] For backend engineers, each time they connect a Power Switch Chain, they have to modify the script to adapt to different floor plans, which is time-consuming and labor-intensive. Summary of the Invention
[0010] Based on the above analysis, the present invention aims to disclose a method for generating power switch chains based on ant colony and neighborhood search algorithms, so as to achieve efficient and stable connection of power switch chains.
[0011] This invention discloses a method for generating power switch chains based on ant colony and neighborhood search algorithms, comprising:
[0012] Step S1: Obtain the name and coordinates of the power switch unit PSC in the digital back-end module block;
[0013] Step S2: Sample and segment the coordinate data of the block; firstly, data sampling divides the block into multiple data blocks, and then data segmentation yields N data packets containing the same number of data blocks;
[0014] Step S3: Use ant colony and neighborhood search algorithms to search each data packet and plan the power route map for each data packet; in the power route map, use each data block including the PSC as a node to obtain a single traversal route map.
[0015] Step S4: Merge the power path diagrams of each data packet to obtain the power path diagram of the block; in the power path diagram of the block, start from the initial data block including the PSC and arrange all data blocks including the PSC in a single traversal; in each data block, arrange the multiple PSCs it includes in a single traversal.
[0016] Step S5: Convert the PSC coordinates in the block's power circuit diagram to obtain the PSC name, and connect the PSCs to form a power switch chain.
[0017] Further, step S2 includes:
[0018] Step S201: Sample the coordinate data of the block; the data sampling adopts a rectangular sampling method, and the block data is divided into multiple rectangular data blocks by several rectangles;
[0019] Step S202: Divide the rectangular data block of the block into data segments; determine the data segmentation point position in the block, and divide the rectangular data block into multiple data packets.
[0020] Further, in step S201, when sampling data, the Y direction is defined as the column direction with smaller PSC intervals in the block, and the X direction is defined as the row direction with larger PSC intervals that are perpendicular to the Y direction. The range of the data sampling rectangle is determined, wherein the length y of the rectangle in the Y direction is set according to the density of PSCs in the block; the maximum value of the length x of the rectangle in the X direction cannot exceed the distance between two adjacent PSC columns.
[0021] During sampling, the sampling step size at each position is determined based on the regularity of the PSC distribution in the block. The sampling step size is the rectangle length y and length x. In areas where the PSC distribution is irregular, including the mem placement area, a smaller sampling step size is used, while in areas with regular distribution, a larger sampling step size is used.
[0022] Furthermore, in step S202, when performing data segmentation, the number of data segments is determined according to the magnitude of the data; the position of the data segmentation point is determined according to the data shape; the position of the segmentation point must ensure that the amount of data between two segmentation points meets the data quantity set for the winding requirements.
[0023] Furthermore, in step S3, when searching each data packet using ant colony and neighborhood search algorithms, the center point coordinates of each rectangular data block in the data packet are used as the coordinates of the rectangular data block. Each data block including the psc is used as a search node to find the shortest connection path of all search nodes in a single traversal of the data packet, which is then used as the planned path.
[0024] Further, in step S4, the process of merging the power route diagrams of each data packet includes:
[0025] 1) Merge the power route diagrams of each data packet into one file;
[0026] 2) Create the functions (def) that need to be used, including:
[0027] The function process_file is used to read a file, check whether the y-value of the second point in each line is greater than the y-value of the first point, and add true or false to the end of the line.
[0028] The function del_file is used to delete duplicate points;
[0029] 3) During the merging process, the function process_file is used to determine whether the second point in the file is true or false, and the function del_file is used to delete duplicate points, resulting in a truth table containing true or false values.
[0030] 4) Process the psc in the corresponding rectangular data block in the search node in ascending or descending order of the y value according to true or false in the truth table;
[0031] 5) Use the sorted data as the power supply roadmap of the block.
[0032] Furthermore, during the search and merging process, perform exception handling for two types of violation events where the distance between two points exceeds the set value; among them,
[0033] The first type of violation event is: the x distance between two points is greater than the set value, and the connection distance between the two points is also greater than the set value;
[0034] The second type of violation event is: the x distance between two points is less than the set value, and the connection distance between the two points is greater than the set value.
[0035] Furthermore, perform exception handling for the first type of violation event through the created main_1_process;
[0036] main_1_process includes the following functions:
[0037] find_vio1; used to detect the first type of violation event, that is, the x distance between two points is greater than the set value;
[0038] find_closest_point_to_ymax: used to find the mid_point that satisfies:
[0039] x_mid - set value < x_min and x_mid + set value > x_max;
[0040] The x_mid is the x value of the found mid_point, and the x_min, x_max are the x values of the two points in the first type of violation event detected; the set value is the maximum distance between the two points after exception handling;
[0041] insert_points_if_needed: used to insert several points between two points to adjust the distance when the distance between the two points still exceeds the set value after inserting the mid point;
[0042] replace_points_with_nearest: used to replace the inserted points with the psc points in the block that are closest to the inserted points to optimize the point distribution;
[0043] During the processing,
[0044] First, traverse all point pairs and use find_vio1 to detect the first type of violation event;
[0045] If a violation is detected, use find_closest_point_to_ymax to find a suitable insertion point;
[0046] Then call insert_points_if_needed to insert the necessary points;
[0047] Finally, optimize these points using replace_points_with_nearest.
[0048] Furthermore, perform exception handling for the second type of violation event through the created main_2_process;
[0049] main_2_process includes the following functions:
[0050] find_vio2: used to detect the second type of violation event,
[0051] find_closest_point: used to find a psc point in the block that satisfies:
[0052] x_mid - set value < x_min and x_mid + set value > x_max;
[0053] During the processing,
[0054] First, traverse all point pairs and use find_vio2 to detect the second type of violation event;
[0055] If a violation is detected, use ind_closest_point to find a suitable psc point for replacement.
[0056] Furthermore, the conversion process in step S5 includes:
[0057] According to the correspondence between the power switch unit psc names and coordinate positions in the block_locations.txt generated in step S1, replace the coordinates in the power supply roadmap of the obtained block with psc names and reverse the file; obtain a list list1 of psc names in positive order and a list list2 of psc names in reverse order;
[0058] After obtaining the lists list1 and list2, connect the two lists to form a list list, constituting a closed-loop power switch chain for dual-path psc; when a single-path psc is required, split the list list into two lists list o 、list e ; where the list list is adopted oor list e A power switch chain that constitutes a single-channel PSC.
[0059] This invention can achieve one of the following beneficial effects:
[0060] The method for generating power switch chains based on ant colony and neighborhood search algorithms disclosed in this invention has high adaptability: it can seamlessly adapt to a variety of different chip architectures and manufacturing processes, and can achieve efficient and stable connections, whether it is an advanced nanoscale process or a more mature micron-scale process.
[0061] Shorter development cycle: The algorithm simplifies the steps of connecting the Power Switch Chain, reduces design complexity and debugging time, thereby significantly shortening the product development cycle. (For the connection of a block of 18,202 power switch cells, an approximate solution can be obtained within 30 minutes using this algorithm); Platform portability: It can be developed using Python and can run on multiple operating systems such as Windows, Linux, and macOS. Attached Figure Description
[0062] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0063] Figure 1 This is a flowchart of the method for generating a power switch chain based on ant colony and neighborhood search algorithms in an embodiment of the present invention.
[0064] Figure 2 This is a schematic diagram of the distribution and connection of PSCs in a block according to an embodiment of the present invention;
[0065] Figure 3 This is a comparison diagram of the first type of violation event before and after abnormal handling in an embodiment of the present invention;
[0066] Figure 4 This is a comparison diagram of the second type of violation event before and after abnormal handling in an embodiment of the present invention. Detailed Implementation
[0067] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and, together with the embodiments of the present invention, serve to illustrate the principles of the present invention.
[0068] This invention discloses a method for generating power switch chains based on ant colony and neighborhood search algorithms, such as... Figure 1 As shown, it includes:
[0069] Step S1: Obtain the name and coordinates of the power switch unit PSC in the digital back-end module block;
[0070] Step S2: Sample and segment the coordinate data of the block; firstly, data sampling divides the block into multiple data blocks, and then data segmentation yields N data packets containing the same number of data blocks;
[0071] Step S3: Use ant colony and neighborhood search algorithms to search each data packet and plan the power route map for each data packet; in the power route map, use each data block including the PSC as a node to obtain a single traversal route map.
[0072] Step S4: Merge the power path diagrams of each data packet to obtain the power path diagram of the block; in the power path diagram of the block, start from the initial data block including the PSC and arrange all data blocks including the PSC in a single traversal; in each data block, arrange the multiple PSCs it includes in a single traversal.
[0073] Step S5: Convert the PSC coordinates in the block's power circuit diagram to obtain the PSC name, and connect the PSCs to form a power switch chain.
[0074] Specifically, in step S1, all PSCs are selected from the coordinates of the PSCs in the digital back-end module block. The name and coordinate position of the power switch unit PSC are written to the file block_locations.txt, taking Innovus as an example.
[0075] Specifically, step S2 includes:
[0076] Step S201: Sample the coordinate data of the block; the data sampling adopts a rectangular sampling method, and the block data is divided into multiple rectangular data blocks by several rectangles;
[0077] Step S202: Divide the rectangular data block of the block into data segments; determine the data segmentation point position in the block, and divide the rectangular data block into multiple data packets.
[0078] Specifically,
[0079] In step S201, during data sampling, the column direction with smaller PSC spacing in the block is taken as the Y direction, and the row direction with larger PSC spacing perpendicular to the Y direction is taken as the X direction. This determines the range of the data sampling rectangle. The length y of the rectangle in the Y direction is set according to the PSC density in the block; the maximum value of the length x of the rectangle in the X direction cannot exceed the distance between two adjacent PSC columns to prevent inaccurate data sampling. Figure 2As shown, the vertically distributed columns are psc. Due to the small intervals along the column direction, they appear as a thick line in the figure.
[0080] Preferably, the length y of the rectangle is less than 2 / 3 of the length x; this is to avoid the problem of an increase in the total distance due to a large number of horizontal lines during calculation.
[0081] More preferably, during sampling, the sampling step size at each position is determined based on the regularity of the PSC distribution in the block. The sampling step size is the rectangle length y and length x. In areas where the PSC distribution is irregular, including the mem placement area, a smaller sampling step size is used, while in areas with regular distribution, a larger sampling step size is used. This satisfies both sampling accuracy and reduces the amount of subsequent computational data.
[0082] For example, when memes are placed around the perimeter of a block, the PSC distribution in the central area of the block is relatively regular. In this case, the sampling step size can be increased, while the sampling step size can be decreased for the meme placement areas around the perimeter to improve sampling accuracy.
[0083] Specifically, in step S202, when performing data segmentation, the number of data segments is determined based on the magnitude of the data; the position of the data segmentation point is determined based on the data shape; the position of the segmentation point must ensure that the amount of data between two segmentation points meets the data quantity set for the winding requirements; the set data quantity is set according to the specific winding requirements.
[0084] Write the location coordinates of the data segmentation points into the configuration file, and divide the rectangular data blocks in step S201 according to the coordinates of the segmentation points;
[0085] This step of data segmentation divides the large dataset in the block into multiple data packets, which are then processed separately in subsequent calculations, improving processing efficiency and effectively reducing runtime.
[0086] Preferably, the total number of each data packet in the partition is no more than 260 (the more data, the higher the runtime exponent).
[0087] Specifically, in step S3, when searching each data packet using ant colony and neighborhood search algorithms, the center point coordinates of each rectangular data block in the data packet are used as the coordinates of the rectangular data block. Each data block including the PSC is used as a search node to find the shortest connection path of all search nodes in a single traversal of the data packet, which is then used as the planned path.
[0088] The ant colony and neighborhood search process includes:
[0089] 1) Create a class named "ant" (or similar to an ant). The function definitions (defs) created under this class include:
[0090] The function choice_next_city is used to select the next coordinate. The probability of selecting the next coordinate is determined by the concentration of pheromones.
[0091] The function cal_lenth is used to calculate distance;
[0092] The function search_path is used to search for paths, ensuring that each point is included in the route planning map.
[0093] 2) Create a TSP class to solve the path planning problem; the functions defined under this class include:
[0094] The function `init_` is used to initialize parameters including the number of ants, the number of iterations, the pheromone importance factor, the pheromone volatility factor, and the heuristic function importance factor.
[0095] The function transf_Dist is used to calculate distance. To meet the actual needs of the search, when the distance is greater than a set value, the distance is doubled to reduce the probability of violations.
[0096] The function get_Dis_Pherom is used to initialize the distance;
[0097] The function `new` is used to initialize the pheromone, the ant colony, the optimal solution, the maximum distance, and the number of iterations.
[0098] The function search_path is used to traverse each ant, search for a path and compare it with the current best ant, determine whether to update the best solution, and update the pheromone.
[0099] The function update_pheromone_gragh is used to obtain the pheromone left by each ant on its path. The pheromone left between every two adjacent nodes on the path is inversely proportional to the total distance of the path. The pheromone between all nodes is updated by adding the decay of the old pheromone to the new iterative pheromone.
[0100] The function notInList is used to record points that are not included in the path planning.
[0101] The function get_route is used to find a route that matches the expected route.
[0102] 3) Using the created ant and TSP classes, perform ant colony and neighborhood search, allowing the ant colony to visit all nodes and calculate the total path length. If a shorter path is found, update the global optimal solution. In each iteration, update the pheromone matrix. When the set number of iterations is reached, output the found optimal path and its corresponding path length as the power route map of the data packet.
[0103] For each data packet, perform calculations one by one, obtain the results, and then process these results.
[0104] Specifically, in step S4, the process of merging the power route diagrams of each data packet includes:
[0105] 1) Merge the power route diagrams of each data packet into one file;
[0106] 2) Create the functions (def) that need to be used, including:
[0107] The function process_file is used to read a file, check whether the y-value of the second point in each line is greater than the y-value of the first point, and add true or false to the end of the line.
[0108] The function del_file is used to delete duplicate points;
[0109] 3) During the merging process, the function process_file is used to determine whether the second point in the file is true or false, and the function del_file is used to delete duplicate points, resulting in a truth table containing true or false values.
[0110] 4) Based on the true or false value in the truth table, process the psc in the rectangular data block corresponding to the search node in ascending or descending order according to the y value;
[0111] 5) Use the sorted data as the power route map for the block.
[0112] Due to the large volume of data processing, exception handling is performed for two unavoidable violations during the search and merging process, including the distance between two points exceeding the set value.
[0113] in,
[0114] The first type of violation is when the x-distance between two points is greater than the set value, and the distance between the lines connecting the two points is also greater than the set value.
[0115] The second type of violation is: the x-distance between two points is less than the set value, or the distance between the lines connecting the two points is greater than the set value;
[0116] Perform exception handling for the first type of violation event through the created main_1_process;
[0117] 1) main_1_process includes the following functions:
[0118] find_vio1; used to detect the first type of violation event, that is, the x-distance between two points is greater than the set value;
[0119] find_closest_point_to_ymax: used to find the mid_point that satisfies:
[0120] x_mid - set value < x_min and x_mid + set value > x_max;
[0121] The x_mid is the x value of the found mid_point, and the x_min and x_max are the x values of two points in the first type of violation event detected; the set value is the maximum distance between two points after exception handling; the set value is set according to actual needs.
[0122] insert_points_if_needed: used to insert several points between two points to adjust the distance when the distance between the two points still exceeds the set value after inserting the mid point;
[0123] replace_points_with_nearest: used to replace the inserted points with the psc points closest to the inserted points in the block to optimize the point distribution.
[0124] 2) During the processing,
[0125] First, traverse all point pairs and use find_vio1 to detect the first type of violation event;
[0126] If a violation is found, use find_closest_point_to_ymax to find a suitable insertion point;
[0127] Then call insert_points_if_needed to insert the necessary points;
[0128] Finally, use replace_points_with_nearest to optimize these points.
[0129] Perform exception handling for the second type of violation event through the created main_2_process;
[0130] 1) main_2_process includes the following functions:
[0131] find_vio2: Used to detect the second type of violation event,
[0132] find_closest_point: Used to find a psc point in the block that satisfies:
[0133] x_mid - set value < x_min and x_mid + set value > x_max;
[0134] 2) During the processing,
[0135] First, traverse all point pairs and use find_vio2 to detect the second type of violation event;
[0136] If a violation is found, use ind_closest_point to find a suitable psc point for replacement.
[0137] As Figure 3 shown, the comparison diagrams before and after the exception handling for the first type of violation event. It can be seen from the figure that through the exception handling, the connection line with the distance between two points exceeding the set value is removed, Figure 3 the red line segment on the left; and the connection is re - made at the position that meets the distance set value;
[0138] As Figure 4 shown, the comparison diagrams before and after the exception handling for the second type of violation event. It can be seen from the figure that through the exception handling, the connection line with the distance between two points exceeding the set value is removed, Figure 4 the red line segment on the left; and the connection is re - made at the position that meets the distance set value.
[0139] Specifically, the conversion process in step S5 includes:
[0140] According to the correspondence between the psc names and coordinate positions of the power switch units in the block_locations.txt generated in step S1, replace the coordinates in the obtained power supply route map of the block with psc names and reverse the file; obtain a list list1 of psc names in positive order and a list list2 of psc names in reverse order;
[0141] After obtaining the lists list1 and list2, connect the two lists to form a list list, constituting a closed - loop power switch chain of dual - path psc; when a single - path psc is required, split the list list into two lists list o 、list e ; where the list list o or list e is used to constitute the power switch chain of single - path psc.
[0142] Preferably, during the generation of the power switch chain, a visual presentation can be provided. Connections are entered sequentially according to coordinate positions, and connections between two points with a distance greater than a set value are displayed in red to facilitate the checking of any violations.
[0143] In summary, the method for generating power switch chains based on ant colony and neighborhood search algorithms disclosed in this invention has high adaptability: it can seamlessly adapt to a variety of different chip architectures and manufacturing processes, and can achieve efficient and stable connections whether it is an advanced nanoscale process or a more mature micrometer-level process.
[0144] Shorter development cycle: The algorithm simplifies the steps of connecting the Power Switch Chain, reduces design complexity and debugging time, thereby significantly shortening the product development cycle. (For the connection of a block of 18,202 power switch cells, an approximate solution can be obtained within 30 minutes using this algorithm); Platform portability: It can be developed using Python and can run on multiple operating systems such as Windows, Linux, and macOS.
[0145] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for generating power switch chains based on ant colony and neighborhood search algorithms, characterized in that, include: Step S1: Obtain the name and coordinates of the power switch unit PSC in the digital back-end module block; Step S2: Sample and segment the coordinate data of the block; firstly, data sampling divides the block into multiple data blocks, and then data segmentation yields N data packets containing the same number of data blocks; Step S3: Use ant colony and neighborhood search algorithms to search each data packet and plan the power route diagram for each data packet; In the power route diagram, a single traversal route diagram is obtained by using each data block including a PSC as a node. Step S4: Merge the power path diagrams of each data packet to obtain the power path diagram of the block; in the power path diagram of the block, start from the initial data block including the PSC and arrange all data blocks including the PSC in a single traversal; in each data block, arrange the multiple PSCs it includes in a single traversal. Step S5: Convert the PSC coordinates in the block's power circuit diagram to obtain the PSC name, and connect the PSCs to form a power switch chain.
2. The method for generating power switch chains based on ant colony and neighborhood search algorithms according to claim 1, characterized in that, Step S2 includes: Step S201: Sample the coordinate data of the block; the data sampling adopts a rectangular sampling method, and the block data is divided into multiple rectangular data blocks by several rectangles; Step S202: Divide the rectangular data block of the block into data segments; determine the data segmentation point position in the block, and divide the rectangular data block into multiple data packets.
3. The method for generating power switch chains based on ant colony and neighborhood search algorithms according to claim 2, characterized in that, In step S201, when sampling data, the Y direction is defined as the column direction with smaller PSC intervals in the block, and the X direction is defined as the row direction with larger PSC intervals that are perpendicular to the Y direction. The range of the data sampling rectangle is determined. The length y of the rectangle in the Y direction is set according to the density of PSCs in the block. The maximum value of the length x of the rectangle in the X direction cannot exceed the distance between two adjacent PSC columns. During sampling, the sampling step size at each position is determined based on the regularity of the PSC distribution in the block. The sampling step size is the rectangle length y and length x. In areas where the PSC distribution is irregular, including the mem placement area, a smaller sampling step size is used, while in areas with regular distribution, a larger sampling step size is used.
4. The method for generating a power switch chain based on ant colony and neighborhood search algorithms according to claim 3, characterized in that, In step S202, when performing data segmentation, the number of data segments is determined based on the magnitude of the data; the position of the data segmentation point is determined based on the data shape; the position of the segmentation point must ensure that the amount of data between two segmentation points meets the data quantity set for the winding requirements.
5. The method for generating a power switch chain based on ant colony and neighborhood search algorithms according to claim 4, characterized in that, In step S3, when using the ant colony and neighborhood search algorithms to search for each data packet, the central point coordinates of each rectangular data block in the data packet are used as the coordinates of the rectangular data block. Taking the data blocks each including psc as search nodes, the shortest connection path that traverses all search nodes in the data packet once is found as the planned path.
6. The method for generating a power switch chain based on the ant colony and neighborhood search algorithms according to claim 5, characterized in that In step S4, the process of merging the power line diagrams of each data packet includes: 1) Merge the power line diagrams of each data packet into one file; 2) Create the functions def that need to be used, including: The function process_file is used to read the file, check whether the y value of the second point in each line is greater than the y value of the first point, and add true or false at the end of the line; The function del_file is used to delete duplicate points; 3) During the merging process, use the function process_file to judge true or false from the second point in the file, and use the function del_file to delete duplicate points to obtain a truth table containing true or false; 4) Process the psc in the corresponding rectangular data block of the search node in ascending or descending order of the y value according to true or false in the truth table; 5) Use the sorted data as the power line diagram of the block.
7. The method for generating a power switch chain based on the ant colony and neighborhood search algorithms according to claim 6, characterized in that During the search and merging processes, exception handling is performed for two violation events where the distance between two points exceeds the set value; among them, The first violation event is that the x distance between two points is greater than the set value, and the connection distance between the two points is also greater than the set value; The second violation event is that the x distance between two points is less than the set value, and the connection distance between the two points is greater than the set value.
8. The method for generating a power switch chain based on the ant colony and neighborhood search algorithms according to claim 7, characterized in that Perform exception handling for the first violation event through the created main_1_process; main_1_process includes the following functions: find_vio1; used to detect the first violation event, that is, the x distance between two points is greater than the set value; find_closest_point_to_ymax: used to find mid_point that satisfies: x_mid - set value < x_min and x_mid + set value > x_max; The x_mid is the x value of the found mid_point, and the x_min and x_max are the x values of the two points detected in the first violation event; the set value is the maximum distance between the two points after exception handling; insert_points_if_needed: used to insert several points between the two points to adjust the distance when the distance between the two points still exceeds the set value after inserting the mid point. replace_points_with_nearest: It is used to replace the inserted points with the psc points in the block that are closest to the inserted points to optimize the point distribution; During the processing, First, traverse all point pairs and use find_vio1 to detect the first type of violation event; If a violation is found, use find_closest_point_to_ymax to find a suitable insertion point; Then call insert_points_if_needed to insert the necessary points; Finally, use replace_points_with_nearest to optimize these points.
9. The method for generating a power switch chain based on the ant colony and neighborhood search algorithms according to claim 7, wherein Through the created main_2_process, exception handling is performed on the second type of violation event; main_2_process includes the following functions: find_vio2: It is used to detect the second type of violation event, find_closest_point: It is used to find a psc point in the block that satisfies: x_mid - set value < x_min and x_mid + set value > x_max; During the processing, First, traverse all point pairs and use find_vio2 to detect the second type of violation event; If a violation is found, use ind_closest_point to find a suitable psc point for replacement.
10. The method for generating a power switch chain based on the ant colony and neighborhood search algorithms according to claim 9, wherein The conversion process in step S5 includes: According to the correspondence between the psc names and coordinate positions of the power switch units in the block_locations.txt generated in step S1, replace the coordinates in the power supply roadmap of the obtained block with the psc names and reverse the file; obtain a list list1 of psc names in positive order and a list list2 of psc names in reverse order; After obtaining lists list1 and list2, the two lists are concatenated to form a single list list, which constitutes a closed-loop power switch chain for the dual-channel PSC. When a single-channel PSC is required, list list is split into two lists: one with odd-numbered rows and one with even-numbered rows. o list e The list is used. o or list e A power switch chain that constitutes a single-channel PSC.