Circuit simulation method and device based on hypergraph partitioning, server and storage medium

Optimizing hypergraph division through parallel tempering algorithm solves the problem of low efficiency of hypergraph division in circuit simulation in the existing technology and achieves a faster and more accurate simulation process.

CN116258114BActive Publication Date: 2024-08-23SHENZHEN HUADA EMPYREAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211096461.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-06
Publication Date
2024-08-23
Estimated Expiration
2042-09-06

AI Technical Summary

Technical Problem

Existing hypergraph partitioning methods are prone to falling into local optima in circuit simulation and cannot effectively explore the partitioned solution space, resulting in low simulation efficiency and long post-simulation time.

Method used

The circuit hypergraph division method based on the parallel tempering algorithm is used to construct multiple Markov chains, exchange temperature coefficients, and optimize the hypergraph to obtain smaller cutting results, thereby improving simulation efficiency.

Benefits of technology

Effectively search the solution space, shorten simulation time, obtain better division results, and improve simulation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116258114B
    Figure CN116258114B
Patent Text Reader

Abstract

The present invention discloses a circuit simulation method and device based on hypergraph partitioning, a server and a storage medium. The circuit simulation method according to an embodiment of the present invention comprises obtaining a circuit netlist; parsing the circuit netlist to establish a first hypergraph; optimizing the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; and performing parallel simulation operations on the optimized hypergraph. The circuit simulation method and device based on hypergraph partitioning, a server and a storage medium according to an embodiment of the present invention are optimized based on a parallel tempering algorithm, and can effectively search the solution space to obtain better partitioning results, thereby shortening the subsequent simulation time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of integrated circuit design automation technology, and in particular to a circuit simulation method and device based on hypergraph partitioning, a server and a storage medium. Background Art

[0002] Circuit simulation is to simulate the designed circuit through simulation software, simulate the actual function, and then analyze and improve it to achieve the optimal design of the circuit. Circuit simulation is an important part of EDA (Electronic design automation).

[0003] High-precision transistor-level circuit simulation is an essential key technology in the analog circuit design process. Due to a large number of parasitic resistors and capacitors, the scale of the circuit post-simulation is usually ten or even a hundred times that of the pre-simulation circuit, resulting in the time of post-simulation being usually tens or even hundreds of times that of pre-simulation. Therefore, it is necessary to improve the simulation efficiency of the simulator.

[0004] In the prior art, in order to improve simulation efficiency, after the simulator stores the netlist in memory, it will use a hypergraph partitioning tool to divide the circuit into several non-overlapping sub-modules, and then distribute these modules to different CPUs for calculation. Then the top-level solution is performed, and the solution is substituted back into each sub-module to complete the solution of the sub-module. Existing hypergraph partitioning methods are often prone to falling into local optimality and cannot effectively explore the partitioned solution space, resulting in poor partitioning results.

[0005] Therefore, it is hoped that there will be a new circuit simulation method and device, server and storage medium based on hypergraph partitioning that can solve the above problems. Summary of the invention

[0006] In view of the above problems, the purpose of the present invention is to provide a circuit simulation method and device, server and storage medium based on hypergraph partitioning, and particularly to a circuit hypergraph partitioning method based on a parallel tempering algorithm, which is optimized based on the parallel tempering algorithm and can effectively search the solution space to obtain better partitioning results, thereby shortening the subsequent simulation time.

[0007] According to one aspect of the present invention, there is provided a circuit simulation method based on hypergraph partitioning, comprising obtaining a circuit netlist; parsing the circuit netlist to establish a first hypergraph; optimizing the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; and performing parallel simulation operations on the optimized hypergraph.

[0008] Optionally, parsing the circuit netlist and establishing the first hypergraph includes modeling the circuit as the first hypergraph according to the connection relationship of the circuit, wherein the vertices of the first hypergraph correspond to the devices of the circuit; and the hyperedges of the first hypergraph correspond to the nodes of the circuit.

[0009] Optionally, optimizing the first hypergraph according to the parallel tempering algorithm to obtain the optimized hypergraph includes constructing multiple Markov chains with different temperature coefficients; sampling each of the Markov chains multiple times; exchanging the temperature coefficients between different Markov chains; obtaining and comparing the cuts of different Markov chains to obtain the Markov chain with the smallest cut; and obtaining the optimized hypergraph based on the Markov chain with the smallest cut.

