Adaptive circuit partitioning method based on regional center load balancing

By converting the gate circuit into an undirected graph and using the breadth-first exploration algorithm to adjust the complexity threshold, the number of circuit blocks can be adaptively adjusted according to the number of regional centers, which solves the problem of poor circuit segmentation in the existing technology. The best effect of circuit segmentation and even distribution of resources are achieved.

CN113139357BActive Publication Date: 2024-09-10SHENZHEN STATE MICRO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110377330.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-08
Publication Date
2024-09-10
Estimated Expiration
2041-04-08

AI Technical Summary

Technical Problem

Existing circuit division algorithms cannot adaptively adjust the number of circuit blocks according to the number of regional centers, resulting in poor global search capabilities or high computational costs, making it difficult to achieve the best effect of circuit division.

Method used

An adaptive circuit segmentation method based on regional center load balancing is proposed. By converting the gate circuit into an undirected graph, sorting the vertices and merging the vertices with a degree lower than the preset degree, using a breadth-first exploration algorithm to traverse the vertices, and adjusting the complexity threshold until Meet the preset division requirements and realize circuit division.

Benefits of technology

The number of circuit blocks is adaptively adjusted according to the number of regional centers, so that the circuit segmentation effect is optimal. The vertex complexity of each block is similar, which is suitable for the even distribution of parallel simulation resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139357B
    Figure CN113139357B
Patent Text Reader

Abstract

The present invention proposes an adaptive circuit partitioning method based on regional center load balancing, which first specifies the number of initial partition blocks, and sorts and saves all vertices in the undirected graph according to the degree of the vertices from large to small, then traverses with the first saved vertex until the sum of the complexity of the vertices currently traversed reaches a threshold, and then traverses from the first vertex of the remaining vertices, and repeats the above steps until all vertices are traversed and the partitioning effect is judged. The partitioning effect is judged by judging whether the sum of the vertex complexity of each block meets the partitioning requirements. If so, the partitioning is completed, otherwise, the number of partition blocks is increased by one and the above steps are repeated until the partitioning requirements are met and the partitioning is completed. Compared with the prior art, the present invention can adaptively adjust the number of circuit partitions according to the number of regional centers within the specified complexity range, so that the circuit partitioning result is optimal. And the sum of the complexity of each block is similar, which is convenient for allocating computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a circuit segmentation method for gate-level simulation, in particular to an adaptive circuit segmentation method based on regional center load balancing. Background Art

[0002] At present, the research on heuristic algorithms for circuit partitioning can be roughly divided into two categories. One is the partitioning algorithm based on group migration technology, the most classic of which is the FM algorithm. This algorithm improves the mobile strategy and data structure, and can perform a good fine division of the circuit, but there is no good method for coarse division and the global search ability of the FM algorithm is still poor, and it is easy to fall into the local optimum. The other is the partitioning method based on traditional combinatorial optimization, such as partitioning methods based on genetic algorithms, simulated annealing algorithms, ant colony algorithms, etc. Although these methods have good global search capabilities, they are rarely used because of their slow convergence speed and high computational cost.

[0003] Therefore, how to design an adaptive circuit segmentation method based on regional center load balancing that can adaptively adjust the number of circuit blocks according to the number of regional centers and improve the circuit segmentation effect is a technical problem that needs to be solved urgently in the industry. Summary of the invention

[0004] In view of the problem in the prior art that the number of circuit blocks cannot be adaptively adjusted according to the number of regional centers, the present invention proposes an adaptive circuit segmentation method based on regional center load balancing.

[0005] The technical solution of the present invention is to propose an adaptive circuit segmentation method based on regional center load balancing, comprising:

[0006] Step S1: convert the gate circuit into an undirected graph;

[0007] Step S2: sorting all vertices in the undirected graph in order according to their vertex degrees, merging vertices whose vertex degrees are lower than a first preset degree with adjacent vertices into one vertex, and using the undirected graph after merging the vertices as the current undirected graph;

[0008] Step S3: starting from the vertex with the largest degree in the current undirected graph, traversing until the sum of the complexity of all traversed vertices reaches a preset complexity threshold, and dividing the currently traversed vertex into a block;

[0009] Step S4: return the undirected graph composed of the remaining untraversed vertices as the current undirected graph to step S3, and proceed to step S5 after all vertices have been traversed;

[0010] Step S5: Determine whether each block meets the preset division requirements. If so, complete the division. If not, adjust the complexity threshold, and return the undirected graph after merging the vertices in step S2 as the current undirected graph to step S3 for re-division until each block meets the preset division requirements.

