Efficient fault simulation and diagnosis method and device for memory and storage medium

By using parallel threads and optimized data structures on the GPU platform, efficient fault simulation is achieved, which solves the problem of slow fault simulation in the existing technology and significantly improves performance.

CN118569170AInactive Publication Date: 2024-08-30中科鉴芯(北京)科技有限责任公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411037334.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing fault simulation algorithms are difficult to further improve the speed of fault simulation on CPU architecture platforms, resulting in slower chip fault simulation.

Method used

The GPU's parallel threads are used for fault simulation, and the fault under test of the target digital circuit is simulated in parallel through the test vector set and logical results. The priority queue and fixed-length array are used to optimize the event queue and the data structure of the faulty machine, and the GPU memory is shared to Improve memory utilization.

Benefits of technology

It significantly improves the speed of fault simulation. Compared with the parallel vector fault simulation algorithm of the CPU platform, it achieves a performance improvement of more than ten times to dozens of times, solving the problem of slow fault simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569170A
    Figure CN118569170A
Patent Text Reader

Abstract

The invention discloses an efficient fault simulation and diagnosis method and device for a memory and a storage medium. The method comprises the following steps: in the process of performing fault diagnosis on a target digital circuit, performing logic simulation on the target digital circuit by using a test vector set to obtain a first logic result; m threads of the GPU are called, parallel fault simulation is carried out on M to-be-tested faults of the target digital circuit by using the test vectors in the test vector set and the first logic result to obtain a fault simulation result, the M threads are threads running in parallel, the number of the test vectors is not larger than the machine word length N of the GPU, and M and N are positive integers; and in the process of performing parallel fault simulation on the M to-be-tested faults of the target digital circuit by using the test vectors in the test vector set and the first logic result, the M threads share a first storage space in which the first logic result is located in a video memory of the GPU. According to the method and the device, the technical problem of relatively low fault simulation speed of the chip in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip testing, and more specifically, to a memory-efficient fault simulation and diagnosis method and device, and a storage medium. Background Art

[0002] This section is intended to provide a background or context to what is stated in the claims or specification, and no admission is made that what is described herein is prior art by inclusion in this section.

[0003] There are many ways to classify fault models of digital circuits. From the perspective of fault behavior, they can be divided into stuck-at fault model, bridge fault model, delay fault model, stuck-open fault model, etc.; from the perspective of simulation level, they can be divided into register transfer level simulation, gate level simulation (the verification object of gate-level simulation is the gate-level netlist. The circuit is directly instantiated using standard cell libraries and IP models (including Memory, IO, Phy, etc.), and has complete functions and timing behaviors. The gate-level netlist usually refers to the netlist obtained after synthesis (without clock tree), or it can refer to the netlist after layout and routing (with clock tree)) and transistor-level simulation.

[0004] At present, the academic and industrial circles mainly use gate-level stuck-at fault simulation. This application is for fault simulation of gate-level stuck-at fault model. Gate-level stuck-at fault refers to a fault in which the output of a logic gate remains unchanged at a certain fixed value. For example, a NOT gate should output 1 when its input is 0 and 0 when its input is 1. When the Stuck-at 0 fault exists, its output remains unchanged at 0 regardless of whether its input is 0 or 1.

[0005] Existing fault simulation algorithms are all accelerated simulation algorithms proposed for the CPU architecture. Although they have significant performance improvements over basic serial simulation algorithms, they are limited by the performance characteristics of the CPU architecture platform itself, and the speed of fault simulation is difficult to further improve.

[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0007] The embodiments of the present application provide a memory-efficient fault simulation and diagnosis method and device, and a storage medium, so as to at least solve the technical problem of slow chip fault simulation speed in the related art.

[0008] According to one aspect of an embodiment of the present application, a memory-efficient fault simulation and diagnosis method is provided, including: in a process of fault diagnosis of a target digital circuit, using a test vector set to perform logic simulation on the target digital circuit to obtain a first logic result; calling M threads of a GPU, using test vectors in the test vector set and the first logic result to perform parallel fault simulation on M faults to be tested in the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; in the process of using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on M faults to be tested in the target digital circuit, the M threads share a first storage space where the first logic result is located in the video memory of the GPU.

[0009] Optionally, calling M threads of the GPU, using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on M faults to be tested of the target digital circuit, and obtaining a fault simulation result, including: when performing the j-th round of fault simulation, selecting N test vectors from the test vector set, calling the i-th thread among the M threads, using the N test vectors and the first logic result to perform fault simulation on the i-th fault to be tested among the M faults to be tested, and obtaining a fault simulation result of the i-th fault to be tested, wherein the N test vectors are test vectors running in parallel, the value range of j is [1, (J-1)], the value of J is obtained by rounding up the quotient between the number of test vectors in the test vector set and N, and the value of i is [1, M]; when performing the J-th round of fault simulation, selecting all test vectors that have not been selected from the test vector set, calling the i-th thread, using the test vectors selected in this round and the first logic result to perform fault simulation on the i-th fault to be tested, and obtaining a fault simulation result of the i-th fault to be tested.