[0010] Optionally, the circuit simulation method also includes coarsening the first hypergraph by at least one level to obtain a minimum hypergraph; performing initial partitioning on the minimum hypergraph to obtain an initial partitioning result; mapping the initial partitioning result to the hypergraph before coarsening step by step, and optimizing it using the FM algorithm based on the parallel tempering algorithm.

[0011] Optionally, the coarsening of the first hypergraph by at least one level to obtain a minimum hypergraph includes performing a first coarsening on the first hypergraph to obtain a second hypergraph, wherein the number of vertices of the second hypergraph is less than the number of vertices of the first hypergraph; performing a second coarsening on the second hypergraph to obtain a third hypergraph, wherein the number of vertices of the third hypergraph is less than the number of vertices of the second hypergraph; performing at least one level coarsening on the third hypergraph until the minimum hypergraph is obtained, wherein the number of vertices of the minimum hypergraph is less than the number of vertices of any remaining hypergraphs; mapping the result of the initial partitioning to the previous level hypergraph step by step includes mapping the partitioning result of the hypergraph with more coarsening times in the two adjacent hypergraphs to the hypergraph with fewer coarsening times according to the mapping relationship of vertices constructed between the two adjacent hypergraphs during the coarsening process; and optimizing using the FM algorithm based on the parallel tempering algorithm includes optimizing according to cutting and the FM algorithm based on the parallel tempering algorithm, so that the optimized cutting is less than the cutting before optimization.

[0012] Optionally, the coarsening includes clustering similar vertices according to similarities between vertices to form coarsened vertices; and forming a next-level hypergraph according to the coarsened vertices.

[0013] Optionally, performing initial partitioning on the minimum hypergraph to obtain the initial partitioning result includes obtaining a weight threshold; dividing the vertices of the minimum hypergraph into two different blocks, wherein the sum of the weights of the vertices in the two different blocks does not exceed the weight threshold.

[0014] Optionally, the circuit simulation method further comprises acquiring the number of divided blocks and an unbalance parameter, wherein the number of divided blocks is used to determine the number of coarsening times; and the unbalance parameter is used to determine the maximum weight sum and the minimum weight sum of each block during division.

[0015] Optionally, the circuit simulation method further includes obtaining the number of partition blocks; recursively partitioning the first hypergraph according to the number of partition blocks to obtain the optimized hypergraph.

[0016] According to another aspect of the present invention, there is provided a circuit simulation device based on hypergraph partitioning, comprising an acquisition unit for acquiring a circuit netlist; a modeling unit for parsing the circuit netlist and establishing a first hypergraph; an optimization unit for optimizing the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; and a computing unit for performing parallel simulation operations on the optimized hypergraph.

[0017] According to another aspect of the present invention, there is provided a server, comprising a processor; and a memory for storing one or more programs; wherein, when the one or more programs are executed by the processor, the processor implements any one of the circuit simulation methods described above.

[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, any circuit simulation method as described above is implemented.

[0019] According to the circuit simulation method and device based on hypergraph partitioning, server and storage medium of the embodiments of the present invention, optimization based on the parallel tempering algorithm can effectively search the solution space and obtain better partitioning results, thereby shortening the subsequent simulation time.

[0020] Furthermore, by using a hypergraph partitioning method based on a parallel tempering algorithm, a partition with smaller cuts can be obtained, and the partitioning results can be output for subsequent simulations.

[0021] Furthermore, the number of partition blocks and the imbalance parameters can be set independently, which can utilize more prior knowledge to improve the partition efficiency.

[0022] Furthermore, a hypergraph partitioning method based on a parallel tempering algorithm is used to partition the hypergraph quickly and accurately. The weight of each block is close and the communication cost between blocks is low. The accurate and efficient partitioning shortens the time for subsequent simulations. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0024] Figure 1A method flow chart of a circuit simulation method based on hypergraph partitioning according to Embodiment 1 of the present invention is shown.

[0025] Figure 2 A method flow chart of a circuit simulation method based on hypergraph partitioning according to the second embodiment of the present invention is shown.

[0026] Figure 3 A flow chart of a method for optimization based on a parallel tempering algorithm according to Embodiment 2 of the present invention is shown.

[0027] Figure 4 A schematic diagram of a circuit simulation device based on hypergraph partitioning according to an embodiment of the present invention is shown.