[0011] Further, merging a vertex whose degree is lower than a first preset degree and an adjacent vertex into one vertex comprises:

[0012] Step S21: merging the vertices in the undirected graph whose degrees are lower than a first preset degree with their adjacent vertices;

[0013] Step S22: merging the vertices whose degree after merging is lower than the first preset degree and whose complexity is lower than the lower limit of the preset complexity range with their adjacent vertices.

[0014] Further, the step of sorting all vertices in the undirected graph in order of degree of the vertices includes:

[0015] The vertex with the largest degree in the undirected graph is determined as the initial vertex, and the vertices are arranged in descending order according to their degrees.

[0016] Furthermore, the degree of the vertex is the number of edges connected to the vertex.

[0017] Furthermore, before step S3, it is also necessary to determine the initial number of division blocks of the current undirected graph, and the initial number of division blocks is determined based on the upper limit value of the preset complexity range and the total complexity of the undirected graph, and the preset complexity threshold is determined based on the total complexity of the undirected graph and the initial number of division blocks.

[0018] Furthermore, before dividing the currently traversed vertices into a block, it is also necessary to determine whether there are indivisible vertices, and the indivisible vertices include: vertices whose degree is lower than a first preset degree, and vertices whose degree is 2 and one side of which has been divided;

[0019] If it is determined that there are indivisible vertices, the indivisible vertices are divided into blocks connected thereto.

[0020] Further, the first preset degree is 2.

[0021] Furthermore, the preset division requirements include:

[0022] All the blocks obtained by segmentation meet the tolerance range, and the difference in the sum of the vertex complexity between any two blocks does not exceed a preset value. The tolerance range is a value range formed by subtracting x from the lower limit of the preset range and adding x to the upper limit.

[0023] Furthermore, the adjusting the complexity threshold comprises: determining the current number of divided blocks to be the number of divided blocks last time plus 1, and determining the current complexity threshold according to the current number of divided blocks and the total complexity of the undirected graph.

[0024] Furthermore, the traversal algorithm is a breadth-first exploration algorithm.

[0025] Compared with the prior art, the present invention has at least the following beneficial effects:

[0026] By sorting all vertices in the undirected graph according to the degree of the vertices and then dividing them, and traversing the vertex with the largest degree as the initial point, the threshold is set adaptively according to the number of divided blocks, so that the number of circuit blocks can be adaptively adjusted according to the number of regional centers, so that the circuit segmentation effect is optimal. At the same time, the sum of the complexity of the vertices in each divided block is similar. During parallel simulation, the simulation resources occupied by each parallel simulation and the simulation time consumed can be similar, which is convenient for allocating computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0028] Figure 1 It is a flowchart of the adaptive circuit segmentation method based on regional center load balancing of the present application;

[0029] Figure 2 A circuit diagram of an embodiment of the present application;

[0030] Figure 3 This is a simplified schematic diagram of the embodiment of the present application;

[0031] Figure 4 This is a schematic diagram of the embodiment of the present application after being divided into two blocks;

[0032] Figure 5 This is a schematic diagram of the embodiment of the present application divided into three parts. DETAILED DESCRIPTION

[0033] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0034] Thus, a feature indicated in this specification will be used to illustrate one of the features of an embodiment of the present invention, rather than implying that each embodiment of the present invention must have the described feature. In addition, it should be noted that this specification describes many features. Although some features can be combined together to illustrate possible system designs, these features can also be used in other combinations that are not explicitly described. Thus, unless otherwise stated, the described combinations are not intended to be limiting.

[0035] The principle and structure of the present invention are described in detail below with reference to the accompanying drawings and embodiments.

[0036] The research on heuristic algorithms for circuit partitioning in the prior art can be roughly divided into two categories. One is the partitioning algorithm based on group migration technology. Taking the FM algorithm as an example, the algorithm improves the mobile strategy and data structure, and can well subdivide the circuit, but there is no good method for coarse partitioning and the global search ability of the FM algorithm is poor. It is easy to fall into the local optimum and cannot perform a good partition for the regional center. The other is the partitioning method based on traditional combinatorial optimization, such as the partitioning method based on genetic algorithm, simulated annealing algorithm, ant colony algorithm, etc. Although this type of method has good global search ability, it is rarely used because of its slow convergence speed and high computational cost. The idea of ​​the present invention is to propose an algorithm that can adaptively adjust the number of circuit blocks according to the number of regional centers, and at the same time make the complexity between each block relatively average, thereby avoiding the problems of poor global search ability or high computational cost in the prior art.

[0037] Specifically, the adaptive circuit segmentation method based on regional center load balancing proposed by the present invention includes:

