CNF Generation Method, Equivalence Verification Method, and Storage Medium for Multiple Output Instances

By finding and binding the number of CNF references of ports in the storage structure, and storing and deleting CNFs using a hash table, the time-consuming and memory-consuming problems of CNF generation of multiple output instances are solved, and the efficiency of circuit equivalence verification is improved.

CN114398847BActive Publication Date: 2025-07-29SHENZHEN STATE MICRO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111517843.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-07-29
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The CNF generation method of multiple output instances in the prior art takes a long time and takes up a lot of memory, resulting in inefficient circuit equivalence verification.

Method used

By looking for the CNF of the port in the storage structure, counting the number of references, and binding and combining CNF in the hash table, reducing duplicate iterations, using the hash table to store and delete CNF to control memory footprint.

Benefits of technology

It effectively reduces the storage memory of CNF, shortens the computing time, and improves the circuit equivalence verification efficiency of multiple output instances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398847B_ABST
    Figure CN114398847B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating CNF of multi-output instances, an equivalence verification method, and a storage medium. The method for generating CNF of multi-output instances includes: during traversal, searching for the CNF corresponding to the input port net of the current port net in the storage structure; if not found, calculating the reference count of the current port net, traversing the circuit connected to the current port net to generate the corresponding CNF, binding the CNF and the reference count and storing them in the storage structure; if found, directly calling the CNF from the storage structure, decreasing the reference count by 1, and when the reference count is 0, deleting the corresponding CNF and its associated data from the storage structure. The present invention can reduce the storage memory of CNF and shorten the calculation time of CNF.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of equivalence verification of digital circuits, and particularly to a method for generating CNF of multi-output instances and an equivalence verification method based on SAT. Background Art

[0002] In the equivalence check of digital circuits, the equivalence verification method based on SAT (satisfiability, Boolean satisfiability problem) is often used. Generally, the Boolean formula of the Boolean satisfiability problem is expressed in the form of conjunctive normal form (CNF). In the equivalence check of circuits, the structures of two designed circuits can be represented in the form of conjunctive normal form, and then an efficient SAT solver is used to solve the CNF to obtain a conclusion on whether the circuits are equivalent.

[0003] In the prior art, there are many methods for obtaining the CNF of single-output instances. However, there are multi-output instances in the circuit, and the existing methods for obtaining CNF have problems of long time consumption and large memory. Since a multi-output instance has multiple output ports, the same multi-output instance will obtain multiple different CNFs according to different output ports. And the circuit connected by the same instance is the same. Iterating different ports will repeatedly iterate the same circuit, resulting in long time consumption, a large number of generated CNFs, and increased memory. Summary of the Invention

[0004] In order to solve the technical problems of excessive time consumption and large memory occupation during the generation of CNF for multi-output instances in the prior art, the present invention provides a method for generating CNF of multi-output instances, an equivalence verification method, and a storage medium.

[0005] The method for generating CNF of multi-output instances provided by the present invention includes:

[0006] During traversal, search for the CNF corresponding to the input port net of the current port net in the storage structure;

[0007] If not found, calculate the reference count of the current port net, traverse the circuit connected by the current port net to generate the corresponding CNF. If the reference count is greater than 1, bind the CNF and the reference count and store them in the storage structure; otherwise, combine the CNF with the CNFs of other ports.

[0008] If found, directly call the combination of the CNF and the CNFs of other ports from the storage structure, subtract 1 from the reference count, and when the reference count is 0, delete the corresponding CNF and its associated data from the storage structure.

[0009] Further, the storage structure is a hash table.

[0010] Further, when the reference count is 0, delete the CNF and its corresponding node from the hash table.

[0011] Further, the reference count of the current port net is the sum of the number of output ports of the instances connected to the port net.

[0012] The SAT-based equivalence verification method proposed by the present invention generates the corresponding CNF by using the CNF generation method for multi-output instances described in the above technical solution.

[0013] The computer-readable storage medium proposed by the present invention is used to store a computer program, which is characterized in that the computer program executes the CNF generation method for multi-output instances described in the above technical solution when running.

[0014] Further, the computer-readable storage medium includes a stack, and the CNF is stored on the stack.

[0015] The method for generating CNF for multi-output instances proposed by the present invention controls the number of iterations of the instance by the reference count of the net of the instance, binds the net and the CNF after generating the CNF, and deletes the CNF corresponding to the instance after the reference count of the net of the instance is reduced to 0 to reduce memory occupancy. The present invention calculates the reference of the input port net (the wire connected to the port) of the multi-output instance, judges the number of output ports of all the instances connected thereto and the number of output ports of the top-level module, and then calculates the reference count, and binds the CNF to the reference count. When iterating to the same port net each time, take out the CNF stored in the hash table after the first iteration from the hash table, and use it to calculate the CNF of the multi-output instance, and then reduce its reference count by 1. After the reference count is 0, delete the corresponding CNF. The present invention uses the reference count of the port net of the instance to bind to the CNF and the hash table for storing repeatedly referenced CNFs to reduce the number of iterative repetitions, thereby reducing memory occupancy and shortening the time to obtain the CNF. Description of the Drawings

[0016] The present invention will be described in detail below in conjunction with embodiments and drawings, wherein:

[0017] Figure 1 is the flowchart of the method according to an embodiment of the present invention;

[0018] Figure 2 is the circuit diagram according to an embodiment of the present invention;