[0028] Figure 5 A schematic diagram of the structure of a server according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0029] Various embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. In each of the accompanying drawings, identical elements are represented by identical or similar reference numerals. For the sake of clarity, the various parts in the accompanying drawings are not drawn to scale. In addition, some well-known parts may not be shown in the drawings.

[0030] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. Many specific details of the present invention, such as the structure, materials, dimensions, processing technology and techniques of the components are described below to provide a clearer understanding of the present invention. However, as those skilled in the art will appreciate, the present invention may be implemented without following these specific details.

[0031] It should be understood that when describing the structure of a component, when a layer or a region is referred to as being "on" or "over" another layer or another region, it may mean that it is directly on the other layer or another region, or that other layers or regions are included between it and the other layer or another region. Moreover, if the component is turned over, the layer or a region will be "below" or "beneath" another layer or another region.

[0032] In mathematics, a hypergraph is a generalization of a general graph, where the edges in a hypergraph can connect any number of vertices. In general, a hypergraph H can be represented as a vertex-edge pair H = (X, E), where X is the set of all vertex elements and E is a non-empty subset of X. If P(x)\{0} represents the set of all subsets of X, then E is a subset of P(X)\{0}, which is called a hyperedge or edge.

[0033] During the circuit simulation process, after the simulator stores the netlist in memory, it usually uses a hypergraph partitioning tool to divide the circuit into several non-overlapping sub-modules, and then distributes these modules to different CPUs for calculation. Then the top layer is solved, and the solution is substituted back into each sub-module to complete the solution of the sub-module.

[0034] The circuit hypergraph partitioning problem is described as follows: an undirected weighted hypergraph consists of vertices and hyperedges, the weights of vertices and hyperedges are c and w respectively, and a hyperedge is a set of vertices. A k-way partitioning problem is to partition the vertices of the hypergraph into k different blocks ∏ = {V 1 ,V 2 ,…,V k}, and these blocks satisfy the condition and The constraints of the partition are: given an imbalance parameter ε, each block V of the k-way partition i Satisfy the conditions c(·) represents the weight of a block. Specifically, the requirement of hypergraph partitioning is: given a required number of blocks k to be partitioned, the smaller the cut, the better. The current binary partition is the intermediate result of partitioning into k blocks. The binary partition also requires that when the hypergraph is divided into two parts, the smaller the cut, the better.

[0035] Hypergraph partitioning is an NP-Hard problem in computational theory. Hypergraph partitioning methods can use a multi-level recursive algorithm to achieve high-quality partitioning. The multi-level algorithm is divided into coarsening, initial partitioning, and optimization stages. The FM (Fiduccia-Matheyses) algorithm can be used in the optimization stage. The FM algorithm is a hypergraph partitioning heuristic algorithm based on movement. The FM algorithm is executed multiple times to iteratively improve the quality of the solution. Each time the FM algorithm is executed, the algorithm moves the vertices with the highest gain (the size of the cut reduced by moving the vertex) in turn, and temporarily allows the partitioning target to deteriorate.

[0036] Figure 1 FIG. 4 is a flow chart of a method for circuit simulation based on hypergraph partitioning according to Embodiment 1 of the present invention. Figure 1 As shown, the circuit simulation method based on hypergraph partitioning according to the first embodiment of the present invention includes the following steps:

[0037] In step S101, a circuit netlist is obtained;

[0038] A circuit netlist is obtained. The circuit netlist is input by a user, for example.

[0039] In step S102, the circuit netlist is parsed to create a first hypergraph;

[0040] The obtained circuit netlist is parsed, and a first hypergraph is established according to the circuit netlist. Optionally, the circuit is modeled as a first hypergraph according to the connection relationship of the circuit, wherein the vertices of the first hypergraph correspond to the components of the circuit, and the hyperedges of the first hypergraph correspond to the nodes of the circuit.

[0041] In step S103, the first hypergraph is optimized according to the parallel tempering algorithm to obtain an optimized hypergraph;

