Digital circuit simulation method and device based on key value truth table

By generating a truth table of key values ​​of operational logic, the problem of low calculation efficiency and large space occupation of the truth table in digital circuit simulation is solved, and the simulation efficiency and time are improved.

CN117540671BActive Publication Date: 2024-10-22BEIJING CORE THINKING TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310458924.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2024-10-22
Estimated Expiration
2043-04-25

AI Technical Summary

Technical Problem

When calculating the truth table of a Boolean function, the existing digital circuit simulation method has low efficiency and takes up a large space, resulting in long simulation time.

Method used

The digital circuit simulation method based on the key value truth table is used to obtain the circuit information and input signal value of the digital circuit to generate the key value truth table of the operation logic, simplifying the calculation and storage of the truth table, thereby improving the simulation efficiency and reducing the number of simulations. time.

Benefits of technology

It speeds up the acquisition efficiency of the truth table, simplifies the space occupied by the truth table, compresses the size of the truth table, improves the calculation time of the Boolean function, and reduces the overall simulation time of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117540671B_ABST
    Figure CN117540671B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a digital circuit simulation method and device based on a key value truth table. The method includes: obtaining circuit information of a digital circuit to be simulated; obtaining signal values ​​of multiple input signals; obtaining port information and an operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the multiple input signals to the ports corresponding to the target digital circuit based on the port information; obtaining the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table. The digital circuit simulation method and device based on a key value truth table involved in the present application can speed up the efficiency of obtaining the truth table during the digital circuit simulation process, simplify the space occupied by the truth table, compress the size of the truth table, thereby improving the calculation time of the Boolean function and reducing the overall simulation time of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of digital circuits, and in particular to a digital circuit simulation method and device based on a key value truth table. Background Art

[0002] A digital circuit is a circuit that uses digital signals to perform arithmetic and logical operations on digital quantities. It is called a digital circuit or digital system. Because it has the functions of logical operation and logic processing, it is also called a digital logic circuit. Logic gates are the basic units of digital logic circuits. Digital circuits can be divided into two categories: combinational logic circuits and sequential logic circuits.

[0003] EDA simulators can simulate the functional behavior of circuits without building actual circuits (a process that can be cumbersome and expensive), so they are very useful tools. Before building the actual circuit, simulating and verifying the design can greatly improve design efficiency. This is because designers can observe and study the behavior of the circuit in advance before building the circuit, without having to pay time and economic costs for the physical implementation of the circuit. Especially for integrated circuits, the electronic processes such as photomasks required to physically implement the circuit are expensive, and the high complexity of integrated circuits is difficult to implement on breadboards, so it is difficult to study the behavior of the circuit using traditional methods. Therefore, almost all integrated circuit designs rely on simulation. The most famous analog simulation is SPICE, and the most famous digital circuit simulators are based on Verilog or VHDL.

[0004] Digital circuits are based on binary digital logic, and their working signals are discrete digital signals. Therefore, there are a large number of Boolean functions represented by Boolean logic in a digital circuit, which are particularly important components of digital circuits. Obviously, it is necessary to calculate a large number of Boolean functions for digital circuit simulation. If the value of the Boolean function is obtained through the truth table, it is necessary to calculate a large number of truth tables of the Boolean function. There are many Boolean functions, and the amount of calculation is also relatively large.

[0005] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0006] In view of this, the present application provides a digital circuit simulation method and device based on a key value truth table, which can speed up the efficiency of truth table acquisition, simplify the space occupied by the truth table, compress the size of the truth table, and thus improve the calculation time of the Boolean function and reduce the overall simulation time of the system during the digital circuit simulation process.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0008] According to one aspect of the present application, a digital circuit simulation method based on a key value truth table is proposed, the method comprising: obtaining circuit information of a digital circuit to be simulated; obtaining signal values ​​of a plurality of input signals; obtaining port information and an operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the plurality of input signals to ports corresponding to the target digital circuit based on the port information; and obtaining a simulation output result of the digital circuit through the signal values ​​of the plurality of signals and the operation logic key value truth table.

