Parallel simulation processing method for gate-level circuits, and computer-readable storage medium
Through the parallel simulation processing method, the gate-level circuit is divided into groups and cone-shaped segmentation, combined with the priority allocation algorithm, solves the problems of high hardware cost and low simulation efficiency in the existing technology, and achieves efficient parallel simulation.
Patent Information
- Application Number
- CN202110438114.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-04-22
AI Technical Summary
In the existing technology, in gate-level circuit simulation, high-performance hardware acceleration methods lead to high hardware costs and high energy consumption, and traditional algorithms cannot effectively perform parallel simulation, resulting in low simulation efficiency.
Parallel simulation processing method is adopted, and the adjacency matrix based on the gate-level circuit is divided into groups. The super-point diagram and cone segmentation algorithm are used to divide the circuit into partitions that can be processed in parallel, and the event queue is generated through the priority allocation algorithm to realize the intra-group Parallel simulation between groups.
It effectively reduces the simulation complexity and the number of edges to be cut off, improves the simulation efficiency, avoids the memory limitations of traditional algorithms and the inconvenience of the message passing mode, and achieves parallelization and scalability of simulation.
Smart Images

Figure CN113095022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gate-level circuit simulation, and in particular to a parallel simulation processing method capable of improving gate-level circuit simulation efficiency. Background Art
[0002] With the continuous development of integrated circuits, whether it is chip forward design or reverse design, they are increasingly dependent on tools, which poses a higher challenge to the processing speed of related software. Completely free and open source digital chip simulators include Icarus Verilog, Yosys, etc.
[0003] During the simulation process, affected by the scale of circuit design, the simulation time of circuits of different scales varies greatly. The simulation of large-scale circuits takes a very long time, while the simulation time of small circuits is in the microsecond level. Accelerating circuit simulation is a key issue that needs to be effectively solved in the chip simulation stage. The running speed of most software depends greatly on the scale of the data set, and the efficiency depends on the computing performance. The use of hardware with better computing performance is now a widely used and effective method to reduce processing time. In order to solve this problem, the use of hardware with excellent computing performance such as multi-core processors and GPUs has become one of the main methods to improve production efficiency in recent years. However, the GPU heterogeneous architecture has high requirements on the energy consumption and cost of the computing platform, and the GPU-based software transplantation development cycle is long, which is not conducive to the rapid realization of short-term software acceleration.
[0004] Therefore, improving simulation efficiency while taking into account hardware costs and energy consumption is a technical problem that needs to be urgently solved in the industry. Summary of the invention
[0005] In order to solve the technical problem in the prior art that simulation acceleration uses high-performance hardware, which leads to high hardware cost, the present invention proposes a parallel simulation processing method for gate-level circuits and a computer-readable storage medium.
[0006] The parallel simulation processing method of gate-level circuits proposed by the present invention comprises:
[0007] Step 1, based on the adjacency matrix of the gate-level circuit, using a first preset segmentation algorithm to segment the graph corresponding to the gate-level circuit into multiple clusters;
[0008] Step 2, taking each group as a superpoint, and encapsulating the data of each superpoint using the first data structure;
[0009] Step 3, based on the superpoint graph formed by all superpoints, using a second preset segmentation algorithm to divide all superpoints into a plurality of partitions that can be processed in parallel, and encapsulating the partition data using a second data structure;
[0010] Step 4: Based on the superpoint data and the partition data, a preset priority allocation algorithm is used to generate a clique priority event queue between cliques and a node priority event queue within a clique;
[0011] Step 5: Simulate the gate-level circuit according to the simulation order defined by the node priority event queue and the group priority event queue.
[0012] Further, the step 1 comprises:
[0013] Step 1.1, preset four sets, namely: T set recording all the confirmed maximal cluster lists, H set recording the nodes that have been added to the current maximal cluster, F set recording the nodes that may be added to the current maximal cluster, and A set recording the nodes that have been added to a maximal cluster that was previously split; the initial elements of F set are all nodes;
[0014] Step 1.2, according to the maximum clique partitioning principle, traverse each node and its successor nodes until all nodes and their successor nodes are traversed and all the partitioned cliques are obtained;
[0015] Each time the traversed node is taken out from the F set and added to the H set, the F set and the A set are updated at the same time;
[0016] When the F set is not empty and the A set is empty, the current maximal clique in the H set has not been split, so continue traversing the next node;
[0017] When both the F set and the A set are empty, the current maximal clique in the H set is split, and all the nodes in the H set are added to the T set as a maximal clique;
[0018] When the F set is empty and the A set is not empty, the current maximal clique in the H set overlaps with the maximal clique that has been split in the T set, so the traversal of the next node continues;
[0019] Step 1.3, intersect the clusters obtained by step 1.2 to obtain the common nodes between the clusters;
[0020] Step 1.4, compare the sizes of two clusters with common nodes, delete the common nodes from the smaller cluster, and obtain all clusters after segmentation.
[0021] Furthermore, in step 1, each node that is not segmented into a maximum cluster is represented as a cluster.
[0022] Further, the step 2 comprises:
[0023] Step 2.1, record the nodes contained in each group, and each group is uniquely identified as a superpoint;
[0024] Step 2.2, traverse the nodes in each superpoint, record the relationship between superpoints and nodes, and the relationship between nodes;
[0025] Step 2.3, based on the relationship between the superpoint and the node and the relationship between the node and the node, obtain the connection relationship between the superpoint and the superpoint;
[0026] Step 2.4: Use the first data structure to encapsulate the superpoints and the connection relationships between the superpoints.
[0027] Further, the content of the first data structure includes: the unique identifier of the superpoint, information of all nodes contained in the superpoint, the unique identifier of the predecessor superpoint of the superpoint, information of the nodes in the superpoint connected to the predecessor superpoint, information of the nodes in the predecessor superpoint connected to the superpoint, the unique identifier of the successor superpoint of the superpoint, information of the nodes in the superpoint connected to the successor superpoint, and information of the nodes in the successor superpoint connected to the superpoint.
[0028] Furthermore, the step 3 specifically includes: using a cone segmentation method to segment all super points into multiple cone regions, and encapsulating each cone region and the super points within each cone region, and the connection relationship between super points between cone regions using a second data structure.
[0029] Furthermore, the content of the second data structure includes: a unique identifier of the conical region, information of all superpoints contained in the conical region, superpoints in the conical region that serve as predecessor superpoints of other conical regions and their connection information, and superpoints in the conical region that serve as successor superpoints of other conical regions and their connection information.
[0030] Further, in step 4, it is determined based on the superpoint data whether there is a ring circuit in the cluster corresponding to the superpoint. If there is a ring circuit, the nodes related to the ring circuit of the cluster are time-extended, and a preset priority allocation algorithm is used based on the superpoint data after the time expansion to generate a node priority event queue within the superpoint; if there is no ring circuit, a preset priority allocation algorithm is used based on the superpoint data to generate a node priority event queue within the superpoint.
[0031] Furthermore, the number of expansions k for the timing expansion of the related nodes of the ring circuit of the group is calculated according to the formula It is calculated that if there are a groups of gate-level circuit main input stimuli in the cluster, k satisfies 1≤k≤a, where m is the maximum memory available to the cluster, n is the number of nodes in the cluster, and p is the number of pins of all nodes in the cluster.
[0032] Furthermore, in step 5, a logic processing unit is allocated to each conical area to realize parallel simulation processing between the conical areas. The logic processing unit determines the simulation order of the cluster within its corresponding conical area according to the cluster priority event queue, and determines the simulation order of the nodes within the cluster according to the node priority event queue.
[0033] Furthermore, in step 5, when performing parallel simulation on the gates represented by the nodes within the cluster, the following steps are included:
[0034] Step 5.1.1, setting three global linear arrays, namely: a first array for storing information of the main input of the gate-level circuit and output information generated by each gate, a second array for storing information received by each pin, and a third array for storing the output value of the gate and its output time and the output value of the main output of the gate-level circuit and its output time;
[0035] Step 5.1.2, during simulation operation, updating the first array to obtain the information of the main input;
[0036] Step 5.1.3, updating the information received by each pin of the current priority gate in the second array based on the information of the main input;
[0037] Step 5.1.4, after the gate of the current priority performs a logic operation, the output value and output time of the gate of the current priority are stored in the third array, and the gate of the next priority is used as the gate of the current priority to proceed to the next step;
[0038] Step 5.1.5, updates the output information generated by each gate in the first array based on the value currently stored in the third array, and updates the information received by each pin of the current priority gate in the second array based on the value currently stored in the first array, and returns to step 5.1.4 for loop execution until the parallel simulation of the gates represented by the nodes in the group is completed.
[0039] The computer-readable storage medium proposed in the present invention is used to store a computer program, and when the computer program is running, the parallel simulation processing method of the gate-level circuit of the above technical solution is executed.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The prior art obtains the connection relationship between nodes in the netlist generated after the hardware description language engineering code is synthesized, and then divides the nodes in the netlist (corresponding to the gates of the gate-level circuit) into levels according to the logical calculation order. The main feature of the existing segmentation method of this technical solution is to convert the gate circuit netlist diagram into a directed graph representation based on its timing partial order relationship, and convert the originally complex gate circuit event segmentation problem into a clique segmentation problem, and propose a fast and parallel clique segmentation method (Bron-Kerbosch extended algorithm) to find all independent complete graph structures in the graph and encapsulate them. The clique encapsulated graph can be segmented again to effectively reduce the number of cut edges.
[0042] The present invention adopts a three-stage parallel algorithm for each logic unit inside the clique, effectively solving the problem that the traditional CMB algorithm simulation cannot expand the parallel simulation to the entire circuit due to the limitation of limited memory; the method of dividing threads into the same process is adopted to create a global array in the shared memory, effectively avoiding the inconvenience caused by the traditional algorithm message passing mode. In the simulation inside the clique, the present invention proposes a method of timing expansion, which makes the simulation both scalable and bounded compared with the original one.
[0043] The present invention uses a cone partitioning algorithm, and each cone graph is processed by a logical processing unit LP. Each logical processing unit is assigned to a working node. A working node is generally considered to be a machine. Each logical processing unit performs parallel simulation in a non-decreasing time scale order according to the priority allocation algorithm to determine the order of clique simulation. The optimistic synchronization algorithm TimeWarp is used between cliques, which can make more full use of the inherent parallelism of the simulation in coarse-grained parallel simulation compared to the optimistic algorithm. On the basis of traditional TimeWarp, we added a priority allocation algorithm to generate the order of activation simulation of cliques, forming the TimeWarp-P algorithm, which can simulate multiple cliques at the same time, making the simulation more parallel. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The present invention is described in detail below with reference to the embodiments and accompanying drawings, wherein:
[0045] Figure 1 It is a brief flow chart of the present invention.
[0046] Figure 2 This is the changing process of the diagram corresponding to the twice-divided gate-level circuit of the present invention.
[0047] Figure 3 It is the segmentation result of the existing maximum clique algorithm.
[0048] Figure 4This is the segmentation process of the maximum clique increasing algorithm of the present invention.
[0049] Figure 5 It is a specific example of the file file2 of the present invention.
[0050] Figure 6 It is a specific example of file file3 of the present invention.
[0051] Figure 7 It is a specific example of file file4 of the present invention.
[0052] Figure 8 It is a specific example of file file5 of the present invention.
[0053] Fig. 9 It is the segmentation result of the gate-level circuit of the example of the present invention after cone partitioning.
[0054] Fig.10 is an example directed graph used to illustrate the priority assignment algorithm of the present invention.
[0055] Fig.11 It is a ring circuit according to an example of the present invention.
[0056] Fig.12 yes Fig.11 Circuit diagram of the ring circuit after timing expansion.
[0057] Fig.13 It is a schematic diagram of the three-stage processing process of the present invention.
[0058] Fig.14 It is an example circuit diagram used to illustrate three parallel simulations of the present invention.
[0059] Fig.15 It is a schematic diagram of the data storage process of the CMB-P algorithm of the present invention. DETAILED DESCRIPTION
[0060] 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 used to limit the present invention.
[0061] 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.
[0062] The principle of the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0063] like Figure 1 As shown, the overall flow chart of the parallel simulation processing method of the gate-level circuit of the present invention is mainly divided into a data preprocessing stage, a priority allocation stage and a simulation stage. In one embodiment, Figure 1 The number 1 in the figure indicates that the basic data involved in the data preprocessing stage is the adjacency matrix of the undirected graph obtained based on the original netlist file. The number 2 indicates that the basic data involved in the cone partitioning algorithm is a JSON file that stores the relationships between clusters. The number 3 indicates Figure 1 The calculation basic data involved in the priority allocation algorithm on the left is a JSON file that stores the relationships between groups (numbers 2 and 3 represent the same file), number 4 represents Figure 1 The calculation basic data involved in the priority allocation algorithm on the right is a JSON file storing the cluster information in the cone area. Sequence number 5 indicates that the calculation basic data involved in the CMB-P algorithm of the present invention is a global priority array, and the JSON file represented by sequence number 3. Sequence number 6 indicates that the calculation basic data involved in the TimeWarp-P algorithm of the present invention is a global priority array, and the JSON file represented by sequence number 4. The following will introduce each stage and the calculation basic data involved in each stage in detail.
[0064] In the data preprocessing stage, the graph corresponding to the gate-level circuit is mainly segmented twice and the data is encapsulated twice. The first segmentation is based on the adjacency matrix of the gate-level circuit. The graph corresponding to the gate-level circuit is segmented into multiple clusters using the first preset segmentation algorithm. Then each cluster is used as a superpoint, and the first data structure is used to encapsulate the data of each superpoint. The second segmentation is based on the superpoint graph formed by all superpoints. The second preset segmentation algorithm is used to divide all superpoints into multiple partitions that can be processed in parallel, and the partition data is encapsulated using the second data structure. In the present invention, clusters and superpoints are equivalent in meaning, and the nodes they contain (nodes represent a gate) have the same content. When a cluster is represented as a point in the graph, the point is a superpoint.
[0065] In the data preprocessing stage, the adjacency matrix is used to store the graph relationship information stored in the original netlist file. The graph relationship information may refer to the directed graph corresponding to the gate-level circuit. The directed graph is then converted into an undirected graph during the calculation process and then the first segmentation is performed. The adjacency matrix may also be used to directly store the undirected graph corresponding to the gate-level circuit (in this case, the adjacency matrix is a symmetric adjacency matrix). Subsequently, based on the adjacency matrix and according to the principle of the maximum clique algorithm, the undirected graph corresponding to the gate-level circuit is segmented for the first time, and the corresponding data is encapsulated. In one embodiment, it may be specifically encapsulated as a JSON file, and the first encapsulated JSON file ( Figure 1 The file represented by sequence number 2 or sequence number 3) is used as the input of the cone partitioning algorithm for the second partitioning. After the second partitioning algorithm is completed, the second JSON file storing the cone partitioning result is output ( Figure 1 The file represented by serial number 4).
[0066] Figure 2 The figure shows the change process of the graph corresponding to the gate-level circuit in the data preprocessing stage. At the beginning, the adjacency matrix stores the directed graph corresponding to the gate-level circuit. According to the principle of the maximum clique algorithm, the nodes in the directed graph are divided into multiple maximal cliques, and then each maximal clique is represented as a superpoint to form a superpoint graph. The superpoint graph includes 6 superpoints V1-V6. Then the superpoint graph is divided for the second time. Based on the cone partitioning algorithm, it is divided into two cone areas. These two cone areas will be simulated in parallel.
[0067] In the priority allocation stage, based on the superpoint data and partition data (files represented by sequence number 4 and sequence number 2 or sequence number 3) in the data preprocessing stage, a preset priority allocation algorithm is used to generate a clique priority event queue between cliques and a node priority event queue within a clique. Specifically, the priority allocation algorithm is used to process the above two JSON files. The first JSON file generated by the maximum clique enhancement algorithm is processed by the priority allocation algorithm to generate a node priority event queue within the clique. The second JSON file generated by the cone partitioning algorithm is processed by the priority allocation algorithm to generate a clique priority event queue between cliques.
[0068] In the simulation phase, the gate-level circuit will be simulated according to the simulation order defined by the node priority event queue and the group priority event queue, that is, the priority event queue generated in the priority allocation phase is used as the initialization of the simulation process. The two JSON files generated in the data preprocessing step serve as a supplement to the circuit information required by the circuit in the simulation process.
[0069] Adjacency Matrix
[0070] The following describes in detail the process of using the adjacency matrix to store graph relationship information in the data preprocessing stage.
[0071] The original netlist file of the gate-level circuit is file1. The node information in file1 is read to extract the nodes and node relationships.
[0072] Create a one-dimensional array b to store the correspondence between node names (L_000000000017eaa0, ...) and array numbers (1, ...) to facilitate subsequent searches. At the same time, create a two-dimensional array a to store the relationship between nodes.
[0073] Loop through the node names in file1, and store the traversed nodes in array b in order to achieve the correspondence between array names and node names.
[0074] Loop through each node in file1, and loop through the outputs array of each node. The outputs array of each node stores all the successor nodes of the node (also called target nodes). Set the relationship [this node->target node] to 1, store it in array a, and change its relationship to undirected, that is, set the relationship [target node->this node] to 1, and store it in array a. Array a is the adjacency matrix of the undirected graph corresponding to the gate-level circuit.
[0075] [First split]
[0076] The first segmentation process in the data preprocessing stage is described in detail below.
[0077] The maximum clique algorithm can find all cliques in the undirected graph corresponding to the gate-level circuit (clique, in English, is a subgraph of an undirected graph, in which there is an edge between any two nodes), such as Figure 3 As shown, the maximum clique algorithm can be used to find two cliques, namely clique1 and clique2, but there is a repeated node 4 between the two cliques found by the maximum clique algorithm, so the maximum clique algorithm needs to be improved to avoid repeated nodes. The first segmentation process of the present invention is based on the principle of the maximum clique algorithm to perform the first segmentation on the undirected graph of the gate-level circuit, but there are no repeated nodes between the segmented clusters. The new processing method based on the maximum clique algorithm in the present invention is called the maximum clique enhancement algorithm. The input of the maximum clique enhancement algorithm is the adjacency matrix of the undirected graph. Assume that in a specific application example, the adjacency matrix of the undirected graph corresponding to a specific example of the gate-level circuit is as shown below.
[0078]
[0079] The output content of the maximum clique enhancement algorithm of the present invention is: clique (4) 1 2 3 4; clique (3) 5 6 7. That is, there are no repeated nodes between clique 4 and clique 3.
[0080] The specific process of the maximum group enhancement algorithm is as follows:
[0081] Step 1.1, preset four sets, namely: T set recording all the confirmed maximal cluster lists, H set recording the nodes that have been added to the current maximal cluster, F set recording the nodes that may be added to the current maximal cluster, and A set recording the nodes that have been added to a maximal cluster that was previously split; the initial elements of F set are all nodes;
[0082] Step 1.2, according to the maximum clique partitioning principle, traverse each node and its successor nodes until all nodes and their successor nodes are traversed and all the partitioned cliques are obtained;
[0083] Each time the traversed node is taken out from the F set and added to the H set, the F set and the A set are updated at the same time;
[0084] When the F set is not empty and the A set is empty, the current maximal clique in the H set has not been split, so continue traversing the next node;
[0085] When both the F set and the A set are empty, the current maximal clique in the H set is split, and all the nodes in the H set are added to the T set as a maximal clique;
[0086] When the F set is empty and the A set is not empty, the current maximal clique in the H set overlaps with the maximal clique that has been split in the T set, so the traversal of the next node continues;
[0087] Step 1.3, intersect the clusters obtained by step 1.2 to obtain the common nodes between the clusters;
[0088] Step 1.4, compare the sizes of two clusters with common nodes, delete the common nodes from the smaller cluster, and obtain all clusters after segmentation.
[0089] by Figure 4 Take the maximum group enhancement algorithm as an example to illustrate the specific application process.
[0090] At the beginning, the segmentation has not started, so the T set is empty and there is no definite maximal clique. The F set contains all the nodes to be segmented, that is, nodes 1-4. The H set and the A set are also empty.
[0091] Then, node 1 is read into the H set, and the F set is updated to store nodes 2 and 3 that are connected to node 1. The A set is still empty.
[0092] Then read node 2 into the H set. The current nodes in the H set are 1 and 2. The F set is updated to store node 3 that is connected to nodes 1 and 2. The A set is still empty.
[0093] Then read node 3 into the H set. The current nodes in the H set are 1-3. The F set is updated. There is no node connected to nodes 1-3, so the F set is empty. At this time, nodes 1-3 have not yet been divided into a certain cluster, so the A set is also empty, which satisfies the fact that both the F set and the A set are empty at the same time. Therefore, nodes 1-3 are regarded as a certain maximal cluster - cluster 1, and cluster 1 can be added to the T set.
[0094] Since node 1 is also connected to node 3, after completing the path to node 2, node 3 is read into the H set. At this time, the current nodes in the H set are 1 and 3, and the A set is updated. At this time, node 2 has appeared in a certain cluster, so the A set is node 2, and the F set is updated. Since node 2 appears in the A set, although node 2 has a connection relationship with nodes 1 and 3, it is not a node that may be divided into the current maximum cluster, so the F set is empty. This satisfies the above step 1.5. When the F set is empty and the A set is not empty, the current maximum cluster in the H set overlaps with the maximum cluster that has been divided in the T set, so there is no need to split it again, and the next round of new node reading begins.
[0095] Next, read node 2. At this time, node 2 is included in the H set. Nodes 3 and 4 are connected to node 2. Update the F set, which includes nodes 3 and 4. Update the A set, which includes node 1 that has been divided into other maximal clusters.
[0096] Next, read node 3. At this time, the H set contains nodes 2 and 3. Update the A set. The node in the A set is 1. Node 1, which is connected to both nodes 2 and 3, has been divided. Therefore, the F set is empty, and continue the next round of reading of new nodes.
[0097] Next, read node 4. At this time, the H set contains nodes 2 and 4. Update the A set, which is empty. Update the F set, which has no nodes connected to both nodes 2 and 4. Therefore, the F set is also empty. At this time, nodes 2 and 4 in the H set form cluster 2, which can be placed in the T set.
[0098] According to the above rules, traverse each node and all the successor nodes connected to the node until all the nodes are traversed, and we can get cluster 1 (including nodes 1, 2, and 3) and cluster 2 (including nodes 2 and 4). Intersect the two clusters to get common node 2. Compare the sizes of the two clusters. If cluster 2 is a small cluster, delete the common node in cluster 2. Finally, cluster 2 is node 4, and cluster 1 remains unchanged.
[0099] In the above segmentation process, there may be isolated nodes that are not segmented into the maximum cluster. In the above segmentation process, if there are nodes that are not segmented into the maximum cluster, these nodes are represented as a cluster separately, and then file file2 is used to record all clusters and their corresponding nodes.
[0100] The formation process of file file2 is:
[0101] Get the array of the maximal cluster obtained by segmentation, and the original netlist file file1;
[0102] Traverse the array of all maximal clusters, treat each maximal cluster as a cluster, set a unique identifier for each cluster, and store the nodes in the array of maximal clusters into the dictionary established with the unique identifier as the key;
[0103] Traverse the isolated nodes that are not in the array of the maximum cluster, that is, the nodes in the original netlist file file1 that have not been recorded in the maximum cluster, treat each of these nodes as an independent cluster, set up a unique identifier for each cluster, and store the nodes contained in the cluster in a dictionary established with the unique identifier as the key;
[0104] After two rounds of traversal, the file file2 is obtained. In a specific application example, the specific content of the file file2 is as follows Figure 5 shown.
[0105] [Use the first data structure for encapsulation]
[0106] Each group obtained in the above steps is regarded as a super point, and the first data structure is used to encapsulate the data of each super point. This process mainly includes the following steps:
[0107] Step 2.1, record the nodes contained in each group. Each group is uniquely identified as a superpoint. The detailed process of this step is the formation process of the above file2.
[0108] Step 2.2, traverse the nodes in each superpoint, record the relationship between superpoints and nodes, and the relationship between nodes;
[0109] Step 2.3, based on the relationship between the superpoint and the node and the relationship between the node and the node, obtain the connection relationship between the superpoint and the superpoint;
[0110] Step 2.4: Use the first data structure to encapsulate the superpoints and the connection relationships between the superpoints.
[0111] Among them, the content of the first data structure includes: the unique identifier of the superpoint, the information of all nodes contained in the superpoint, the unique identifier of the predecessor superpoint of the superpoint, the information of the nodes in the superpoint connected to the predecessor superpoint, the information of the nodes in the predecessor superpoint connected to the superpoint, the unique identifier of the successor superpoint of the superpoint, the information of the nodes in the superpoint connected to the successor superpoint, and the information of the nodes in the successor superpoint connected to the superpoint.
[0112] The output result of the above step 2.2 is file file3. The travel process of file file3 is described in detail below.
[0113] Get the original netlist file file1 and file file2;
[0114] Loop through the unique identifier (clique_ID) of each clique and the corresponding node name in file2, find the corresponding node information from the original netlist file1, and insert the node information into file2. The node information here includes the device model of the gate corresponding to the node, the device model of the predecessor node of the node, the unique identifier of the predecessor node, the device model of the successor node of the node, the unique identifier of the successor node, etc.
[0115] Traverse the nodes in each clique in file2, and find the information of the predecessor node inputs and the successor node outputs of this node in the original netlist file1. Loop through the predecessor node inputs and successor node outputs of each node to see if the node is in the current clique.
[0116] If the predecessor node is not in this clique, a key is created with the unique identifier node_ID of this node under the key of the import attribute of the predecessor clique of this clique, and the value value corresponding to the unique identifier node_ID of the node stores the unique identifier clique_ID of the clique where its predecessor node is located, the node name of its predecessor node, and the input pin number (i.e., pin) of the predecessor node pointing to this node.
[0117] If the successor node is not in this clique, a key is created with the node_ID of this node under the key of the outputs attribute of this clique_ID. The value corresponding to the node_ID stores the clique_ID of the successor node, the node name of the successor node, and the output pin number of the successor node corresponding to this node.
[0118] The above operation process modifies the file file2. After the above process is completed, the updated file file2 is named file3. The file file3 records the relationship between the superpoint and the node and the relationship between the node and the node. In a specific embodiment, the specific content of the file file3 is as follows: Figure 6 shown.
[0119] In the above process, the value search corresponding to the node's unique identifier node_ID is implemented as follows:
[0120] How to traverse based on the unique identifier clique_ID of the cluster: If a predecessor node or successor node of the currently traversed node cannot be traversed in the nodes identified by clique_ID, it means that one of its predecessor nodes or successor nodes is in the nodes identified by other clique_ID. Traverse all the nodes identified by clique_ID, find the corresponding node, record the unique identifier clique_ID of the cluster corresponding to the node, and exit the loop.
[0121] How to traverse the name of the predecessor node or successor node of the currently traversed node: If a predecessor node or successor node of this node cannot be traversed in all nodes identified by the unique identifier clique_ID of the current clique, directly record the name of this predecessor node or successor node.
[0122] How to traverse the input and output pin numbers: If a predecessor or successor node of this node cannot be traversed in all nodes nodes under the unique identifier clique_ID of the current clique, record the name of the predecessor or successor node. Find the inputs array (predecessor node array) or outputs array (successor node array) corresponding to the name of this node in the original netlist file file1, find the name of the predecessor or successor node from these two arrays, and record its position in the array, which is the pin number. For example, the original netlist file file1 records
[0123] ['nodes'][node_label]['outputs'][0] = other_label, indicating that output 0 of node node_label points to pin 0 of other_label.
[0124] After the above steps 2.3 and 2.4, the output is file4, which is the first JSON file. The specific formation process of file4 is described below.
[0125] Get file file3 and back up file3 to form file file4.
[0126] Loop through the clique_ID in file3, that is, loop through each clique;
[0127] Loop through the from_community corresponding to the nodes in the import under clique_ID, and compare the from_community attribute values of all nodes under the predecessor information import of the cluster (file3[clique_ID]['import'][node]['from_community']). Save the nodes with the same from_community into file4. In other words, when traversing to a specific cluster, when the predecessor node of a node in the cluster is not in the current cluster, it is necessary to know which cluster the predecessor node belongs to through traversal, that is, it is necessary to know its from_community attribute. Similarly, for the successor nodes in other clusters, it is also necessary to know which cluster the successor node comes from, that is, it is necessary to know its target_community attribute.
[0128] First, clear the values contained in the original predecessor information import and successor information export in file4. The storage method is to create a new key under the import attribute of file4, with the key value being all different from_communities (the value of the attribute from_community is the unique identifier of the group from which all predecessor nodes come), and store the nodes with the same from_community under the corresponding from_community. Loop through the target_community corresponding to the nodes in the export under the clique_ID, and compare the target_community of all nodes under the export. Store the nodes with the same target_community in file4. The storage method is to create a new key under the export attribute of file4, with the key value being all different target_communities, and store the nodes with the same target_community under the corresponding target_community.
[0129] Then fill the specific information of different nodes under import and export in file3 into file4, and output file4. In a specific embodiment, the specific content of file4 is as follows: Figure 7 As shown. File file4 is the superpoint data encapsulated by the first data structure, which can also be called group data. The content of the first data structure can be represented by the following table 1.
[0130]
[0131]
[0132] Table 1 First data structure
[0133] [Second division and encapsulation using the second data structure]
[0134] After the first segmentation, clusters are obtained. Each cluster is represented as a superpoint in the graph, and a superpoint graph is formed. The second segmentation is to use the cone partitioning algorithm to divide all superpoints in the superpoint graph into multiple cone regions, such as Figure 8 As shown, each cone region, the super points within each cone region, and the connection relationship between the super points between cone regions are encapsulated using a second data structure.
[0135] In one embodiment, the content of the second data structure includes: a unique identifier of the conical region, information of all superpoints contained in the conical region, superpoints in the conical region that serve as predecessor superpoints of other conical regions and their connection information, and superpoints in the conical region that serve as successor superpoints of other conical regions and their connection information.
[0136] The cone partitioning algorithm is an existing algorithm. Its principle is: create a CRoot list to store the source points of the netlist. The size of the CRoot list represents the number of partitions. Traverse all nodes in the CRoot list. Scan the successor nodes from the first node, and scan the successor nodes of the successor nodes through depth-first traversal (also known as breadth-first traversal algorithm) until the terminal node is scanned. Assign a unique label to each scanned node. Then scan other nodes in the CRoot list, perform depth-first traversal, and assign unique labels to the traversed nodes. If a node is found to have a label during the scanning process, stop assigning values to this node and scan the successor nodes of other nodes. Until the scanning is completed.
[0137] The detailed application process of the cone partitioning algorithm in the present invention is described below.
[0138] Get file file4, which is the first JSON file.
[0139] Create two empty dictionaries record_dict and temp_dict. The dictionary record_dict is used to store the correspondence between nodes and partition labels of cone areas, and the dictionary temp_dict is used to store output files.
[0140] Use the cone segmentation algorithm to assign cone partition labels to the superpoints in file4. Loop through the superpoints in file4, and store each superpoint as a key corresponding to its partition label in the dictionary record_dict for subsequent search.
[0141] Loop through the dictionary record_dict, group the partitions with the same label into one category, and use the partition label as the key in the dictionary temp_dict, which corresponds to an empty dictionary. Three keys are created in the empty dictionary, namely nodes: used to store all nodes in the cone area; input information import: used to store input superpoint information, that is, when the predecessor superpoint of a superpoint in the cone area (also called the input superpoint) is not in the current cone partition, it is necessary to record the predecessor superpoint and the unique identifier of the cone partition where it is located; output information export: used to store output superpoint information, that is, when the successor superpoint of a superpoint in the latest area (also called the target superpoint) is not in the current cone partition, it is necessary to record the successor superpoint and the unique identifier of the cone partition where it is located.
[0142] How to obtain the data of the above nodes: traverse the dictionary record_dict and store the super points with the same partition label into the nodes list of the cone partition.
[0143] How to obtain the data imported by the above input information: traverse all the superpoints of each cone area in the dictionary temp_dict. Every time a superpoint is traversed, search for the superpoint in its import in file4. If there is a superpoint in the import that is not in this cone area, traverse the superpoint nodes of other cone areas. After finding a match, create a from_cone attribute to record the predecessor cone area, and create a from_clique attribute to record the superpoint that sends the signal in the predecessor cone area, that is, the clique.
[0144] How to obtain the data of the above output information export: traverse all the superpoints of each cone area in the dictionary temp_dict. Every time a superpoint is traversed, search for the superpoint in its export in file4. If there is a superpoint in the export that is not in this cone partition, traverse the superpoint nodes of other cone partitions. After finding a match, create a target_cone attribute to record the target partition, that is, the successor cone area, and create a target_clique attribute to record the superpoint that receives the signal in the target partition, that is, the clique.
[0145] The dictionary temp_dict is output as file5 to obtain a second JSON file. The second JSON file is a file encapsulated by the second data structure. In one embodiment, the specific content of the second JSON file is as follows: Fig. 9 shown.
[0146] The content of the second data structure can be represented by the following Table 2.
[0147]
[0148]
[0149] Table 2 Second data structure
[0150] In the above-mentioned entire data preprocessing stage, the first segmentation divides the undirected graph corresponding to the gate-level circuit into multiple cliques, and a clique is a complete graph. Assume an undirected graph G, a clique is a subgraph of graph G, and all vertices in the subgraph are connected by edges. Considering that each pair of different vertices in the complete graph is connected by an edge, that is, the points inside the complete graph are closely connected. Compared with an incomplete graph, segmenting a complete graph will cut off a large number of edges and generate more pins. In order to reduce the cutting of edges, the present invention adopts the maximum clique enhancement algorithm to segment in units of cliques, avoids segmenting the complete graph, finds all independent complete graph structures in the graph, and encapsulates them. Segmenting the graph after clique encapsulation can effectively reduce the number of cut edges and reduce the complexity of simulation.
[0151] Subsequently, the present invention uses a cone partitioning algorithm to partition the graph structure processed by the maximum clique enhancement algorithm to generate a corresponding data structure. The maximum clique enhancement algorithm and the cone partitioning algorithm are used to prepare data preprocessing for the priority allocation stage of the subsequent process.
[0152] Priority Assignment
[0153] In the priority allocation process, based on the superpoint data and partition data obtained in the above stage, a preset priority allocation algorithm is used to generate the cluster priority event queues between clusters and the node priority event queues within the clusters.
[0154] There is a timing relationship between the gates of a local gate-level circuit, but some gates or gate circuits can be simulated in parallel. For example, if an AND1 outputs signals to an AND2 and an OR1 at the same time, then AND2 and OR1 can be simulated in parallel. The purpose of the preset priority allocation algorithm is to find gate circuits with the same priority and arrange gate circuits with different priorities from high to low (gate circuits with the same priority can be simulated in parallel). The simulation order is to read the simulation of each layer in the order of the two-dimensional list. After the first layer of parallel simulation is completed, the next layer will be simulated in parallel.
[0155] The priority assignment rule is that the priority of the successor node is lower than that of its predecessor node (the same applies to super nodes). When the priority assignment of all nodes and super nodes is completed, the algorithm ends. The input file of the algorithm is the node relationship graph stored in the adjacency matrix and the super node relationship graph stored in the adjacency matrix. The output of the algorithm is a two-dimensional list arranged from high to low priority, each time including nodes of the same priority (the same applies to super nodes).
[0156] by Fig.10 Take an example to illustrate the process of the priority allocation algorithm and the final allocation result. There are 7 nodes in the initial directed graph, namely node 1 to node 7. It can be determined that the nodes with priority 0 are: node 1, node 4 and node 7. After removing the node with priority 0, it can be further determined that the nodes with priority 1 are: node 2 and node 3. After removing the node with priority 1, it can be determined that the node with priority 2 is node 6, and after removing the node with priority 2, it can be determined that the node with priority 3 is node 5. Therefore, the corresponding priority list can be obtained, and the priority of the queue with priority 0 is the highest, and the priority of the queue with priority 3 is the lowest.
[0157] It should be noted that before allocating priorities, it is necessary to determine whether there is a ring circuit in the cluster corresponding to the superpoint based on the superpoint data, because the ring circuit involves the problem of search space explosion during simulation. If there is a ring circuit, it is necessary to perform time expansion on the ring circuit-related nodes of the cluster, and use the preset priority allocation algorithm based on the superpoint data after time expansion to generate a node priority event queue within the superpoint; if there is no ring circuit, use the preset priority allocation algorithm based on the superpoint data to generate a node priority event queue within the superpoint.
[0158] The timing expansion principle of the annular space is described below.
[0159] like Fig.10 As shown, in gate-level circuits, local loop circuits usually appear, that is, the output of a gate is the input of the previous gate. Fig.10The output of the AND gate and the OR gate is the input of the XOR gate, and the output of the XOR gate is the input of the AND gate and the OR gate. This kind of local loop circuit usually causes the problem of search space explosion. We use the simulation demonstration of 8 groups of excitations to illustrate the problem. The 8 groups of excitations are b=1, c=1 from T=0 to T=3; b=1, c=0 from T=4 to T=7. The initial value of other pins is 0. At T=0, the simulation starts, and pins b and c receive excitations from the outside, and the other pins are all initially set to the default value of 0; from T=1 to T=3, the external excitation does not change, and the values of other pins change periodically according to the gate calculation rule; at T=4, the external excitation causes the values of pins b and c to change, and the values of other pins change periodically according to the gate calculation rule; from T=5 to T=7, the external excitation does not change, and the values of other pins change periodically according to the gate calculation rule. When T has infinite moments, the simulation results are also endless. Table 3 below lists only the moments T=0 to T=7, and the simulation data when the external excitation is changed only at moments T=0 and T=4.
[0160] Time T 0 1 2 3 4 5 6 7 …… Pin A 0 1 0 1 0 1 0 1 …… Pin b 1 1 1 1 1 1 1 1 …… Pin c 1 1 1 1 0 0 0 0 …… Pin D 0 1 0 1 0 1 0 1 …… Pin E 0 0 1 0 1 0 1 0 …… Pin f 0 1 1 1 1 0 1 0 …… Pin g 0 0 1 0 1 0 1 0 …… Pin h 0 1 1 1 1 0 1 0 …… Pin i 0 1 0 1 0 1 0 1 ……
[0161] Table 3 Local data of simulation excitation of ring circuit
[0162] Fig.10 The example in the figure is only a local ring circuit with 3 gates, which has 2 main inputs and 8 sets of excitations. The main input referred to in the present invention includes the excitation to be input by the user, and can also be the external input of the local gate-level circuit. The external input may be the output of other local gate-level circuits, that is, the main input is the temporary excitation formed by the user input excitation and / or the intermediate state. If there is a local ring circuit with k nodes, there are n main input pins, and there are m sets of excitation data in m cycles, the time is O(n) and the simulation complexity is O(n) m ), the amount of calculation grows exponentially. This is the problem of search space explosion. The letter O represents the simulation time.
[0163] In order to effectively solve this problem, the present invention proposes a method of timing expansion. A local ring circuit is simulated for N time periods, which is equivalent to a local ring diagram cascading N identical circuit diagrams behind it. This is timing expansion. Fig.12 shown. Fig.11 If the local circuit of the circuit is to be cycled N times, then N loop simulations must be performed, which is equivalent to Fig.12 In the case of N cascades, all values are calculated in one simulation cycle, and each layer (divided by the dotted line) corresponds to Fig.12 each cycle.
[0164] In the data preprocessing stage, a local ring circuit diagram will be segmented and encapsulated into a clique, and then time expansion will be performed. The advantage of time expansion is that the maximum number of excitation groups and simulation cycle can be specified according to the allocated memory size and computing resources (number of allocated cores), thereby limiting the scale of simulation, making the simulation both scalable and bounded compared to the original. In addition, each computing unit is the same, which facilitates the transplantation of distributed parallel simulation based on a specific algorithm CMB-P (a simulation algorithm to be introduced later) for a smaller circuit.
[0165]
TimeWarp-P algorithm and CMB-P algorithm
[0166] When simulation is performed after the simulation priority is determined, a logic processing unit is allocated to each cone area to realize parallel simulation processing between cone areas. The logic processing unit determines the simulation order of the cluster within its corresponding cone area according to the cluster priority event queue, and determines the simulation order of the nodes within the cluster according to the node priority event queue.
[0167] The TimeWarp-P algorithm is an improvement based on the existing TimeWarp algorithm (time rewinding algorithm). In the existing TimeWarp algorithm, each logic processing unit LP is set with a local clock (LVT), a global clock (GVT), a state preservation queue, an input buffer (IB), and an output buffer (OB). The local clock represents the current simulation time of each logic processing unit LP, while the global clock represents the minimum time scale of unprocessed events in the entire system. After the simulation starts, each logic processing unit LP i The logic processing unit LP processes the events in its event queue in non-decreasing time order and periodically saves the simulation state. i The event messages sent by the logical processing unit to other logical processing units are stored in OB, while the event messages sent by other logical processing units to the logical processing unit are stored in IB and are stored until the final submission. i It cannot guarantee that the events in its IB are received and processed in the order of the time stamp, so when the logic processing unit LP i The time stamp T of an event message taken from IB k Less than its own local clock C i When the causal relationship is wrong, it is considered that there is a causal error. k The simulation after time may be incorrect. At this time, the Time Warp algorithm restores LVT to T k , and then use the roll back mechanism to take T out of the state save queue k The most recent saved state before the moment, and LP iThe simulation state is restored to this state.
[0168] The TimeWarp-P algorithm of the present invention is improved on the basis of the above-mentioned TimeWarp algorithm. Through the cone partitioning algorithm described above, each cone graph is simulated by a logic processing unit LP. Each logic processing unit is assigned to a working node. A working node is generally considered to be a host. Each logic processing unit performs parallel simulation in a non-decreasing time scale order according to the order of clique simulation determined by the above-mentioned priority allocation algorithm. The sender and receiver of the message are determined according to the directed edges between the cliques of different logic processing units LP in the whole graph. When the time scale T of the message received by the logic processing unit LP is k Less than its own local clock C i When the rollback mechanism is used, the logical processing unit LP is restored to T k The state at the moment, that is, the state of deleting the queue that is greater than T k All status information.
[0169] The data structures provided for each logic processing unit in the present invention include: a local clock LVT, which is used to record the simulation time of the logic processing unit; a global clock GVT, which is used to record the maximum simulation time of the gate-level circuit currently being simulated; a receiving message queue Input_queue, which is used to receive new messages sent by other logic processing units; a sending message queue Output_queue, which is used to receive output messages that the gates in the corresponding cone area need to send to the gates in other cone areas; a state saving queue Clique_state_queue, which is used to record the state values of all gates and each pin of the currently simulated group at each moment; and a group relationship queue Clique_relation_array, which is used to record the next group pointed to by the current group. When the next group is located in other cone areas, the output value and output time of the corresponding gate are stored in the sending message queue.
[0170] The CMB-P algorithm is an improved algorithm based on the CMB algorithm. The CMB (Chandy-Misra-Bryant) algorithm is the earliest distributed parallel simulation conservative synchronization algorithm. k , T k ), only when the logical processing unit LP i (representing the i-th logical processing unit) determines that it will not receive an event with a timestamp greater than E k Timestamp T k When the event is smaller, the logical processing unit LP i Event E k Processing is performed to ensure that the logical processing unit LP iEvent E processed k Timestamp T k ≥C i (where timestamp C i Logical Processing Unit LP i The algorithm establishes a fully interconnected message channel for each logical processing unit and ensures that event messages are always sent in a non-decreasing order of time stamps on each message channel. Each message channel has a FIFO input queue and a channel clock associated with it, and is also provided with an input buffer (IB) and an output buffer (OB). The input buffer is used to store event messages sent by the corresponding logical processing unit, and the output buffer is used to store event messages sent to the corresponding logical processing unit. For a certain message channel, when its input queue is empty, the value of the channel clock is set to the size of the time stamp of the last event message received; otherwise, the value of the channel clock is set to the size of the time stamp of the earliest event message in the queue. At the beginning of the simulation, LP selects the event with the smallest time stamp from its own event queue and the input queue of the message channel with the smallest channel clock value for processing. When the input queue of the message channel with the smallest channel clock value is empty, the logical processing unit LP blocks and waits; only when the input queue is no longer empty when the event is loaded, the logical processing unit LP will unblock and resume the above processing process. The CMB algorithm strictly satisfies the causal constraints through this processing method and avoids the occurrence of causal errors.
[0171] The CMB-P algorithm of the present invention calculates the number of extensions within the clique block (within the clique) and performs timing extension according to the memory allocated by the clique, and uses a three-parallel algorithm to perform fast simulation for each logic processing unit. According to the device activation order obtained by the previous priority allocation algorithm, parallel simulation between gate devices is performed on the same layer, and then the next layer is simulated to continuously advance the simulation progress. By creating a shared array in a shared memory, each gate has a fixed entry in the shared array, and the information in the entry is updated in ascending order of time, and inserted into the FIFO queue of the corresponding input pin at the next calculation, thereby avoiding the cumbersome synchronization operation of message passing in the traditional CMB algorithm.
[0172] The main principles of three-parallel simulation of the logic processing unit are introduced below. A simulation cycle needs to go through three stages: updating the main input, updating the value of the input pin, and gate evaluation.
[0173] Update the main input stage, extract the main input signal from the main input queue and insert it into the message queue of the pin on the first-level gate. The main input here refers to the stimulus of external input, such as the stimulus set by the user;
[0174] In the update input pin stage, the output signal produced by each gate is extracted and inserted into the input pin driven by the gate;
[0175] In the gate evaluation phase, the earliest event in the input pin FIFO is extracted, and then the new state of the gate output is calculated based on the gate type and the value of the input pin.
[0176] A simulation loop allocates three groups of threads to process three stages respectively, and the three stages are executed sequentially. For each in each stage, a group of threads is allocated for parallel operation. The parallel simulation is continuously promoted according to the device activation order determined by the above priority allocation algorithm. For example Fig.13 , arrow A1 indicates the first stage, which is to obtain and process the main input. The local circuit has 4 main inputs, so 4 threads are allocated for processing; secondly, arrow A2 indicates the second stage, which is to add data from the output array to the input pins. There are 6 input pins, so 6 threads are allocated for processing; finally, arrow A3 indicates the third stage, which is to perform gate evaluation and add the gate output to the output array. Since the gates themselves have a front-and-back relationship, the activation simulation order of each gate is obtained according to the priority algorithm. The gate simulation of the first stage Process 1 should be performed first, and then the parallel simulation of the second stage Process 2 and the third stage Process 3 should be performed.
[0177] The advantages of this fine-grained mapping strategy are twofold: first, the computation of each thread can be simplified, thereby preventing redundant computations introduced by memory access overhead and complex logic; second, since fine-grained objects have a high structural regularity, branch divergence can be minimized.
[0178] When the three-parallel simulation method is used to parallel simulate the gates represented by the nodes in the group, the specific steps include:
[0179] Step 5.1.1, set three global linear arrays, namely: a first array gate_output_array for storing the information of the main input of the gate-level circuit and the output information generated by each gate, a second array pin_FIFO_array for storing the information received by each pin, and a third array gate_status_array for storing the output value of the gate and its output time and the output value of the main output of the gate-level circuit and its output time;
[0180] Step 5.1.2, during simulation operation, update the first array to obtain the main input information;
[0181] Step 5.1.3, updating the information received by each pin of the current priority gate in the second array based on the information of the main input;
[0182] Step 5.1.4, after the gate of the current priority performs a logic operation, the output value and output time of the gate of the current priority are stored in the third array, and the gate of the next priority is used as the gate of the current priority to proceed to the next step;
[0183] Step 5.1.5, updates the output information generated by each gate in the first array based on the value currently stored in the third array, and updates the information received by each pin of the current priority gate in the second array based on the value currently stored in the first array, and returns to step 5.1.4 for loop execution until the parallel simulation of the gates represented by the nodes in the group is completed.
[0184] by Fig.14 Take the circuit shown as an example, Fig.15 The first array gate_output_array stores the main input PI[0]-PI[4] and the information output[0]-output[4] generated by each gate. The second array pin_FIFO_array stores the received information of each pin pin[0]-pin
[12] . The third array gate_status_array stores the current output logic value of the gate and its time gate[0]-gate[4] and the value of the main output and the time PO[0]-PO[2] of the last received message.
[0185] The present invention converts the traditional message passing mode into a shared memory mode during the simulation process. Through the global array, the output of each gate in the global data has a fixed entry. During each simulation iteration, the message transmitted by a gate is written to the corresponding entry in the array. Then during the update process, the message is read from the array position corresponding to the gate and inserted into the message FIFO of the corresponding input pin. Each gate is a logic unit. According to our simulation method, the message sequence generated by the logic unit is a FIFO sequence. The new messages received by each gate pin are arranged in the order of timestamp from small to large, so as to ensure the synchronization of the simulation.
[0186] Since the simulation of each clique is in a working node, the memory of a working node is shared by its derived threads. According to the number of nodes n of the clique, the number of pins p of the clique and the maximum memory m available to the clique, the number of times k of the timing extension of the ring circuit when the clique has a ring circuit can be calculated. The working node should ensure that the number k is greater than or equal to 1; if the clique has a main input stimulus, the number is a groups, then k should be less than or equal to a. That is, the number k can be calculated by the formula Calculated.
[0187] The present invention adopts a timing expansion method in the internal simulation of a clique, and expands the clique k times according to the maximum memory, the number of nodes inside the clique, and the number of pins inside the clique, so as to better control the simulation scale of the cyclic circuit, so that the local ring circuit is expandable and bounded; a conservative synchronization algorithm is adopted for fine-grained calculation, which effectively guarantees the correctness of the calculation; a three-stage parallel algorithm is adopted for each logic unit (gate) inside the clique, and the priority devices at the same level in each clique are simulated in parallel, which solves the problem that the traditional CMB algorithm simulation cannot expand the parallel simulation to the entire circuit due to the limitation of limited memory; a method of dividing threads into the same process is adopted to create a global array in the shared memory, which effectively avoids the inconvenience caused by the traditional algorithm message passing mode.
[0188] At the same time, based on the traditional TimeWarp algorithm, the present invention adds a priority allocation algorithm to generate the activation simulation order of cliques to form a TimeWarp-P algorithm. Multiple cliques can be simulated at the same time, making the simulation more parallelized.
[0189] The present invention also protects a corresponding computer-readable storage medium, which is used to store a computer program, and when the computer program is run, the above-mentioned parallel simulation processing method of the gate-level circuit is executed.
[0190] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A parallel simulation processing method for gate-level circuits, characterized in that: include: Step 1, based on the adjacency matrix of the gate-level circuit, using a first preset segmentation algorithm to segment the graph corresponding to the gate-level circuit into multiple clusters; Step 2, taking each group as a superpoint, and encapsulating the data of each superpoint using the first data structure; Step 3, based on the superpoint graph formed by all superpoints, using a second preset segmentation algorithm to divide all superpoints into a plurality of partitions that can be processed in parallel, and encapsulating the partition data using a second data structure; Step 4: Based on the superpoint data and the partition data, a preset priority allocation algorithm is used to generate a clique priority event queue between cliques and a node priority event queue within a clique; Step 5, simulating the gate-level circuit according to the simulation order defined by the node priority event queue and the group priority event queue; The step 1 comprises: Step 1.1, preset four sets, namely: T set recording all the confirmed maximal cluster lists, H set recording the nodes that have been added to the current maximal cluster, F set recording the nodes that may be added to the current maximal cluster, and A set recording the nodes that have been added to a maximal cluster that was previously split; the initial elements of F set are all nodes; Step 1.2, according to the maximum clique partitioning principle, traverse each node and its successor nodes until all nodes and their successor nodes are traversed and all the partitioned cliques are obtained; Each time the traversed node is taken out from the F set and added to the H set, the F set and the A set are updated at the same time; When the F set is not empty and the A set is empty, the current maximal clique in the H set has not been split, so continue traversing the next node; When both the F set and the A set are empty, the current maximal clique in the H set is split, and all the nodes in the H set are added to the T set as a maximal clique; When the F set is empty and the A set is not empty, the current maximal clique in the H set overlaps with the maximal clique that has been split in the T set, so the traversal of the next node continues; Step 1.3, intersect the clusters obtained by step 1.2 to obtain the common nodes between the clusters; Step 1.4, compare the sizes of two clusters with common nodes, delete the common nodes from the smaller cluster, and obtain all clusters after segmentation.
2. The parallel simulation processing method for gate-level circuits according to claim 1, characterized in that: In step 1, each node that is not segmented into a maximum cluster is represented as a cluster.
3. The parallel simulation processing method for gate-level circuits according to claim 1, characterized in that: The step 2 comprises: Step 2.1, record the nodes contained in each group, and each group is uniquely identified as a superpoint; Step 2.2, traverse the nodes in each superpoint, record the relationship between superpoints and nodes, and the relationship between nodes; Step 2.3, based on the relationship between the superpoint and the node and the relationship between the node and the node, obtain the connection relationship between the superpoint and the superpoint; Step 2.4: Use the first data structure to encapsulate the superpoints and the connection relationships between the superpoints.
4. The parallel simulation processing method for gate-level circuits according to claim 3, characterized in that: The content of the first data structure includes: the unique identifier of the superpoint, information of all nodes contained in the superpoint, the unique identifier of the predecessor superpoint of the superpoint, information of the nodes in the superpoint connected to the predecessor superpoint, information of the nodes in the predecessor superpoint connected to the superpoint, the unique identifier of the successor superpoint of the superpoint, information of the nodes in the superpoint connected to the successor superpoint, and information of the nodes in the successor superpoint connected to the superpoint.
5. The parallel simulation processing method for gate-level circuits according to claim 1, characterized in that: The step 3 specifically includes: using a cone segmentation method to segment all super points into multiple cone regions, and encapsulating each cone region, the super points within each cone region, and the connection relationship between super points between cone regions using a second data structure.
6. The parallel simulation processing method for gate-level circuits according to claim 5, characterized in that: The content of the second data structure includes: a unique identifier of a conical region, information of all superpoints contained in the conical region, superpoints in the conical region that are predecessor superpoints of other conical regions and their connection information, and superpoints in the conical region that are successor superpoints of other conical regions and their connection information.
7. The parallel simulation processing method for gate-level circuits according to claim 1, characterized in that: In step 4, it is determined whether there is a ring circuit in the cluster corresponding to the superpoint based on the superpoint data. If there is a ring circuit, the nodes related to the ring circuit of the cluster are time-extended, and a preset priority allocation algorithm is used based on the superpoint data after the time expansion to generate a node priority event queue within the superpoint; if there is no ring circuit, a preset priority allocation algorithm is used based on the superpoint data to generate a node priority event queue within the superpoint.
8. The parallel simulation processing method for gate-level circuits according to claim 7, characterized in that: The number of expansions k for the timing expansion of the related nodes of the ring circuit of the group is based on the formula It is calculated that if there are a groups of gate-level circuit main input stimuli in the cluster, k satisfies 1≤k≤a, where m is the maximum memory available to the cluster, n is the number of nodes in the cluster, and p is the number of pins of all nodes in the cluster.
9. The parallel simulation processing method for gate-level circuits according to claim 1, characterized in that: In step 5, a logic processing unit is allocated to each conical area to realize parallel simulation processing between the conical areas. The logic processing unit determines the simulation order of the cluster within its corresponding conical area according to the cluster priority event queue, and determines the simulation order of the nodes within the cluster according to the node priority event queue.
10. The gate-level circuit parallel simulation processing method according to claim 1, characterized in that: When the gates represented by the nodes in the cluster are simulated in parallel in step 5, the following steps are included: Step 5.1.1, setting three global linear arrays, namely: a first array for storing information of the main input of the gate-level circuit and output information generated by each gate, a second array for storing information received by each pin, and a third array for storing the output value of the gate and its output time and the output value of the main output of the gate-level circuit and its output time; Step 5.1.2, during simulation operation, updating the first array to obtain the information of the main input; Step 5.1.3, updating the information received by each pin of the current priority gate in the second array based on the information of the main input; Step 5.1.4, after the gate of the current priority performs a logic operation, the output value and output time of the gate of the current priority are stored in the third array, and the gate of the next priority is used as the gate of the current priority to proceed to the next step; Step 5.1.5, updates the output information generated by each gate in the first array based on the value currently stored in the third array, and updates the information received by each pin of the current priority gate in the second array based on the value currently stored in the first array, and returns to step 5.1.4 for loop execution until the parallel simulation of the gates represented by the nodes in the group is completed.
11. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is run, the parallel simulation processing method for gate-level circuits according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Circuit division preprocessing method and gate-level circuit parallel simulation method
CN112651197A
Method and system for generating partitioned matrices for parallel circuit simulation
US20110098990A1