[0042] The first hypergraph is optimized according to the parallel tempering algorithm to obtain the optimized hypergraph. Among them, the parallel tempering algorithm adopts a method similar to tempering heating, allowing the low-temperature configuration and the high-temperature configuration to exchange to improve statistical sampling. The parallel tempering algorithm is also called the replica exchange method, which can run multiple replicas under different conditions. For the canonical ensemble, we generally choose temperature as the change condition between different replicas, so that a series of replicas run under different temperature conditions, and then perform parallel canonical ensemble simulations under these different temperature conditions. After a period of simulation, we can design a Monte Carlo process to try to exchange a pair of adjacent temperature configurations according to a certain probability. If the exchange is successful, the pair of new configurations will run under the new temperature conditions respectively; if the exchange fails, the pair of configurations will keep the original temperature. Repeat this process every fixed exchange attempt interval until the end of the simulation. The parallel tempering algorithm has natural parallelism and can be easily and quickly parallelized. The parallel tempering algorithm allows a parallel computing resource (node, processor or thread, etc.) to run a simulation under ensemble conditions, and then try to exchange temperature or configuration at regular intervals, without requiring a lot of secondary development work for existing codes and algorithms.

[0043] Optionally, optimizing the first hypergraph according to the parallel tempering algorithm to obtain the optimized hypergraph includes: constructing multiple Markov chains with different temperature coefficients; sampling each Markov chain multiple times; exchanging the temperature coefficients between different Markov chains; obtaining and comparing the cuts of different Markov chains to obtain the Markov chain with the smallest cut; and obtaining the optimized hypergraph based on the Markov chain with the smallest cut.

[0044] Optionally, the circuit simulation method according to the embodiment of the present invention further includes obtaining the number of partition blocks; and recursively partitioning the first hypergraph according to the number of partition blocks to obtain an optimized hypergraph.

[0045] In step S104, parallel simulation operations are performed on the optimized hypergraph.

[0046] Perform parallel simulation operations on the optimized hypergraph.

[0047] In an optional embodiment of the present invention, the circuit simulation method further includes coarsening the first hypergraph at least one level to obtain a minimum hypergraph; performing an initial partitioning on the minimum hypergraph to obtain an initial partitioning result; mapping the initial partitioning result to the hypergraph before coarsening step by step, and optimizing it using the FM algorithm based on the parallel tempering algorithm. Optionally, coarsening includes clustering similar vertices according to the similarity between vertices to form coarsened vertices; and forming a next-level hypergraph according to the coarsened vertices. Optionally, performing an initial partitioning on the minimum hypergraph to obtain an initial partitioning result includes obtaining a weight threshold; dividing the vertices of the minimum hypergraph into two different blocks, wherein the sum of the weights of the vertices in the two different blocks does not exceed the weight threshold. Optionally, the weight of the first hypergraph is determined according to the computational amount of each device in the simulation; during the coarsening process, if multiple vertices form a new vertex, then the weight of the new vertex is the sum of the weights of the multiple vertices. Hyperedges have no weight (or a weight of 1) in the initial hypergraph. In the process of coarsening, the clustering of vertices will also cause the clustering of some hyperedges. Then the weight of the new hyperedges formed is equal to the sum of the weights of the original hyperedges.

[0048] Optionally, performing at least one level of coarsening on the first hypergraph to obtain a minimum hypergraph includes performing a first coarsening on the first hypergraph to obtain a second hypergraph, wherein the number of vertices of the second hypergraph is less than the number of vertices of the first hypergraph; performing a second coarsening on the second hypergraph to obtain a third hypergraph, wherein the number of vertices of the third hypergraph is less than the number of vertices of the second hypergraph; performing at least one level of coarsening on the third hypergraph until a minimum hypergraph is obtained, wherein the number of vertices of the minimum hypergraph is less than the number of vertices of any of the remaining hypergraphs. Mapping the results of the initial partitioning to the upper level hypergraph step by step includes mapping the partitioning results of the hypergraph with more coarsening times in the two adjacent hypergraphs to the hypergraph with fewer coarsening times according to the mapping relationship of vertices constructed between the two adjacent hypergraphs during the coarsening process; optimizing using the FM algorithm based on the parallel tempering algorithm includes optimizing according to cutting and the FM algorithm based on the parallel tempering algorithm, so that the optimized cutting is less than the cutting before optimization.