[0009] In an exemplary embodiment of the present application, it also includes: obtaining a Boolean function corresponding to the digital circuit; parsing the Boolean function to generate an expression tree; and generating a truth table of key values ​​of the operation logic based on the expression tree.

[0010] In an exemplary embodiment of the present application, the operation logic key value truth table is generated based on the expression tree, including: determining the target value of the root node of the expression tree; traversing the expression tree based on the target value; inferring the operation logic key value combination of the Boolean function based on the logical relationship during the traversal process; and generating the operation logic key value truth table through the operation logic key value combination.

[0011] In an exemplary embodiment of the present application, traversing the expression tree based on the target value includes: taking the target value as the numerical value corresponding to the root node of the expression tree; and traversing the expression tree through a priority search algorithm based on the target value.

[0012] In an exemplary embodiment of the present application, the operation logic key value combination of the Boolean function is calculated based on the logical relationship during the traversal process, including: obtaining the value of the root node during the traversal of the expression tree; calculating the value of the lower-level nodes based on the value of the root node and its corresponding operation type; traversing the lower-level nodes one by one until the bottom-level leaf node is traversed; and generating the operation logic key value combination based on the traversal result.

[0013] In an exemplary embodiment of the present application, the lower-level nodes are traversed one by one until the bottom-level leaf node is traversed, including: in the process of traversing the lower-level nodes one by one, obtaining the current node; when the current node is not a leaf node, inferring the value of the lower-level node according to the value of the current node and its corresponding operation type; traversing until the bottom-level leaf node is reached.

[0014] In an exemplary embodiment of the present application, the operation logic key value combination is generated according to the traversal result, including: extracting all branches in the expression tree from the traversal result; and using the numerical value of the leaf node contained in each branch as the operation logic key value combination of the branch.

[0015] In an exemplary embodiment of the present application, the operation logic key value truth table is generated by the operation logic key value combination, including: arranging the operation logic key value combination in a preset order; taking the target value as the output value; and generating the operation logic key value truth table by the operation logic key value combination arranged in a preset order and the output value.

[0016] In an exemplary embodiment of the present application, the simulation output result of the digital circuit is obtained by the signal values ​​of the multiple signals and the operation logic key value truth table, including: extracting the key value combination in the operation logic key value truth table row by row; comparing the signal values ​​of the multiple signals and the key value combination to obtain the simulation output result of the digital circuit.

[0017] According to one aspect of the present application, a digital circuit simulation device based on a key value truth table is proposed, and the device includes: a circuit module, used to obtain circuit information of a digital circuit to be simulated; a signal module, used to obtain signal values ​​of multiple input signals; a truth table module, used to obtain port information and a logic key value truth table corresponding to the digital circuit based on the circuit information; an input module, used to input the multiple input signals to the ports corresponding to the target digital circuit based on the port information; and an output module, used to obtain the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table.

[0018] According to one aspect of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0019] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0020] According to the digital circuit simulation method and device based on key value truth table of the present application, by obtaining circuit information of the digital circuit to be simulated; obtaining signal values ​​of multiple input signals; obtaining port information and operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the multiple input signals to the ports corresponding to the target digital circuit based on the port information; and obtaining the simulation output results of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table, the efficiency of obtaining the truth table can be accelerated during the digital circuit simulation process, the space occupied by the truth table can be simplified, the size of the truth table can be compressed, and the calculation time of the Boolean function can be improved, thereby reducing the overall simulation time of the system.

[0021] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative work.

[0023] Figure 1 The present invention is a flowchart of a digital circuit simulation method based on a key value truth table according to an exemplary embodiment.

[0024] Figure 2 Shown is a basic logic gate truth table of an exemplary Boolean function using the digital circuit simulation method of the present disclosure.

[0025] Figure 3 The present invention is a flowchart of a digital circuit simulation method based on a key value truth table according to an exemplary embodiment.