[0038] Step S1: convert the gate circuit into an undirected graph;

[0039] Step S2: sorting all vertices in the undirected graph in order according to their vertex degrees, merging vertices whose vertex degrees are lower than a first preset degree with adjacent vertices into one vertex, and using the undirected graph after merging the vertices as the current undirected graph;

[0040] Step S3: starting from the vertex with the largest degree in the current undirected graph, traversing until the sum of the complexity of all traversed vertices reaches a preset complexity threshold, and dividing the currently traversed vertex into a block;

[0041] Step S4: return the undirected graph composed of the remaining untraversed vertices as the current undirected graph to step S3, and proceed to step S5 after all vertices have been traversed;

[0042] Step S5: Determine whether each block meets the preset division requirements. If so, complete the division. If not, adjust the complexity threshold, and return the undirected graph after merging the vertices in step S2 as the current undirected graph to step S3 for re-division until each block meets the preset division requirements.

[0043] See also Figure 1 , which is a flow chart of the adaptive circuit segmentation method based on regional center load balancing of the present application. Before segmentation, the gate circuit needs to be converted into an undirected graph to facilitate subsequent merging and segmentation. It is generally composed of multiple vertices and multiple edges connecting adjacent vertices. After the gate circuit is converted into the corresponding undirected graph, each vertex in the undirected graph is equivalent to a gate circuit, and the edges connected to it represent the connection relationship between the gate circuit and the gate circuits adjacent to it.

[0044] After converting the circuit into an undirected graph, the total complexity N of the gate circuit needs to be calculated to set the initial number of partition blocks. The total complexity N of the gate circuit is the sum of the complexities of all vertices in the gate circuit. For example, if the gate circuit includes vertex 1, vertex 2, and vertex 3, where the complexity of vertex 1 is 2, the complexity of vertex 2 is 3, and the complexity of vertex 3 is 1, the total complexity N of the gate circuit is the sum of the complexity 2 of vertex 1, the complexity 3 of vertex 2, and the complexity 1 of vertex 3, which is 6. After the total complexity N is obtained, the initial number of partition blocks can be obtained according to the preset complexity range. The preset complexity range is the complexity range of each block that needs to be obtained when dividing. For example, if the final division needs to obtain a block with a complexity range of [6, 8], the division is performed with this complexity range [6, 8] as the preset complexity range. Here, the preset complexity range is [a, b], where b is greater than a. The number of initial partition blocks is the quotient N / b obtained by dividing the total complexity N of the gate circuit by the upper limit b of the preset complexity range. For example, if the total complexity N is 30, the upper limit b of the preset complexity range is 6, and the number of initial partition blocks is 30 / 6=5. If the quotient obtained by dividing the total complexity N of the gate circuit by the upper limit of the preset complexity range is a non-integer, the result is rounded up to the initial number of partition blocks.

[0045] It can be seen from the preset complexity range that the initial number of divided blocks is the minimum number of blocks that can satisfy the division. Because the complexity of each vertex in the undirected graph (complexity is a property of a gate circuit, which characterizes the amount of computing resources it needs to consume during simulation or the length of simulation time required, and the total complexity of the gate circuit is the sum of all gate complexities) is different, there may be a situation where the complexity of a certain block is larger during segmentation and exceeds the complexity range. Therefore, the present invention divides with the minimum number of blocks as the initial number of blocks, and judges the division effect after division. If the division requirements are met, the division is completed. If the division requirements are not met, the number of divided blocks is increased by one and the division is continued until the maximum number of blocks is reached. In this way, the division can be continuously performed from the minimum number of blocks to the maximum number of blocks to obtain the number of blocks that meet the division requirements, thereby obtaining the optimal division method.

[0046] After setting the initial number of partition blocks, all vertices in the undirected graph are sorted and saved according to the degree of the vertex. In the present invention, the vertex with the largest degree in the undirected graph is determined as the initial vertex, and the vertex is sorted from large to small according to the degree of the vertex. The degree of the vertex represents the number of edges connected to the vertex. The larger the degree of the vertex, the more edges are connected to the gate circuit, and the closer it is to the center of the gate circuit. After sorting and saving from large to small, the first vertex obtained is the vertex with the largest degree of the vertex, and traversing with this vertex is traversing based on the center of the partial area. In other embodiments, the vertex can also be sorted from small to large according to the degree of the vertex, and the last vertex among the saved vertices is the vertex with the largest degree of the vertex, and traversing with this vertex can also obtain the same partitioning effect.