[0049] In an optional embodiment of the present invention, the circuit simulation method further includes obtaining the number of partition blocks and an unbalanced parameter, wherein the number of partition blocks is used to determine the number of coarsening times; the unbalanced parameter is used to determine the maximum weight sum and the minimum weight sum of each block during partitioning, and the unbalanced parameter is used to determine the maximum weight sum and the minimum weight sum of each block during partitioning. Assuming that the weight sum of all vertices in the hypergraph is w, and the unbalanced parameter is ε, then the maximum weight sum of block 0 and block 1 is max=(1+ε)*w / 2, and the minimum weight sum is min=(1-ε)*w / 2. When partitioning, the weight sum of block 0 and block 1 is required to be between max and min. The constraint condition of hypergraph partitioning is that, given an unbalanced parameter, each block of k-way partitioning satisfies the above condition. It should be noted that there are many objective functions for hypergraph partitioning, and the objective function preferably used in the embodiment of the present invention is cut-net. Cutting refers to the weight sum of all cut edges. Cutting edges are vertices connected by this hyperedge in different blocks. The goal of hypergraph partitioning is to minimize the cut of partitioning k blocks under the premise of satisfying the constraint conditions.

[0050] According to the circuit simulation method based on hypergraph partitioning in the above embodiment, the modeled hypergraph can be divided into a plurality of blocks of similar size with fewer cuts, thereby shortening the subsequent simulation time.

[0051] Each vertex of the hypergraph has an ID (identification), which corresponds to which block the vertex belongs to. Then these ID information will be used in the subsequent simulation process. Since each vertex corresponds to a device, in the subsequent process, the devices belonging to the same block establish circuit equations for solution, so that different blocks are equivalent to being independent of each other and can be run in parallel to speed up the simulation. Size approximation is the weight and approximation of the vertices in each block, and the degree of approximation is determined by the imbalance parameter entered by the user.

[0052] Figure 2 A method flow chart of a circuit simulation method based on hypergraph partitioning according to the second embodiment of the present invention is shown. Figure 3 The flowchart of the method for optimizing according to the parallel tempering algorithm according to the second embodiment of the present invention is shown. Figure 2 and Figure 3 As shown, the circuit simulation method according to the second embodiment of the present invention includes the following steps:

[0053] In step S201, a circuit netlist and options input by a user are received;

[0054] Receive the circuit netlist and option settings input by the user. Optionally, the option settings input by the user specifically include: at least one of the user's target number of partition blocks, the maximum imbalance (imbalance parameter) between the partition blocks, etc.

[0055] In step S202, the circuit netlist is parsed to construct a hypergraph model of the circuit;

[0056] Parse the circuit netlist and construct a hypergraph model of the circuit. A hypergraph contains two elements: vertices and hyperedges. When modeling, each device in the circuit corresponds to a vertex in the hypergraph; each node in the circuit corresponds to a hyperedge in the hypergraph. Each hyperedge in the hypergraph can connect multiple vertices, indicating that the node in the circuit is connected to the ports of multiple devices. The vertex of the hypergraph is connected to a hyperedge, indicating that the port of the corresponding device is connected to a node. Optionally, according to the connection relationship of the circuit, the input circuit is modeled as a hypergraph, and the vertices and hyperedges of the hypergraph correspond to the devices and nodes in the circuit respectively. Constructing a hypergraph based on the connection situation in the circuit can more intuitively reflect the structural information of the circuit.

[0057] In step S203, the hypergraph is coarsened level by level to reduce the size of the hypergraph;

[0058] The hypergraph is coarsened level by level to reduce the size of the hypergraph. Specifically, when clustering vertices, the adjacent vertices of each vertex are traversed, and the vertices connected by small and heavy hyperedges are (tended to be) clustered. The vertices in each cluster are merged into a new vertex, and new hyperedges are formed according to the connection relationship between the vertices to form the next level of hypergraph. After the next level of hypergraph is formed, the vertices continue to be clustered to form the next level of hypergraph... Repeat this clustering algorithm (coarsening level by level) until the number of vertices in the new hypergraph (the above-mentioned minimum hypergraph) is small enough, or the number of vertices reduced after clustering is too small.

[0059] In step S204, the minimum hypergraph is initially partitioned;

[0060] Perform binary partitioning on the minimum hypergraph to obtain an initial partitioning result. Each vertex of the minimum hypergraph has an id (identification), 0 or 1. 0 represents that the vertex belongs to block 0; 1 represents that the vertex belongs to block 1. If the ids of the vertices connected by an edge are both 0 and 1, it means that the net is a cut edge. The vertices and hyperedges of the minimum hypergraph obtained by step-by-step coarsening are greatly reduced compared to the largest hypergraph (the first hypergraph mentioned above), and the minimum hypergraph can retain the structural information of the first hypergraph. Therefore, the minimum hypergraph can be partitioned with high quality, and the partitioning reflects the partitioning of the first hypergraph to a certain extent. Optionally, a variety of different initial partitioning algorithms are used for the minimum hypergraph, and the result with the smallest cut is used as the initial partitioning result.

