GPU-based method for accelerating logical rewriting

By parallelizing the sub-process of AIG rewriting and the lock-free replacement algorithm on the GPU, the problem of low parallelism in the CPU parallel logic rewriting algorithm is solved, more efficient logic synthesis is achieved, and the logic synthesis of modern large-scale designs is significantly improved. efficiency.

WO2024178761A1PCT designated stage expired Publication Date: 2024-09-06SHANGHAI TECH UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/083573
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-27
Filing Date
2023-03-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing CPU parallel logic rewriting algorithms fail to exploit more parallelism at the intra-node level and have low parallelization efficiency, resulting in efficiency bottlenecks in logic synthesis of modern large-scale designs.

Method used

Adopting a GPU-based logic rewrite acceleration method, by parallelizing the sub-process of AIG rewrite, including a recursion-free parallel algorithm and a lock-free replacement algorithm, using the node scheduler and GPU-friendly graph data structure to achieve high parallelism within the node and efficient concurrent operations.

Benefits of technology

The parallelism and efficiency of logic rewriting are significantly improved, achieving 3.81 times acceleration with the same quality results compared to the state-of-the-art GPU parallel methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023083573_06092024_PF_FP
    Figure CN2023083573_06092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the present invention is a GPU-based method for accelerating logical rewriting. The present invention parallelizes the sub-process of AIG rewriting. The recursive sub-process of AIG rewriting is redesigned to be non-recursive in order to provide sufficient parallelism for a GPU. Secondly, in order to parallelize a replacement step on a GPU, the present invention uses a lock to ensure that mutually exclusive access inevitably breaks the scalability of parallelism between nodes. In order to make full use of large-scale inter-node parallelism, the present invention proposes a work scheduler that groups nodes of non-overlapping MFFCs, such that nodes in the MFFC can be deleted simultaneously without conflicts. In order to create and delete the same node at the same time, the present invention further provides a GPU-friendly graphical data structure to support these concurrent operations.
Need to check novelty before this filing date? Find Prior Art

Description

Logic rewriting acceleration method based on GPU Technical Field

[0001] The present invention relates to a logic rewriting acceleration algorithm. Background Art

[0002] Logic synthesis plays an important role in optimizing multi-level logic networks in automated design flows. Logic synthesis is typically applied to networks derived from compiled HDLs (such as VHDL or Verilog) before technology mapping to standard cells or programmable devices. Other uses of logic synthesis include hardware simulation, design complexity estimation, software synthesis, and fast pre-processing of circuits before equivalence checking [3]. Logic rewriting is an effective technique for optimizing multi-level logic networks and plays an increasingly important role in logic synthesis flows. Modern integrated circuits (ICs) and systems on chips (SoCs) typically contain millions to trillions of logic gates. In addition, due to the locality and greediness of logic rewriting, multiple rounds of rewriting operations are usually required to reduce the total number of circuit gates. The time required to optimize these logic networks becomes increasingly expensive with modern serial logic rewriting algorithms. Therefore, parallelizing logic rewriting is crucial to speeding up logic synthesis for large designs.

[0003] In the past few decades, many logic rewriting algorithms based on different logic network representations, such as And-Inverter Graph (AIG), Majority-Inverter Graph (MIG) and Xor-Majority Graph (MIG), have been proposed. And according to the conclusions drawn in [1], logic rewriting algorithms based on different logic representations share similar computational patterns. Therefore, parallel rewriting algorithms based on AIG can be easily converted to algorithms based on other logic network representations. The serial logic rewriting algorithm based on AIG representation was proposed in [2] and has been well implemented in the industrial-grade logic synthesis tool ABC. Currently, there are parallel algorithms based on AIG based on CPU and GPU. The CPU-based parallel logic rewriting algorithm [3] exploits inter-node parallelism, but uses locks to ensure mutual exclusive access between threads. The GPU-based parallel logic rewriting algorithm [4] accelerates part of the algorithm through node-level parallelism. It also proposes a concept of logical cut that can be used for replacement and has been proven to be correct.

