A circuit partitioning method based on reverse search and genetic algorithm
Through the circuit division method based on reverse search and genetic algorithm, MIMO gate-level circuits are divided into MISO systems, which solves the problems of long simulation time and load imbalance in traditional simulation technology, and realizes a circuit with zero communication volume and load balance. Partitioning improves the efficiency of parallel simulation.
Patent Information
- Application Number
- CN202210576541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-05-25
AI Technical Summary
When traditional gate-level circuit simulation technology faces the design of very large-scale integrated circuits, the simulation time is too long, and the communication volume and load imbalance in parallel simulation limit the development of circuit design.
A circuit division method based on reverse search and genetic algorithm is used to divide MIMO gate-level circuits into MISO systems, and through genetic algorithm optimization, circuit division with zero communication volume and load balancing is achieved.
The communication volume and load balancing of circuit division are achieved, which significantly improves the efficiency of parallel simulation and avoids the imbalance problem of simulation time.
Smart Images

Figure CN114741996B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of gate-level circuit parallel simulation of electronic design automation, and in particular to a circuit partitioning method based on reverse search and genetic algorithm. Background Art
[0002] In gate level circuit (GLC) design, circuit functions are often verified by simulation. As the circuit scale increases, the time required for simulation increases. Traditional simulation technology can no longer meet the growing circuit scale requirements, limiting the development of VLSI design. With the development of parallel computers and cloud computing technology, gate level circuit systems can be divided, and simulation methods based on parallel architectures can be used to reduce simulation time, which can effectively alleviate this problem.
[0003] In order to realize parallel simulation, the circuit needs to be reasonably divided. Minimizing the communication volume and load balancing between simulators are key indicators for evaluating the quality of division. Minimizing the communication volume means minimizing the time spent on communication between simulators. The time spent on communication is proportional to the number of cut edges. Generally, the time spent on communication between simulators is one order of magnitude higher than the time spent on accessing the local memory of the simulator. Therefore, in parallel simulation, if the communication between simulators is frequent, the time spent on communication occupies most of the working time. Therefore, reducing the communication overhead between simulators is the key to improving the simulation speed. Load balancing means that the simulation time of each simulator should be roughly the same, which is related to the number of logic gates and the calculation speed of the simulator. If the scale of each block in the circuit division is quite different, then the simulation time of each simulator in the parallel simulation will be quite different, which is prone to the "bucket effect". The overall simulation time is subject to the simulator with the longest simulation time. The current algorithms are all aimed at minimizing the communication volume and load balancing, but neither problem has been completely solved. Summary of the invention
[0004] The invention provides a circuit partitioning method based on reverse search and genetic algorithm, the purpose of which is to achieve zero circuit partitioning communication volume and load balancing, and solve the problem of long circuit simulation time in electronic design automation.
[0005] In order to achieve the above object, the present invention provides a circuit partitioning method based on reverse search and genetic algorithm, comprising:
[0006] Step 1, modeling the circuit gate level netlist;
[0007] Step 2, performing a reverse search from the output port of the MIMO gate-level circuit and recording the search results, performing an initial division based on the search results, and dividing the MIMO gate-level circuit into MISO systems with the same number as the number of output ports;
[0008] Step 3, combining, merging and optimizing the MISO systems based on the genetic algorithm, performing a union operation on the MISO systems that meet the initial division requirements, and obtaining the desired number of division blocks m;
[0009] Step 4: Output the m blocks divided into the circuit as circuit gate-level netlists and load them into the simulator respectively.
[0010] Among them, step 1 converts the gate-level netlist into a directed graph model, which includes nodes and directed edges. The nodes represent logic gates or triggers, and the directed edges represent the connection relationship between nodes. The adjacency matrix is used to represent the internal connection relationship of the directed graph model, and the simulation time of the node is described by the weight array.
[0011] The search results are all nodes associated with the output port.
[0012] Among them, the genetic algorithm uses a single chromosome to represent an individual, a sufficient number of individuals constitute the population, and a gene in each chromosome represents a MISO system of the initial division.
[0013] Wherein, step 3 comprises:
[0014] Step 31: Input the target number of blocks m, the number of individuals in the population N, the mutation probability p, the proportional factor β and the total number of evolutions G. max ;
[0015] Step 32, encoding the MISO system;
[0016] Step 33, initializing the population;
[0017] Step 34, evaluating the individuals in the current population according to the evaluation function and sorting them in ascending order according to the evaluation values of the evaluation function;
[0018] Step 35, select the first N individuals in the population according to the ranking, and discard the rest;
[0019] Step 36, determine whether the number of evolution times G of individuals in the current population has reached the maximum value G max If not, a new individual is generated by crossover, and the mutation occurs according to the mutation probability p. After adding the new individual to the population, step 34 is repeated until the number of evolutions G of the individuals in the current population reaches the maximum value G max Go to step 37, otherwise, go directly to step 37;
[0020] Step 37, outputting the best individual in the population, that is, outputting the best circuit partitioning solution.
[0021] The individual N in the genetic algorithm is greater than 50, the mutation probability p is less than 10%, the proportional factor β is 0.5, and the total number of evolutions G max Greater than 30.
[0022] The evaluation function in step 34 includes the standard deviation ASD of each block weight i,G and repeatability MUL i,G ;
[0023] Standard deviation of each block weight ASD i,G for
[0024]
[0025] Repeatability MUL i,G for
[0026] MUL i,G =cost i,G -cost initial
[0027] Evaluation function f i,G for
[0028] f i,G =β·ASD i,G +(1-β)·MUL i,G
[0029] Among them, cost i,G The weight of each chromosome, cost Yk (k=1, 2, ..., m) is the weight of the set of genes with the same number on a chromosome, cost initial is the total weight of the whole circuit before circuit partitioning, and β is the proportional factor.
[0030] Among them, crossover is to select two individuals as parents, select a substring in parent 1 and copy it to the corresponding position of an empty string to produce an initial offspring, and randomly select a substring in parent 2, and copy the substring to the initial offspring in order for crossover.
[0031] Among them, mutation is the drastic change in the chromosomes of a few individuals in a population, which produces new characteristics that did not exist before during the evolution process.
[0032] The above scheme of the present invention has the following beneficial effects:
[0033] The present invention eliminates the communication between simulators in parallel simulation, assigns weights to each logic gate circuit of the gate-level circuit, and determines the load balancing of the division result based on the weight, so that the circuit division result is more reasonable, and the communication volume is zero and the load is balanced.
[0034] Other beneficial effects of the present invention will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of an embodiment of the present invention;
[0036] Figure 2 A directed graph initially divided based on reverse search according to an embodiment of the present invention;
[0037] Figure 3 A diagram showing a crossover operation performed on a chromosome according to an embodiment of the present invention;
[0038] Figure 4 is a directed graph of an 8-bit carry-lookahead adder;
[0039] Figure 5 For this embodiment, Figure 4 The directed graph of the first block after partitioning;
[0040] Figure 6 For this embodiment, Figure 4 The directed graph of the second block after partitioning;
[0041] Figure 7 For this embodiment, Figure 4 Directed graph of the third block after partitioning. DETAILED DESCRIPTION
[0042] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0044] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installation", "connection" and "connection" should be understood in a broad sense, for example, it can be a locking connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0045] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0046] In view of the existing problems, the present invention provides a circuit partitioning method based on reverse search and genetic algorithm.
[0047] Before the specific implementation of the present invention, the following concepts need to be introduced:
[0048] Independent parallel simulation: refers to the situation where when each simulator is simulating in parallel, there is no need for communication between the simulators and no information exchange.
[0049] Communication volume: refers to the amount of communication data between simulators when each simulator is simulating in parallel. In independent parallel simulation, the communication volume is zero.
[0050] Weight: The weight of a logic gate is the number of input ports of the logic gate plus 1; the ratio of weights of different nodes is roughly equal to the ratio of simulation time of the corresponding logic gates. The weight of a gate-level circuit is the sum of the weights of all its logic gates.
[0051] Load: refers to the number of circuits loaded into the simulator. The length of simulation time depends on the amount of load. Load balancing means that the scale of the circuits simulated in each simulator is similar, that is, the simulation time is similar.
[0052] MIMO system: refers to a system with multiple input ports and multiple output ports.
[0053] MISO system: refers to a system with multiple input ports and 1 output port.
[0054] like Figure 1 As shown, an embodiment of the present invention provides a circuit partitioning method based on reverse search and genetic algorithm, comprising:
[0055] Step 1, modeling the circuit gate-level netlist; by converting the gate-level netlist into a directed graph model, the directed graph model includes nodes and directed edges, the nodes represent logic gates or triggers, the directed edges represent the connection relationship between nodes, the adjacency matrix is used to represent the internal connection relationship of the directed graph model, the simulation time of the node is described by the weight array, the weight is assigned to each logic gate circuit of the gate-level circuit, and the load balancing of the partitioning result is judged based on the weight, so that the circuit partitioning result is more reasonable.
[0056] For example: In the directed graph G(V, E), V = {v1, v2, ..., v n} is a set of nodes, n is the number of nodes in the directed graph, E = {e1, e2, …, e b} is the set of directed edges, where b is the number of directed edges; for a directed graph with n nodes, the size of the adjacency matrix is n×n, W is the weight array, W(v i ) is the node v i The weight of .
[0057] Among them, the value d in the i-th row and j-th column of the adjacency matrix ij As shown in formula (1).
[0058]
[0059] Then proceed to step 2.
[0060] Step 2, performing a reverse search from the output port of the MIMO gate-level circuit and recording the result of each search, performing an initial division according to the search result, and dividing the MIMO gate-level circuit into MISO systems with the same number as the number of output ports;
[0061] Specifically, if the MIMO gate-level circuit has S output ports, the S output ports are counted as a set Out, and then the reverse search starts from the nodes in the set Out. When a node a satisfies d aOut(i) =1, indicating that node a and Out(i) are connected, then node a is stored in the set Mi{i}. bd =1, indicating that node b and node a are connected, so node b is stored in the set Mi{i}. Similarly, all nodes associated with the output port Out(i) are stored in the set Mi{i}; the directed graph is initially divided into S blocks, and all nodes in the set Mi{i} are divided into the i-th block.
[0062] by Figure 2Take the directed graph of a MIMO system as an example. The directed graph has three output ports, that is, S is 3, namely v6, v10 and v11, which are recorded as set Out. From v6, reverse search can be searched to the node (v1, v2, v3, v4, v5, v6), recorded as M{1}; from node v10, reverse search can be searched to the node (v1, v2, v7, v8, v9, v10), recorded as M{2}; from node v11, reverse search can be searched to the node (v1, v2, v7, v8, v9, v11), recorded as M{3}; so it can be Figure 2 The directed graph in a is initially divided into three blocks, namely three MISO systems, such as Figure 2 As shown in b.
[0063] Step 3, based on the genetic algorithm, the MISO system is combined, merged, and optimized, and the MISO system that meets the requirements of the initial division is subjected to a union operation to obtain the desired number of division blocks m; its purpose is to merge two blocks with too many identical units to obtain the desired number of division blocks m, get rid of the limitation on the number of output ports, ensure that the weights of each block in the division result are roughly equal, and ensure that the load is relatively balanced.
[0064] Specifically, the genetic algorithm uses a single chromosome to represent an individual, a sufficient number of individuals constitute the population, each chromosome consists of S genes, and one gene represents a MISO system of the initial division.
[0065] Step 3 includes:
[0066] Step 31: Input the target number of blocks m, the number of individuals in the population N, the mutation probability p, the proportional factor β and the total number of evolutions G. max ; Individual N is greater than 50, the mutation probability p is less than 10%, the proportional factor β is 0.5, and the total number of evolutions G max Greater than 30.
[0067] Step 32, encoding the MISO system;
[0068] Chromosomes are encoded using integers, and the value of each gene is the number of the set to which the gene is assigned. Therefore, a chromosome is a circuit partitioning scheme. The chromosome is represented by formula (2):
[0069] X i,G (i=1,2,…,N)=(x1,x2,…,x S ) (2)
[0070] Among them, X i,G is the chromosome, i is the number of individuals in the population, i.e. the number of chromosomes, G is the number of evolutions, N is the total number of individuals in each generation, S is X i,GThe dimension of is the number of output ports of the reverse search initial partition MISO system. j is a gene, 1≤x j (j=1, 2, ..., S)≤m, where m is the total number of blocks that are expected to be divided.
[0071] For example: Chromosome X 2,3 is (Y1, Y3, Y2, Y2, Y1, Y2, Y3, Y3), which means the third generation chromosome of the second individual, S is 8, and m is 3. Among them, the encodings of genes x1 and x5 are the same, belonging to the Y1 block; the encodings of genes x3, x4 and x6 are the same, belonging to the Y2 block; the encodings of genes x2, x7 and x8 are the same, belonging to the Y3 block.
[0072] Step 33, initializing the population;
[0073] The initial population is randomly generated within the solution range. For any gene x on chromosome X j (j=1, 2, ..., S) has a value range of [1, m] and an initial value of
[0074] x j =1+round[(m-1)·rand(0,1)] (3)
[0075] The round function is used to round to the nearest integer, and the rand(0, 1) function is used to randomly generate a random decimal within [0, 1].
[0076] Step 34, evaluate the individuals in the current population according to the evaluation function and sort them in ascending order according to the evaluation value of the evaluation function; establish the evaluation function f i,G , evaluate the quality of circuit partitioning results.
[0077] Specifically, the evaluation function includes the standard deviation ASD of the weights of each block in the partition result i,G and repeatability MUL i,G ;
[0078] The weight of each chromosome is cost i,G , can be obtained by formula (4):
[0079] cost i,G =cost Y1 +cost Y2 +…+cost Ym (4)
[0080] Standard deviation of each block weight ASD i,G for
[0081]
[0082] Repeatability MUL i,G for
[0083] MUL i,G =cost i,G -cost initial (6)
[0084] Evaluation function f i,G for
[0085] f i,G =β·ASD i,G +(1-β)·MUL i,G (7)
[0086] Among them, cost i,G The weight of each chromosome, cost Yk (k=1, 2, ..., m) is the weight of the set of genes with the same number on a chromosome, cost initial is the total weight of the entire circuit before circuit partitioning, and β is the proportional factor. By controlling the proportional factor β, the importance of load balancing and duplication in the circuit partitioning result can be controlled.
[0087] According to the evaluation value f of the evaluation function i,G Sort by, f i,G The lower the individual, the higher the ranking. Evaluation function f i,G The smaller the value, the higher the individual fitness, and the more it meets the requirements of circuit division. β is the proportional factor. The larger β is, the larger the standard deviation ASD is. i,G For the evaluation function f i,G The smaller β is, the greater the impact of MUL i,G For the evaluation function f i,G The impact is greater.
[0088] Step 35, select the first N individuals in the population according to the ranking, and discard the rest;
[0089] Step 36, determine whether the number of evolution times G of individuals in the current population has reached the maximum value G max If not, a new individual is generated by crossover, and the mutation occurs according to the mutation probability p. After adding the new individual to the population, step 34 is repeated until the number of evolutions G of the individuals in the current population reaches the maximum value G max Go to step 37, otherwise, go directly to step 37;
[0090] Crossover is to select two individuals as parents, select a substring in parent 1, the substring length is s.g, and copy it to the corresponding position of an empty string to generate an initial offspring, randomly select a substring in parent 2, the substring length is S-sg, and copy the substring to the initial offspring in order for crossover; Figure 3 Shown is a crossover operation diagram, where the number of output ports S of the initial partitioned MISO system is 8 and the number of target partitioned blocks m is 3.
[0091] Mutation is a way for a population to jump out of the local optimal solution by causing a significant change in the chromosomes of a few individuals in the population. The mutation of chromosomes is affected by the mutation probability p. For a gene x in any chromosome X, j (j=1, 2, ...S), if
[0092] rand(0,1)<p (8)
[0093] Then the gene x j Mutation occurs, and the mutation formula is as follows:
[0094] x j =1+round[(m-1)*rand(0,1)] (9).
[0095] Step 37, outputting the best individual in the population, that is, outputting the best circuit partitioning solution.
[0096] Step 4: Output the m blocks divided into the circuit as circuit gate-level netlists and load them into the simulator respectively.
[0097] This embodiment combines an 8-bit carry-lookahead adder to perform circuit division, such as Figure 4 As shown in Figure 1, there are 17 external input signals and 9 output ports. After the circuit netlist is converted into a directed graph, there are 68 nodes with a total weight of 325. The output port S is 9, and the set Out is {v3, v8, v14, v21, v29, v38, v48, v59, v68}. The number of nodes and weights of the 9 MISO systems initially divided by reverse search are shown in Table 1.
[0098] Table 1 Initial division of 9 MISO systems
[0099] The first few 1 2 3 4 5 6 7 8 9 Number of nodes 1 5 8 11 14 17 20 23 25 Total weight 4 16 27 39 52 66 81 98 110
[0100] Then, the genetic algorithm is used to optimize the initial partition results, and finally it is divided into three blocks. The number of nodes and weights are shown in Table 2.
[0101] Table 2 Circuit partitioning results after genetic algorithm combination and optimization
[0102]
[0103]
[0104] The directed graphs of the final partition results are as follows: Figure 5 , Figure 6 , Figure 7 shown.
[0105] The embodiment of the present invention first models the gate-level netlist. A directed graph, an adjacency matrix and a weight array are used to represent the gate-level circuit. The MIMO system is divided into multiple MISO systems by reverse search. The MISO systems have no dependencies and do not need to communicate during parallel simulation. They can be simulated independently in parallel. Based on the genetic algorithm, multiple MISO systems are combined and optimized to obtain the desired number of partition blocks, balance the simulation load, reduce the same units between different partition blocks, and finally obtain the circuit partition result. The circuit partitioning method of the present invention can improve the efficiency of circuit parallel simulation. It has been proved in practice that it is very practical.
[0106] The present invention eliminates the communication between simulators in parallel simulation, assigns weights to each logic gate circuit of the gate-level circuit, and determines the load balancing of the division result based on the weight, so that the circuit division result is more reasonable, and the communication volume is zero and the load is balanced.
[0107] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A circuit partitioning method based on reverse search and genetic algorithm, characterized in that: include: Step 1, modeling the circuit gate level netlist; Step 2, performing a reverse search from the output port of the MIMO gate-level circuit and recording the search results, performing an initial division based on the search results, and dividing the MIMO gate-level circuit into MISO systems with the same number as the number of output ports; Step 3, combining, merging and optimizing the MISO systems based on the genetic algorithm, performing a union operation on the MISO systems that meet the initial division requirements, and obtaining the desired number of division blocks m; The step 3 comprises: Step 31: Input the target number of blocks m, the number of individuals in the population N, the mutation probability p, the proportional factor β and the total number of evolutions G. max ; Step 32, encoding the MISO system; Step 33, initializing the population; Step 34, evaluating the individuals in the current population according to the evaluation function and sorting them in ascending order according to the evaluation values of the evaluation function; The evaluation function includes the standard deviation ASD of each block weight i,G and repeatability MUL i,G ; The standard deviation ASD of the weights of each block i,G for The repeatability MUL i,G for MUL i,G =cost i,G -cost initial The evaluation function f i,G for f i,G =β·ASD i,G +(1-β)·MUL i,G Among them, cost i,G The weight of each chromosome, cost Yk , k = 1, 2, ..., m, is the weight of the integrated genes with the same number on a chromosome, cost initial is the total weight of the whole circuit before circuit partitioning, and β is the proportional factor; Step 35, select the first N individuals in the population according to the ranking, and discard the rest; Step 36, determine whether the number of evolution times G of individuals in the current population has reached the maximum value G max If not, a new individual is generated by crossover, and the mutation occurs according to the mutation probability p. After adding the new individual to the population, step 34 is repeated until the number of evolutions G of the individuals in the current population reaches the maximum value G max Go to step 37, otherwise, go directly to step 37; Step 37, outputting the best individual in the population, that is, outputting the optimal circuit partitioning scheme; Step 4: Output the m blocks divided into the circuit as circuit gate-level netlists and load them into the simulator respectively.
2. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The step 1 converts the gate-level netlist into a directed graph model, wherein the directed graph model includes nodes and directed edges, wherein the nodes represent logic gates or triggers, and the directed edges represent the connection relationship between nodes. An adjacency matrix is used to represent the internal connection relationship of the directed graph model, and a weight array is used to describe the simulation time of the node.
3. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The search result is all nodes associated with the output port.
4. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The genetic algorithm uses a single chromosome to represent an individual, and a sufficient number of individuals constitute a population. A gene in each chromosome represents a MISO system initially divided.
5. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The individual N in the genetic algorithm is greater than 50, the mutation probability p is less than 10%, the proportional factor β is 0.5, and the total number of evolutions G max Greater than 30.
6. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The crossover is to select two individuals as parents, select a substring in parent 1 and copy it to the corresponding position of an empty string to generate an initial offspring, and randomly select a substring in parent 2, and copy the substring in order to the initial offspring for crossover.
7. The circuit partitioning method based on reverse search and genetic algorithm according to claim 1, characterized in that: The mutation is the change in the chromosomes of a few individuals in the population, which produces characteristics that did not exist before during the evolution process.
Citation Information
Patent Citations
Transmission device, transmission method, reception device, reception method, integrated circuit, and program
WO2014087663A1
Global optimization, searching and machine learning method based on lamarck acquired genetic principle
WO2018161468A1
