Fault number reduction method based on equivalent grouping
Through the method based on equivalent grouping, the number of faults of automotive-grade chips is reduced, the coverage rate of equivalent faults is improved, the problems of large consumption and inefficiency of computing resources in the prior art are solved, and more efficient fault compression and Certification process.
Patent Information
- Application Number
- CN202410930698.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-05
Smart Images

Figure CN118898221A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of circuit fault compression, and in particular to a method for reducing the number of faults based on equivalent grouping. Background Art
[0002] With the development of automotive electronics and intelligence, automotive electronic and electrical systems have become increasingly complex, and failure modes have also changed from traditional mechanical damage to electronic and electrical failure. Internationally, automotive functional safety certification based on the ISO26262 standard is widely used. This standard covers the entire process of automotive product development and provides assurance measures for the functional safety of electronic and electrical systems. ISO26262 standard certification has a very high degree of recognition in the automotive chip industry. Automotive-grade chip companies (referring to chips that meet automotive-grade technical standards and can be used for automotive control) need to provide customers with products that have passed ISO26262 standard certification, which has also become the entry threshold for automotive-grade chip suppliers. Functional safety simulation is the most critical step to improve the reliability and safety of automotive-grade chips. Fault simulation, as one of the most important testing methods, can test the functional failure risk of the system by injecting faults.
[0003] However, since automotive-grade chips contain a large number of circuits, usually a single large-scale automotive-grade chip contains tens of thousands of circuits, the number of simulations is huge, resulting in a long simulation time. Compared with general consumer chips, the verification workload of automotive-grade chips is expected to increase by 2 to 3 times. In addition, during the fault simulation process, there is equivalence between faults, that is, the output values of circuits with different faults are the same, and these faults are called equivalent faults. The set of all faults in the circuit can be divided into equivalent sets, and the faults in the set are equivalent to each other. You only need to select one fault from the equivalent set for fault simulation. Therefore, by determining the equivalence between faults, you can reduce the number of simulations, speed up the functional safety simulation of automotive chips, and thus shorten the certification cycle of automotive chips.
[0004] However, as the scale of circuits continues to expand and the number of gate circuit nodes increases, the number of faults that need to be verified also increases. Currently proposed methods such as hierarchical fault compression methods, methods that use the hierarchical structure in circuit design to optimize fault folding, and methods based on Boolean satisfiability all face problems such as high consumption of computing resources, low efficiency, over-reliance on circuit structure, and insufficient equivalent fault coverage. Summary of the invention
[0005] In view of this, an embodiment of the present application proposes a method for reducing the number of faults based on equivalent grouping, which divides faults from the perspective of circuit output response, avoids the disadvantage of over-reliance on circuit structure caused by dividing faults according to circuit hierarchy, and adopts group iteration and parallel computing methods to effectively improve the efficiency of equivalent fault judgment. It adopts a fault set merging algorithm based on a union-find set structure to avoid redundant verification and improve the coverage of equivalent faults.
[0006] In a first aspect, an embodiment of the present application proposes a method for reducing the number of faults based on equivalent grouping, the method comprising the following steps: obtaining a fault list and a gate-level netlist of a target circuit; performing circuit topology structure analysis based on the gate-level netlist of the target circuit, generating a test vector group according to the circuit topology analysis structure result, injecting each fault in the fault list into the target circuit to obtain each fault circuit, simulating each fault circuit based on several test vectors in the test vector group, and initially grouping each fault circuit according to the simulation result; wherein the simulation results of each fault circuit in the same initial group are the same; based on other test vectors in the test vector group, performing parallel iterative segmentation on each initial grouping according to the scale segmentation principle and the information gain segmentation principle to obtain a final grouping; performing equivalence verification on the fault circuits in each final grouping according to fault symmetry and fault propagation, and performing union-find-based fault merging on each equivalent fault circuit to obtain each equivalent fault set; generating an equivalent fault list based on each equivalent fault set and outputting it.
[0007] Through the above method, the division based on circuit simulation is first performed, that is, the initial division of faults is performed from the perspective of circuit output response, thereby avoiding the disadvantage of over-reliance on circuit structure caused by fault division based on circuit level. For the initial grouping, further division is performed by parallel iterative segmentation, so that the number of fault circuits contained in the grouping becomes smaller and smaller, until the final grouping is obtained after no further division. Such small-scale grouping is convenient for reducing the number of subsequent equivalence verifications, thereby reducing the compression time. At the same time, each grouping that needs to be further divided is performed by a parallel multi-threading method, which greatly improves the overall iteration speed and solves the problem of high time cost and computational cost of fault compression. Considering the symmetry and transitivity of the fault, the final grouping is subjected to fault merging based on union-find set (search merging) to optimize the equivalence verification process between multiple fault circuits, avoid redundant verification of obviously equivalent faults, and be able to fully connect the divided faults to improve the equivalent fault coverage.
[0008] Optionally, a circuit topology analysis is performed based on the gate-level netlist of the target circuit, and a test vector group is generated according to the circuit topology analysis result, including: defining a structure in the C++ language to represent a logic gate, wherein the information of the structure includes the gate type, input and output of the logic gate, defining a class to represent the circuit diagram of the target circuit, wherein the class includes two data structures, wherein one data structure is used to store logic gates, wherein the key represents the gate name of the logic gate, and the value represents the structure of the logic gate, and the other data structure is used to store a connection diagram, wherein the key represents the name of the node, and the value represents the list of names of the logic gates connected to the node; wherein the node is the input and output of the logic gate; traversing each row of the gate-level netlist of the target circuit, decomposing each row into gate name, gate type, input and output, creating an object representing the logic gate, and setting its gate type, input and output, creating an object representing the connection diagram to store the gate name, gate type, input and output of the target circuit, and setting the ... An object representing a logic gate is added to the circuit diagram of the target circuit; an access set is created to record visited nodes, a stack is created to store the result of topological sorting, and a recursive function is defined; each node is traversed, the current node is marked as visited, all adjacent nodes of the current node are traversed, and for each unvisited adjacent node, the recursive function is recursively called, and the current node is pushed into the stack; when all nodes are marked as visited, the node sequence stored in the stack is output as the result of topological sorting to obtain the circuit topology analysis result; the inputs and outputs of all logic gates in the target circuit are used as test nodes, and test vectors are generated based on the circuit topology analysis result, and the test nodes covered by the generated test vectors are recorded, and new test vectors are generated based on the uncovered test nodes, and finally a test vector group is formed based on all the generated test vectors.
[0009] Optionally, the method injects each fault in the fault list into the target circuit to obtain each fault circuit, simulates each fault circuit based on several test vectors in the test vector group, and initially groups each fault circuit according to the simulation results, including: using a scripting language to extract information of each fault in the fault list, generate an injection file for each fault, the content of the injection file includes injection time, injection node and injection simulator command; inserts the injection file of each fault into the test platform file in sequence to obtain each fault circuit; simulates each fault circuit based on several test vectors in the test vector group to obtain the output waveform of each fault circuit; compares the output waveforms of each fault circuit, and classifies the fault circuits with the same output waveform into the same initial group, and classifies the fault circuits with different output waveforms into different initial groups.
[0010] Optionally, based on other test vectors in the test vector group, each initial group is iteratively divided in parallel according to the scale division principle and the information gain division principle to obtain the final group, including: in the first iteration, traverse each initial group to determine whether the number of faulty circuits in the current initial group is less than a first preset threshold; if the number of faulty circuits in the current initial group is less than the first preset threshold, directly use the current initial group as a final group; if the number of faulty circuits in the current initial group is greater than or equal to the first preset threshold, then based on other test vectors in the test vector group, each faulty circuit in the current initial group is re-simulated, and each faulty circuit in the current initial group is intermediately grouped according to the simulation results; wherein each initial group that needs to be re-simulated corresponds to an independent task, and each task is performed simultaneously using multi-threading technology; after the first iteration, enter the subsequent iteration stage, in In each iteration, each intermediate group is traversed to determine whether the number of faulty circuits in the current intermediate group is less than the first preset threshold; if the number of faulty circuits in the current intermediate group is less than the first preset threshold, the current intermediate group is directly taken as a final group; if the number of faulty circuits in the intermediate group is greater than or equal to the first preset threshold, it is determined whether the information gain between two adjacent iterations is less than the second preset threshold; if the information gain between two adjacent iterations is less than the second preset threshold, the current intermediate group is directly taken as a final group; if the information gain between two adjacent iterations is greater than or equal to the second preset threshold, each faulty circuit in the current intermediate group is re-simulated based on other test vectors in the test vector group, until the number of faulty circuits in the divided intermediate group is less than the first preset threshold, or the information gain between two adjacent iterations is less than the second threshold, the iteration is terminated to obtain the final group.
[0011] Optionally, for the intermediate group S and the intermediate groups (S1, S2, ..., S k ,…,S n ), the information gain between two adjacent iterations is calculated by the following formula:
[0012] IG(S)=H(S)-H(S1,S2,…,S n )
[0013]
[0014] n1+n2+…+n k +…+n n =n
[0015] k=1,2,…,n
[0016] Where n represents the number of faulty circuits in the middle group S, p i represents the probability corresponding to the i-th fault circuit in the intermediate group S, H(S) represents the information entropy of the intermediate group S, n k Indicates the middle group S k The number of fault circuits in k ) represents the middle group S k The information entropy of n ) represents the information entropy of the intermediate group S after grouping, IG(S) represents the information gain between two adjacent iterations of the intermediate group S, and if the previous iteration of the two adjacent iterations is the first iteration of the total, then S represents an initial grouping.
[0017] Optionally, the method performs equivalence verification on the fault circuits in each final group according to fault symmetry and fault transmissibility, and performs fault merging based on a union-find set on each equivalent fault circuit to obtain each equivalent fault set, including: traversing each final group, treating each fault circuit in the current final group as an independent set, setting the parent node of each fault circuit to itself, and setting the rank of each set to 0; performing equivalence verification on each fault circuit in the current final group according to fault symmetry and fault transmissibility to determine each equivalent fault circuit in the current final group; merging the sets corresponding to each equivalent fault circuit based on the rank of each set, and then performing path compression on the merged sets to finally obtain each equivalent fault set.
[0018] Optionally, the sets corresponding to the equivalent fault circuits are merged based on the ranks of the sets, and then the merged sets are path compressed to obtain equivalent fault sets, including: when two sets need to be merged, the ranks of the two sets need to be merged are compared; if the ranks of the two sets need to be merged are not equal, the root node of the set with the smaller rank is pointed to the root node of the set with the larger rank; if the ranks of the two sets need to be merged are equal, the root node of one of the sets is arbitrarily selected to point to the root node of the other set; the rank of the pointed set is increased by 1 to obtain the merged set; for the merged set, starting from the node to be found, traverse upward along the parent node of the node to be found until the root node is found, and while returning the root node, the parent node of each node on the traversal path is directly set to the found root node.
[0019] In the second aspect, an embodiment of the present application proposes a fault number reduction system based on equivalent grouping, including: an acquisition module, a simulation grouping module, a parallel iterative segmentation module, an equivalent merging module and an output module; the acquisition module is used to acquire a fault list and a gate-level netlist of a target circuit; the simulation grouping module is used to perform circuit topology structure analysis based on the gate-level netlist of the target circuit, generate a test vector group according to the circuit topology analysis structure result, inject each fault in the fault list into the target circuit to obtain each fault circuit, simulate each fault circuit based on several test vectors in the test vector group, and simulate each fault circuit according to the simulation. The method comprises the following steps: firstly performing an initial grouping of each fault circuit based on the true result, wherein the simulation results of each fault circuit in the same initial group are the same; secondly performing a parallel iterative segmentation module, which is used to perform parallel iterative segmentation of each initial group based on other test vectors in the test vector group and in accordance with the scale segmentation principle and the information gain segmentation principle to obtain a final grouping; thirdly performing an equivalent merging module, which is used to perform an equivalent verification of the fault circuits in each final grouping according to the fault symmetry and fault transmission, and perform a union-find set-based fault merger on each equivalent fault circuit to obtain each equivalent fault set; and fourthly performing an output module, which is used to generate and output an equivalent fault list based on each equivalent fault set.
[0020] In a third aspect, an embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for reducing the number of faults based on equivalent grouping as described in the first aspect above.
[0021] In a fourth aspect, an embodiment of the present application proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for reducing the number of faults based on equivalent grouping as described in the first aspect above.
[0022] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1is a flowchart of a method for reducing the number of faults based on equivalent grouping provided by an embodiment of the present application;
[0025] Figure 2 is a flow chart of partitioning based on circuit simulation provided by an embodiment of the present application;
[0026] Figure 3 is a flowchart of parallel iterative segmentation provided by an embodiment of the present application;
[0027] Figure 4 A flowchart of a fault merging based on a union-find set is provided by an embodiment of the present application;
[0028] Figure 5 is a structural diagram of a method for reducing the number of faults based on equivalent grouping provided by an embodiment of the present application;
[0029] Figure 6 is a schematic diagram of the composition structure of a system for reducing the number of faults based on equivalent grouping provided by another embodiment of the present application;
[0030] Figure 7 It is a structural schematic diagram of an electronic device provided by another embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the various embodiments of the present application, many technical details are proposed in order to make the reader better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is only for the convenience of description, and the specific implementation mode of the present application should not constitute any limitation. The various embodiments can be combined with each other and referenced to each other under the premise of no contradiction.
[0032] The fault simulation and verification process is the process of analyzing the behavior of the circuit under fault conditions by injecting various types of faults. Among them, the output values of faulty circuits with different faults may be the same on the input vector, so these faults can be called "equivalent faults". The set of all faults in the circuit can be divided into equivalent sets, so that all faults in the set are equivalent to each other. Fault simulation only needs to select one fault from the equivalent set for simulation. The process of finding equivalent faults is called fault compression. A key task in the fault simulation process is to determine which faults lead to the same circuit behavior, that is, to determine which faults are equivalent faults. The identification of equivalent faults can significantly simplify the fault analysis process, because equivalent faults only need to be processed once, reducing redundant workload. In recent years, in the research of fault compression methods, its core revolves around fault equivalence and fault dominance. Domestic and foreign teams have done a lot of research on fault compression. Lioy et al. proposed a method to compress faults by using functional fault equivalence, and Agrawal et al. proposed a fault compression method by using functional dominance. However, with the continuous expansion of circuit scale and the increase of gate circuit nodes, the number of faults that need to be verified also increases. The current fault compression methods face the problems of high computing resource consumption and low efficiency. Therefore, each team mainly focuses on circuit partitioning or fault partitioning to reduce the huge number of fault simulations, and "divide and conquer" large-scale circuits or large numbers of fault sets to improve the efficiency of fault compression methods in large-scale circuit fault simulation.
[0033] Hahn et al. proposed a hierarchical fault compression method, the core idea of which is to divide complex circuits into multiple levels, each level contains one or more subcircuits, each subcircuit can be further decomposed into smaller subcircuits until the bottom level of basic logic gates and triggers, thereby simplifying the design, analysis and testing process. However, this method is highly dependent on the hierarchical structure of the circuit. If the relationship between subcircuits is very complex, it may become difficult to perform fault equivalence analysis at the subcircuit level, and this complexity may lead to reduced analysis efficiency.
[0034] Sandireddy et al. proposed a method to optimize the fault folding process by using the hierarchical structure in circuit design. If two faults are functionally equivalent in a subcircuit (module), they are also equivalent in the larger circuit containing the subcircuit, that is, fault folding is performed at the subcircuit level and the result is then applied to the entire circuit. However, this method relies on the reuse of subcircuits. If the number of unique subcircuits in the circuit is large and the reuse rate is low, the advantage of this method will be weakened.
[0035] Quoc et al. proposed a Boolean satisfiability-based method to detect equivalent injection faults in mapped netlists. This method combines structural pruning and functional analysis to detect equivalent faults through iterative Boolean satisfiability. The core idea is to use a SAT solver (Boolean satisfiability problem solver) to prove or disprove the equivalence of any two faults and to use counterexamples generated by the SAT solver to refine candidate equivalent fault classes. However, for very large industrial circuits, the computational complexity of the SAT solver may still be very large, resulting in a long processing time, and the coverage achieved by this method is not high enough.
[0036] In summary, the current fault compression method has at least the following problems:
[0037] 1) Over-reliance on circuit structure
[0038] Although the hierarchical fault compression method can simplify the design, analysis, and testing process by dividing complex circuits into multiple levels, this method is very dependent on the hierarchical structure of the circuit. If the relationship between subcircuits is very complex, it may become difficult to perform fault equivalence analysis at the subcircuit level, resulting in reduced analysis efficiency. The method of optimizing the fault folding process by utilizing the hierarchical structure in circuit design relies on the reuse of subcircuits. If the number of unique subcircuits in the circuit is large and the reuse rate is low, the advantage of this method will be weakened. Even if fault folding is performed at the subcircuit level and the results are then applied to the entire circuit, the effect of this optimization will be greatly reduced if there are many unique subcircuits and they are not often reused.
[0039] 2) Equivalent fault coverage is not high
[0040] Faults are transitive. If fault a is equivalent to fault b, and fault b is equivalent to fault c, then fault a is also equivalent to fault c. If fault a and fault b have been determined to be equivalent, and fault b and fault c have been determined to be equivalent, then there is no need to verify that fault a is equivalent to fault c. Current fault compression methods do not consider the transitivity of faults and cannot fully determine the equivalence between all faults, resulting in a low coverage rate of equivalent faults. If all faults are traversed for equivalence verification, the time cost will increase exponentially with the number of faults and the circuit scale.
[0041] 3) High time and computational costs
[0042] When the circuit scale is large, due to the constraints of the circuit structure, it will take a lot of time to analyze the circuit hierarchy, resulting in high time and computational costs and low efficiency for fault compression methods based on circuit hierarchy. Especially in industrial applications, the number of faults may reach hundreds of thousands or even more, resulting in an extremely slow verification process. When the number of faults is large, the number of fault pairs that need to be compared for equivalence will also be very large, resulting in an exponential increase in the amount of calculation.
[0043] In order to solve the problems of over-reliance on circuit structure, low equivalent fault coverage, and high time and computational costs in the currently proposed fault compression methods, an embodiment of the present application proposes a fault number reduction method based on equivalent grouping, which is applied to electronic devices, wherein the electronic device may be a terminal or a server. In this embodiment and the following embodiments, the electronic device is illustrated using the server as an example. The implementation details of the fault number reduction method based on equivalent grouping proposed in this embodiment are specifically described below. The following content is only the implementation details provided for ease of understanding and is not necessary for the implementation of this solution.
[0044] The specific process of the method for reducing the number of faults based on equivalent grouping proposed in this embodiment can be as follows: Figure 1 As shown in the steps in, specifically including:
[0045] Step 101, obtaining a fault list and a gate-level netlist of a target circuit.
[0046] In a specific implementation, the method for reducing the number of faults based on equivalent grouping proposed in this embodiment can be roughly divided into three stages, namely, division based on circuit simulation, parallel iterative segmentation, and fault merging based on union-find set. When fault compression is required, the division stage based on circuit simulation is first entered, and the server needs to obtain the fault list and the gate-level netlist of the target circuit. The information in the fault list includes the fault name, fault type, fault location, etc.
[0047] Step 102, perform circuit topology analysis based on the gate-level netlist of the target circuit, generate a test vector group based on the circuit topology analysis results, inject each fault in the fault list into the target circuit to obtain each fault circuit, simulate each fault circuit based on several test vectors in the test vector group, and initially group each fault circuit according to the simulation results.
[0048] In the specific implementation, Figure 2 As shown, the input of the partition based on circuit simulation is the fault list and the gate-level netlist of the target circuit, and the output is an initial group containing different fault circuits. The server first performs circuit topology structure analysis based on the gate-level netlist of the target circuit, and generates a test vector group according to the results of the circuit topology analysis structure. The test vectors in the test vector group will be used as stimuli in the simulation process. The server injects each fault in the fault list into the target circuit to obtain each fault circuit. At this time, based on several test vectors in the test vector group, each fault circuit is simulated separately, and the simulation results of each fault circuit can be obtained. The server regards each fault circuit with the same simulation results as the same equivalence class and divides them into the same initial group, while each fault circuit with different simulation results belongs to different equivalence classes and needs to be divided into different initial groups.
[0049] In an example, the server performs circuit topology analysis based on the gate-level netlist of the target circuit. The process of generating a test vector group according to the circuit topology analysis result can be divided into three sub-processes: constructing a circuit diagram, topological sorting, and generating test vectors.
[0050] Constructing a circuit diagram means parsing out each component (logic gate) of the target circuit, which can be achieved using structures in C++. The server first needs to define the data structure, that is, define a structure in the C++ language to represent the logic gate. The information of the structure includes the gate type, input and output of the logic gate. Then define a class to represent the circuit diagram of the target circuit. The defined class contains two data structures, one of which is used to store logic gates. The key of the data structure represents the gate name of the logic gate, and the value represents the structure of the logic gate. The other data structure is used to store the connection diagram. The key of the data structure represents the name of the node, and the value represents the name list of the logic gate connected to the node. The node value here is the input and output of the logic gate.
[0051] Next, the server parses the gate-level netlist of the target circuit and uses std::vector <std::string>Store the netlist information of each row, traverse each row of the gate-level netlist of the target circuit, decompose each row into gate name, gate type, input and output, create an object representing the logic gate, and set its gate type, input and output, create an object representing the connection diagram to add the object representing the logic gate to the circuit diagram of the target circuit. At this point, the circuit diagram has been constructed and the topological sorting process can be entered.
[0052] The purpose of the topological sorting process is to determine the order of signal propagation. The server can use recursion to perform a depth-first search on each unvisited node, recursively visit all its successor nodes, and add the node to the topological sorting result during the fallback process. First, the server needs to create a visit set to record the visited nodes, then create a stack to store the results of the topological sorting, and finally define a recursive function. Subsequently, the server traverses each node, marks the current node as visited, and then traverses all adjacent nodes of the current node, recursively calls the recursive function for each unvisited adjacent node, and finally pushes the current node into the stack. When all nodes are marked as visited, the server outputs the node order stored in the stack as the topological sorting result, and obtains the circuit topology structure analysis result.
[0053] During the test vector generation process, the server needs to use the inputs and outputs of all logic gates in the target circuit as test nodes, and then generate test vectors based on the circuit topology analysis results, and record the test nodes covered by the generated test vectors. Then, new test vectors are generated based on the uncovered test nodes, and finally a test vector group is formed based on all the generated test vectors to ensure that the vast majority of nodes can be covered.
[0054] In one example, the server uses a simulator to simulate a faulty circuit. First, a scripting language is used to extract information about each fault in a fault list, and an injection file for each fault is generated. The content of the injection file includes injection time, injection node, and injection simulator command. Then, the injection file for each fault is inserted into the test platform file in sequence to obtain each faulty circuit. After that, the server simulates each faulty circuit based on several test vectors in the test vector group, obtains the output waveform of each faulty circuit (waveform file in VCD format), and uses the simulator vcdiff command to compare the output waveforms of each faulty circuit. Faulty circuits with the same output waveform are regarded as the same equivalence class and are classified into the same initial group. Faulty circuits with different output waveforms are regarded as different equivalence classes and are classified into different initial groups.
[0055] Step 103 , based on other test vectors in the test vector group, and in accordance with the scale segmentation principle and the information gain segmentation principle, each initial group is segmented in parallel and iteratively to obtain a final group.
[0056] In a specific implementation, after obtaining each initial grouping, the server can perform parallel iterative segmentation on each initial grouping based on other test vectors in the test vector group according to the scale segmentation principle and the information gain segmentation principle to obtain the final grouping. The scale segmentation principle means that groups with too few fault circuits will not be segmented, and the information gain segmentation principle means that if the segmentation effect between two consecutive segmentations is not significant, no segmentation will be performed. These two principles can effectively avoid the waste of computing resources.
[0057] In one example, the parallel iterative segmentation process can be as follows Figure 3 As shown. In the first iteration, the server traverses each initial grouping, and determines whether the number of faulty circuits in the current initial grouping is less than the first preset threshold (scale) based on the scale segmentation principle. If the number of faulty circuits in the current initial grouping is less than the first preset threshold, it means that the current initial grouping can be quickly analyzed later, and the server directly uses the current initial grouping as a final grouping. If the number of faulty circuits in the current initial grouping is greater than or equal to the first preset threshold, each faulty circuit in the current initial grouping is simulated again based on other test vectors in the test vector group, and each faulty circuit in the current initial grouping is intermediately grouped according to the simulation results. After completing the first traversal, the server can obtain several intermediate groups, and know which initial group these intermediate groups are divided from.
[0058] It is worth noting that the server treats each group that needs to be re-simulated as an independent task. Each independent task is performed simultaneously using multi-threading technology. The server uses a thread pool to manage threads to ensure efficient use of multi-core processors. Using C++ <thread>The library implements multi-threaded processing, and each thread is responsible for the division task of a group.
[0059] In each subsequent iteration phase, the server needs to traverse each intermediate group and determine whether the number of faulty circuits in the current intermediate group is less than the first preset threshold based on the scale segmentation principle. If the number of faulty circuits in the current intermediate group is less than the first preset threshold, the current intermediate group is directly used as a final group. If the number of faulty circuits in the intermediate group is greater than or equal to the first preset threshold, the server continues to determine whether the information gain between two adjacent iterations is less than the second preset threshold (IGth) based on the information gain segmentation principle. If the information gain between two adjacent iterations is less than the second preset threshold, it means that the division effect is not obvious. At this time, the server directly uses the current intermediate group as a final group. If the information gain between two adjacent iterations is greater than or equal to the second preset threshold, it means that the division effect is more obvious, and it can continue to be divided down. The server re-simulates each faulty circuit in the current intermediate group based on other test vectors in the test vector group until the number of faulty circuits in all divided intermediate groups is less than the first preset threshold, or the information gain between two adjacent iterations is less than the second preset threshold. At this time, the iteration ends and the final group is obtained.
[0060] In one example, for the middle group S and the middle groups (S1, S2, ..., S k ,…,S n ), the information gain between two adjacent iterations can be calculated by the following formula:
[0061] IG(S)=H(S)-H(S1,S2,…,S n )
[0062]
[0063] n1+n2+…+n k +…+n n =n
[0064] k=1,2,…,n
[0065] Where n represents the number of faulty circuits in the middle group S, p i represents the probability corresponding to the i-th fault circuit in the intermediate group S, H(S) represents the information entropy of the intermediate group S, n k Indicates the middle group S k The number of fault circuits in k ) represents the middle group S k The information entropy of n ) represents the information entropy of the intermediate group S after grouping, IG(S) represents the information gain between two adjacent iterations of the intermediate group S, and if the previous iteration of the two adjacent iterations is the first iteration of the total, then S represents an initial grouping.
[0066] Step 104 , based on fault symmetry and fault transferability, perform equivalence verification on the fault circuits in each final group, and perform fault merging based on a union-find set on each equivalent fault circuit to obtain each equivalent fault set.
[0067] In a specific implementation, after obtaining the final grouping, the server can perform equivalence verification on the fault circuits in each final grouping according to fault symmetry and fault propagation, and perform fault merging based on a union-find set on each equivalent fault circuit to obtain each equivalent fault set.
[0068] Assume that a final group contains t faulty circuits. If each pair of faulty circuits is to be verified for equivalence (using an equivalence verification tool for equivalence judgment, which is not described in this application), theoretically, t×(t-1) verifications are required. However, due to the symmetry of the equivalence relation (i.e., if faulty circuit a is equivalent to faulty circuit b, then faulty circuit b is also equivalent to faulty circuit a), we do not need to repeatedly verify that a≡b and b≡a, which reduces the number of direct verifications to t×(t-1) / 2. In actual operation, the number of verifications depends not only on the number of faulty circuits in the final group, but also on the number of equivalent circuits. In the best case, if all faulty circuits in the final group are equivalent, using the symmetry of the equivalence relation, we only need to perform t-1 verifications to complete all verifications, and the algorithm complexity is O(t). In the worst case, if all faulty circuits in the final group are not equivalent, each pair of faulty circuits must be verified one by one, then t×(t-1) / 2 verifications are required, and the algorithm complexity is O(t 2 ). In addition, considering the transitivity of faults (if fault circuit a is equivalent to fault circuit b, and fault circuit b is equivalent to fault circuit c, then fault circuit a is also equivalent to fault circuit c), if a≡b and b≡c have been determined, then a≡c does not need to be verified again, which can further reduce the number of verifications. It can be seen that the efficiency of fault equivalence verification in the final group depends to a large extent on the number of equivalent fault circuits. More importantly, due to the symmetry and transitivity of equivalence, there are "obvious" equivalent fault circuits. Equivalence verification of these known equivalent circuits will waste unnecessary time and computing resources. Therefore, identifying and utilizing these "obvious" equivalent fault circuits can significantly improve the efficiency of the verification process and avoid unnecessary duplication of work.
[0069] In this regard, the server can perform fault merging based on the union-find set (search merging) for each equivalent fault circuit, such as Figure 4 As shown in the figure, the union-find set is an efficient data structure used to handle the merging and searching operations of disjoint sets. The core idea of the algorithm is searching and merging, that is, querying whether two elements are in the same set and quickly merging two different sets. The server traverses each final group, treats each fault circuit in the current final group as an independent set, sets the parent node of each fault circuit to itself, sets the rank of each set to 0, and then performs equivalence verification on each fault circuit in the current final group based on fault symmetry and fault transmission, determines each equivalent fault circuit in the current final group, and finally merges the sets corresponding to each equivalent fault circuit based on the rank of each set, and then performs path compression on the merged set to finally obtain each equivalent fault set.
[0070] When two sets need to be merged, the server compares the ranks of the two sets to be merged. If the ranks of the two sets to be merged are not equal, the root node of the set with the smaller rank points to the root node of the set with the larger rank. If the ranks of the two sets to be merged are equal, the root node of one of the sets is arbitrarily selected to point to the root node of the other set. After completing the pointing, the server increases the rank of the pointed set by 1 to obtain the merged set. Rank-based merging is an optimization strategy used to reduce the imbalance of the tree that may be caused by the merge operation. This strategy ensures that the smaller tree is always merged into the larger tree during the merge, thereby keeping the height of the tree as small as possible and improving the efficiency of the search operation.
[0071] For the merged set, the server starts from the node to be found, traverses upward along the parent node of the node to be found, until the root node is found, and while returning to the root node, the parent node of each node on the traversal path is directly set to the found root node. In this way, the originally deep tree structure is compressed into an almost flat structure, and the height of the tree is greatly reduced, thereby speeding up subsequent search operations.
[0072] Step 105: Generate and output an equivalent fault list based on each equivalent fault set.
[0073] In a specific implementation, after obtaining each equivalent fault set, the server may convert the data format based on each equivalent fault set, generate an equivalent fault list, and output it.
[0074] In an example, the three stages of the method for reducing the number of faults based on equivalent grouping proposed in this embodiment can be as follows: Figure 5 shown.
[0075] In this embodiment, firstly, a division based on circuit simulation is performed, that is, the initial division of faults is performed from the perspective of circuit output response, thereby avoiding the disadvantage of over-reliance on circuit structure caused by fault division based on circuit level. For the initial grouping, further division is performed by parallel iterative segmentation, so that the number of fault circuits contained in the grouping becomes smaller and smaller, until the final grouping is obtained after no further division. Such small-scale grouping is convenient for reducing the number of subsequent equivalence verifications, thereby reducing the compression time. At the same time, each grouping that needs to be further divided is performed by a parallel multi-threading method, which greatly improves the overall iteration speed and solves the problem of high time cost and computational cost of fault compression. Considering the symmetry and transitivity of the fault, the final grouping is subjected to a fault merging based on a union-find set (search merging) to optimize the equivalence verification process between multiple fault circuits, avoid redundant verification of obviously equivalent faults, and be able to fully connect the divided faults to improve the equivalent fault coverage.
[0076] Another embodiment of the present application proposes a system for reducing the number of faults based on equivalent grouping. The implementation details of the system for reducing the number of faults based on equivalent grouping proposed in this embodiment are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for implementing this embodiment. Figure 6 It is a structural diagram of a fault quantity reduction system based on equivalent grouping proposed in this embodiment, including: an acquisition module 201, a simulation grouping module 202, a parallel iterative segmentation module 203, an equivalent merging module 204 and an output module 205.
[0077] The acquisition module 201 is used to acquire a fault list and a gate-level netlist of a target circuit.
[0078] The simulation grouping module 202 is used to perform circuit topology analysis based on the gate-level netlist of the target circuit, generate a test vector group according to the circuit topology analysis structure results, inject each fault in the fault list into the target circuit to obtain each fault circuit, simulate each fault circuit based on several test vectors in the test vector group, and initially group each fault circuit according to the simulation results, wherein the simulation results of each fault circuit in the same initial group are the same.
[0079] The parallel iterative segmentation module 203 is used to perform parallel iterative segmentation on each initial grouping based on other test vectors in the test vector group according to the scale segmentation principle and the information gain segmentation principle to obtain final groups.
[0080] The equivalent merging module 204 is used to perform equivalent verification on the fault circuits in each final group according to fault symmetry and fault transferability, and perform fault merging based on a union-find set on each equivalent fault circuit to obtain each equivalent fault set.
[0081] The output module 205 is used to generate and output an equivalent fault list based on each equivalent fault set.
[0082] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiments.
[0083] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.
[0084] Another embodiment of the present application relates to an electronic device, such as Figure 7 As shown, the electronic device includes: at least one processor 301; and a memory 302 communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301, and the instructions are executed by the at least one processor 301 so that the at least one processor 301 can execute a method for reducing the number of faults based on equivalent grouping described in the above-mentioned method embodiments.
[0085] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art, so they are not further described in this article. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0086] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0087] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, a method for reducing the number of faults based on equivalent grouping described in the above method embodiments can be implemented.
[0088] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM (Read-Only Memory), RAM (Random Access Memory), disk or optical disk and other media that can store program codes.
[0089] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.< / thread> < / std::string>
Claims
1. A method for reducing the number of faults based on equivalent grouping, characterized in that: include: Obtain a fault list and a gate-level netlist of the target circuit; Performing circuit topology analysis based on the gate-level netlist of the target circuit, generating a test vector group according to the circuit topology analysis structure result, injecting each fault in the fault list into the target circuit to obtain each fault circuit, simulating each fault circuit based on a number of test vectors in the test vector group, and initially grouping each fault circuit according to the simulation result; wherein the simulation results of each fault circuit in the same initial group are the same; Based on other test vectors in the test vector group, each initial group is iteratively segmented in parallel according to the scale segmentation principle and the information gain segmentation principle to obtain a final group; According to fault symmetry and fault transmission, the fault circuits in each final group are verified to be equivalent, and the faults of each equivalent fault circuit are merged based on the union-find set to obtain each equivalent fault set; Generate an equivalent fault list based on each equivalent fault set and output it.
2. The method for reducing the number of faults based on equivalent grouping according to claim 1, characterized in that: The circuit topology analysis is performed based on the gate-level netlist of the target circuit, and a test vector group is generated according to the circuit topology analysis result, including: A structure in C++ language is defined to represent a logic gate, wherein the information of the structure includes the gate type, input and output of the logic gate, and a class is defined to represent the circuit diagram of the target circuit, wherein the class includes two data structures, wherein one data structure is used to store the logic gate, wherein the key represents the gate name of the logic gate, and the value represents the structure of the logic gate, and the other data structure is used to store a connection diagram, wherein the key represents the name of the node, and the value represents the name list of the logic gate connected to the node; wherein the node is the input and output of the logic gate; Traversing each row of the gate-level netlist of the target circuit, decomposing each row into gate name, gate type, input and output, creating an object representing a logic gate and setting its gate type, input and output, creating an object representing a connection diagram to add the object representing the logic gate to the circuit diagram of the target circuit; Create a visit set to record the visited nodes, create a stack to store the results of topological sorting, and finally define a recursive function; Traverse each node, mark the current node as visited, then traverse all adjacent nodes of the current node, recursively call the recursive function for each unvisited adjacent node, and finally push the current node into the stack; When all nodes are marked as visited, the order of the nodes stored in the stack is output as a topological sorting result to obtain a circuit topology structure analysis result; The inputs and outputs of all logic gates in the target circuit are used as test nodes. Based on the circuit topology analysis results, test vectors are generated, and the test nodes covered by the generated test vectors are recorded. New test vectors are then generated based on the uncovered test nodes. Finally, a test vector group is formed based on all the generated test vectors.
3. The method for reducing the number of faults based on equivalent grouping according to claim 2, characterized in that: The step of injecting each fault in the fault list into the target circuit to obtain each fault circuit, simulating each fault circuit based on a plurality of test vectors in the test vector group, and initially grouping each fault circuit according to the simulation result includes: Using a scripting language, extracting information of each fault in the fault list, generating an injection file for each fault, wherein the content of the injection file includes injection time, injection node and injection simulator command; Insert the injection files of each fault into the test platform file in sequence to obtain each fault circuit; Simulating each fault circuit based on a plurality of test vectors in the test vector group to obtain an output waveform of each fault circuit; Compare the output waveforms of each fault circuit, classify the fault circuits with the same output waveform into the same initial group, and classify the fault circuits with different output waveforms into different initial groups.
4. The method for reducing the number of faults based on equivalent grouping according to claim 1, characterized in that: The step of performing parallel iterative segmentation on each initial grouping based on other test vectors in the test vector group according to the scale segmentation principle and the information gain segmentation principle to obtain the final grouping includes: In the first iteration, each initial group is traversed to determine whether the number of faulty circuits in the current initial group is less than a first preset threshold; If the number of faulty circuits in the current initial group is less than the first preset threshold, directly taking the current initial group as a final group; If the number of faulty circuits in the current initial group is greater than or equal to the first preset threshold, each faulty circuit in the current initial group is re-simulated based on other test vectors in the test vector group, and each faulty circuit in the current initial group is intermediately grouped according to the simulation result; wherein each initial group that needs to be re-simulated corresponds to an independent task, and each task is performed simultaneously using multi-threading technology; After the first iteration is completed, the subsequent iteration phase is entered. In each iteration, each intermediate group is traversed to determine whether the number of faulty circuits in the current intermediate group is less than the first preset threshold; If the number of faulty circuits in the current intermediate group is less than the first preset threshold, directly taking the current intermediate group as a final group; If the number of faulty circuits in the intermediate group is greater than or equal to the first preset threshold, determining whether the information gain between two adjacent iterations is less than a second preset threshold; If the information gain between two adjacent iterations is less than the second preset threshold, directly taking the current intermediate group as a final group; If the information gain between two adjacent iterations is greater than or equal to the second preset threshold, then each faulty circuit in the current intermediate group is simulated again based on other test vectors in the test vector group until the number of faulty circuits in the divided intermediate group is less than the first preset threshold, or the information gain between two adjacent iterations is less than the second threshold, the iteration is terminated, and the final grouping is obtained.
5. The method for reducing the number of faults based on equivalent grouping according to claim 4, characterized in that: For the intermediate group S and the intermediate groups (S1, S2, ..., S k ,…,S n ), the information gain between two adjacent iterations is calculated by the following formula: IG(S)=H(S)-H(S1,S2,...,S n ) n1+n2+…+n k +…+n n =n k=1,2,...,n Where n represents the number of faulty circuits in the middle group S, p i represents the probability corresponding to the i-th fault circuit in the intermediate group S, H(S) represents the information entropy of the intermediate group S, n k Indicates the middle group S k The number of fault circuits in k ) represents the middle group S k The information entropy of n ) represents the information entropy of the intermediate group S after grouping, IG(S) represents the information gain between two adjacent iterations of the intermediate group S, and if the previous iteration of the two adjacent iterations is the first iteration of the total, then S represents an initial grouping.
6. The method for reducing the number of faults based on equivalent grouping according to claim 1, characterized in that: According to the fault symmetry and fault transmission, the fault circuits in each final group are verified to be equivalent, and each equivalent fault circuit is merged based on the union-find set to obtain each equivalent fault set, including: Traverse each final group, treat each faulty circuit in the current final group as an independent set, set the parent node of each faulty circuit to itself, and set the rank of each set to 0; According to the fault symmetry and fault transmission, each fault circuit in the current final group is equivalently verified to determine each equivalent fault circuit in the current final group; Based on the rank of each set, the sets corresponding to each equivalent fault circuit are merged, and then the merged sets are path compressed to finally obtain each equivalent fault set.
7. The method for reducing the number of faults based on equivalent grouping according to claim 6, characterized in that: The method of merging the sets corresponding to the equivalent fault circuits based on the rank of each set, and then performing path compression on the merged sets to obtain the equivalent fault sets includes: When two sets need to be merged, the ranks of the two sets to be merged are compared. If the ranks of the two sets to be merged are not equal, the root node of the set with the smaller rank is pointed to the root node of the set with the larger rank. If the ranks of the two sets to be merged are equal, the root node of one of the sets is arbitrarily selected to point to the root node of the other set. Increase the rank of the pointed set by 1 to obtain the merged set; For the merged set, starting from the node to be found, traverse upward along the parent node of the node to be found until the root node is found. While returning the root node, the parent node of each node on the traversal path is directly set to the found root node.
8. A system for reducing the number of faults based on equivalent grouping, characterized in that: include: Acquisition module, simulation grouping module, parallel iterative segmentation module, equivalent merging module and output module; An acquisition module, used to acquire a fault list and a gate-level netlist of a target circuit; A simulation grouping module, used for performing circuit topology analysis based on the gate-level netlist of the target circuit, generating a test vector group according to the circuit topology analysis structure result, injecting each fault in the fault list into the target circuit to obtain each fault circuit, simulating each fault circuit respectively based on a number of test vectors in the test vector group, and initially grouping each fault circuit according to the simulation result, wherein the simulation result of each fault circuit in the same initial group is the same; A parallel iterative segmentation module, used to perform parallel iterative segmentation on each initial grouping based on other test vectors in the test vector group according to a scale segmentation principle and an information gain segmentation principle to obtain a final grouping; An equivalent merging module is used to perform equivalent verification on the fault circuits in each final grouping according to fault symmetry and fault transmission, and to perform fault merging based on a union-find set on each equivalent fault circuit to obtain each equivalent fault set; The output module is used to generate and output an equivalent fault list based on each equivalent fault set.
9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method for reducing the number of faults based on equivalent grouping as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a method for reducing the number of faults based on equivalent grouping as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Waveform comparison method, electronic equipment and storage medium
CN121508502A