[0004] However, the state-of-the-art CPU-parallel logic rewriting algorithm [3] fails to exploit more parallelism at the intra-node level. Specifically, for each node, the assigned threads still execute all the internal processes of the logic rewriting algorithm sequentially. If all these sub-processes are parallelized and different nodes are still processed in parallel, more parallelism can be extracted. In addition, in order to parallelize the replacement step in the logic rewriting, [3] uses a large number of locks to ensure mutual exclusion when threads change the same node, which greatly reduces the effectiveness of inter-node parallelism. The GPU-parallel logic rewriting algorithm [4] only accelerates the cut enumeration and evaluation steps through node-level parallelism. These two steps are only run once on the original logic network and are not re-executed when the logic network is updated. Therefore, in order to ensure that the replacement of each node still has benefits, they leave the replacement step of updating the logic network to be executed serially on the CPU. This results in a lot of unnecessary communication between the CPU and GPU, greatly reducing the efficiency of parallelization.

[0005] References

[0006] [1] H. Riener, E. Testa, W. Haaswijk, A. Mishchenko, L. Amaru, G. DeMicheli, and M. Soeken. Scalable generic logic synthesis: One approach to rule them all. In 2019 56th ACM / IEEE Design Automation Conference (DAC), pages 1-6, 2019.

[0007] [2]A.Mishchenko, S.Chatterjee, and R.Brayton.Dag-aware aig rewriting: a fresh look at combinational logic synthesis.In 2006 43rd ACM / IEEE Design Automation Conference, pages 532-535, 2006.

[0008] [3] V. Possan, Y.-S Lu, A. Mishchenko, K. Pingali, R. Ribas, and A. Reis. Unlocking fine-grain parallelism for aig rewriting. In 2018 IEEE / ACM International Conference on Computer-Aided Design (ICCAD), pages 1-8, 2018.

[0009] [4] S. Lin, J. Liu, T. Liu, MDFWong, and EFYYoung. Novelrewrite: Node-level parallel aig rewriting. In Proceedings of the 59th ACM / IEEE Design Automation Conference, DAC'22, page 427-432, New York, NY, USA, 2022. Association for Computing Machinery.

[0010] Summary of the Invention

[0011] The technical problem to be solved by the present invention is that the existing CPU parallel logic rewriting algorithm fails to utilize more parallelism at the intra-node level and has low parallelization efficiency.

[0012] In order to solve the above technical problems, the technical solution of the present invention is to provide a GPU-based logic rewriting acceleration method, characterized in that the sub-process of AIG rewriting is parallelized, and the parallel AIG logic rewriting includes the following steps:

[0013] On the CPU side, the scheduler asynchronously selects a group of nodes with the same level from the input AIG logic network. These nodes are then copied to the GPU memory, and the GPU sequentially launches kernels to rewrite these nodes in parallel. Simultaneously, the CPU also begins selecting another group of nodes for the GPU to rewrite, completely overlapping the scheduling and rewriting processes. The GPU uses cut enumeration, MFFC calculation, evaluation, and replacement to complete the parallel rewriting of nodes, where:

[0014] Cut enumeration uses a parallel cut enumeration algorithm designed based on the subgraph level. The parallel cut enumeration algorithm processes nodes with the same level simultaneously, from lower level to higher level: the nodes in the subgraph used for replacement in the previous scheduling cycle are divided into different lists LAN[slevel] according to the level of the subgraph. slevel is the local level of the node in the subgraph used for replacement. The cut of the nodes in the same list LAN[slevel] is calculated in parallel, and then the Boolean function corresponding to the cut is calculated;

[0015] MFFC calculation uses a top-down computing model to parallelize the recursive MFFC calculation algorithm: starting with a list of cuts that need to calculate MFFC, each MFFC calculation of a cut is assigned to a thread block, and threads in the same thread block collaborate to calculate the MFFC of the cut. When the thread block obtains the corresponding cut:

[0016] Step 1: The root node of the current cut is added to the MFFC set corresponding to this node. MFFC is the set that stores all the last MFFC nodes.

