Driving matrix and its generation method, gate circuit information representation method, diagram
Through the generation of the driving matrix and directed driving diagram, the problem of insufficient gate circuit information expression in the prior art is solved, and the complete retention and unambiguous representation of gate circuit information is realized, and the circuit analysis and operation process is simplified.
Patent Information
- Application Number
- CN202110377752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-08
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-04-08
AI Technical Summary
In the prior art, gate circuit information cannot effectively retain the type, input and output port information and connection relationship of the gate in directed graph and adjacency matrix representation, resulting in information loss and ambiguity, making it difficult to meet the complex analysis and processing requirements of digital integrated circuits. .
A driving matrix and its generation method are proposed. By creating internal, input and output driving matrix, it represents the connection relationship and port information of the gate circuit in detail, and generates a directed driving diagram to ensure that the connection relationship and reservation of the gate circuit are represented without ambiguity. Door type, input and output port information.
It realizes a complete expression of gate circuit information, ensures one-to-one mapping between the circuit and the diagram, retains gate circuit type, input and output port information and connection information, simplifies circuit segmentation and mathematical operations, and avoids non-0 in traditional matrices. The complexity of elements.
Smart Images

Figure CN113515908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gate circuit simulation, and in particular to a driving matrix for representing gate circuit information, a method for generating the driving matrix, a method for representing gate circuit information and a corresponding directed driving graph. Background Art
[0002] When processing and computing (for example, segmenting and grouping) gate-level digital integrated circuits (gate circuits for short), it is necessary to use appropriate mathematical forms to represent the gate-level netlist of the digital integrated circuit. The gate-level netlist contains the instantiation of the gate circuit and the connection relationship based on port mapping. Based on the gate-level netlist, a connection diagram of the gate circuit can be drawn.
[0003] In the standard cell library based on mainstream processes, according to the working principle of static complementary CMOS circuits (complementary metal oxide semiconductor circuits), most combinational logic units are in the form of multiple inputs and single output (MISO), inverters and drivers are single input and single output (SISO), differential complementary output logic is multiple inputs and two outputs (MIDO), and sequential logic is multiple inputs and one output or multiple inputs and two outputs. If the gate circuit is abstracted as a vertex, the input and output of the gate circuit are understood as directions, and the connection between the input and output of the gate circuit is understood as the connection between vertices, then the gate circuit and its connection relationship can be represented by a directed graph. The representation of the example circuit can be as follows: Figure 1 As shown in the table in Figure 2 as shown in .
[0004] In graph theory, adjacency matrix or incidence matrix is generally used to represent the connection relationship between the edges of vertices in a directed graph. Let G = (V, E), V = {v1, v2, v3, ..., v n} is a vertex set, E = {e1, e2, e3, ..., em} is a directed edge set. Let aij represent the vertex v i The number of directed edges between the vertex vj and the resulting matrix A = A(G) = [aij]n × n is the adjacency matrix of graph G. Let mij represent the vertex v i The number of times the directed edge ej is associated with each other, and the resulting matrix M = M(G) = [m ij ] n×m is the incidence matrix of graph G. Figure 1 The adjacency matrix of a circuit and directed graph is Figure 3shown.
[0005] Directed graphs cannot distinguish between certain different circuit connection relationships. For example, a gate has multiple outputs, and these outputs are connected to different inputs of another gate; and a gate has only one output, and this output is connected to different inputs of another gate. For these two cases, directed graphs will abstract them into the same connection relationship, such as Figure 4 As shown, taking the two different connections of full adder (FA) and half adder (HA) as examples, this will result in different circuits connecting according to the same directed graph to obtain the same adjacency matrix.
[0006] In the process of abstracting the gate-level netlist into a directed graph, some information is lost, such as the type of gate, the connection relationship between the gate's input port and the driver end, and the connection relationship between the gate's output port and the load input end. The type of gate directly determines the logical function and delay of the gate; different input ports have different load capacitances, and the delay and power consumption of the driver gate connected to this port are also different; different output ports have different driving capabilities, and the delay and power consumption of this port are also different. For combinational logic gates, different input modes bring different delays; for sequential logic gates, the timing analysis methods of the data input (D) end and the clock input (CK) end are different.
[0007] In graph theory, this information is invalid because directed graphs and adjacency matrices only care about the connection relationship between vertices. In addition to focusing on the connection relationship, the analysis and processing of digital integrated circuits also need to pay attention to the function of the gate, calculate delay, power consumption, size and other information. In the process of calculating the matrix representing the gate-level netlist, this information in addition to the connection relationship is needed. After the matrix calculation is completed, when re-outputting the processed circuit netlist (such as segmentation, grouping, etc.) according to the calculation results of the matrix, information such as the type of gate, input and output port names, and connection relationships are also required. Therefore, it is necessary to modify the directed graph and adjacency matrix so that the above additional information can be effectively expressed.
[0008] Therefore, how to provide a matrix that can express more circuit netlist information is a technical problem that the industry needs to solve urgently. Summary of the invention
[0009] In order to solve the technical problem in the prior art that the amount of gate circuit information represented by the adjacency matrix is small, the present invention proposes a driving matrix and a generation method thereof, a method for representing gate circuit information, and a graph.
[0010] The present invention proposes a driving matrix for representing gate circuit information, wherein the meanings represented by the rows and columns of the driving matrix are selected from one of the following two: a gate, and a connection port of the same type corresponding to the gate. When a connection port is connected to a gate, the value of the matrix element pointed to by the gate and the connection port in the driving matrix is a collection of information of the ports connected to the gate and the connection port.
[0011] Further, the driving matrix includes an internal driving matrix for representing the internal connection relationship of the gates of the gate circuit, and the rows and columns of the internal driving matrix are selected from the following two: all output ports of all gates, all gates;
[0012] When an output port of a gate is connected to another gate, the values of the matrix elements pointed to by the output port of the gate and the other gate in the internal driving matrix are information of all input ports of the other connected gate.
[0013] Further, the driving matrix includes an input driving matrix for indicating the connection relationship between the circuit input ports and the gates of the gate circuit, and the rows and columns of the input driving matrix are respectively one of the following: all circuit input ports, and gates connected to the circuit input ports;
[0014] When a circuit input port is connected to a gate, the value of the matrix element pointed to by the circuit input port and the gate in the input driving matrix is the information of all the input ports of the connected gate.
[0015] Further, the driving matrix includes an output driving matrix for indicating the connection relationship between the circuit output ports and the gates of the gate circuit, and the rows and columns of the output driving matrix are respectively one of the following: all circuit output ports, and gates connected to the circuit output ports;
[0016] When a circuit output port is connected to a gate, the value of the matrix element pointed to by the gate and the circuit output port in the output driving matrix is the information of all the output ports of the connected gate.
[0017] The present invention also proposes a method for generating a driving matrix according to the above technical solution, comprising:
[0018] Read the data of the gate-level netlist;
[0019] Based on the data of the gate-level netlist, a first data structure is created to store the connection ports and the connections of the gates, and the connection ports and the connections are classified into rows or columns in the first data structure according to the gates to which they belong;
[0020] creating a second data structure to store the gate, the circuit input port, and the circuit output port, respectively;
[0021] The elements of the first data structure are traversed based on the elements of the second data structure, and the values of the elements corresponding to the driving matrix are found therefrom to generate the driving matrix.
[0022] Further, when the driving matrix is an internal driving matrix, the generating method includes:
[0023] Step 1.1: Create the internal drive matrix;
[0024] Step 1.2: Read all ports and their connections of a gate in the first data structure, and search for an output port and its connection of the gate as the output port and its connection of the current gate;
[0025] Step 1.3: Traverse all ports and their connections of other gates other than the current gate in the first data structure, find the input ports and their connections of other gates that have the same connection as the output port and its connection of the current gate, and add the information of the input ports of the other gates to the values of the matrix elements pointed to by the output port of the current gate and the other gates in the internal driving matrix;
[0026] Step 1.4: Continue to search for the output port of the current gate and its connection until the output port of the current gate is matched. If the output port of the current gate and its connection are found, return to step 1.3; if the output port of the current gate is matched, return to step 1.2 until the output ports of all gates are matched.
[0027] Further, when the driving matrix is an input driving matrix, the generating method includes:
[0028] Step 2.1: Create the input drive matrix;
[0029] Step 2.2: Read a circuit input port in the second data structure as the current circuit input port;
[0030] Step 2.3: Traverse all ports and their connections of all gates in the first data structure, find the connection information of the input port of the gate that is the same as the input port information of the current circuit, and set the value of the matrix element pointed to by the current circuit input port and the gate in the input driving matrix as the input port information of the gate;
[0031] Step 2.4: Return to step 2.2 to read the next circuit input port as the current circuit input port until all circuit input ports are read.
[0032] Furthermore, when the driving matrix is an output driving matrix, the generating method includes:
[0033] Step 3.1: Create the output drive matrix;
[0034] Step 3.2: Read a circuit output port in the second data structure as the current circuit output port;
[0035] Step 3.3: traverse all ports and their connections of all gates in the first data structure, find the connection information of the output port of the gate that is the same as the output port information of the current circuit, and set the value of the matrix element pointed to by the output port of the current circuit and the gate in the output driving matrix as the output port information of the gate;
[0036] Step 3.4: Return to step 3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
[0037] Furthermore, the first data structure is a two-dimensional dictionary structure, and the second data structure is a vector.
[0038] The method for representing gate circuit information proposed in the present invention uses the driving matrix described in the above technical solution to represent the information of the gate circuit, and the information of the gate circuit includes: at least one of the internal connection relationship of the gate, the connection relationship between the boundary gate in the gate and the circuit input port, and the connection relationship between the boundary gate in the gate and the circuit output port.
[0039] Furthermore, it also includes using vectors to represent the information of the gate circuit.
[0040] Furthermore, the vector includes at least one of: a vector containing all gates, a vector containing all output ports of all gates, a vector containing all circuit input ports, a vector containing all circuit output ports, and a vector containing device types of gates corresponding to all gates.
[0041] Furthermore, elements with the same sequence number in the vector containing all gates and the vector containing device types of gates corresponding to all gates correspond to the same gate.
[0042] The directed driving graph generated by the driving matrix described in the above technical solution proposed by the present invention includes:
[0043] Vertices, each vertex represents a door;
[0044] Input boundary vertices, each of which represents a circuit input port;
[0045] Output boundary vertices, each of which represents a circuit output port;
[0046] Nodes,belong to the corresponding vertices, and each node represents an output port of a gate;
[0047] A line connects an input boundary vertex to a vertex, and connects a vertex to an output boundary vertex. When the end of the line is connected to the vertex, the end of the line is provided with information for marking the input port of the vertex.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] 1. The directed drive graph can unambiguously represent the connection relationship of the gate circuit, and achieve a one-to-one mapping between the circuit and the graph; and retain all gate circuit types, gate circuit input and output port information and connection information, circuit module input and output port information and connection information.
[0050] 2. The driving matrix and vector can fully describe the directed driving graph, unambiguously represent the connection relationship of the gate circuit, and retain all gate circuit types, gate circuit input and output port information and connection information, circuit module input and output port information and connection information.
[0051] 3. The input and output port information and connection information of the circuit module are expressed in separate matrices and vectors, which does not affect the judgment of the connection complexity between internal gate circuits. The connection between the input and output ports of the circuit module and the internal gate circuit is generally simple. If these connections are expressed in the internal driving matrix, it may affect the judgment of the connection complexity of the internal gate circuit when performing circuit segmentation and other operations.
[0052] 4. When performing mathematical operations, you only need to replace the non-zero elements in the matrix with 1 to perform matrix operations. Other values besides 0 and 1 may appear in the traditional adjacency matrix. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention is described in detail below with reference to the embodiments and accompanying drawings, wherein:
[0054] Figure 1 This is one of the examples in the prior art of using vertices of a directed graph to represent gate circuits.
[0055] Figure 2 This is the second example of a gate circuit and its directed graph in the prior art.
[0056] Figure 3 It is one of the examples of gate circuits, directed graphs and their adjacency matrices in the prior art.
[0057] Figure 4 This is the second example of gate circuits, directed graphs and their adjacency matrices in the prior art.
[0058] Figure 5(a)-Figure 5(c) is an example of a gate circuit and the corresponding directed graph and adjacency matrix.
[0059] Figure 6It is an embodiment of the internal driving matrix corresponding to the gate circuit of FIG5(a).
[0060] Figure 7 It is an embodiment of the input driving matrix corresponding to the gate circuit of FIG5(a).
[0061] Figure 8 It is an embodiment of the output driving matrix corresponding to the gate circuit of FIG5(a).
[0062] Fig. 9 5( a ) and two vectors of gates and their device types corresponding to the gate circuit.
[0063] Fig.10 This is the instantiation process of the first and second data structures in one embodiment of the present invention.
[0064] Fig.11 is a flow chart of generating an internal driving matrix in one embodiment of the present invention.
[0065] Fig.12 4 is a flow chart of generating vectors representing each output port of a vertex according to an embodiment of the present invention.
[0066] Fig.13 It is a flow chart of generating circuit input and output vectors in one embodiment of the present invention.
[0067] Fig.14 is a flow chart of generating an input drive matrix in one embodiment of the present invention.
[0068] Fig.15 is a flow chart of generating an output driving matrix in one embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0070] Thus, a feature indicated in this specification will be used to illustrate one of the features of an embodiment of the present invention, rather than implying that each embodiment of the present invention must have the described feature. In addition, it should be noted that this specification describes many features. Although some features can be combined together to illustrate possible system designs, these features can also be used in other combinations that are not explicitly described. Thus, unless otherwise stated, the described combinations are not intended to be limiting.
[0071] The principle of the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0072] like Figure 5(a)-Figure 5(c) As shown, the present invention provides an example of a specific gate circuit, and the present invention will be explained below based on the circuit of this example.
[0073] The circuit shown in FIG. 5( a ) shows the specific components of the gate circuit, the input port and output port of each device, and the connection relationship with the external connection port (including the circuit input port and the circuit output port).
[0074] FIG5(b) shows the directed graph of the circuit shown in FIG5(a) and the adjacency matrix of the circuit. It can be seen from the adjacency matrix that the adjacency matrix does not contain input and output information. Although it can be known that there are two port connections between vertex U1 (gate U1, representing a device of type HAOX1) and vertex U2 (gate U2, representing a device of type XXOR2X1), the specific connection information is unknown. The same is true for the associations between other vertices. It is difficult to see the specific information. The same is true for the directed graph mapped by the adjacency matrix.
[0075] FIG5(c) shows a directed driving graph that can be obtained based on the driving matrix of the present invention. In the directed driving graph, the present invention defines as follows:
[0076] Vertex, define each vertex represents a door, vertex U1-vertex U4 is also called door U1-U4;
[0077] Input boundary vertices, each of which is defined to represent a circuit input port, such as the current gate circuit module needs to be input from the output port of another gate circuit module;
[0078] Output boundary vertices, each of which is defined to represent a circuit output port. The so-called circuit output port is an output port of a gate circuit module. The gate circuit module may be composed of one gate or multiple gates. In other words, the circuit output port is also the output port of the gate in the gate circuit module that is to output to other gate circuit modules or a certain gate.
[0079] Nodes,belong to the corresponding vertices, and each node is defined to represent an output port of a gate;
[0080] A line connects an input boundary vertex to a vertex, and connects a vertex to an output boundary vertex. When the end of the line is connected to the vertex, the end of the line is provided with information for marking the input port of the vertex. In a specific embodiment, the information of the input port specifically refers to a name or ID that can uniquely identify the input port.
[0081] The directed drive graph further refines the vertices of the directed graph in the prior art, so that when the vertices in the prior art are specifically displayed, the corresponding nodes are displayed by the number of their output ports. Taking vertex U1 as an example, it will be displayed as two nodes. The two nodes Z and O are the two output ports of vertex U1, and the two output ports of vertex U1 are drawn with their information at the corresponding positions in the graph, such as drawing the names A and B of the corresponding input ports on the line connecting the input ports. This makes the information of vertex U1 richer. Vertices U2-U4 are drawn in the same way, and their input and output ports are also displayed in the graph by node annotation or line annotation. The specific types of these vertices are the device types of the corresponding gates in the standard cell library.
[0082] In this figure, vertex U1 connected to circuit input ports INA[0] and INA[1] is a boundary vertex. Vertex U4 connected to circuit input port INB and circuit output port OUTB is also a boundary vertex. Similarly, vertex U3 connected to circuit output port OUTA is also a boundary vertex. The input boundary vertex of the directed drive graph is defined as the input signal of the circuit module netlist. Each element in the vector type input signal is an input boundary vertex. The input boundary vertex is an output vertex for the internal circuit. In other words, the circuit input ports INA[0], INA[1], and INB are visualized as an input boundary vertex.
[0083] The output boundary vertex of the directed driving graph is defined as the output signal of the circuit module netlist. Each element in the vector type output signal is an output boundary vertex. For the internal circuit, the output boundary vertex is the input boundary vertex of other circuit parts. In other words, the circuit output ports OUTA and OUTB are visualized as an output boundary vertex.
[0084] pass Figure 5(a)-Figure 5(c) From the comparison, we can see that the directed drive graph distinguishes the connections of gate U1->gate U2 and gate U2->gate U3 very well, and retains the connection information of the input and output ports of each gate, as well as the connection information of the input and output ports of the netlist.
[0085] The driving matrix of the present invention is described in detail below. The driving matrix of the present invention is used to identify gate circuit information, and the meanings represented by its rows and columns are selected from the following two: vertices, and the same type of connection ports corresponding to the vertices. When a vertex is connected to a certain connection port, the value of the matrix element pointed to by the vertex and the connection port in the driving matrix is the information of the port connected to the vertex and the connection port. For example, each row of the driving matrix represents an output port of a vertex, and each column of the driving matrix represents each vertex. For example, each row of the driving matrix represents each vertex, and each column of the driving matrix represents an output port of a vertex. Since the status of the rows and columns of the matrix is essentially the same, no matter which one is selected as the row or the column, the elements of the formed matrix are essentially the same.
[0086] The driving matrix used to represent the gate circuit information specifically includes an internal driving matrix, an input driving matrix and an output driving matrix.
[0087] The internal driving matrix is used to represent the internal connection relationship between the vertices of the gate circuit, which is the internal connection relationship between vertices U1 to U4 in this embodiment. The rows and columns of the internal driving matrix are selected from the following two: all output ports of all vertices, all vertices. In one embodiment, each row of the internal driving matrix represents an output port of a vertex, and each column represents a vertex. When an output port of a vertex is connected to one or more input ports of another vertex, the value of the matrix element pointed to by the output port of the vertex and the other vertex in the internal driving matrix is the information of the input port of the other vertex. For example, the output port Z of vertex U1 is connected to the input port A of vertex U2, then the value of the matrix element at the intersection of the row representing U1_Z and the column representing U2 is the input port name A of U2. The output port Z of vertex U2 is connected to both the input port A of vertex U3 and the input port B of vertex U3, then the value of the matrix element at the intersection of the row representing U2_Z and the column representing U3 is the two input port names AB of U3.
[0088] Figure 6The specific values of the internal driving matrix inst_drv_matrix in an embodiment are given. A row of the internal driving matrix inst_drv_matrix represents the connection relationship between a certain output port of a certain gate and the input ports of all other gates. In order to clearly indicate the connected input ports, each element in this row is defined as the name of the input port of each gate connected to this output port; if this output port is not connected to a certain gate, the matrix element value corresponding to this gate position is 0. In particular, if this output port is connected to two or more ports of a certain gate, the matrix element value corresponding to this gate position is the set of all input port names connected to this gate and this row of output ports. The vector inst_name is a row vector, and the value of each element of the vector inst_name is "the name of each gate instantiated in the netlist", and the length of the row vector is the number of gates in the netlist. The vector inst_drv is a column vector, the elements of which are the output ports of each gate in the netlist, and the value of the element is "the name of each gate instantiated in the netlist_the name of the output port of this gate", and the length of this column vector is the sum of the number of output ports of all gates in the netlist.
[0089] The connection between the input and output ports of the circuit module and the internal gate circuit is generally simple. If these connections are expressed in the internal drive matrix, it may affect the judgment of the complexity of the internal gate circuit connection when performing circuit segmentation and other operations. Therefore, in order to fully express the gate circuit structure without affecting the results of operations such as gate segmentation, the column vector input_drv and column vector drv_output are defined, the input drive matrix input_drv_matrix, and the output drive drv_output_matrix represent the connection of the input and output ports of the circuit module.
[0090] The input driver matrix represents the connection relationship between the circuit input port and the gate of the gate circuit. The rows and columns of the input driver matrix are one of the following two: all circuit input ports, and the gates connected to the circuit input ports. When a circuit input port is connected to the input port of a gate, the value of the matrix element pointed to by the circuit input port and the gate in the input driver matrix is the information of the input port of the gate, such as the name of the input port. For example, if the input port of a circuit is connected to the input port of a vertex, then in the input driver matrix, the value of the matrix element pointed to by the row represented by the circuit input port and the column represented by the vertex is the input port of the vertex.
[0091] like Figure 7As shown, in a specific embodiment, a column vector input_drv is defined, and the elements thereof are each circuit input port in the circuit module netlist, that is, each input boundary vertex. A row of the input drive matrix input_drv_matrix is defined to represent the connection relationship between a certain input boundary vertex and the input ports of all gates. In order to clearly indicate the connected input ports, each element in this row is defined as the information of the input port of each gate connected to this input boundary vertex, such as the name of the input port. If this input boundary vertex is not connected to a certain gate, the matrix element value corresponding to this gate position is 0. In particular, if this input boundary vertex is connected to two or more ports of a certain gate, the matrix element value corresponding to this gate position is the set of all input port names connected to this gate and this row of input boundary vertices. For example, if the circuit input port inb is connected to the input port B of vertex U4, then the value of the element at the intersection of the row represented by the circuit input port INB and the column represented by the vertex U4 in the input drive matrix input_drv_matrix is the input port name B of vertex U4.
[0092] The output driver matrix is used to represent the connection relationship between the circuit output port and the gate of the gate circuit. The rows and columns of the output driver matrix are one of the following two: all circuit output interfaces and the gates connected to the circuit output ports. When the output port of a gate is connected to a circuit output port, the value of the matrix element pointed to by the gate and the circuit output port in the output driver matrix is the information of the output port of the gate.
[0093] like Figure 8 As shown, in one embodiment, a column vector drv_output is defined, wherein the elements are each circuit output port in the circuit module netlist, that is, each output boundary vertex. A row of the output driver matrix drv_output_matrix is defined to represent the connection relationship between a certain output boundary vertex and the output ports of all gates. In order to clearly indicate the connected output ports, each element in this row is defined as the name of the output port of each gate connected to this output boundary vertex; if this output boundary vertex is not connected to a certain gate, the matrix element value corresponding to this gate position is 0. For example, if the circuit output port OUTA is connected to the output port Z of vertex U3, then the value of the element pointed to by the output driver matrix OUTA and U3 is Z.
[0094] The present invention also protects a method for representing gate circuit information. The information of the gate circuit can generally be divided into several aspects: the internal connection relationship of the vertex, the connection relationship between the boundary vertex in the vertex and the circuit input port, and the connection relationship between the boundary vertex in the vertex and the circuit output port. The method for representing the gate circuit information of the present invention uses the driving matrix in the above technical solution to protect at least one of the information. In addition to representing the gate circuit information with the above driving matrix, the gate circuit information also involves the type of the gate, which is related to the calculation complexity, delay, power consumption and other information of the gate during simulation. In other words, the gate circuit information also includes the device types corresponding to all vertices.
[0095] The device types corresponding to all vertices are represented by two vectors, where the elements of one vector contain all vertices, and the elements of the other vector contain the device types corresponding to all vertices. A vertex and the device type corresponding to the vertex are respectively used as the values of the elements with the same sequence number in two vectors to make the vertex and its device type correspond to each other.
[0096] like Fig. 9 As shown, the inst_ref vector is defined, and the elements in it are the types of each gate in the standard cell library in the netlist. Taking the circuit shown in the invention as an example, its inst_name vector and inst_ref vector correspond the device types of specific gates to each other through elements with the same serial number.
[0097] The present invention avoids ambiguity and retains all information in the circuit when describing the circuit through the above-mentioned multiple matrices and vectors. When performing mathematical operations, matrix operations can be performed by simply replacing non-zero elements with 1. There is one thing that needs attention: when performing matrix segmentation, the rows in the internal drive matrix inst_drv_matrix cannot be segmented if they correspond to different output ports belonging to the same gate in the column vector inst_drv. The columns in the internal drive matrix inst_drv_matrix correspond to each gate circuit device and there are no restrictions when performing segmentation operations.
[0098] The present invention also includes a method for generating the driving matrix, which specifically includes the following steps:
[0099] Read the data of the gate-level netlist;
[0100] Based on the data of the gate-level netlist, a first data structure is created to store each connection port of each vertex and its connection line, and the connection ports and their connection lines are classified into rows or columns in the first data structure according to the vertex to which they belong;
[0101] Creating a second data structure to store vertices, circuit input ports, and circuit output ports, respectively;
[0102] The elements of the first data structure are traversed based on the elements of the second data structure, and the elements corresponding to the driving matrix are found therein to generate the driving matrix.
[0103] In one embodiment, the first data structure may be a two-dimensional dictionary structure, and the second data structure may be three second data structures, which may specifically be vectors.
[0104] When generating the internal drive matrix, the following steps are specifically included:
[0105] Step 1.1: Create the internal drive matrix;
[0106] Step 1.2: Read all ports and their connections of a vertex in the first data structure, and search for an output port and its connection of the vertex as the output port and its connection of the current vertex;
[0107] Step 1.3: traverse all ports and their connections of other vertices except the current vertex in the first data structure, find the input ports and their connections of other vertices that have the same connection as the output port and its connection of the current vertex, and set the value of the matrix element pointed to by the output port of the current vertex and the other vertex in the internal driving matrix as the information of the input port of the other vertex, such as the name;
[0108] Step 1.4: Continue to search for the output port of the current vertex and its connection until the output port of the current vertex is matched. If the output port of the current vertex and its connection are found, return to step 1.3; if the output port of the current vertex is matched, return to step 1.2 until the output ports of all vertices are matched.
[0109] The following uses Python's data structure as an example to illustrate.
[0110] Before generating any driving matrix, it is necessary to do the corresponding preparation work, that is, read the data of the gate-level netlist. Specifically, read the entry-level netlist first, and then read each valid instantiation circuit in the entry-level netlist. Then create a list name_list, the elements of which are the instantiation names of each gate, that is, U1 to U4. Create a list ref_list, the elements of which are the device types of each gate in the standard cell library. Create a two-dimensional dictionary structure sckt_list. Each row in this dictionary corresponds to a gate or device type in name_list and ref_list. Each "key-value pair" in this row represents the connection relationship of "name-connection" of each port of this gate. Taking the input port of U1 as an example, the key-value pairs in this two-dimensional dictionary structure include Z-connection 1, which is the connection between the output port Z of vertex U1 and the input port A of vertex U2. It also includes A - connection 2, which is the connection between the input port A of vertex U1 and the circuit input port. Since this connection 2 is the connection between the input boundary vertex and the boundary vertex, the specific name of connection 2 in this embodiment is INA[0]. The key-value pairs related to vertex U1 also include B - connection 3 and O - connection 4, among which B - connection 3 is actually B_INB, which is the connection between the input port of vertex U1 and the circuit input port INB. O - connection 4 is the connection between the output port O of vertex U1 and the input port B of vertex U2. The list name_list referred to here is the vector inst_name, and the list ref_list is the vector inst_ref. Through Fig.10 The flowchart shown is used to obtain all instantiated lists name_list, lists ref_list, and two-dimensional dictionary structures sckt_list.
[0111] like Fig.11As shown, the specific implementation process of the internal drive matrix is introduced below. By obtaining the instantiation list name_list, the list type_list, and the two-dimensional dictionary structure sckt_list, the purpose of the list type_list is to store the output type of the input port and output port of each vertex. Since a gate has a name in the standard cell library, which is its prototype or reference (reference); when it is instantiated in the circuit, there will be an instantiated name. For example, an AND gate has the name ANDX2M in the standard cell library, which is the ref of this gate; the name when instantiated is U1, which is the name of the vertex (name). Taking the AND gate as an example, the AND gate can have different sizes, such as ANDX1M, ANDX2M, ANDX4M, etc., but they all belong to the AND gate type. If the AND gate type is defined as AND, then AND is the type of this gate ANDX2M U1, which will be stored in type_list and used to calculate the computational cost of the output port of vertex U1 (represented as a node in the directed drive graph). A numerical value is used to represent it, that is, different references of the same type use a numerical value to represent its computational cost.
[0112] Read a row of the two-dimensional dictionary structure sckt_list, that is, all the connection ports of a vertex (including input ports and output ports), read the connection ports of the current row in sequence, find the first output port, and then read the other rows of the two-dimensional dictionary structure sckt_list in sequence to find the connection with the same key-value pair as the connection name of the first output port, so as to find the relationship between the input port and the output port between the vertices. According to the above method, find the second to nth output ports of the current row in sequence, and find the corresponding input ports as the values of the matrix elements of the internal driving matrix. Then read other rows in sequence, and find the relationship between their output ports and the input ports of other vertices represented by other rows in accordance with the above method, and assign values to the corresponding matrix elements of the internal driving matrix. In this process, the vector m_row is a row of inst_drv_matrix, and the variable has_conn indicates whether the output port of a gate has a connection relationship with the input port of the current instantiated gate. If has_conn is false, it means that there is no connection relationship between the two, and the value of the corresponding matrix element of the internal driving matrix is 0. The variable input_wire represents the connection of the input port of the vertex, and the variable output_wire represents the connection of the output port of the vertex.
[0113] like Fig.12As shown, the vector inst_drv of the output port of each vertex can also be generated based on the two-dimensional dictionary structure, and a variable name_idx is defined as the index of the vector inst_name. Based on the vector inst_name, for a gate with only one output port, "_output port name" is appended to the gate name; for a gate with multiple output ports, the gate name is copied multiple times, and then "_output port name" is appended to the gate name respectively. The process of generating the vector inst_drv vector is as follows Fig.12 As shown. Instantiate the relevant vectors and two-dimensional dictionary structures, obtain all output port names of each vertex (that is, all output port names of each gate) by reading each row of the two-dimensional dictionary structure sckt_list in turn, and combine the found output port names and corresponding vertices into elements in the vector inst_drv according to the above naming rules. Figure 6 , taking the circuit illustrated in the present invention as an example, the values of the various elements of the vector inst_drv are listed.
[0114] Before introducing the generation method of the input driving matrix and the output driving matrix, first obtain the circuit input port vector i_p_list of the circuit module and the circuit output port vector o_p_list of the circuit module. Fig.13 As shown, by reading the netlist data, the circuit input port vector i_p_list and the circuit output port vector o_p_list are obtained.
[0115] The following describes the method for generating the input drive matrix, which specifically includes the following steps:
[0116] Step 2.1: Create the input drive matrix;
[0117] Step 2.2: Read a circuit input port in the second data structure as the current circuit input port;
[0118] Step 2.3: traverse all ports and their connections of all vertices in the first data structure, find the connection name of the input port of the vertex that has the same name as the input port of the current circuit, and set the value of the matrix element pointed to by the current circuit input port and the vertex in the input driving matrix as the name of the input port of the vertex;
[0119] Step 2.4: Return to step 2.2 to read the next circuit input port as the current circuit input port until all circuit input ports are read.
[0120] like Fig.14As shown, in a specific embodiment, the corresponding vector name_list, i_p_list and two-dimensional dictionary structure skct_list are first instantiated, a circuit input port is read from the vector i_p_list, and the two-dimensional dictionary structure is traversed to find the connection name of the connection port of the vertex with the same name as the circuit input port. When it is found, the name of the connection port corresponding to the vertex is added to the value of the matrix element corresponding to the input drive matrix. The above process is repeated until the connection relationship corresponding to all circuit input port names is found.
[0121] The following describes a method for generating an output drive matrix, which specifically includes the following steps:
[0122] Step 3.1: Create the output drive matrix;
[0123] Step 3.2: Read a circuit output port in the second data structure as the current circuit output port;
[0124] Step 3.3: traverse all ports and their connections of all vertices in the first data structure, find the connection name of the output port of the vertex with the same name as the output port of the current circuit, and set the value of the matrix element pointed to by the output port of the current circuit and the vertex in the output driving matrix as the name of the output port of the vertex;
[0125] Step 3.4: Return to step 3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
[0126] like Fig.15 As shown, in a specific embodiment, the corresponding vector name_list, o_p_list and two-dimensional dictionary structure skct_list are first instantiated, a circuit output port is read from the vector o_p_list, and the two-dimensional dictionary structure is traversed to find the connection name of the connection port of the vertex with the same name as the circuit output port. When it is found, the name of the connection port corresponding to the vertex is added to the value of the matrix element corresponding to the output drive matrix. The above process is repeated until the connection relationship corresponding to all circuit output port names is found.
[0127] In the above driving matrix generation process, the values of all driving matrix elements are empty when they are created. When there is no connection relationship between the corresponding connection ports of two vertices, the corresponding element value is set to 0. If there is a connection relationship, the name of the corresponding connection port is added to the value of the corresponding element.
[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A driving matrix for representing gate circuit information, characterized in that: The meanings represented by the rows and columns of the driving matrix are selected from the following two types respectively, and the types selected by the rows and columns are different: gates, and connection ports of the same type corresponding to the gates; when a connection port is connected to a gate, the value of the matrix element pointed to by the gate and the connection port in the driving matrix is a collection of information of the ports connected to the gate and the connection port; The types of the connection ports include input ports and output ports; The information of the connection port is a name that uniquely identifies the port.
2. The driving matrix according to claim 1, characterized in that: The driving matrix includes an internal driving matrix for representing the internal connection relationship of the gates of the gate circuit, and the rows and columns of the internal driving matrix are selected from the following two types respectively, and the types selected by the rows and columns are different: all output ports of all gates, all gates; When an output port of a gate is connected to another gate, the values of the matrix elements pointed to by the output port of the gate and the other gate in the internal driving matrix are information of all input ports of the other connected gate.
3. The driving matrix according to claim 1, characterized in that: The driving matrix includes an input driving matrix for indicating the connection relationship between the circuit input ports and the gates of the gate circuit, wherein the rows and columns of the input driving matrix are respectively one of the following two and the types selected by the rows and columns are different: all circuit input ports and gates connected to the circuit input ports; When a circuit input port is connected to a gate, the value of the matrix element pointed to by the circuit input port and the gate in the input driving matrix is the information of all the input ports of the connected gate.
4. The driving matrix according to claim 1, characterized in that: The driving matrix includes an output driving matrix for indicating the connection relationship between the circuit output ports and the gates of the gate circuit, wherein the rows and columns of the output driving matrix are respectively one of the following two and the rows and columns are selected in different types: all circuit output ports and gates connected to the circuit output ports; When a circuit output port is connected to a gate, the value of the matrix element pointed to by the gate and the circuit output port in the output driving matrix is the information of all the output ports of the connected gate.
5. A method for generating a driving matrix according to any one of claims 1 to 4, characterized in that: include: Read the data of the gate-level netlist; Based on the data of the gate-level netlist, a first data structure is created to store the connection ports and the connections of the gates, and the connection ports and the connections are classified into rows or columns in the first data structure according to the gates to which they belong; creating a second data structure to store the gate, the circuit input port, and the circuit output port, respectively; The elements of the first data structure are traversed based on the elements of the second data structure, and the values of the elements corresponding to the driving matrix are found therefrom to generate the driving matrix.
6. The method for generating a driving matrix according to claim 5, characterized in that: When the driving matrix is an internal driving matrix, the generating method includes: Step 1.1: Create the internal drive matrix; Step 1.2: Read all ports and their connections of a gate in the first data structure, and search for an output port and its connection of the gate as the output port and its connection of the current gate; Step 1.3: Traverse all ports and their connections of other gates other than the current gate in the first data structure, find the input ports and their connections of other gates that have the same connection as the output port and its connection of the current gate, and add the information of the input ports of the other gates to the values of the matrix elements pointed to by the output port of the current gate and the other gates in the internal driving matrix; Step 1.4: Continue to search for the output port of the current gate and its connection until the output port of the current gate is matched. If the output port of the current gate and its connection are found, return to step 1.3; if the output port of the current gate is matched, return to step 1.2 until the output ports of all gates are matched.
7. The method for generating a driving matrix according to claim 5, characterized in that: When the driving matrix is an input driving matrix, the generating method includes: Step 2.1: Create the input drive matrix; Step 2.2: Read a circuit input port in the second data structure as the current circuit input port; Step 2.3: Traverse all ports and their connections of all gates in the first data structure, find the connection information of the input port of the gate that is the same as the input port information of the current circuit, and set the value of the matrix element pointed to by the current circuit input port and the gate in the input driving matrix as the input port information of the gate; Step 2.4: Return to step 2.2 to read the next circuit input port as the current circuit input port until all circuit input ports are read.
8. The method for generating a driving matrix according to claim 5, wherein: When the driving matrix is an output driving matrix, the generating method includes: Step 3.1: Create the output drive matrix; Step 3.2: Read a circuit output port in the second data structure as the current circuit output port; Step 3.3: traverse all ports and their connections of all gates in the first data structure, find the connection information of the output port of the gate that is the same as the output port information of the current circuit, and set the value of the matrix element pointed to by the output port of the current circuit and the gate in the output driving matrix as the output port information of the gate; Step 3.4: Return to step 3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
9. The method for generating a driving matrix according to any one of claims 5 to 8, characterized in that: The first data structure is a two-dimensional dictionary structure, and the second data structure is a vector.
10. A method for representing gate circuit information, characterized in that: The driving matrix as described in any one of claims 1 to 4 is used to represent the information of the gate circuit, and the information of the gate circuit includes: at least one of the internal connection relationship of the gate, the connection relationship between the boundary gate in the gate and the circuit input port, and the connection relationship between the boundary gate in the gate and the circuit output port.
11. The method for representing gate circuit information according to claim 10, characterized in that: Also included is information about using vectors to represent the gate circuits.
12. The method for representing gate circuit information according to claim 11, characterized in that: The vector includes at least one of: a vector containing all gates, a vector containing all output ports of all gates, a vector containing all circuit input ports, a vector containing all circuit output ports, and a vector containing device types of gates corresponding to all gates.
13. The method for representing gate circuit information according to claim 12, characterized in that: Elements with the same sequence number in the vector containing all gates and the vector containing device types of gates corresponding to all gates correspond to the same gate.
14. A directed driving graph generated by using the driving matrix according to any one of claims 1 to 4, characterized in that: include: Vertices, each vertex represents a door; Input boundary vertices, each of which represents a circuit input port; Output boundary vertices, each of which represents a circuit output port; Nodes,belong to the corresponding vertices, and each node represents an output port of a gate; A line connects an input boundary vertex to a vertex, and connects a vertex to an output boundary vertex. When the end of the line is connected to the vertex, the end of the line is provided with information for marking the input port of the vertex.