[0047] After all the vertices in the undirected graph are sorted and saved according to their vertex degrees, the undirected graph needs to be merged and simplified. Please refer to Figure 2 Since there are vertices located at the edge of the undirected graph and the vertex degree is 1, if they are split during segmentation, the resulting blocks will only contain one vertex, which will not meet the segmentation requirements. Therefore, before the undirected graph is segmented, it is necessary to merge and simplify it. Specifically, it includes:

[0048] Step S21: merging the vertices in the undirected graph whose degrees are lower than a first preset degree with their adjacent vertices;

[0049] Step S22: merging the vertices whose degree after merging is lower than the first preset degree and whose complexity is lower than the lower limit of the preset complexity range with their adjacent vertices.

[0050] The first preset degree is 2. The vertices with a degree lower than the first preset degree are vertices with a degree of 1. The degree of a vertex of 1 indicates that the gate circuit is connected by only one edge. If it is split, a separate gate circuit will be obtained, which does not meet the partitioning requirements. Therefore, it is necessary to merge it into the adjacent vertices. After merging it with the adjacent vertices, it is divided together with the adjacent vertices to avoid the problem of the vertex being divided into blocks separately. At the same time, if the degree of the vertex obtained after the merger is still 1 and its complexity is lower than the lower limit a of the preset complexity range, it is similar to the vertex of the edge. If it is divided out separately, it will not meet the partitioning requirements. This type of vertex needs to continue to be merged. Figure 2 Vertex 7 and vertex 8, vertex 8 is a vertex with a degree of 1, and needs to be merged with its adjacent vertex 7, but the vertex corresponding to the vertex obtained after the merger also becomes 1, and its complexity is 3 (the complexity of this vertex is the sum of the complexities of vertex 7 and vertex 8, the complexity of vertex 7 is 2, and the complexity of vertex 8 is 1). If it is lower than the lower limit value a of the complexity range, if it is disconnected during the splitting, the splitting condition will not be met. At this time, the vertex needs to be merged with the adjacent vertex again, that is, merged with vertex 6.

[0051] After the undirected graphs are merged and simplified, the merged undirected graph is divided as the current undirected graph. It is necessary to select the vertex with the largest degree from the current undirected graph as the initial vertex to start traversal. Since the present invention sorts the vertices in the undirected graph from large to small according to the degree of the vertices, the first vertex saved is the vertex with the largest degree, that is, the vertex with the largest number of adjacent vertices, which can be regarded as the regional center of this part of vertices. In the present invention, this vertex is used as the initial point for traversal until the sum of the complexity of all traversed vertices reaches the preset complexity threshold, and the currently traversed vertex is divided into a block.

[0052] After a partition, it is necessary to determine whether all vertices in the undirected graph have been traversed. If all vertices have been traversed, the partition is complete. If there are still vertices that have not been traversed, it is necessary to continue the traversal. The undirected graph composed of the remaining untraversed vertices is used as the current undirected graph, and the vertex with the largest degree in the current undirected graph is used as the starting point for traversal until the sum of the complexity of all traversed vertices reaches the preset complexity threshold and then is divided into one piece. The current step is repeated until all vertices are traversed.

[0053] The algorithm used in the traversal of the present invention is a breadth-first exploration algorithm. Given a graph G = (V, E) and a source vertex s, breadth-first exploration is to systematically explore the edges of G, thereby "discovering" all vertices that s can reach, and calculating the distances from s to all these vertices (the minimum number of edges). The algorithm can also generate a breadth-first tree with s as the root and including all reachable vertices. For any vertex v reachable from s, the path from s to v in the breadth-first tree is the shortest path from s to v in the graph G, that is, the path containing the minimum number of edges. The algorithm is applicable to both directed and undirected graphs.

[0054] Since all vertices are sorted from large to small according to the degree of the vertices when saving, it is only necessary to start the traversal from the first saved vertex when traversing. For example, the undirected graph includes vertices 1, 2, 3, 4, 5, 6, and 7, which are sorted by degree as {1, 6, 5, 2, 4, 7, 3}, and are saved in array A, where vertex 1 has the largest degree and vertex 3 has the smallest degree. In the first division, it is only necessary to start the traversal from the first vertex 1. Assuming that the vertices obtained by the traversal are {1, 2, 4}, it is divided into one block and then removed from array A. The remaining vertices in array A become {6, 5, 7, 3}. Since vertex 6 is the vertex with the largest degree among the remaining vertices, after the undirected graph formed by the remaining untraversed vertices is used as the current undirected graph, it can still be traversed with the first vertex 6, which can be regarded as the regional center of the current undirected graph. By sorting and traversing by this method, it is easier and more convenient to determine the regional center of each block and traverse with the regional center.