[0010] Optionally, in the process of performing parallel fault simulation on M faults to be tested in the target digital circuit using the test vectors in the test vector set and the first logic result, the method also includes: when the output logic value of any gate in the target digital circuit does not match the corresponding logic value in the first logic result, treating the gate as a faulty gate and writing all output gates of the faulty gate into an event queue, wherein the event queue is stored in a second storage space in the video memory.

[0011] Optionally, in the process of performing parallel fault simulation on M to-be-tested faults of the target digital circuit using the test vectors and logic simulation results in the test vector set, the method also includes: taking out a gate from the event queue as the target gate; when the input gate of the target gate exists in the second logic result, taking out the input logic value of the target gate from the second logic result, and when the input gate of the target gate does not exist in the second logic result, taking out the input logic value of the target gate from the first logic result, wherein the second logic result is used to store the logic value of the fault and is stored in the second storage space in the video memory; inputting the obtained input logic value into the target gate to obtain the output logic value of the target gate; when the output logic value of the target gate does not match the corresponding logic value in the first logic result, storing the output logic value of the target gate in the second logic result, and writing all output gates of the target gate into the event queue.

[0012] Optionally, before using the test vectors and logic simulation results in the test vector set to perform parallel fault simulation on M faults to be tested in the target digital circuit, the method also includes: sorting all gates in the target digital circuit by level to obtain a level index; using the level indexes of all gates in the target digital circuit to establish a priority queue, wherein the event queue is implemented based on the priority queue.

[0013] Optionally, after performing parallel fault simulation on M faults to be tested of the target digital circuit using the test vectors and logic simulation results in the test vector set, the method further includes: determining that the current fault to be tested is detected by the current test vector when the output logic value of any gate of the last layer of the target digital circuit does not match the corresponding logic value in the first logic result; and determining that the current fault to be tested is not detected by the current test vector when the output logic values ​​of all gates of the last layer of the target digital circuit do not match the corresponding logic values ​​in the first logic result.

[0014] Optionally, before extracting the input logic value of the target gate from the second logic result, the method further includes: using a fixed-length array to store the second logic result, wherein the fixed-length array uses a binary search method to implement data search.

[0015] According to another aspect of an embodiment of the present application, a memory-efficient fault simulation and diagnosis device is also provided, including: a logic simulation unit, used to perform logic simulation on the target digital circuit using a test vector set during fault diagnosis of the target digital circuit to obtain a first logic result; a fault simulation unit, used to call M threads of the GPU, and use the test vectors in the test vector set and the first logic result to perform parallel fault simulation on M faults to be tested in the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; a sharing unit, used to instruct the M threads to share the first storage space where the first logic result is located in the video memory of the GPU during parallel fault simulation on M faults to be tested in the target digital circuit using the test vectors in the test vector set and the first logic result.

[0016] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, the storage medium including a stored program, and the above method is executed when the program is run.

[0017] According to another aspect of an embodiment of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above method through the computer program.

[0018] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the embodiments of the above method.

[0019] In an embodiment of the present application, in the process of fault diagnosis of a target digital circuit, a test vector set is used to perform logic simulation on the target digital circuit to obtain a first logic result; M threads of the GPU are called, and the test vectors in the test vector set and the first logic result are used to perform parallel fault simulation on the M faults to be tested of the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; in the process of performing parallel fault simulation on the M faults to be tested of the target digital circuit using the test vectors in the test vector set and the first logic result, the M threads share the first storage space where the first logic result is located in the video memory of the GPU, thereby solving the technical problem of slow fault simulation speed of the chip in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flow chart of an optional memory-efficient fault simulation and diagnosis method according to an embodiment of the present application; Figure 2 is a schematic diagram of an optional circuit gate structure according to an embodiment of the present application; Figure 3 is a schematic diagram of an optional memory-efficient fault simulation solution according to an embodiment of the present application; Figure 4 is a schematic diagram of an optional circuit gate structure according to an embodiment of the present application; Figure 5 is a schematic diagram of an optional circuit gate structure according to an embodiment of the present application; Figure 6 is a schematic diagram of an optional memory-efficient fault simulation and diagnosis device according to an embodiment of the present application; Figure 7 It is a structural block diagram of a terminal according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] The verification and testing of digital logic circuits cannot be separated from simulation. Simulation is divided into logic simulation and fault simulation. Logic simulation is to use computer software to calculate the output response of the circuit under test under a given input stimulus, while fault simulation is to calculate the output response of the circuit under test under a given input stimulus when a fault exists. Among them, fault simulation needs to calculate the output response of each fault under each vector. Assuming there are m faults and n groups of vectors, the time complexity of the fault simulation algorithm is O(mn). With the increase in the number of vectors and the expansion of the circuit scale, the time overhead of fault simulation will increase sharply, even to an unacceptable level. Therefore, acceleration is required, such as using parallel fault (Parallel Fault) fault simulation, parallel vector (Parallel Pattern) fault simulation, concurrent fault simulation, etc. These fault simulation algorithms are all accelerated simulation algorithms proposed for CPU architecture, and the acceleration effect is limited.