[0019] Figure 3 is the circuit diagram according to another embodiment of the present invention. Detailed Description of the Invention

[0020] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clear and understandable, the present invention will be further described in detail below with reference to 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.

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

[0022] As Figure 1 shown, when traversing in the CNF generation method of the multi-output instance of the present invention, if a port net is traversed, the CNF corresponding to the input port net of the current port net is searched in the storage structure. For example, if the current port net is connected to instance 1 as an output port net, then the CNF corresponding to the input port net of instance 1 is searched.

[0023] If the CNF corresponding to the input port net of instance 1 is not found in the storage structure, the reference count of the current port net is calculated, that is, the reference count of the output port net of instance 1 is calculated. Then the circuit connected to the current port net is traversed, and the corresponding CNF is generated. If the reference count of the current port net is greater than 1, the CNF and the reference count are bound and stored in the corresponding storage structure. Otherwise, the CNF is combined with the CNFs of other ports.

[0024] In a specific embodiment, the storage structure is a hash table.

[0025] If the CNF corresponding to the input port net of instance 1 is found in the storage structure, the CNF is directly called from the storage structure to be combined with the CNFs of other ports, and the reference count corresponding to the CNF is decremented by 1. When the reference count is 0, the corresponding CNF and its associated data are deleted from the storage structure.

[0026] As Figure 2 shown, the following uses a specific example to illustrate the calculation method of the reference count of CNF.

[0027] The reference count of the CNF corresponding to the output port net of instance inst is the sum of the two output ports of inst1, the three output ports of inst2, the two output ports of inst3, and the direct output port port, so the reference count is 2 + 3 + 2 + 1 = 8.

[0028] As Figure 3 shown below, a specific example is used to illustrate the CNF generation process of the present invention.

[0029] When traversing to the output port net1 of inst, check whether there is a corresponding CNF for the input port net of inst in the storage structure. If not found, generate a corresponding CNF based on the circuit connected to port net1, and calculate the reference count of port net1. At this time, the reference count of port net1 is 3. Store the CNF corresponding to net1 and the reference count in the hash table. The CNFs of port net2 and port net3 are traversed and calculated in the same way.

[0030] When iterating to port net4, check whether there is a corresponding CNF for the input port net1 of FADD. If it can be found in the hash table, directly call the corresponding CNF, and at the same time, the reference count of this CNF is decremented by 1 and becomes 2. When iterating to port net5 or port net6, the reference count of this CNF will be decremented by 1. After iterating through ports net4 to net6, the reference count of this CNF becomes 0. At this time, delete the corresponding node and the corresponding CNF from the hash table.

[0031] In the above process, when iterating through ports net4 to net6, the CNFs of ports net1, net2, and net3 can be directly obtained through the hash table. Just directly use their calculations and decrement their reference counts by 1. When the reference count of the CNF corresponding to port net1 is 0, and there is no circuit that needs it anymore, its CNF can be deleted from the CNF hash table, and the CNF memory can be cleared.

[0032] The hash table in which the CNF is stored uses the STL container in C++. net is used as the key, and CNF is used as the value. The reference count will be stored as a member value in the CNF class. Taking the implementation in C++ language as an example, each CNF will be instantiated as a CNF class in the C++ program and bound to the CNF.

[0033] The present invention also protects an SAT-based equivalence verification method. This equivalence verification method uses the CNF generation method for multi-output instances of the above technical solution to generate the corresponding CNF.

[0034] The present invention also protects a computer-readable storage medium. When the computer program runs on this computer-readable storage medium, it executes the CNF generation method for multi-output instances of the above technical solution. And the computer-readable storage medium includes a stack, and the CNF is stored on the stack, thereby improving the search speed.

[0035] In the above introduction of the present invention, whether net is a port net, an input port net, or an output port net is based on examples. If no examples are described, net is called a port net. When there are specific examples, based on net being the input or output of the example, this net becomes an input port net or an output port net. Therefore, the same net has multiple different expressions.

[0036] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating CNF with multiple output instances, characterized in that, Including: During traversal, search for the CNF corresponding to the input port net of the current port net in the storage structure; If not found, calculate the reference count of the current port net, traverse the circuit connected to the current port net to generate the corresponding CNF. If the reference count is greater than 1, bind the CNF and the reference count and store them in the storage structure; Otherwise, combine the CNF with the CNFs of other ports; If found, directly call the combination of the CNF and the CNFs of other ports from the storage structure, decrement the reference count, and when the reference count is 0, delete the corresponding CNF and its associated data from the storage structure; The reference count of the current port net is the sum of the number of output ports of the instances connected to the port net.

2. The CNF generation method for multi-output instances according to claim 1, wherein The storage structure is a hash table.

3. The CNF generation method with multiple output instances according to claim 2, wherein When the reference count is 0, delete the CNF and its corresponding node from the hash table.

4. A SAT-based equivalence verification method, characterized in that, Generate the corresponding CNF using the CNF generation method for multi-output instances according to any one of claims 1 to 3.

5. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program runs, it executes the CNF generation method for multi-output instances according to any one of claims 1 - 3.

6. The computer-readable storage medium according to claim 5, wherein The computer-readable storage medium includes a stack, and the CNF is stored on the stack.

Citation Information

Patent Citations

  • A layout instantiation integrity detection method

    CN109409002A

  • Sequential circuit equivalent testing and verifying

    CN1710567A