[0061] In step S205, the partitions are mapped level by level, and the partitions are optimized based on the FM algorithm with parallel tempering;

[0062] The initial partitioning results are mapped to the upper level hypergraph step by step (from the smallest hypergraph to the first hypergraph step by step), and the partitioning is optimized using the FM algorithm based on parallel tempering. According to the mapping relationship between the vertices of two adjacent hypergraphs, the partitioning results of the smaller hypergraph are mapped to the larger hypergraph. After the mapping, the partitioning on the larger hypergraph has a larger optimization space, and the partitioning results can be further optimized.

[0063] The FM algorithm based on the Parallel Tempering (PT) algorithm includes the following steps:

[0064] In step S301, a plurality of Markov chains with different temperature coefficients are constructed;

[0065] Multiple Markov chains are set, each Markov chain has the same starting state (partition) and a different temperature coefficient T, and the temperature coefficients of adjacent Markov chains are adjacent, 0≤T≤1.

[0066] In step S302, multiple sampling is performed on each Markov chain;

[0067] Perform a certain number of MCMC samplings on each Markov chain, that is, randomly select a new solution (new partition) in the neighborhood of the current partition of each chain. If the partition result of the new solution is better than the current partition, accept the new solution, otherwise accept the new solution according to the Metropolis criterion. The probability of accepting the new solution is Where T i is the temperature coefficient of chain i, ΔCUT=CUT old -CUT new During sampling, the smallest cut produced by each chain is recorded.

[0068] In step S303, the temperature coefficients between different Markovs are exchanged;

[0069] After a certain number of samplings, the temperature coefficients of different chains are exchanged according to the Metropolis-Hastings criterion, and the probability of accepting the exchange is α = min(1, e ΔTΔCUT ), where ΔT = T i -T j (T i is the temperature coefficient of chain i), ΔCUT=CUT i -CUT j (CUT i for the cleavage of chain i).

[0070] In step S304, the cuts of different Markov chains are obtained and compared to obtain the Markov chain with the smallest cut;

[0071] Repeat step S302 and step S303 for a certain number of iterations, obtain and compare the cuts of different Markov chains, take the minimum cut in all chains as the cut of the current hypergraph, and obtain the Markov chain with the minimum cut.

[0072] In step S305, an optimized hypergraph is obtained according to the Markov chain with the smallest cut.

[0073] The optimized hypergraph is obtained based on the Markov chain with the smallest cut.

[0074] Optionally, the method for generating a new solution is as follows: the traditional FM algorithm maintains two buckets, each bucket stores the vertices that may be moved in each block, and these vertices are sorted in descending order according to the gain. Gain refers to the size of the reduction in the cut after the vertex is moved. Therefore, in the FM algorithm based on parallel tempering, when selecting a new solution, multiple high-gain vertices are selected from each block, and then a vertex is randomly selected from these vertices. The partition generated by moving the vertex to another block is the generated new solution.

[0075] Optionally, the optimization process is to adjust the id of each vertex (the block to which the vertex belongs). After a vertex id changes, the hyperedge connected to it may change from a non-cut edge to a cut edge, or from a cut edge to a non-cut edge, thereby changing our goal-the cut. The optimization is to find a smaller cut than before optimization when changing the vertex id as much as possible.

[0076] In step S206, recursive partitioning is performed and the partitioning result is output.

[0077] According to the required number of partition blocks, recursive partitioning is performed (continuously coarsening-partitioning-optimizing according to the above steps), and the final partitioning result is output. Optionally, whether to further partition is determined according to the number of partition blocks input by the user. According to the partitioning result obtained in step S205, the hypergraph is divided into two parts to form two new hypergraphs, and steps S203 to S205 are repeated until the number of partition blocks reaches the target number of partition blocks.

[0078] According to another aspect of the present invention, a circuit simulation device based on hypergraph partitioning is provided. Figure 4 FIG. 2 shows a schematic diagram of a circuit simulation device based on hypergraph partitioning according to an embodiment of the present invention. Figure 4 As shown, the circuit simulation device according to the embodiment of the present invention is used to execute the circuit simulation method as described above, and the circuit simulation device includes an acquisition unit 110 , a modeling unit 120 , an optimization unit 130 and a calculation unit 140 .