[0024] As mentioned above, the CPU architecture can be accelerated in the fault simulation algorithm. Although the performance is improved compared to the basic serial simulation algorithm, it is difficult to further improve the speed of fault simulation due to the performance characteristics of the CPU architecture platform itself. In view of this, with the rapid development of the graphics and artificial intelligence fields, general GPU technology has been rapidly developed, and modern GPUs have far surpassed CPUs in computing power and data throughput. Therefore, the applicant thought of using GPU to accelerate the fault simulation process. The most intuitive way is to use GPU to accelerate the parallel vector fault simulation algorithm, because the task division of the parallel vector fault simulation algorithm is the simplest.

[0025] According to one aspect of the embodiments of the present application, a method embodiment of a memory-efficient fault simulation and diagnosis method is provided, which can solve the technical problem of slow chip fault simulation speed in related technologies by simulating faults in parallel through parallel threads of a GPU. Figure 1 is a flowchart of an optional memory-efficient fault simulation and diagnosis method according to an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps: Step S102 , in the process of performing fault diagnosis on the target digital circuit, performing logic simulation on the target digital circuit using a test vector set to obtain a first logic result.

[0026] Fault diagnosis is an important part of testability design. If a logic circuit fails the test, fault diagnosis is responsible for determining where the fault may occur. By narrowing the scope of the fault point, the subsequent physical failure analysis will be easier and faster. The basic method of fault diagnosis is to establish a diagnostic dictionary. The principle is to calculate the fault effect of each fault through fault simulation, so as to establish a mapping relationship from fault effect to possible faults. Since fault simulation is required for all vectors and all faults, fault simulation becomes the part with the largest time share in fault diagnosis. Therefore, improving the efficiency of fault simulation is of great significance to improving the efficiency of fault diagnosis.

[0027] Step S104, calling M threads of the GPU, using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M faults to be tested of the target digital circuit, to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers.

[0028] When performing the j-th round (i.e., the 1st round to the (J-1)th round) of fault simulation, N test vectors are selected from the test vector set, the i-th thread among the M threads is called, and the i-th fault to be tested among the M faults to be tested is simulated using the N test vectors and the first logic result to obtain the fault simulation result of the i-th fault to be tested, wherein the N test vectors are test vectors running in parallel, the value range of j is [1, (J-1)], the value of J is obtained by rounding up the quotient between the number of test vectors in the test vector set and N, and the value of i is [1, M]; When performing the Jth round (i.e., the last round) of fault simulation, all test vectors that have not been selected are selected from the test vector set, the i-th thread is called, and the test vectors selected in this round and the first logic result are used to perform fault simulation on the i-th fault to be tested, thereby obtaining the fault simulation result of the i-th fault to be tested.

[0029] The idea of ​​accelerating the parallel vector simulation algorithm is to do parallelism in the dimension of faults. Specifically, in the GPU architecture, for the same set of test vectors, each thread is responsible for simulating one fault. Assuming that the GPU has three threads, the simulation process is as follows: in the first simulation, thread 1 is responsible for simulating the first fault with vectors 0-63, thread 2 is responsible for simulating the second fault with vectors 0-63, and thread 3 is responsible for simulating the third fault with vectors 0-63; in the second simulation, thread 1 is responsible for simulating the first fault with vectors 64-127, thread 2 is responsible for simulating the second fault with vectors 64-127, and thread 3 is responsible for simulating the third fault with vectors 64-127.

[0030] In each simulation pass, threads 1, 2, and 3 are executed in parallel. Since each thread uses the same vector, each thread shares the same good machine, i.e., the first logic result (the logic value of the circuit when no fault exists), and the faults simulated by each thread are different, so each thread has its own dedicated fault machine, i.e., the second logic result (the logic value of the circuit when a fault exists).