[0026] Figure 4 An expression tree of an exemplary Boolean function using the digital circuit simulation method disclosed in the present invention is shown.

[0027] Figure 5 The present invention is a flowchart of a digital circuit simulation method based on a key value truth table according to another exemplary embodiment.

[0028] Figure 6 It is a schematic diagram of a traversal process of a digital circuit simulation method based on a key value truth table according to another exemplary embodiment.

[0029] Figure 7 The invention is a block diagram of a digital circuit simulation device based on a key-value truth table according to an exemplary embodiment.

[0030] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment.

[0031] Fig. 9 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0033] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0036] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0037] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0038] The technical abbreviations involved in this application are explained as follows:

[0039] Boolean function: describes how to determine a Boolean output based on some logical calculation of Boolean inputs. They play a fundamental role in problems in complexity theory and in chip design for digital computers.

[0040] Boolean logic: Boolean logic is a logical algebraic system named after the British mathematician George Boole. The main Boolean logic operators are logical AND (and), logical OR (or), logical NOT (not), and logical XOR (xor).

[0041] Truth table: A table that represents all possible states between input and output of a logic event.

[0042] Binary tree: It is a set of n finite elements. The set is either empty or consists of an element called the root and two disjoint binary trees called the left subtree and the right subtree. It is an ordered tree. When the set is empty, the binary tree is called an empty binary tree. In a binary tree, an element is also called a node.

[0043] Expression tree: The leaf nodes of an expression tree are operands, and the other nodes are operators. Assuming that all operators are binary operators, a binary tree is formed. We can recursively calculate the values ​​of the left and right subtrees to get the value of the entire expression tree.

[0044] Breadth-first search algorithm (also known as breadth-first search): It is one of the simplest graph search algorithms. Its alias is also called BFS. It is a blind search method that aims to systematically expand and check all nodes in the graph to find the result. In other words, it does not consider the possible location of the result and thoroughly searches the entire graph until the result is found.

[0045] Depth-First Search (DFS): It is one of the most common graph search methods. Depth-first search will search along a path and fall back to the node just visited when it cannot search. Depth-first traversal traverses the graph in the same way as depth-first search. And each node can only be visited once.

[0046] Traversal refers to visiting each node in a tree (or graph) in turn along a search route.

[0047] Verilog HDL: It is a hardware description language that describes the structure and behavior of digital system hardware in text form. It can be used to represent logic circuit diagrams, logic expressions, and the logic functions performed by digital logic systems. Verilog HDL and VHDL are the two most popular hardware description languages ​​in the world.

[0048] Bit (BIT, Binary digit), a computer term, is a unit of information volume, which is a transliteration of the English word BIT. It is also a bit in a binary number, a unit of measurement for information volume, and the smallest unit of information volume.

[0049] The truth table is the basis of digital circuit simulation calculation. For the calculation of the truth table, the simple way is to obtain a set of permutations and combinations based on the input, and then input these combinations one by one to obtain the output, and then you can get the truth table. However, according to the algorithm of permutations and combinations, the number of permutations and combinations increases exponentially with the increase of input. Calculating the combinations one by one also requires a lot of calculation.

[0050] In a digital circuit, assuming that there are n input signals, and only considering that the input value of each input signal of the Boolean function is 0 or 1, there are 2n combinations of all permutations in the truth table. When the signal value of the input signal is 0, 1, x, and z, there are 4n permutations and combinations of the truth table. The size of the truth table grows exponentially with the number of input combinations. In the prior art, the amount of computation required for the truth table simulation is relatively large when the truth table is obtained through permutations and combinations. At the same time, the truth table also takes up a lot of space in this application.

[0051] In view of the technical bottlenecks in the prior art, this application proposes a digital circuit simulation method based on a key value truth table, which can speed up the calculation time of generating a truth table, reduce the size of the truth table, and reduce the simulation time. The content of this application is described in detail below in conjunction with specific embodiments.