[0017] Step 2: The left and right children of the root node are added to buffer F1. Each thread extracts a node n from buffer F1. If all fan-outs of node n are in the current MFFC set, the function IS_MFFC_NODE(n) will be evaluated as true. At this point, all fan-outs of node n are added to buffer F2, and node n is added to the MFFC set.

[0018] Step 3: Repeat step 2 until all nodes in buffer F1 are processed, and then swap the roles of F1 and F2.

[0019] Step 4: Use the same method from step 2 to step 3 to process a leaf node of the current cut until all leaf nodes of the current cut are processed;

[0020] In the replacement phase, a lock-free replacement algorithm is used to resolve the large amount of data contention caused by frequent modifications to the logic graph. Specifically, to resolve conflicts where different threads holding overlapping MFFCs may delete the same node, a node scheduler is used to group nodes with non-overlapping MFFCs.

[0021] To resolve the conflict that the MFFCs held by different threads do not overlap, but one thread may want to share the node that other threads will delete, the replacement process is divided into two phases: in the first phase, each block of the GPU deletes the MFFC and builds a new subgraph; in the second phase, each block of the GPU combines all equivalent nodes into a supernode, which supports concurrent deletion / creation operations of a node without introducing locks between different threads.

[0022] Preferably, the node scheduler is a level-based node scheduler that simulates the topological order of sequential node scheduling, starting from a primary level and increasing the level after selecting all nodes in the level.

[0023] Preferably, the number of nodes scheduled by the node scheduler in one scheduling cycle is a user-defined value, which determines the degree of parallelism.

[0024] Preferably, the fan-out number of the super node is the sum of the fan-out numbers of all the equivalent nodes. After the super node is generated, the fan-out value of each equivalent node becomes invalid.

[0025] Preferably, the following method is used to determine whether any two nodes n0 and n1 are equivalent:

[0026] If all fan-in nodes of nodes n0 and n1 point to the same supernode and the polarity of the inputs is the same, then nodes n0 and n1 are equivalent.

[0027] First, to exploit intra-node parallelism, the present invention parallelizes the subroutines rewritten by AIG. Given the limited parallelism of recursive processes, directly mapping the recursive subroutines rewritten by AIG (such as the cut and MFFC (maximum fanout-free cone) calculation algorithms) to the GPU is extremely inefficient. Therefore, these subroutines are redesigned to be non-recursive to provide sufficient parallelism for the GPU. In addition, other logic optimization or logic verification algorithms can also utilize the proposed parallel cut and MFFC calculation algorithms to accelerate their runtime. Second, to parallelize the replacement step on the GPU, the present invention uses locks to ensure mutually exclusive access, which inevitably destroys the scalability of inter-node parallelism. To fully exploit large-scale inter-node parallelism, the present invention proposes a work scheduler that groups non-overlapping MFFC nodes so that nodes in the MFFC can be deleted simultaneously without conflict. In order to simultaneously create and delete the same node, we also propose a GPU-friendly graph data structure to support these concurrent operations.

[0028] Compared with the existing technical solutions, the innovation of the present invention lies in:

[0029] (1) This paper proposes a recursion-free parallelization algorithm that can effectively exploit the parallelism within the rewritten nodes, which is difficult to achieve due to the highly recursive nature of the original rewriting algorithm.

[0030] (2) This paper proposes a parallel lock-free replacement algorithm that includes a work scheduler that can schedule mutually exclusive nodes and a GPU-friendly data structure that can support efficient concurrent operations. Therefore, our lock-free algorithm is highly scalable and can effectively achieve more inter-node parallelism.

[0031] (3) Compared with the most advanced GPU parallel method [4], the proposed method can achieve an average speedup of 3.81 times with the same quality of results. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 shows an example of AIG rewriting [2];

[0033] Figure 2 illustrates the basic process of parallel AIG logic rewriting;

[0034] Figure 3 illustrates a supernode;

[0035] FIG4 illustrates the parallel cut enumeration algorithm proposed in the present invention;

[0036] Figure 5 illustrates a top-down computational model to parallelize the recursive MFFC computation algorithm. DETAILED DESCRIPTION