[0031] Step S106 , in the process of performing parallel fault simulation on M faults to be tested of the target digital circuit using the test vectors in the test vector set and the first logic result, the M threads share a first storage space where the first logic result is located in the video memory of the GPU.

[0032] During the fault simulation process, if the output logic value of any gate in the target digital circuit does not match the corresponding logic value in the first logic result, the gate is treated as a faulty gate and all output gates of the faulty gate are written into the event queue, wherein the event queue is stored in the second storage space in the video memory.

[0033] For the event queue, one gate can be taken out from the event queue each time as the target gate; when the input gate of the target gate exists in the second logic result (a fixed-length array is used to store the second logic result, and the fixed-length array adopts a binary search method to implement data search), the input logic value of the target gate is taken out from the second logic result, and when the input gate of the target gate does not exist in the second logic result, the input logic value of the target gate is taken out from the first logic result, wherein the second logic result is used to store the faulty logic value and is saved in the second storage space in the video memory; the obtained input logic value is input into the target gate to obtain the output logic value of the target gate; when the output logic value of the target gate does not match the corresponding logic value in the first logic result, the output logic value of the target gate is stored in the second logic result, and all output gates of the target gate are written into the event queue.

[0034] It should be noted that all gates in the target digital circuit can be sorted by level to obtain a level index; a priority queue is established using the level indexes of all gates in the target digital circuit, and the event queue is implemented based on the priority queue.

[0035] After performing parallel fault simulation on M faults to be tested of the target digital circuit using the test vectors and logic simulation results in the test vector set, when the output logic value of any gate of the last layer of the target digital circuit does not match the corresponding logic value in the first logic result, it is determined that the current fault to be tested is detected by the current test vector; when the output logic values ​​of all gates of the last layer of the target digital circuit do not match the corresponding logic values ​​in the first logic result, it is determined that the current fault to be tested is not detected by the current test vector.

[0036] As an optional embodiment, the following is combined with Figures 2 to 5 The technical solution of this application is further described in detail: The GPU platform has a disadvantage, that is, the memory size (the memory on the GPU is also called video memory) is small. Even for professional-grade GPUs designed for professional computing, the maximum video memory is generally only tens of GB, which is far smaller than the memory size of hundreds or thousands of GB on server-level CPU platforms. Therefore, memory overhead is the biggest obstacle to GPU-accelerated parallel vector fault simulation algorithms.

[0037] For the parallel vector fault simulation algorithm, there are three main aspects of memory overhead: the first aspect is the goodmachine, that is, the logical value of each gate in the tested circuit when there is no fault; the second aspect is the fault machine, that is, the logical value of each gate when the current fault exists. Fault simulation is essentially to compare the fault machine with the goodmachine; the third aspect is the event queue. Parallel vector fault simulation is an event-driven simulation algorithm. Whenever the output logic value of a gate is different from the good machine, all its output gates are added to the event queue. Only the gates in the event queue need to be simulated.

[0038] Now let's consider GPU acceleration. Since the parallelism is in the fault dimension, all faults share a goodmachine, so the memory overhead of the goodmachine does not constitute a bottleneck. The biggest problem is that each fault requires an independent fault machine and event queue, which leads to greater memory overhead as the degree of parallelism increases. Assuming that the number of gates of the circuit under test is m and the degree of parallelism is n, the memory overhead of the fault machine and event queue is O(mn), which is unacceptable for the GPU platform.

[0039] This application focuses on the optimization of fault machine and event queue, using priority queue to implement event queue and fixed-length array and binary search to implement fault machine, improving memory utilization, so as to maximize parallelism under limited memory. For the specific process, see Figure 3 .

[0040] The present invention proposes a memory-efficient event queue and fault machine implementation method, thereby realizing GPU-accelerated fault simulation. The event queue implemented using a priority queue and the faultmachine implemented using a fixed-length array and binary search. As an optional embodiment, the following is described in conjunction with the specific implementation method: This application proposes a memory-efficient CPU+GPU collaborative fault simulation method. The basic idea is to redesign the data structure of the fault machine and event queue to achieve efficient and compact use of memory at the expense of a certain amount of time efficiency, thereby reducing the memory overhead of each thread, thereby increasing the number of threads that can be run in parallel and improving the acceleration effect.

[0041] The acceleration algorithm of this application is as follows: for each batch of vectors (64 vectors in bit-level parallelism), first run the logic simulation and store the result of the logic simulation in the good machine. The logic simulation here can be performed on the CPU or on the GPU, and is only run once, and the good machine only needs to save a copy on the GPU.