[0079] Specifically, the acquisition unit 110 is used to acquire a circuit netlist.

[0080] The modeling unit 120 is used to parse the circuit netlist and establish a first hypergraph;

[0081] The optimization unit 130 is used to optimize the first hypergraph according to the parallel tempering algorithm to obtain an optimized hypergraph.

[0082] The operation unit 140 is used to perform parallel simulation operations on the optimized hypergraph.

[0083] Figure 5 FIG. 2 shows a schematic diagram of the structure of a server according to an embodiment of the present invention. Figure 5 The present disclosure also proposes a block diagram of an exemplary server suitable for implementing the embodiments of the present disclosure. It should be understood that Figure 5 The server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0084] like Figure 5 As shown, the server 200 is in the form of a general-purpose computing device. The components of the server 200 may include, but are not limited to: one or more processors or processing units 210, a memory 220, and a bus 201 connecting different system components (including the memory 220 and the processing unit 210).

[0085] Bus 201 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0086] The server 200 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the server 200, including volatile and non-volatile media, removable and non-removable media.

[0087] System memory 220 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 221 and / or cache memory 222. Server 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 223 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 201 via one or more data medium interfaces. Memory 220 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of each embodiment of the present disclosure.

[0088] A program / utility 224 having a set (at least one) of program modules 2241 may be stored, for example, in the memory 220, such program modules 2241 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 2241 generally perform the functions and / or methods of the embodiments described in the embodiments of the present disclosure.

[0089] Further, the server 200 may also be connected to a display 300 for displaying the results of the screening and sorting. The display 300 may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display 300 may also be a touch screen.

[0090] Further, the server 200 can also communicate with one or more devices that enable users to interact with the server 200, and / or communicate with any device (such as a network card, a modem, etc.) that enables the server 200 to communicate with one or more other computing devices. Such communication can be performed through an input / output (I / O) interface 230. In addition, the server 200 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 240. As shown in the figure, the network adapter 240 communicates with other modules of the server 200 through a bus 201. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the server 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0091] The processing unit 210 executes various functional applications and data processing by running the programs stored in the system memory 220, such as implementing the circuit simulation method for the device modeling tool provided in the embodiment of the present disclosure.

[0092] An embodiment of the present invention also provides a computer-readable storage medium having a computer program (or computer executable instructions) stored thereon. When the program is executed by a processor, it is used to execute the circuit simulation method provided by the embodiment of the present disclosure, the method comprising: obtaining a circuit netlist; parsing the circuit netlist to establish a first hypergraph; optimizing the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; and performing parallel simulation operations on the optimized hypergraph.

[0093] The computer storage medium of the embodiment of the present disclosure may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it.

[0094] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0095] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0096] Computer program code for performing the operation of the disclosed embodiments may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​(such as Java, Smalltalk, C++), and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0097] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0098] According to the embodiments of the present invention as described above, these embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made based on the above description. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can make good use of the present invention and the modified use based on the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A circuit simulation method based on hypergraph partitioning, comprising: Get the circuit netlist; Parsing the circuit netlist to establish a first hypergraph; Optimizing the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; Performing parallel simulation operations on the optimized hypergraph, The step of optimizing the first hypergraph according to the parallel tempering algorithm to obtain an optimized hypergraph includes: Construct multiple Markov chains with different temperature coefficients; Performing multiple sampling on each of the Markov chains; exchanging temperature coefficients between different Markov chains; Obtaining and comparing the cuts of different Markov chains to obtain a Markov chain with the smallest cut; Obtaining the optimized hypergraph according to the Markov chain with the smallest cut; The circuit simulation method further includes: Coarsening the first hypergraph by at least one level to obtain a minimum hypergraph; Performing initial partitioning on the minimum hypergraph to obtain an initial partitioning result; Mapping the initial partitioning result to the hypergraph before coarsening step by step, and optimizing it using the FM algorithm based on the parallel tempering algorithm; The step of coarsening the first hypergraph by at least one level to obtain a minimum hypergraph comprises: Performing a first coarsening on the first hypergraph to obtain a second hypergraph, wherein the number of vertices of the second hypergraph is less than the number of vertices of the first hypergraph; Performing a second coarsening on the second hypergraph to obtain a third hypergraph, wherein the number of vertices of the third hypergraph is less than the number of vertices of the second hypergraph; Performing at least one level of coarsening on the third hypergraph until the minimum hypergraph is obtained, wherein the number of vertices of the minimum hypergraph is less than the number of vertices of any other hypergraph; Mapping the results of the initial partitioning to the upper level hypergraph step by step includes: According to the mapping relationship of vertices constructed between two adjacent hypergraphs during the coarsening process, the partition result of the hypergraph with more coarsening times in the two adjacent hypergraphs is mapped to the hypergraph with less coarsening times; The optimization using the FM algorithm based on the parallel tempering algorithm includes: Optimization is performed according to the cutting and the FM algorithm based on the parallel tempering algorithm, so that the cutting after optimization is smaller than the cutting before optimization.