[0055] Before dividing the currently traversed vertices into a block, it is also necessary to determine whether there are indivisible vertices, where indivisible vertices include: vertices whose degree is lower than the first preset degree, and vertices whose degree is 2 and whose one side has been divided. The first preset degree is 2, and vertices whose degree is lower than the first preset degree are vertices with a degree of 1, which cannot be divided individually. At the same time, if the degree of a vertex is 2, it means that the vertex is connected to two connected edges. If one side is divided, it cannot be divided again. If it is divided, the vertex will be divided out separately, which does not meet the division requirements. Therefore, after determining the vertices that cannot be divided, they need to be divided into the blocks connected to them without being divided.

[0056] After the first division, it is necessary to determine whether all vertices have been traversed. If all vertices have been traversed, it means that the division is completed. If there are vertices that have not been traversed, the first vertex among the remaining vertices is used as the starting point to traverse again, and the above steps are repeated to obtain the second block. Each division is bounded by the preset complexity threshold. When the preset complexity threshold is reached, the traversal is stopped, and all the vertices traversed this time are divided into a block. The preset complexity threshold is determined according to the total complexity of the undirected graph and the number of initial division blocks. The method for determining the number of initial division blocks has been explained above and will not be repeated here. When the number of initial division blocks is determined to be n, the preset complexity threshold is determined as the quotient of the total complexity of the gate circuit divided by the number of initial division blocks n, and its value is N / n.

[0057] After the above division, multiple blocks can be obtained, which are the same as the number of initial division blocks set, and the sum of the complexity of all vertices in each block is close to the complexity threshold, that is, the complexity of each obtained by division is relatively balanced. However, since there are often one or more vertices with high complexity in the gate circuit, such as Figure 2 Vertex 4, vertex 11, vertex 13, etc. in the partition, if this part of the vertices is the last vertex to be traversed during the partition, it is easy for the partitioned blocks to have more than the set complexity threshold due to the addition of this vertex, thus affecting the partitioning effect. For example, assuming that the complexity threshold is 6, the vertices traversed in the first traversal are vertex 1, vertex 2, vertex 3, and vertex 4, where the complexity of vertex 1, vertex 2, and vertex 3 is 1, and the complexity of vertex 4 is 2. At this time, the sum of the complexity of all traversed vertices is 5, and it is necessary to continue traversing. The complexity of the next vertex 5 to be traversed is 4. After the traversal, the sum of the complexity of all traversed vertices becomes 9, reaching the complexity threshold, and it is divided into one block. After the final partition is completed, assuming that the complexity of the remaining vertices is relatively balanced, it is easy for the sum of the complexity of the second block to be 6 and the sum of the complexity of the third block to be 6, which is much smaller than the sum of the complexity of the first block of vertices, thus affecting the partitioning effect. Therefore, after the partition is completed, it is necessary to judge its specific partitioning effect.

[0058] Specifically, after the first division is completed, it is necessary to determine whether the various blocks obtained by the division meet the preset division requirements. The preset division requirements are: all the blocks obtained by the division meet the tolerance range, and the difference in the sum of the vertex complexity between any two blocks does not exceed the preset value. The tolerance range is the range of values ​​formed by the lower limit value of the preset range minus x and the upper limit value plus x. When the preset complexity range is [a, b], the tolerance range is [ax, b+x], where x represents the maximum value that can be tolerated beyond the preset complexity range. The larger the x, the larger the value that can be tolerated, and the greater the limit of each block exceeding the preset complexity range. On the contrary, the smaller the x, the smaller the value that can be tolerated, and the closer the each block is to the preset complexity range. In this application, x is 1, and its tolerance range is [a-1, b+1].

[0059] At the same time, there may be a situation where all blocks are within the complexity range, but the complexity of the blocks differs greatly. For example, if the tolerance range is [9, 15], the sum of the complexity of the vertices in the first block is 10, the sum of the complexity of the vertices in the second block is 9, and the sum of the complexity of the vertices in the third block is 15. In this case, all blocks are within the tolerance range, but the difference in the sum of the complexity of the vertices in the first block, the second block, and the third block is large, which obviously does not meet the division requirements. Therefore, after the division, it is also necessary to determine the difference in the sum of the complexity of the vertices between the blocks. When the difference does not exceed the preset value, the division condition is met. The larger the preset value, the greater the difference in complexity between the final blocks. The smaller the preset value, the closer the complexity between the final blocks. In this application, the preset value is taken as 1. Only when the difference in complexity between the blocks does not exceed 1 is it considered that the division condition is met. That is, the final division requirement is that the sum of the complexity of the vertices in each block meets the tolerance range, and the difference in the sum of the complexity of the vertices in each block does not exceed 1. Only when this division requirement is met, the current division effect is considered good and the division is completed. Otherwise, the division effect is considered poor.