[0042] Then start GPU parallelism, with each thread simulating a fault. For each thread, if the fault value of the fault gate is different from that of the good machine, add the output gate of the fault gate to the event queue. Take a gate from the event queue, first take its input logic value, for each of its input gates, if the input gate is in the fault machine, take the value from the faultmachine, otherwise take the value from the good machine. After taking the value, calculate its output logic value. If the output logic value is different from that of the good machine, store it in the fault machine and add its output gate to the event queue. Repeat the above process until the event queue is empty. During the calculation process, if it is found that the output logic value of the Primary Output (the basic output of the circuit) is different from that of the good machine, it means that the fault is detected by the current vector. Conversely, if the output of any Primary Output is different from that of the good machine during the calculation process, it means that the fault cannot be detected by the current vector.

[0043] The algorithm flow is not much different from the event-driven vector parallel fault simulation algorithm. The key lies in the design of the event queue and the fault machine. Different from the hierarchical queue implementation of the event queue on the CPU platform, this application first sorts all gates by level, obtains the level index, and then uses the level index to establish a priority queue (using a small root heap to implement the priority queue). In this way, the element at the head of the queue is the element with the smallest index and is also the gate with the smallest level, which meets the requirements of the event queue.

[0044] The following compares two implementations of event queues: the space complexity of the hierarchical queue implementation is O(n), where n is the total number of gates in the circuit, and the time complexity of both enqueue and dequeue is O(1); while the space complexity of the priority queue implementation is O(d), where d is the maximum number of gates that need to be simulated, which is generally much smaller than the total number of gates, and the time complexity of enqueue and dequeue is O(log k), where k is the number of events in the current queue. Figure 2 As shown, the hierarchical index satisfies: the indexes of all gates are unique; if the level of gate A is smaller than the level of gate B, then the hierarchical index of A must be smaller than the hierarchical index of B; the hierarchical indexes of gates at the same level do not have a fixed size relationship.

[0045] The implementation of the fault machine on the CPU platform is exactly the same as that of the good machine, that is, a one-dimensional array that uses the gate id as the index to access the fault value of each gate. Figure 2 For example, Figure 2 The circuit has five gates, so its goodmachine and fault machine are a one-dimensional array with a length of 5. Obviously, this implementation method is very inefficient in terms of space, because in fault simulation, only the logic values ​​of a small number of gates will change, while the logic values ​​of most gates remain the same as the logic values ​​of the good machine. Therefore, this application uses a fixed-length array to save the logic values ​​of the faultmachine, and all logic values ​​are arranged in the array in the order of addition. Because the hierarchical index of the output gate of each gate must be greater than its own hierarchical index, and the event queue takes the gate with the smallest hierarchical index each time, it can be guaranteed that the hierarchical index of the gate added to the fault machine each time is strictly monotonically increasing, so the fault machine array is ordered. In this way, when searching for the fault machine, a binary search can be performed through the hierarchical index to improve the search efficiency. The space complexity of the fault machine according to the access method of the good machine is O(n), n is the number of logic gates in the circuit, and the time complexity of the search is O(1). The space complexity of the fixed-length array access method is O(1), which is a fixed value that can be adjusted according to specific hardware parameters. The time complexity is O(log k), where k is the number of elements in the array. If the number of faulty gates of a fault exceeds the size of the fixed-length array, the fault is handed over to the CPU for separate processing.

[0046] The following are some examples: by Figure 4 Take the circuit in as an example, assuming the input is 10111, then the circuit state is as follows: The good machine is 01011 (according to the order of logic gates, the output of gate 1 is 0, the output of gate 2 is 1, the output of gate 3 is 0, and the outputs of gates 4 and 5 are 1). At this time, a SA0 (Stuck-at 0) fault is injected into gate 2, and the circuit state is as follows: Figure 5 shown.

[0047] The calculation process of the CPU fault simulation algorithm is as follows: 1) Initialize the fault machine to the value of the good machine. At this time, the fault machine is 01011.

[0048] 2) Set the fault output of gate 2 to 0, and the fault machine is 00011. The fault machine value of gate 2 is different from the good machine, so the output gate 4 of gate 2 is added to the event queue. At this time, the event queue is {{},{4},{}} (the event queue is implemented by a layered queue, the first layer event queue is empty, and gate 4 is in the second layer, so 4 is stored in the second layer event queue, and the third layer event queue is also empty).

[0049] 3) Take gate 4 from the event queue, and its input is gate 1 and gate 2. Take the output 00 of gate 1 and gate 2 directly from the fault machine as the input of gate 4, and calculate its output value to be 0. At this time, the fault machine is 00001. Because its output is different from that of the good machine, its output gate 5 is added to the event queue. At this time, the event queue is {{},{},{5}}.