2. The circuit simulation method according to claim 1, wherein: The parsing of the circuit netlist to establish a first hypergraph comprises: According to the connection relationship of the circuit, the circuit is modeled as the first hypergraph, Among them, the vertices of the first hypergraph correspond to the devices of the circuit; and the hyperedges of the first hypergraph correspond to the nodes of the circuit.

3. The circuit simulation method according to claim 1, wherein: The roughening includes: According to the similarity between vertices, similar vertices are clustered to form coarsened vertices; A next level hypergraph is formed according to the coarsened vertices.

4. The circuit simulation method according to claim 1, wherein: The initial partitioning of the minimum hypergraph to obtain the initial partitioning result comprises: Get the weight threshold; Divide the vertices of the minimum hypergraph into two different blocks, The sum of the weights of the vertices in the two different blocks does not exceed the weight threshold.

5. The circuit simulation method according to claim 1, further comprising: Get the number of partition blocks and imbalance parameters, The number of divided blocks is used to determine the number of coarsening times; The imbalance parameter is used to determine the maximum weight sum and the minimum weight sum of each block during partitioning.

6. The circuit simulation method according to claim 1, further comprising: Get the number of partition blocks; The first hypergraph is recursively divided according to the number of division blocks to obtain the optimized hypergraph.

7. A circuit simulation device based on hypergraph partitioning, comprising: An acquisition unit, used for acquiring a circuit netlist; A modeling unit, used for parsing the circuit netlist and establishing a first hypergraph; An optimization unit, configured to optimize the first hypergraph according to a parallel tempering algorithm to obtain an optimized hypergraph; as well as A computing unit, used for performing parallel simulation computing on the optimized hypergraph, The step of optimizing the first hypergraph according to the parallel tempering algorithm to obtain an optimized hypergraph includes: Construct multiple Markov chains with different temperature coefficients; Performing multiple sampling on each of the Markov chains; exchanging temperature coefficients between different Markov chains; Obtaining and comparing the cuts of different Markov chains to obtain a Markov chain with the smallest cut; Obtaining the optimized hypergraph according to the Markov chain with the smallest cut; The circuit simulation device is also used for: Coarsening the first hypergraph by at least one level to obtain a minimum hypergraph; Performing initial partitioning on the minimum hypergraph to obtain an initial partitioning result; Mapping the initial partitioning result to the hypergraph before coarsening step by step, and optimizing it using the FM algorithm based on the parallel tempering algorithm; The step of coarsening the first hypergraph by at least one level to obtain a minimum hypergraph comprises: Performing a first coarsening on the first hypergraph to obtain a second hypergraph, wherein the number of vertices of the second hypergraph is less than the number of vertices of the first hypergraph; Performing a second coarsening on the second hypergraph to obtain a third hypergraph, wherein the number of vertices of the third hypergraph is less than the number of vertices of the second hypergraph; Performing at least one level of coarsening on the third hypergraph until the minimum hypergraph is obtained, wherein the number of vertices of the minimum hypergraph is less than the number of vertices of any other hypergraph; Mapping the results of the initial partitioning to the upper level hypergraph step by step includes: According to the mapping relationship of vertices constructed between two adjacent hypergraphs during the coarsening process, the partition result of the hypergraph with more coarsening times in the two adjacent hypergraphs is mapped to the hypergraph with less coarsening times; The optimization using the FM algorithm based on the parallel tempering algorithm includes: Optimization is performed according to the cutting and the FM algorithm based on the parallel tempering algorithm, so that the cutting after optimization is smaller than the cutting before optimization.

8. A server, comprising: processor; A memory for storing one or more programs; When the one or more programs are executed by the processor, the processor implements the circuit simulation method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, wherein: When the program is executed by a processor, the circuit simulation method according to any one of claims 1 to 6 is implemented.