[0060] If the segmentation effect is not good, it is necessary to adjust the complexity threshold, and return the undirected graph after merging the vertices in step S2 as the current undirected graph to step S3 for re-division until each block meets the preset segmentation requirements. Wherein, adjusting the complexity threshold includes: determining the current number of divided blocks to be the number of divided blocks in the previous time plus 1, and determining the current complexity threshold according to the current number of divided blocks and the total complexity of the undirected graph. The calculation method of the current complexity threshold is the same as before, and its value is the quotient of the total complexity of the gate circuit and the current number of divided blocks. If the number of divided blocks in the first division is the initial number of divided blocks, assuming that it is 3 blocks, and the total complexity of the gate circuit is 30, then the preset complexity threshold is 10. When it is determined that the first division does not meet the segmentation requirements, the current number of divided blocks is set to be the initial number of divided blocks plus 1, that is, the current number of divided blocks is 4 blocks, and the current complexity threshold is determined to be the quotient of the total complexity of the gate circuit 30 and the current number of divided blocks 4. The result is the current complexity threshold. If the result is not an integer, it is rounded to an integer. At the same time, if the blocks obtained when the number of divided blocks is 4 still do not meet the division requirements, the current number of divided blocks is set to the previous number of divided blocks 4 plus 1, that is, the current number of divided blocks is 5, and the complexity threshold is re-determined and divided again until the final division result meets the division requirements.

[0061] Among them, the sum of the complexity of the vertices of each block is calculated through the corresponding weight matrix. The weight matrix is ​​a matrix that stores the logical effort value of the gate circuit represented by each vertex (that is, the computational cost of each vertex, namely the vertex complexity). Through this matrix, the sum of the vertex complexity of each block can be calculated intuitively.

[0062] Since the present application ultimately makes each block obtained by the division within the tolerance range, and the difference in the sum of the complexity of the vertices between the blocks does not exceed the preset value, that is, the sum of the complexity of the vertices between the blocks is similar, and the vertex with the largest degree is traversed as the center of the current area, after setting the number of division blocks, the number of blocks of the circuit can be adaptively adjusted according to the number of regional centers.

[0063] See also Figures 2 to 5 , an embodiment of the present invention and its division method are described below, Figure 2 It is an undirected graph corresponding to a gate circuit, in which each vertex represents a gate circuit. If two vertices are connected, it means that the two gate circuits are connected to each other. The number next to the vertex in the figure represents its complexity. If it is not numbered, it means that the complexity of the vertex is 1.

[0064] After obtaining the undirected graph, we need to calculate the total complexity of the gate circuit. The total complexity is the sum of the complexity of each vertex. The complexity of vertex 1, vertex 2, vertex 3, vertex 6, vertex 8, vertex 10, vertex 11, vertex 12, vertex 15, and vertex 16 is 1, the complexity of vertex 5, vertex 7, vertex 14, and vertex 17 is 2, the complexity of vertex 9 and vertex 13 is 3, and the complexity of vertex 4 is 4, so the total complexity is (1*10+2*4+3*2+4*1) = 28. Set the complexity range to [10,14], so the initial number of blocks is 28 / 14=2 blocks, and its tolerance range is [9,15].

[0065] After determining the initial number of partition blocks, all vertices in the undirected graph are saved in order from large to small according to the degree of the vertex. The degree of a vertex is the number of edges connected to the vertex. The degree of vertex 2, vertex 3, vertex 5, vertex 8, vertex 16, and vertex 17 is 1, the degree of vertex 4, vertex 7, vertex 9, vertex 10, vertex 12, vertex 14, and vertex 15 is 2, the degree of vertex 6 and vertex 11 is 4, and the degree of vertex 1 and vertex 13 is 5. Therefore, the final saved result is array A={1, 13, 6, 11, 4, 7, 9, 10, 12, 14, 15, 2, 3, 5, 8, 16, 17}.

[0066] After all the vertices in the undirected graph are saved in order from the largest to the smallest degree, the undirected graph is merged and simplified to avoid dividing the vertices with a degree of 1 into a single piece. Among them, the vertices with a degree of 1 are vertex 2, vertex 3, vertex 5, vertex 8, vertex 16, and vertex 17. They are divided into adjacent vertices, among which vertex 2, vertex 3, and vertex 5 are merged into vertex 1, vertex 8 is merged into vertex 7, vertex 16 is merged into vertex 13, and vertex 17 is merged into vertex 6. Since the degree of vertex 8 is 1 after merging vertex 7, and its complexity becomes 3 (the complexity of vertex 7 is 2, and the complexity of vertex 8 is 1. After merging, the complexity of this point is the sum of the complexity of vertex 7 and the complexity of vertex 8), which is lower than the lower limit of the complexity range of 10, so it is necessary to merge again and merge the vertex into vertex 6.