[0050] 4) Take gate 5 from the event queue. Similarly, directly get its input from the fault machine as 00, calculate the output value as 0, and the fault machine is 00000. Because the output of gate 5 is different from the good machine and gate 5 is the Primary Output, the SA0 fault of gate 2 is detected by vector 10111.

[0051] The calculation process of GPU accelerated fault simulation algorithm is as follows: 1) Set the size of the fault machine and event queue to 3 (this is just to illustrate that it is a fixed-length array. The size depends on the video memory size of the specific device. The larger the video memory, the larger the array size can be set).

[0052] 2) Set the fault output of gate 2 to 0, while its good machine is 1. The output is different from the good machine, so it is recorded in the fault machine. At this time, the fault machine is {{2, 0}} (the data structure of the fault machine is {hierarchical index, logical value}, which means that the fault output of gate 2 is 0). At the same time, add the output gate 4 of gate 2 to the event queue. At this time, the event queue is {4}.

[0053] 3) Take gate 4 from the event queue, and its input is gate 1 and gate 2. Use the binary search method to search the hierarchical index in the fault machine. Gate 1 is not found, so the output of gate 1 is taken as 0. Then search for gate 2 and find that the fault output of gate 2 is 0 in the fault machine, so the output of gate 2 is taken as 0. Finally, the output of gate 4 is calculated to be 0, which is different from the good machine, so gate 4 is recorded in the fault machine. At this time, the fault machine is {{2,0},{4,0}} (the fault machine is ordered for the hierarchical index, so it can be searched by binary search). At the same time, the output of gate 4, gate 5, is added to the event queue. At this time, the event queue is {5}.

[0054] Gate 5 is taken out from the event queue. Similarly, its inputs are 0 and 0, and the calculated output is 0. Since the faulty output is different from the good machine and gate 5 is the Primary Output, the SA0 fault of gate 2 is detected by vector 10111.

[0055] The fault simulation algorithm in the CPU platform is a parallel vector fault simulation algorithm, which is limited by the size of the memory and cannot be directly applied to the GPU platform. The main memory bottleneck lies in the fault machine and event queue. This application redesigns the memory-efficient fault machine and event queue, implements the parallel vector fault simulation algorithm on the GPU platform, and realizes a memory-efficient CPU and GPU collaborative fault simulation method.

[0056] The present invention is verified on ISCAS89 and ITC99 benchmark circuits, and the fault simulation results are compared and analyzed. The results show that the present invention can achieve a performance improvement of more than ten to dozens of times compared to the parallel vector fault simulation algorithm of the CPU platform under the premise of ensuring the correctness of the fault simulation results. It can be seen that the implementation method of the present application greatly improves the utilization rate of the memory at the cost of a certain loss of time efficiency, thereby improving the parallelism of the GPU and improving the acceleration effect.

[0057] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0059] According to another aspect of an embodiment of the present application, a memory-efficient fault simulation and diagnosis device for implementing the above-mentioned memory-efficient fault simulation and diagnosis method is also provided. Figure 6 is a schematic diagram of an optional memory-efficient fault simulation and diagnosis device according to an embodiment of the present application, such as Figure 6 As shown, the device may include: The logic simulation unit 61 is used to perform logic simulation on the target digital circuit using the test vector set to obtain a first logic result during the process of performing fault diagnosis on the target digital circuit; A fault simulation unit 63 is used to call M threads of the GPU, and use the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M to-be-tested faults of the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of the test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; The sharing unit 65 is used to instruct the M threads to share the first storage space where the first logic result is located in the video memory of the GPU when using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M faults to be tested of the target digital circuit.

[0060] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run in a corresponding hardware environment and can be implemented by software or hardware.

[0061] Optionally, optionally, calling M threads of the GPU, using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M faults to be tested of the target digital circuit, and obtaining a fault simulation result, including: when performing the j-th round of fault simulation, selecting N test vectors from the test vector set, calling the i-th thread in the M threads, using the N test vectors and the first logic result to perform fault simulation on the i-th fault to be tested among the M faults to be tested, and obtaining a fault simulation result of the i-th fault to be tested. The result is as follows: N test vectors are test vectors running in parallel, the value range of j is [1, (J-1)], the value of J is the quotient between the number of test vectors in the test vector set and N rounded up, and the value of i is [1, M]; when performing the Jth round of fault simulation, all test vectors that have not been selected are selected from the test vector set, the i-th thread is called, and the test vectors selected in this round and the first logical result are used to perform fault simulation on the i-th fault to be tested, so as to obtain the fault simulation result of the i-th fault to be tested.