[0037] Below in conjunction with specific embodiment, further set forth the present invention.Should be understood that these embodiments are only used to illustrate the present invention and are not used in limiting the scope of the present invention.In addition, should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall equally within the scope limited by the appended claims of the application.

[0038] An AIG is a directed acyclic graph that represents the structural implementation of the logical functionality of a circuit or network in the logic synthesis process. Each node in an AIG has a level attribute, which is defined as the number of nodes on the longest path from any input to that node. Our parallel algorithm is level-based. The process of AIG logic rewriting is to replace the n-input subgraph in the AIG with a logically equivalent but structurally different n-input subgraph. The replacement subgraph has fewer nodes or can reuse other nodes in the AIG, thus reducing the number of nodes in the final AIG. As shown in Figure 1, the logical functionality of subgraphs 1 and 2 is equivalent. Since subgraph 2 has fewer nodes, we will replace subgraph 1 with subgraph 2.

[0039] The basic process of parallel AIG logic rewriting is shown in Figure 2: On the CPU side, the scheduler asynchronously selects a group of nodes with the same level from the input AIG logic network. These nodes are then copied to GPU memory, and the GPU sequentially launches kernels to rewrite these nodes in parallel. Simultaneously, the CPU also begins selecting another group of nodes for the GPU to rewrite, completely overlapping the scheduling and rewriting processes. The GPU-based process involves four steps: cut enumeration, MFFC (Maximum Fanout Free Cone) calculation, evaluation, and replacement.

[0040] Rewriting algorithms typically employ two types of parallelism. One is coarse-grained parallelism, or inter-node parallelism. Different nodes are processed in parallel, but each node is processed serially. The other is fine-grained parallelism, or intra-node parallelism. At this level of parallelism, operations on each node are processed in parallel. Of the aforementioned steps, cut enumeration and MFFC calculation are highly recursive and difficult to parallelize on GPUs, making these two components the most challenging. We redesigned the algorithms for these two components to explore greater intra-node parallelism. Inter-node parallelism aims to enable simultaneous rewriting of multiple AIG nodes. Due to inter-node dependencies, effectively exploiting inter-node parallelism is challenging. Node replacement is the core step in logic rewriting and the only step that modifies the AIG. It replaces a subgraph with an equivalent subgraph with fewer nodes, or with a subgraph that shares the same nodes. This step frequently modifies the logical graph, resulting in significant data contention and hindering inter-node parallelism. Therefore, we propose a lock-free replacement algorithm to effectively resolve these data conflicts. Since the intra-node parallelism of the node evaluation step is a common parallel paradigm and this step does not delete or create new nodes, the parallelization of this step is relatively easy to implement and will not be described in detail here.

[0041] 1) Lock-free inter-node parallelization (node ​​replacement)

[0042] Two types of conflicts between threads can arise during the replacement step. First, different threads may delete the same node if their MFFCs overlap. Second, even if their MFFCs do not overlap, a thread may want to share a node that another thread is about to delete. The existence of these two types of conflicts significantly limits the scalability of parallel rewriting algorithms. To address the first type of conflict, we propose a node scheduler that groups nodes whose MFFCs do not overlap. To resolve the second type of conflict, we divide the replacement process into two phases. In the first phase, each GPU block deletes MFFCs and builds a new subgraph. Specifically, each block creates a new node for the subgraph, even if equivalent nodes exist outside the new subgraph. In the second phase, each block combines all equivalent nodes into a supernode. This data structure supports concurrent node deletion and creation operations without introducing locks between different threads. This delayed equivalence lookup pattern eliminates locks and ensures correctness when exploiting inter-node parallelism.

[0043] 1) Node Scheduler:

[0044] Node scheduling is crucial as it directly affects the quality of results and the level of parallelism. Two issues need to be considered: 1) The behavior of the proposed parallel work scheduler should be similar to the sequential ABC-based node scheduling (nodes are processed in topological order) to ensure quality. 2) The selected nodes for parallel rewriting should not interfere with each other (lock-free). If the work scheduler selects incorrect nodes, locking will be required between thousands of threads, significantly reducing the parallelism. The main goal of the scheduler is to schedule nodes with non-overlapping MFFCs so that each thread block can remove MFFC nodes without synchronization.

