A digital circuit static learning method and system based on data parallelism
By using multi-thread parallel processing and event queue allocation in static learning of digital circuits, the problem of slow running speed caused by single-thread implementation is solved, rapid static learning of large-scale digital circuits is achieved, and testing efficiency is improved.
Patent Information
- Application Number
- CN202111063013.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-10
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-09-10
AI Technical Summary
In the existing technology, the static learning process of digital circuits has a single-thread implementation, which results in slow and time-consuming operation in large-scale digital circuits. It is difficult to meet the testing needs of large-scale digital circuits with millions or even tens of millions of logic gate levels.
Using a method based on data parallelism, by creating multiple parallel threads and respective event queues, learning task groups are assigned and processed in parallel to avoid data conflicts and improve learning speed.
It significantly improves the calculation speed of static learning, reduces the number of multi-thread serial executions, solves the problem of too long single-thread running time, and is suitable for rapid testing of large-scale digital circuits.
Smart Images

Figure CN113919261B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a digital circuit static learning method and system based on data parallelism. Background Art
[0002] Digital circuit design needs to go through test simulation before tape-out to ensure the correctness and completeness of the design. Therefore, test simulation plays a key role in digital circuit design. Automatic test vector generation (ATPG) is the process in which the test vectors used in digital circuit testing are automatically generated by the program, which plays an important role in digital circuit testing. Static learning is an algorithm used to identify additional implicit inference relationships between various logic gates in digital circuits. It is usually performed as a preprocessing step before ATPG begins, and the results obtained will help ATPG complete faster.
[0003] Backtracking may be required during ATPG operation when the following two situations occur:
[0004] 1) When a fault cannot propagate the fault effect to the output nodes of a digital circuit based on the current assignments to the logic gates;
[0005] 2) In order to meet the test conditions of the test vector, a signal must be set to 0 and 1 at the same time.
[0006] When backtracking, the ATPG algorithm needs to cancel the assignment of one or more signals, and then reassign the signals that need to be reassigned or other related signals, in an attempt to eliminate the above two situations. It can be seen that the backtracking operation is necessary for ATPG, but it is also very time-consuming.
[0007] Static learning is a learning algorithm used to identify additional implicit derivation relationships between logic gates in digital circuits. The static learning procedure assigns a binary value (0 or 1) to the logic gates in the digital circuit, and then uses this value as a starting point for forward or backward derivation. During the derivation process, if implicit derivation relationships between logic gates are identified, these derivation relationships are stored and can be used in subsequent ATPG processes. At the same time, static learning can also discover conflicts and redundancies in digital circuits.
[0008] Using the implicit derivation relationship obtained by static learning in the ATPG process will effectively trim the search space and reduce the number of backtracking, which will reduce the ATPG running time accordingly.
[0009] Static learning and event-driven logic simulation are similar in that both use event queues to complete event management. If static learning is implemented through a single-threaded operation, the logic gates in the digital circuit are learned one by one. Only after the current logic gate is learned will the next logic gate be learned. Therefore, if static learning is implemented through a single thread, only one event queue is needed to complete all event management tasks, and in fact, the memory space occupied is relatively small. However, due to the limitations of single-thread implementation, once the scale of the digital circuit increases, the speed of completing the entire static learning process will become very slow and time-consuming.
[0010] Currently, static learning only has a single-threaded implementation. As the number of logic gates in a digital circuit increases, the number of times the learning program is called also increases. Therefore, learning a large digital circuit with millions or even tens of millions of logic gates takes several minutes or even longer, which is undoubtedly a time cost burden for digital circuit testing.
[0011] If the learning program is run dynamically or recursively during the ATPG operation, more global derivation relationships will be identified, which will be more conducive to the operation of ATPG. However, this requires the learning program to be executed multiple times during the ATPG process, which will greatly increase the running time, making it unrealistic to apply it to large digital circuits at the million or even tens of millions of logic gates level. Summary of the invention
[0012] The purpose of the present invention is to provide a digital circuit static learning method and system based on data parallelism to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.
[0013] In order to achieve the above object, the present invention provides the following technical solutions:
[0014] A digital circuit static learning method based on data parallelism, the method comprising the following steps:
[0015] Step S100, obtaining all learning tasks that need to be learned in the digital circuit;
[0016] Step S200, storing all learning tasks that need to be learned in the digital circuit into an array, and dividing the learning tasks that need to be learned in the array into a plurality of learning task groups;
[0017] Step S300: create multiple parallel threads, and assign respective event queues to all parallel threads;
[0018] Step S400: calling all parallel threads to start working; wherein each thread grabs a different set of learning task groups from the array when starting to work;
[0019] Step S500: Each thread independently completes a set of learning tasks currently captured according to its assigned event queue;
[0020] Step S600: If any thread completes a currently captured set of learning task groups, it queries whether there are any learning task groups that have not been captured in the array. If so, the thread captures a set of learning task groups that have not been captured from the array for learning; otherwise, all threads stop working after completing the currently captured learning task groups.
[0021] Furthermore, the learning task includes a logic gate and a logic value of the logic gate; the event queue is a queue for storing and managing events, and the event queue is responsible for collecting events and popping out the collected events in sequence, and the event refers to a logic gate whose input value in a digital circuit changes.
[0022] Further, the step S200 includes:
[0023] Create an array according to all the learning tasks that need to be learned in the digital circuit, and determine the size of the array to store all the learning tasks;
[0024] All learning tasks that need to be learned in the array are equally divided according to the order of learning tasks to form several groups of learning tasks.
[0025] Furthermore, the step S200 further includes:
[0026] Combine the logic gates and the logic values of all the learning tasks into a specific value through logic bit operations;
[0027] The specific numerical value is stored in an array as a learning task.
[0028] Furthermore, the method further includes: when all parallel threads are called to start working, each of the threads sequentially captures a group of learning tasks in a serial manner.
[0029] Furthermore, the method further includes: if multiple threads have completed a set of learning task groups currently captured, the multiple threads sequentially query in a serial manner whether there are any learning task groups that have not been captured in the array.
[0030] Furthermore, the method further comprises:
[0031] When multiple threads have completed a currently captured set of learning task groups, and there are still learning task groups that have not been captured in the array, the multiple threads will capture a set of learning task groups that have not been captured from the array in a serial manner for learning.
[0032] A computer-readable storage medium stores a digital circuit static learning program based on data parallelism. When the digital circuit static learning program based on data parallelism is executed by a processor, the steps of the digital circuit static learning method based on data parallelism as described in any one of the above are implemented.
[0033] A digital circuit static learning system based on data parallelism, the system comprising:
[0034] at least one processor;
[0035] at least one memory for storing at least one program;
[0036] When the at least one program is executed by the at least one processor, the at least one processor implements any of the above-mentioned digital circuit static learning methods based on data parallelism.
[0037] The beneficial effects of the present invention are as follows: the present invention discloses a digital circuit static learning method and system based on data parallelism, the present invention improves the computing speed of static learning by learning multiple tasks in parallel through multi-threading, and at the same time allocates a respective event queue to each thread, and avoids data conflicts during thread operation through data parallelism. In addition, since each thread is responsible for different learning tasks, the time point when the thread completes the task is also different, which greatly reduces the probability of multiple threads grabbing new learning tasks from the array at the same time, reduces the number of times multiple threads are executed in series, and ensures the parallelism of the method. The static learning based on data parallelism implemented by this method can greatly improve the computing speed of the learning program, and solves the problem of the existing single-thread static learning running time being too long. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 is a flow chart of a static learning method for digital circuits based on data parallelism in an embodiment of the present invention;
[0040] Figure 2 It is a schematic diagram of dividing the learning tasks in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of this application, so as to fully understand the purpose, scheme and effect of this application. It should be noted that the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0042] When the inventor was conducting research on static learning, he found that the existing single-threaded implementation method had the problem of too long running time. To address this problem, the inventor proposed a new static learning implementation method based on data parallelism based on the characteristic that data parallelism can be achieved in the static learning process, which can greatly improve the running speed of static learning.
[0043] refer to Figure 1 ,like Figure 1 A digital circuit static learning method based on data parallelism provided in an embodiment of the present application is shown, and the method comprises the following steps:
[0044] Step S100, obtaining all learning tasks that need to be learned in the digital circuit;
[0045] Step S200, storing all learning tasks that need to be learned in the digital circuit into an array, and dividing all learning tasks that need to be learned in the array into a plurality of learning task groups; wherein each learning task group includes a plurality of learning tasks;
[0046] Step S300: create multiple parallel threads, and assign respective event queues to all parallel threads;
[0047] Step S400: calling all parallel threads to start working; wherein each thread grabs a different set of learning task groups from the array when starting to work;
[0048] Step S500: Each thread independently completes a set of learning tasks currently captured according to its assigned event queue;
[0049] Step S600: If any thread completes a currently captured set of learning task groups, it queries whether there are any learning task groups that have not been captured in the array. If so, the thread captures a set of learning task groups that have not been captured from the array for learning; otherwise, all threads stop working after completing the currently captured learning task groups.
[0050] It should be noted that in the embodiment provided by the present invention, the entire digital circuit is first scanned, and all learning tasks that need to be learned in the digital circuit are collected and stored in an array. The learning tasks in the array are divided into several learning task groups of appropriate size so that the total processing time of each thread for the learning task group is roughly the same. Allocate respective event queues for all parallel threads for subsequent event management. Since all parallel threads are assigned respective event queues, when all threads learn their respective learning tasks in parallel, the memory space accessed by each thread will not overlap, and there will be no data conflict.
[0051] In a preferred embodiment, the learning task includes a logic gate and the logic value of the logic gate; the event queue is a queue for storing and managing events, and the event queue is responsible for collecting events and popping out the collected events in sequence, and the event refers to a logic gate whose input value in a digital circuit changes.
[0052] In this embodiment, the digital circuit can be understood as a topological structure including a plurality of logic gates and connection relationships between the logic gates, and the learning tasks of static learning are extracted from the topological structure and stored in an array.
[0053] like Figure 2 As shown, in a preferred embodiment, step S200 includes:
[0054] Create an array based on all the learning tasks that need to be learned in the digital circuit, and determine the size of the array to store all the learning tasks; avoid some learning tasks not being stored because the array is too small, resulting in erroneous results.
[0055] All learning tasks that need to be learned in the array are equally divided according to the order of learning tasks to form several groups of learning tasks.
[0056] In a preferred embodiment, the step S200 further includes:
[0057] Combine the logic gates and the logic values of all the learning tasks into a specific value through logic bit operations;
[0058] The specific numerical value is stored in an array as a learning task.
[0059] It should be noted that learning a learning task means that the logic gates in the event queue are processed in an event-driven manner, starting from the logic gates in the learning task and the logic values of the logic gates. If the input logic value of the logic gate changes, the logic gate needs to be re-evaluated and processed accordingly. In this embodiment, the logic gates in all learning tasks and the logic values of the logic gates are combined into specific values through bit operations of four-valued logic;
[0060] In a preferred embodiment, the method further comprises: when all parallel threads are called to start working, each of the threads sequentially captures a group of learning tasks in a serial manner.
[0061] In the embodiment provided by the present invention, all threads are simultaneously ready to grab a set of learning task groups from the array to start working. These threads need to grab tasks one by one in a serial manner, which can avoid the situation where multiple threads grab the same set of learning task groups and ensure that no tasks in the array will be missed or learned repeatedly.
[0062] In a preferred embodiment, the method further includes: if multiple threads have completed a set of learning task groups currently captured, the multiple threads sequentially query in a serial manner whether there are any learning task groups that have not been captured in the array.
[0063] If multiple threads are ready to check whether there are unfinished learning tasks in the array at the same time, these threads need to access the array one by one in a serial manner to ensure that no tasks in the array are learned repeatedly and that the threads do not access memory space outside the array, resulting in erroneous results.
[0064] In a preferred embodiment, the method further comprises:
[0065] When multiple threads have completed a currently captured set of learning task groups, and there are still learning task groups that have not been captured in the array, the multiple threads will capture a set of learning task groups that have not been captured from the array in a serial manner for learning.
[0066] When there are multiple threads preparing to grab a group of learning tasks that have not been grabbed from the array for learning at the same time, these threads need to grab new tasks from the array one by one in a serial manner to ensure that no tasks in the array are missed or learned repeatedly.
[0067] and Figure 1 Corresponding to the method, an embodiment of the present invention further provides a computer-readable storage medium, on which a digital circuit static learning program based on data parallelism is stored. When the digital circuit static learning program based on data parallelism is executed by a processor, the steps of the digital circuit static learning method based on data parallelism as described in any of the above embodiments are implemented.
[0068] and Figure 1 Corresponding to the method, an embodiment of the present invention further provides a digital circuit static learning system based on data parallelism, the system comprising:
[0069] at least one processor;
[0070] at least one memory for storing at least one program;
[0071] When the at least one program is executed by the at least one processor, the at least one processor implements the digital circuit static learning method based on data parallelism described in any of the above embodiments.
[0072] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0073] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete logic gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the digital circuit static learning system based on data parallelism, and uses various interfaces and lines to connect the various parts of the entire digital circuit static learning system based on data parallelism.
[0074] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the digital circuit static learning system based on data parallelism by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as an event management function, a logic gate evaluation function, etc.), etc.; the data storage area can store data created according to the operation of the program (such as event data, logic values of logic gates, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart-Media-Card, SMC), a secure digital (Secure-Digital, SD) card, a flash card (Flash-Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0075] Although the description of the present application has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims by reference to the attached claims, taking into account the prior art, so as to effectively cover the intended scope of the present application. In addition, the above description of the present application is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present application that have not yet been foreseen may still represent equivalent changes to the present application.
Claims
1. A digital circuit static learning method based on data parallelism, characterized in that: The method comprises the following steps: Step S100, obtaining all learning tasks that need to be learned in the digital circuit; Step S200, storing all learning tasks that need to be learned in the digital circuit into an array, and dividing the learning tasks that need to be learned in the array into a plurality of learning task groups; Step S300: create multiple parallel threads, and assign respective event queues to all parallel threads; Step S400, calling all parallel threads to start working; wherein each thread grabs a different set of learning task groups from the array when starting to work; Step S500: Each thread independently completes a set of learning tasks currently captured according to its assigned event queue; Step S600: If any thread completes the currently captured learning task group, it queries whether there is any learning task group that has not been captured in the array. If so, the thread captures a learning task group that has not been captured from the array for learning; otherwise, all threads stop working after completing the currently captured learning task group. The learning task includes a logic gate and a logic value of the logic gate; the event queue is a queue for storing and managing events, and the event queue is responsible for collecting events and popping out the collected events in sequence, and the event refers to a logic gate whose input value in a digital circuit changes; The step S200 includes: Create an array according to all the learning tasks that need to be learned in the digital circuit, and determine the size of the array to store all the learning tasks; All learning tasks to be learned in the array are equally divided according to the order of learning tasks to form several groups of learning tasks; The step S200 further includes: Combine the logic gates and the logic values of all the learning tasks into a specific value through logic bit operations; Storing the specific numerical value in an array as a learning task; The method further comprises: when all parallel threads are called to start working, each of the threads sequentially captures a set of learning tasks in a serial manner; The method further comprises: if the plurality of threads have completed a set of learning task groups currently captured, the plurality of threads sequentially query in a serial manner whether there are any learning task groups that have not been captured in the array; The method further comprises: When multiple threads have completed a currently captured set of learning task groups, and there are still learning task groups that have not been captured in the array, the multiple threads will capture a set of learning task groups that have not been captured from the array in a serial manner for learning.
2. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the digital circuit static learning method based on data parallelism as claimed in claim 1 are implemented.
3. A digital circuit static learning system based on data parallelism, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the digital circuit static learning method based on data parallelism as claimed in claim 1.
Citation Information
Patent Citations
Memory-limited digital circuit parallel static learning method and system
CN113919255A