[0052] Figure 1 The flowchart of a digital circuit simulation method based on a key value truth table is shown according to an exemplary embodiment. The digital circuit simulation method 10 based on a key value truth table at least includes steps S102 to S110.

[0053] like Figure 1 As shown, in S102, circuit information of the digital circuit to be simulated is obtained. The circuit information may include: a logic circuit diagram and a logic expression.

[0054] In S104, signal values ​​of multiple input signals are obtained. For example, the input signals of this simulation include four signals a, b, c, and d, and the signal value of each input signal is determined. As described above, the signal value can be 0, 1, x, and z.

[0055] In S106, port information and arithmetic logic key value truth table corresponding to the digital circuit are obtained based on the circuit information. A Boolean function corresponding to the digital circuit may be obtained; the Boolean function may be parsed to generate an expression tree; and the arithmetic logic key value truth table may be generated based on the expression tree.

[0056] In one embodiment, the Boolean function may be, for example:

[0057] f = ((a&b)|c)&d;

[0058] The details of “analyzing the Boolean function to generate an expression tree; and generating the operation logic key value truth table based on the expression tree” will be described in Figure 3 The corresponding embodiments are described in detail. By the method in this application, the calculated operation logic key value truth table can be shown in Table 1:

[0059] Table 1: Truth table of key values ​​of operation logic

[0060] f a b c d 0 - - - 0 0 0 - 0 - 0 - 0 0 - 1 - - 1 1 1 1 1 - 1

[0061] In the truth table of the key values ​​of the operation logic, "-" represents any value. For example, in the first row of the table, a corresponds to "-", b corresponds to "-", c corresponds to "-", and d corresponds to "0"; its meaning is that as long as the value of d is 1, no matter what the values ​​of a, b, and c are, the corresponding output result f is "0".

[0062] The operation logic key value truth table can be pre-stored in the circuit information of the digital circuit or at a preset position, and can be directly called in actual applications.

[0063] In S108, the plurality of input signals are input to ports corresponding to the target digital circuit based on the port information. The input signals are input to corresponding ports.

[0064] In S110, the simulation output result of the digital circuit is obtained by using the signal values ​​of the multiple signals and the operation logic key value truth table. The key value combination in the operation logic key value truth table can be extracted row by row; the signal values ​​of the multiple signals and the key value combination are compared to obtain the simulation output result of the digital circuit.

[0065] The signal value of the input signal can be compared with the above operation logic key value truth table one by one to obtain the simulation output result of the digital circuit.

[0066] According to the digital circuit simulation method based on key value truth table of the present application, by obtaining circuit information of the digital circuit to be simulated; obtaining signal values ​​of multiple input signals; obtaining port information and operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the multiple input signals to the ports corresponding to the target digital circuit based on the port information; and obtaining the simulation output results of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table, the efficiency of obtaining the truth table can be accelerated during the digital circuit simulation process, the space occupied by the truth table can be simplified, the size of the truth table can be compressed, and the calculation time of the Boolean function can be improved, and the overall simulation time of the system can be reduced.

[0067] It should be clearly understood that the present application describes how to form and use specific examples, but the principles of the present application are not limited to any details of these examples. On the contrary, based on the teaching of the content disclosed in the present application, these principles can be applied to many other embodiments.

[0068] After research, the applicant of the present disclosure found that the expression of digital circuits is generally expressed in the form of a hardware description language, which represents logic circuit diagrams and logic expressions in the form of text. EDA can read this text when simulating a circuit, and obtain the Boolean function to be simulated from this text. The mapping relationship between the input and output of each Boolean function will not change during the simulation, so the mapping of the Boolean function can be obtained through the basic logic gate truth table before simulation.

[0069] Figure 2 1 is a basic logic gate truth table of an exemplary Boolean function using the digital circuit simulation method disclosed in the present invention. The basic logic gate truth table can be as follows: Figure 2 As shown, for the exemplary Boolean function above, for example: f = ((a&b)|c)&d;