[0062] Optionally, in the process of performing parallel fault simulation on M faults to be tested of the target digital circuit using the test vectors in the test vector set and the first logic result, when the output logic value of any gate in the target digital circuit does not match the corresponding logic value in the first logic result, the gate is treated as a faulty gate and all output gates of the faulty gate are written into an event queue, wherein the event queue is stored in a second storage space in the video memory.

[0063] Optionally, in the process of performing parallel fault simulation on M faults to be tested of the target digital circuit using the test vectors in the test vector set and the logic simulation results, a gate is taken out from the event queue as a target gate; when the input gate of the target gate exists in the second logic result, the input logic value of the target gate is taken out from the second logic result, and when the input gate of the target gate does not exist in the second logic result, the input logic value of the target gate is taken out from the first logic result, wherein the second logic result is used to store the logic value of the fault and is saved in the second storage space in the video memory; the acquired input logic value is input into the target gate to obtain the output logic value of the target gate; when the output logic value of the target gate does not match the corresponding logic value in the first logic result, the output logic value of the target gate is stored in the second logic result, and all output gates of the target gate are written into the event queue.

[0064] Optionally, before using the test vectors in the test vector set and the logic simulation results to perform parallel fault simulation on the M faults to be tested in the target digital circuit, all gates in the target digital circuit are sorted by level to obtain a hierarchical index; a priority queue is established using the hierarchical indexes of all gates in the target digital circuit, wherein the event queue is implemented based on the priority queue.

[0065] Optionally, after performing parallel fault simulation on the M faults to be tested of the target digital circuit using the test vectors in the test vector set and the logic simulation results, when the output logic value of any gate in the last layer of the target digital circuit does not match the corresponding logic value in the first logic result, it is determined that the current fault to be tested is detected by the current test vector; when the output logic values ​​of all gates in the last layer of the target digital circuit do not match the corresponding logic values ​​in the first logic result, it is determined that the current fault to be tested is not detected by the current test vector.

[0066] Optionally, before taking out the input logic value of the target gate from the second logic result, a fixed-length array is used to store the second logic result, wherein the fixed-length array uses a binary search method to implement data search.

[0067] According to another aspect of an embodiment of the present application, a server or terminal for implementing the above-mentioned memory-efficient fault simulation and diagnosis method is also provided.

[0068] Figure 7 is a structural block diagram of a terminal according to an embodiment of the present application, such as Figure 7As shown, the terminal may include: one or more (only one is shown in the figure) processors 701, a memory 703, and a transmission device 705, such as Figure 7 As shown, the terminal may also include an input and output device 707.

[0069] Among them, the memory 703 can be used to store software programs and modules, such as the program instructions / modules corresponding to the memory-efficient fault simulation and diagnosis method and device in the embodiment of the present application. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 703, that is, realizing the above-mentioned memory-efficient fault simulation and diagnosis method. The memory 703 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 703 may further include a memory remotely arranged relative to the processor 701, and these remote memories can be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0070] The above-mentioned transmission device 705 is used to receive or send data via a network, and can also be used for data transmission between a processor and a memory. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 705 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 705 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0071] Specifically, the memory 703 is used to store application programs.

[0072] The processor 701 may call the application stored in the memory 703 through the transmission device 705 to perform the following steps: In the process of fault diagnosis of the target digital circuit, the target digital circuit is logically simulated using a test vector set to obtain a first logic result; M threads of the GPU are called, and the test vectors in the test vector set and the first logic result are used to perform parallel fault simulation on the M faults to be tested of the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of the test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; in the process of performing parallel fault simulation on the M faults to be tested of the target digital circuit using the test vectors in the test vector set and the first logic result, the M threads share a first storage space where the first logic result is located in the video memory of the GPU.

[0073] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0074] It can be understood by those skilled in the art that Figure 7 The structure shown is for illustration only, and the terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 7 It does not limit the structure of the above electronic device. For example, the terminal may also include Figure 7 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 7 Different configurations shown.

[0075] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0076] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to execute the program code of the memory-efficient fault simulation and diagnosis method.

[0077] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0078] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: In the process of fault diagnosis of the target digital circuit, the target digital circuit is logically simulated using a test vector set to obtain a first logic result; M threads of the GPU are called, and the test vectors in the test vector set and the first logic result are used to perform parallel fault simulation on the M faults to be tested of the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of the test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; in the process of performing parallel fault simulation on the M faults to be tested of the target digital circuit using the test vectors in the test vector set and the first logic result, the M threads share a first storage space where the first logic result is located in the video memory of the GPU.