[0045] We found that a group of nodes at the same level can be guaranteed to have independent MFFC. The scheduler starts with the primary input (level = 0) and increments the level after selecting all nodes in that level. The number of nodes scheduled in a scheduling cycle is a user-defined value, which determines the number of nodes rewritten in parallel (i.e., parallelism). In addition, the proposed level-based node scheduler also simulates the topological order of sequential node scheduling, thereby ensuring the quality of the rewriting results. At the same time, it still provides sufficient parallel work for parallel logic rewriting.

[0046] 2) Supernode:

[0047] The first step in node replacement is to delete the MFFC node. This step can be performed without conflicts due to the level-based node scheduler. The second step is to build a new subgraph. In this step, there are many opportunities for node sharing. Whether a node is shared is determined during the node evaluation step, so during this step, the node to be shared may have already been deleted or is about to be deleted as an MFFC node. Therefore, in this process, to prevent some threads from reusing nodes that other threads may have already deleted or are about to delete, these threads will create duplicate nodes for the node, regardless of whether there is an opportunity for reuse.

[0048] To remove these redundant nodes and simultaneously reduce the inefficiency of deleting equivalent nodes on the GPU, we propose a supernode graph data structure. Specifically, all equivalent nodes in the AIG form a new supernode, whose fan-out is the sum of the fan-outs of all equivalent nodes. After the supernode is generated, the fan-out value of each equivalent node is invalidated, making it appear that the equivalent nodes are just a single node. Figure 3 shows how to detect all equivalent nodes. To determine whether n0 and n1 are equivalent, we query their fan-in nodes and corresponding supernodes. In this example, the left fan-in of n0 and n1 are n2 and n3, respectively. Observe that n2 and n3 point to the same supernode h0, and the same is true for their right fan-in. Therefore, if the polarity of the inputs is also the same, then n0 and n1 are equivalent. After the entire rewriting process, we scan the entire AIG and replace the fan-in of each node with the corresponding equivalent node, eliminating the need for explicit node deletion on the GPU.

[0049] 2) Intra-node parallelization without recursion

[0050] 1) Parallel cut enumeration:

[0051] The k-feasible cut serial process for a given node is recursive. Specifically, let C1 and C2 be two groups of cuts, then the cut-merge operation is defined as: C1◇C2={u∪v|u∈C1,v∈C2,|u∪v|≤k} (1)

[0052] Where ◇ represents the symbol for merging two groups of cuts, and k represents the number of leaf nodes of the cut (“k-feasible” means that the cut has k leaf nodes).

[0053] The set of k-feasible cuts Φ(n) for a node n is defined by the following recursive function:

[0054] Where PI represents the primary input, n.left represents the left child of node n, and n.right represents the right child of node n.

[0055] This recursive process is not suitable for GPU platforms, so we propose a parallel cut enumeration algorithm. When computing the cut of a node, to avoid recursion, it is necessary to ensure that the cuts of both left and right children have been calculated. According to the node scheduler used in the replacement step, only nodes at the same level are scheduled together. In other words, for each new scheduling cycle, the cuts of the newly scheduled nodes at the same level need to be calculated for further processing. In addition, after the replacement, some new nodes are added to the AIG. These added nodes may change the cut sets of nodes at higher levels. Therefore, the cut sets of these newly scheduled nodes should be calculated before the newly scheduled nodes to ensure the correctness of the cut enumeration function. These added nodes come from different subgraphs at different levels. Therefore, computing the cuts of these nodes simultaneously will lead to dependency issues between nodes. To address this problem, we propose a bottom-up parallel computing kernel that ensures computational dependencies between nodes while exploiting sufficient parallelism.