[0070] Through the basic logic gate function, the corresponding truth table can be obtained as shown in Table 2:

[0071] Table 2: Truth table

[0072] f a b c d 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1

[0073] For this Boolean function, observing its truth table, we can find that some of the inputs are critical. What is critical? Once the value of one or more inputs is determined, the output of this function is determined. No matter what the values ​​of the remaining inputs are, they will not affect the output value. For other Boolean functions, there will be different truth tables, which are not listed here one by one.

[0074] For example, if d is 0, the output will be 0 regardless of the other values. If b and c or a and c are 0, the output will also be 0. If c and d are 1, the output will be 1.

[0075] If we only focus on the key value, its operation logic key value truth table is shown in Table 1 above. Among them, "-" means any value.

[0076] The size of the truth table is reduced from 16 rows to 5 rows. The operation logic key value truth table is equivalent to compressing the volume of the original truth table. This method can reduce the size of the truth table.

[0077] The applicant of the present disclosure has proposed a method of compressing the truth table through the above analysis. Figure 3 The flowchart of a digital circuit simulation method based on a key value truth table is shown according to an exemplary embodiment. The digital circuit simulation method 30 based on a key value truth table at least includes steps S303 to S308.

[0078] like Figure 3 As shown, in S302, the Boolean function corresponding to the digital circuit is obtained. The Boolean function: f = ((a&b)|c)&d; can be used as an example to illustrate the embodiment of the present application.

[0079] In S304, the Boolean function is parsed to generate an expression tree. Figure 4 The expression tree of an exemplary Boolean function using the digital circuit simulation method disclosed in the present invention is shown. The exemplary Boolean function is, for example, f=((a&b)|c)&d. The leaf nodes of the expression tree are operands, and the other nodes are operators.

[0080] In S306, the operation logic key value truth table is generated based on the expression tree. The target value of the root node of the expression tree can be determined; the expression tree is traversed based on the target value; the operation logic key value combination of the Boolean function is inferred based on the logical relationship during the traversal process; and the operation logic key value truth table is generated through the operation logic key value combination.

[0081] In one embodiment, the target value may be used as the numerical value corresponding to the root node of the expression tree; and the expression tree may be traversed through a priority search algorithm based on the target value.

[0082] The target value may be the value of the root node, and the root node may be the output value f of the Boolean function, for example, f has two possible values: 1 or 0. According to the steps in the following text, a truth table of the key values ​​of the operation logic of the Boolean function when f=1 and a truth table of the key values ​​of the operation logic of the Boolean function when f=0 may be established respectively.

[0083] In one embodiment, the operation logic key value combinations can be arranged in a preset order; the target value is used as an output value; and the operation logic key value truth table is generated by the operation logic key value combinations arranged in a preset order and the output value.

[0084] Figure 5 The present invention is a flowchart of a digital circuit simulation method based on a key value truth table according to another exemplary embodiment. Figure 5 The process 50 shown is for Figure 3 The detailed description of "inferring the operation logic key value combination of the Boolean function based on the logical relationship during the traversal process" in the process S306 shown.

[0085] like Figure 5 As shown, in S502, in the process of traversing the expression tree, the value of the root node is obtained.

[0086] In S504, the values ​​of the lower nodes are calculated according to the value of the root node and its corresponding operation type.

[0087] In S506, the lower layer nodes are traversed one by one until the bottom layer leaf node is traversed. In the process of traversing the lower layer nodes one by one, the current node can be obtained; when the current node is not a leaf node, the value of the lower layer node is calculated according to the value of the current node and its corresponding operation type; and the traversal is completed until the bottom layer leaf node is reached.

[0088] In S508, the operation logic key value combination is generated according to the traversal result. All branches in the expression tree can be extracted from the traversal result; and the values ​​of the leaf nodes included in each branch are used as the operation logic key value combination of the branch.