[0079] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0080] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0081] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0082] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0083] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0084] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0086] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0087] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A memory efficient fault simulation and diagnosis method, characterized in that: include: In the process of performing fault diagnosis on the target digital circuit, performing logic simulation on the target digital circuit using the test vector set to obtain a first logic result; Calling M threads of the GPU, using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M to-be-tested faults of the target digital circuit, to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of the test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; In the process of performing parallel fault simulation on M to-be-tested faults of the target digital circuit using the test vectors in the test vector set and the first logic result, the M threads share a first storage space in the video memory of the GPU where the first logic result is located.

2. The method according to claim 1, characterized in that Calling M threads of the GPU, using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M to-be-tested faults of the target digital circuit, and obtaining fault simulation results, including: When performing the j-th round of fault simulation, N test vectors are selected from the test vector set, the i-th thread among the M threads is called, and the i-th fault to be tested among the M faults to be tested is simulated using the N test vectors and the first logic result to obtain a fault simulation result of the i-th fault to be tested, wherein the N test vectors are test vectors running in parallel, the value range of j is [1, (J-1)], the value of J is obtained by rounding up the quotient between the number of test vectors in the test vector set and N, and the value of i is [1, M]; When performing the Jth round of fault simulation, all test vectors that have not been selected are selected from the test vector set, the i-th thread is called, and the test vectors selected in this round and the first logical result are used to perform fault simulation on the i-th fault to be tested, so as to obtain the fault simulation result of the i-th fault to be tested.

3. The method according to claim 1 or 2, characterized in that: In the process of performing parallel fault simulation on M to-be-tested faults of the target digital circuit using the test vectors in the test vector set and the first logic result, the method further includes: When the output logic value of any gate in the target digital circuit does not match the corresponding logic value in the first logic result, the gate is treated as a faulty gate and all output gates of the faulty gate are written into an event queue, wherein the event queue is stored in a second storage space in the video memory.

4. The method according to claim 3, characterized in that In the process of performing parallel fault simulation on M to-be-tested faults of the target digital circuit using the test vectors in the test vector set and the logic simulation results, the method further includes: Taking a gate from the event queue as a target gate; When the input gate of the target gate exists in the second logic result, the input logic value of the target gate is taken from the second logic result, and when the input gate of the target gate does not exist in the second logic result, the input logic value of the target gate is taken from the first logic result, wherein the second logic result is used to store the faulty logic value and is stored in the second storage space in the video memory; Inputting the acquired input logic value into the target gate to obtain the output logic value of the target gate; When the output logic value of the target gate does not match the corresponding logic value in the first logic result, the output logic value of the target gate is stored in the second logic result, and all output gates of the target gate are written into the event queue.

5. The method according to claim 4, characterized in that Before performing parallel fault simulation on the M to-be-tested faults of the target digital circuit using the test vectors in the test vector set and the logic simulation results, the method further includes: Sorting all gates in the target digital circuit by level to obtain a level index; A priority queue is established using the hierarchical indexes of all gates in the target digital circuit, wherein the event queue is implemented based on the priority queue.

6. The method according to claim 4, characterized in that After performing parallel fault simulation on the M to-be-tested faults of the target digital circuit using the test vectors in the test vector set and the logic simulation results, the method further includes: In a case where an output logic value of any gate of the last layer of the target digital circuit does not match a corresponding logic value in the first logic result, determining that a current fault to be tested is detected by a current test vector; When the output logic values ​​of all gates of the last layer of the target digital circuit match the corresponding logic values ​​in the first logic result, it is determined that the current fault to be tested is not detected by the current test vector.

7. The method according to claim 4, characterized in that Before taking the input logic value of the target gate from the second logic result, the method further includes: A fixed-length array is used to store the second logical result, wherein the fixed-length array uses a binary search method to implement data search.

8. A memory efficient fault simulation and diagnosis device, characterized in that: include: A logic simulation unit, used to perform logic simulation on the target digital circuit using a test vector set during a process of performing fault diagnosis on the target digital circuit to obtain a first logic result; A fault simulation unit, configured to call M threads of the GPU, and use the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M to-be-tested faults of the target digital circuit to obtain a fault simulation result, wherein the M threads are threads running in parallel, the number of the test vectors is not greater than the machine word length N of the GPU, and M and N are positive integers; A sharing unit is used to instruct the M threads to share a first storage space where the first logic result is located in the video memory of the GPU when using the test vectors in the test vector set and the first logic result to perform parallel fault simulation on the M faults to be tested of the target digital circuit.

9. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the method described in any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Memory-limited digital circuit parallel static learning method and system

    CN113919255A

  • Method, device and equipment for simulation

    CN117377961A

  • Dimension fusion parallel fault simulation method and system for digital circuit

    CN117538726A

  • Method, device and equipment for logic simulation

    CN117751295A

  • Fault simulation method and related equipment

    CN118261095A