[0067] See also Figure 3 This is the undirected graph after the merger, where the complexity of vertex 1 becomes 5 (which is the sum of the complexity of vertex 1, vertex 2, vertex 3, and vertex 5. The complexity of subsequent merged vertices is equal to the sum of the complexity of all vertices merged with it, which will not be repeated), the complexity of vertex 4 and vertex 13 is 4, the complexity of vertex 9 is 3, the complexity of vertex 6 is 6, the complexity of vertex 14 is 2, and the complexity of vertex 10, vertex 11, vertex 12, and vertex 15 is 1.

[0068] After merging and simplification, it is necessary to determine the center of the area for the first division. The traversal is performed with the first vertex in array A as the initial point 1. After determining the center of the area, it is necessary to determine the complexity threshold. The complexity threshold is the quotient of the total complexity of the gate circuit 28 divided by the current number of division blocks 2, that is, the complexity threshold is 14.

[0069] Since the complexity of vertex 1 is 5, it is necessary to traverse again and obtain the vertices of the next layer as vertex 4 and vertex 6. At this time, the total complexity of the traversed vertices is 6+5+6, and its total complexity is 15, reaching the complexity threshold, and it is divided into one block. At this time, the remaining vertices in array A are {13, 11, 9, 10, 12, 14, 15, 16}, and then traverse again with the first vertex in the current array A as the center of the region, that is, traverse with vertex 13 as the center of the region. Since the complexity of vertex 13 is 4, which is lower than the complexity threshold of 14, it is necessary to continue traversing and obtain vertices 11, vertex 12, vertex 14, and vertex 14. At this time, the total complexity of the traversed vertices becomes 4+2+1+1+1=9, which is still less than the complexity threshold of 14, so it is necessary to continue traversing to obtain vertices 9 and 10. At this time, all vertices in set A are traversed and two blocks are obtained.

[0070] The sum of the vertex complexities of the first block is 15, and the sum of the vertex complexities of the second block is 13. Although the vertex complexities of the two blocks meet the tolerance range, the difference between the sum of the complexity of the vertices in the first block and the sum of the complexity of the vertices in the second block is 2, which does not meet the division requirements, so it needs to be divided again. At this time, the number of divided blocks is 1 plus the number of divided blocks in the last time, that is, 3 blocks. At the same time, its complexity threshold also changes to 28 / 3=9.3 accordingly with the number of divided blocks. Here, the complexity threshold is rounded to 9.

[0071] After determining the complexity threshold, it is necessary to repeat the above division steps to divide again. First, determine the center of the area at the first division (that is, the initial traversal point). The traversal starts with the first vertex in set A as the initial point, that is, starting from vertex 1. Since the complexity of vertex 1 is 5, which is lower than the complexity threshold, it needs to be traversed again. At this time, the breadth-first exploration algorithm is used to obtain vertices 4 and 6, and the vertices are added in turn. Since the sum of the complexity of the currently traversed vertices has reached the complexity threshold after adding vertex 4, vertex 1 and vertex 4 are divided into 1 block.

[0072] After the first division, the remaining vertices in set A are {13, 6, 11, 7, 9, 10, 12, 14, 15, 2, 3, 5, 8, 16, 17}. At this time, it is necessary to divide it again and traverse it with the first vertex among the remaining vertices as the center of the area, that is, start traversing from vertex 13. Since the complexity of vertex 13 is 4, which is lower than the complexity threshold, it is necessary to traverse it again to obtain the second-layer vertices 11, vertex 12, vertex 14, and vertex 15. At this time, the sum of the complexity of the traversed vertices is exactly equal to 9, so it is divided into 1 block.

[0073] At the same time, since the vertex degree of vertex 10 is 2 and one side is split (the first block is vertex 1 and vertex 4, and vertex 4 is separated from vertex 10), it needs to be divided into adjacent blocks. Since the sum of the vertex complexities of blocks {1, 4} or {13, 11, 12, 14, 15} is 9, vertex 10 can be divided into any block without affecting the final division result. In this embodiment, it is divided into block {1, 4}.