[0089] In a specific embodiment, take the example of finding the key value of the operation logic whose output is 0. For the AND gate, only one of its inputs is required to be 0, so you can only traverse downward along one input, and the target value of the input is 0. If this input is the output of an OR gate, for the OR gate, if its output is required to be 0, then its two inputs must also be 0. At this time, you need to traverse downward along its two inputs and require them to be 0. Priority means deciding how to search downward based on the output requirements and the type of gate. In this way, when you reach the leaf node, you will get a set of key values, which may be one or several. Next, traverse another branch that has not been traversed to obtain another set of key values, until all branches are traversed to obtain all key value combinations.

[0090] Figure 6 FIG. 1 is a schematic diagram of a traversal process of a digital circuit simulation method based on a key value truth table according to another exemplary embodiment. Figure 6As shown, a truth table of a set of key values ​​can be obtained in one traversal, with the output being 0, a being 0, c being 0, and other values ​​being arbitrary.

[0091] It is understandable that the above embodiment is only described by taking the value range of the input signals a, b, c, d as 0 or 1 as an example. If the value range of the input signals a, b, c, d is 4: 0, 1, x or z, it can also be based on the IEEE Standard for The Hardware Description Language manual gives the truth table to obtain the corresponding combination. For multi-input gates, as long as it has a clear truth table, this method can also be used to find the key value of the operation logic. The method is the same. Moreover, for the method disclosed in this disclosure, if

[0092] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided in the present application are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0093] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0094] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0095] Figure 7 FIG. 1 is a block diagram of a digital circuit simulation device based on a key value truth table according to an exemplary embodiment. Figure 7 As shown, the digital circuit simulation device 70 based on the key value truth table includes: a circuit module 702, a signal module 704, a truth table module 706, an input module 708, and an output module 710. The digital circuit simulation device 70 based on the key value truth table may also include: a generation module 712.

[0096] The circuit module 702 is used to obtain circuit information of the digital circuit to be simulated;

[0097] The signal module 704 is used to obtain signal values ​​of multiple input signals;

[0098] The truth table module 706 is used to obtain the port information and logic key value truth table corresponding to the digital circuit based on the circuit information;

[0099] The input module 708 is used to input the multiple input signals to the ports corresponding to the target digital circuit based on the port information;

[0100] The output module 710 is used to obtain the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table. The output module 710 is also used to extract the key value combination in the operation logic key value truth table row by row; compare the signal values ​​of the multiple signals with the key value combination to obtain the simulation output result of the digital circuit.

[0101] The generation module 712 is used to obtain the Boolean function corresponding to the digital circuit; parse the Boolean function to generate an expression tree; and generate the operation logic key value truth table based on the expression tree.

[0102] According to the digital circuit simulation device based on key value truth table of the present application, by obtaining circuit information of the digital circuit to be simulated; obtaining signal values ​​of multiple input signals; obtaining port information and operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the multiple input signals to the ports corresponding to the target digital circuit based on the port information; and obtaining the simulation output results of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table, the efficiency of obtaining the truth table can be accelerated during the digital circuit simulation process, the space occupied by the truth table can be simplified, the size of the truth table can be compressed, and the calculation time of the Boolean function can be improved, thereby reducing the overall simulation time of the system.

[0103] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0104] Refer to the following Figure 8 hereinafter describes an electronic device 800 according to this embodiment of the present application. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0105] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), a display unit 840, etc.

[0106] The storage unit stores a program code, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 810 can perform the following steps: Figure 1 , Figure 3 , Figure 5 Follow the steps shown in .

[0107] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .

[0108] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0109] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0110] The electronic device 800 may also communicate with one or more external devices 800' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 800, and / or any device (e.g., routers, modems, etc.) that the electronic device 800 can communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface 850. In addition, the electronic device 800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 860. The network adapter 860 may communicate with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0111] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Fig. 9As shown, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation mode of the present application.