[0056] As shown in FIG4 , the parallel cut enumeration algorithm disclosed in the present invention is designed based on the level of the subgraph. CUT_ENUMERATION_KERNEL is the top-level function used to calculate the cut set for a given node. In the previous scheduling cycle, the previous set of scheduled nodes has completed the replacement step. The subgraph used for replacement is recorded, and the nodes in the subgraph are stored in list_nodes. These newly added nodes are divided into different lists LAN[slevel] according to the level of the subgraph (slevel is the local level of the node in the newly added subgraph). The maximum level (ML) of the subgraph is the maximum level of all subgraphs dynamically obtained after the previous set of nodes are replaced. Then, these newly added nodes LAN[slevel] of the same slevel are used as parameters of the PARALLELCUTENUM_ONELEVEL function. PARALLEL_MERGE is used to parallelize the cuts of these nodes (the implementation of the function is defined in equation (2)). The calculated cuts are then passed to PARALLEL_COMPUTE_BOOLEAN_FUNCTION to calculate the Boolean function corresponding to the cut (used to find equivalent subgraphs in subsequent steps). Since the number of cuts for each node is fixed, the number of cuts will double after merging the cuts, so not all of these cuts will be retained. The retained cuts are selected by PARALLEL_SELECT_CUTS.

[0057] The core idea of ​​parallel cut enumeration is to process nodes with the same level simultaneously, from lower level to higher level (line 2). This computation pattern breaks the dependencies between added nodes. For example, if node n with slevel = 4 is being processed, it can safely merge the cut sets of its child nodes because all nodes with slevel < 4 are guaranteed to have a calculated cut set. It also extends sufficient parallelism because all nodes with the same slevel are processed simultaneously. After the cuts of the newly added nodes are calculated, the cuts of the next scheduled nodes can be calculated, and these calculated cuts will be used in the following steps.

[0058] 2) Parallel MFCC calculation:

[0059] This paper proposes a top-down computation model to parallelize the recursive MFC computation algorithm. To unlock parallelism, the proposed method should process multiple nodes simultaneously and efficiently check whether these nodes are in the MFC. Based on the definition of the MFC, it can be concluded that if all fan-outs of a node (except the root node) are in the MFC, then the node is also in the MFC. The core idea of ​​our proposed method is to maintain a subset of the MFC and the nodes to be processed in the correct order, so that the node's presence in the MFC can be checked only by looking at the subset of the MFC.

[0060] As shown in Figure 5, the MFFC algorithm disclosed in the present invention requires three data structures: two lists, F1 and F2, for temporarily storing intermediately processed nodes, and MFFC, a set storing all final MFFC nodes. The algorithm begins with a list of cuts for which MFFCs need to be calculated. Each MFFC calculation for a cut is assigned to a thread block, and threads within the same block collaborate to calculate the MFFC for that cut. When a thread block obtains the corresponding cut (LC[block_id]), the root node of that cut is first added to the MFFC set corresponding to that node (line 4). The algorithm allocates two buffers, F1 and F2, to store the current search boundary. First, the left and right children of the root node are added to F1 (lines 5-6). Each thread extracts a node n from F1 (line 10). If all fan-outs of n are in the current MFFC set, the function IS_MFFC_NODE(n) evaluates to true (line 11). Then, all children of n (i.e., all fan-outs) are added to F2, and node n is added to the MFFC (lines 12-14). After processing all nodes in F1, the for loop ends (line 9), and the roles of F1 and F2 are swapped (lines 17-19). Finally, when all leaf nodes of the cut have been processed, FIND_ALL_CUT_LEAVES evaluates to true, and the while loop ends (line 7). Because a node may have multiple parents, this node is added to F2 (the swapped F1). F1.REMOVE_DUPLICATED_NODES is used to remove duplicate nodes (line 8).

[0061] As mentioned above, based on the definition of mffc, if all fanouts of a node (except the root node) are in mffc, then the node is also in mffc. By processing nodes sequentially using PBFS (parallel breadth search), determining whether all fanouts of a node are in mffc is done before determining whether the node is in mffc. If the fanout is an mffc node, it is added to the MFFC. Therefore, it is sufficient to check whether a node is MFFC only from the MFFC. Since all fanouts of the current boundary nodes in the mffc have been pushed into the mffc, nodes from the same boundary will never become each other's fanouts. Therefore, it is always safe to process these nodes in parallel for mffc calculation.

[0062] The above algorithm is implemented on a computer system with a GPU to achieve rapid synthesis of the circuit.

Claims