[0074] After the second block division, there are still vertices in set A, and it needs to be divided again. At this time, set A becomes {6, 9}. At this time, the traversal is started with the first vertex in set A as the starting point, that is, vertex 6 is started. Since the complexity of vertex 6 is 6, which is lower than the complexity threshold, it is necessary to continue traversing to obtain vertex 9. At this time, the sum of the complexity of the traversed vertices is 9, which just reaches the complexity threshold 9, and the traversal is stopped.

[0075] At the same time, since all vertices in set A have been traversed, it is determined that the partition is completed at this time, and the three blocks are {1, 4, 10}, {13, 11, 12, 14, 15}, and {6, 9}, and the sum of the complexity of their vertices is 10, 9, and 9 respectively. At the same time, since the tolerance range is [9, 15], each block meets the tolerance range. At the same time, the difference between the sum of the complexity of the vertices of the first block, the second block, and the third block is 1, which meets the partition requirements and completes the partition. After the partition is completed, each block is degraded to the original graph, and three blocks are obtained, namely {1, 2, 3, 4, 5, 10}, {11, 12, 13, 14, 15, 16}, and {6, 7, 8, 9, 17}, which can be used for circuit simulation.

[0076] Compared with the prior art, the present invention can adaptively adjust the number of circuit blocks according to the number of regional centers, so as to achieve the best circuit segmentation effect. At the same time, the difference in the sum of the complexity of the vertices between the blocks finally divided does not exceed 1, so that the simulation resources occupied by each block and the simulation time consumed can be similar, which is convenient for allocating simulation resources.

[0077] The above are only partial or preferred embodiments of the present invention. Neither the text nor the drawings can limit the scope of protection of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the overall concept of the present invention, or direct / indirect application in other related technical fields are included in the scope of protection of the present invention.

Claims

1. An adaptive circuit partitioning method based on regional center load balancing, characterized in that: include: Step S1: convert the gate circuit into an undirected graph; Step S2: sorting all vertices in the undirected graph in order according to their vertex degrees, merging vertices whose vertex degrees are lower than a first preset degree with adjacent vertices into one vertex, and using the undirected graph after merging the vertices as the current undirected graph; Step S3: starting from the vertex with the largest degree in the current undirected graph, traversing until the sum of the complexity of all traversed vertices reaches a preset complexity threshold, and dividing the currently traversed vertex into a block; Step S4: return the undirected graph composed of the remaining untraversed vertices as the current undirected graph to step S3, and proceed to step S5 after all vertices have been traversed; Step S5: Determine whether each block meets the preset division requirements. If so, complete the division. If not, adjust the complexity threshold, and return the undirected graph after merging the vertices in step S2 as the current undirected graph to step S3 for re-division until each block meets the preset division requirements.

2. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The step of combining a vertex whose degree is lower than a first preset degree and an adjacent vertex into one vertex comprises: Step S21: merging the vertices in the undirected graph whose degrees are lower than a first preset degree with their adjacent vertices; Step S22: merging the vertices whose degree after merging is lower than the first preset degree and whose complexity is lower than the lower limit of the preset complexity range with their adjacent vertices.

3. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The step of sorting all vertices in the undirected graph in order according to the degree of the vertices comprises: The vertex with the largest degree in the undirected graph is determined as the initial vertex, and the vertices are arranged in descending order according to their degrees.

4. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The degree of a vertex is the number of edges connected to the vertex.

5. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: Before step S3, it is also necessary to determine the initial number of blocks of the current undirected graph. The initial number of blocks is determined according to the upper limit of a preset complexity range and the total complexity of the undirected graph. The preset complexity threshold is determined according to the total complexity of the undirected graph and the initial number of blocks.

6. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: Before dividing the currently traversed vertices into a block, it is also necessary to determine whether there are indivisible vertices, and the indivisible vertices include: vertices whose degree is lower than a first preset degree, and vertices whose degree is 2 and one side of which has been divided; If it is determined that there are indivisible vertices, the indivisible vertices are divided into blocks connected thereto.

7. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The first preset degree is 2.

8. The adaptive circuit partitioning method based on regional center load balancing according to claim 2, characterized in that: The preset division requirements include: All the blocks obtained by segmentation meet the tolerance range, and the difference in the sum of the vertex complexity between any two blocks does not exceed a preset value. The tolerance range is a value range formed by subtracting x from the lower limit of the preset range and adding x to the upper limit.

9. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The adjusting complexity threshold comprises: determining the current number of divided blocks to be the number of divided blocks last time plus 1, and determining the current complexity threshold according to the current number of divided blocks and the total complexity of the undirected graph.

10. The adaptive circuit partitioning method based on regional center load balancing according to claim 1, characterized in that: The traversal algorithm is a breadth-first exploration algorithm.