[0112] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0113] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0114] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0115] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium realizes the following functions: obtaining circuit information of a digital circuit to be simulated; obtaining signal values ​​of multiple input signals; obtaining port information and an operation logic key value truth table corresponding to the digital circuit based on the circuit information; inputting the multiple input signals to the ports corresponding to the target digital circuit based on the port information; and obtaining the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table.

[0116] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0117] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.

[0118] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A digital circuit simulation method based on a key value truth table, characterized in that: include: Acquire circuit information of a digital circuit to be simulated, and acquire port information corresponding to the digital circuit based on the circuit information; Get the signal values ​​of multiple input signals; Obtaining a Boolean function corresponding to the digital circuit; Parsing the Boolean function to generate an expression tree; Determine a target value of a root node of the expression tree; traversing the expression tree based on the target value; In the process of traversing the expression tree, get the value of the root node; Calculate the value of the lower layer node according to the value of the root node and its corresponding operation type; Traverse the lower-level nodes one by one until the bottom-level leaf node is reached; Generate a combination of operation logic key values ​​according to the traversal results; Generate an operation logic key value truth table by combining the operation logic key values; inputting the plurality of input signals to ports corresponding to the target digital circuit based on the port information; The simulation output result of the digital circuit is obtained through the signal values ​​of the multiple signals and the operation logic key value truth table.

2. The digital circuit simulation method according to claim 1, characterized in that: Traversing the expression tree based on the target value includes: Taking the target value as the value corresponding to the root node of the expression tree; The expression tree is traversed by a priority search algorithm based on the target value.

3. The digital circuit simulation method according to claim 1, characterized in that: Traverse the lower-level nodes one by one until the bottom-level leaf node is reached, including: In the process of traversing the lower-level nodes one by one, obtain the current node; When the current node is not a leaf node, the value of the lower node is calculated according to the value of the current node and its corresponding operation type; Traverse to the bottom leaf node.

4. The digital circuit simulation method according to claim 1, characterized in that: The operation logic key value combination is generated according to the traversal result, including: Extract all branches in the expression tree from the traversal result; The values ​​of the leaf nodes contained in each branch are used as the key value combination of the operation logic of the branch.

5. The digital circuit simulation method according to claim 1, characterized in that: Generating the operation logic key value truth table by combining the operation logic key values ​​includes: Arranging the operation logic key value combinations in a preset order; Taking the target value as an output value; The operation logic key value truth table is generated by combining the operation logic key values ​​and the output value arranged in a preset order.

6. The digital circuit simulation method according to claim 1, characterized in that: Obtaining the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table, including: Extracting key value combinations from the operation logic key value truth table row by row; The signal values ​​of the plurality of signals are combined and compared with the key value to obtain a simulation output result of the digital circuit.

7. A digital circuit simulation device based on a key value truth table, characterized in that: include: A circuit module, used to obtain circuit information of a digital circuit to be simulated, and obtain port information corresponding to the digital circuit based on the circuit information; A signal module, used for obtaining signal values ​​of multiple input signals; A truth table module, used to obtain the Boolean function corresponding to the digital circuit, parse the Boolean function to generate an expression tree, determine the target value of the root node of the expression tree, traverse the expression tree based on the target value, obtain the value of the root node in the process of traversing the expression tree, infer the value of the lower node according to the value of the root node and the corresponding operation type, traverse the lower nodes one by one until the bottom leaf node is traversed, generate an operation logic key value combination according to the traversal result, and generate an operation logic key value truth table through the operation logic key value combination; An input module, configured to input the plurality of input signals to ports corresponding to the target digital circuit based on the port information; The output module is used to obtain the simulation output result of the digital circuit through the signal values ​​of the multiple signals and the operation logic key value truth table.

Citation Information

Patent Citations

  • Digital circuit logic expression simplification method based on central concept

    CN111914499A

  • Signal path automatic extraction method, system and device and storage medium

    CN115455900A

  • Test case generation program, test case generation method and test case generator

    JP2016115287A

  • Rapid expression coverage

    US20150067627A1

  • Computerized generation of truth tables for sequential and combinatorial cells

    US5416719A