1. A logic rewrite acceleration method based on GPU, characterized in that: Parallelize the sub-process of AIG rewriting. Parallel AIG logic rewriting includes the following steps: On the CPU side, the scheduler asynchronously selects a group of nodes with the same level from the input AIG logic network; then, these nodes are copied to the GPU memory, and the GPU sequentially launches kernels to rewrite these nodes in parallel. At the same time, the CPU also starts to select another group of nodes for the GPU to rewrite, completely overlapping the scheduling and rewriting processes; the GPU uses cut enumeration, MFFC calculation, evaluation and replacement to complete the parallel rewriting of nodes, where: The cut enumeration adopts a parallel cut enumeration algorithm designed based on the level of the subgraph. The parallel cut enumeration algorithm is used to process nodes with the same level at the same time, from the lower level to the higher level: the nodes in the subgraph used for replacement in the previous scheduling cycle are divided into different lists LAN[slevel] according to the level of the subgraph. slevel is the local level of the node in the subgraph used for replacement. The cut of the nodes in the same list LAN[slevel] is calculated in parallel, and then the Boolean function corresponding to the cut is calculated; MFFC calculation uses a top-down calculation mode to parallelize the recursive mffc calculation algorithm: starting with the list of cuts that need to calculate mffc, each mffc calculation of a cut is assigned to a thread block, and the threads in the same thread block collaborate to calculate the mffc of the cut. When the thread block gets the corresponding cut: Step 1: The root node of the current cut is added to the MFFC set corresponding to this node. MFFC is the set that stores all the last MFFC nodes. Step 2: The left and right children of the root node are added to the buffer F1. Each thread extracts a node n from the buffer F1. If all the fan-outs of node n are in the current MFFC set, the function IS_MFFC_NODE(n) will be evaluated as true. At this time, all the fan-outs of node n are added to the buffer F2, and node n is added to the MFFC set. Step 3: Repeat step 2 until all nodes in buffer F1 are processed, and then swap the roles of F1 and F2; Step 4: Use the same method from step 2 to step 3 to process a leaf node of the current cut until all leaf nodes of the current cut are processed; In the replacement phase, a lock-free replacement algorithm is used to solve the large amount of data contention that exists in the frequent modification of the logic graph, where: To solve the conflict that different threads holding overlapping MFFCs may delete the same node, a node scheduler is used to group nodes that do not overlap MFFCs; To resolve the conflict that the MFFCs held by different threads do not overlap, but one thread may want to share the node that other threads will delete, the replacement process is divided into two stages: in the first stage, each block of the GPU deletes the MFFC and builds a new subgraph; in the second stage, each block of the GPU combines all equivalent nodes into a supernode, which supports concurrent deletion / creation operations of a node without introducing locks between different threads.

2. A GPU-based logic rewrite acceleration method as claimed in claim 1, characterized in that: The node scheduler is a level-based node scheduler that simulates the topological order of sequential node scheduling, starting from the primary level and increasing the level after selecting all nodes in the level.

3. A GPU-based logic rewrite acceleration method as claimed in claim 2, characterized in that: The number of nodes scheduled by the node scheduler in a scheduling cycle is a user-defined value that determines the degree of parallelism.

4. The GPU-based logic rewrite acceleration method according to claim 1, characterized in that: The fan-out number of the super node is the sum of the fan-out numbers of all the equivalent nodes. After the super node is generated, the fan-out value of each equivalent node becomes invalid.

5. The GPU-based logic rewrite acceleration method according to claim 1, characterized in that: The following method is used to determine whether any two nodes n0 and n1 are equivalent: If all fan-in nodes of nodes n0 and n1 point to the same supernode and the polarity of the inputs is the same, then nodes n0 and n1 are equivalent.

Citation Information

Patent Citations

  • Concurrent real-time program verification ptimized processing system and method based on rewrite logic

    CN102231133A

  • Logic optimization method and device of integrated circuit, electronic equipment and readable medium

    CN115204076A

  • Logic circuit and system and computer program product for logic synthesis

    US20160055270A1

  • Boolean logic optimization in majority-inverter graphs

    US20160350469A1