Gate-level netlist processing method and computer storage medium
The driving matrix represents the connection relationship of the gate circuit and reconstructs the new netlist file, solving the problem of information loss in the prior art, realizing the complete expression and efficient simulation processing of gate circuit information.
Patent Information
- Application Number
- CN202110377762.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-08
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-04-08
AI Technical Summary
In the prior art, gate-level netlist files lose the type of gate circuit, input and output port information and connection relationships during segmentation and grouping, resulting in low simulation efficiency and incomplete information.
Use the driver matrix to represent the connection relationship of the gate circuit, and reconstruct the new netlist file through the internal, input and output driver matrix, retain the type and port information of the gate circuit, and use separate matrices and vectors to express the port information during the segmentation process to ensure the information Integrity.
It realizes the complete expression and unambiguous representation of gate circuit information, improves simulation efficiency, and obtains detailed new netlist files through simple matrix operations, supporting efficient simulation processing.
Smart Images

Figure CN113515909B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gate circuit simulation, and in particular to a method for processing a gate-level netlist before simulating a gate-level netlist file. Background Art
[0002] Before simulating a gate-level digital integrated circuit (hereinafter referred to as a gate circuit), the gate-level netlist file of the gate circuit needs to be processed. For example, when simulating a very large gate circuit, in order to improve efficiency, the gate circuit needs to be segmented and grouped so that the gate circuit can be segmented into multiple sub-blocks, and then the multiple sub-blocks are processed in parallel to improve the simulation efficiency.
[0003] The gate-level netlist file cannot be directly used to perform operations on gate circuits (such as segmentation and grouping), so it is necessary to use appropriate mathematical forms to represent the gate-level netlist of digital integrated circuits. The gate-level netlist contains the instantiation of gate circuits and the connection relationship based on port mapping. A connection diagram of the gate circuit can be drawn based on the gate-level netlist. In the prior art, an adjacency matrix is usually used to represent the gate circuit, so that the gate circuit can be segmented or grouped, and then a new gate-level netlist is generated based on the adjacency matrix corresponding to the segmented gate circuit for simulation processing.
[0004] However, the adjacency matrix will lose some information about the gate circuit, such as the type of gate, the connection relationship between the gate input port and the driver end (also called the circuit input port), the connection relationship between the gate output port and the load input end (also called the circuit output port), etc. The type of gate directly determines the logical function and delay size 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.
[0005] In addition to focusing on the connection relationship, the analysis and processing of digital integrated circuits also need to focus on 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, the type of gate, input and output port information (such as name), connection relationship and other information are also needed. However, the current adjacency matrix and the new gate-level netlist converted by the segmented adjacency matrix either lose this information or require a very complicated process to regain this information, resulting in unsuccessful simulation progress.
[0006] Therefore, how to provide a gate-level netlist processing method is a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0007] In order to solve the technical problem in the prior art that the amount of information of gate circuits represented by an adjacency matrix is small, the present invention provides a gate-level netlist processing method and a computer storage medium.
[0008] The present invention proposes a method for processing a gate-level netlist, comprising:
[0009] Step 1, the circuit connection relationship of the gate circuit corresponding to the original netlist file is represented by a driving matrix, wherein the row vector and the column vector of the driving matrix are selected from the following two: a gate, and information of a connection port of the same type corresponding to the gate, and 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 set of information of the port connected to the gate and the connection port;
[0010] Step 2, operating the gate circuit based on the driving matrix used to characterize the gate circuit corresponding to the original netlist file, to obtain a driving matrix used to characterize the gate circuit after the operation;
[0011] Step 3: Reconstruct a new netlist file of each gate circuit after operation based on the driving matrix corresponding to each gate circuit after operation.
[0012] Furthermore, the driving matrix that can characterize the circuit connection relationship of any gate circuit includes: an internal driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all output ports of all gates, an output driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all circuit output ports, and an input driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all circuit input ports.
[0013] Furthermore, the operation includes segmenting or grouping gate circuits corresponding to the original netlist file.
[0014] Furthermore, the new netlist file of the gate circuit after reconstruction operation includes:
[0015] Step 3.1, converting the output driving matrix into a new output driving matrix used to characterize the connection relationship between the output ports of all gates of the corresponding gate circuit and the output ports of all circuits, and taking the row vector and column vector of the internal driving matrix as the reference, so that the vectors used by the new output driving matrix and the internal driving matrix to characterize the output ports of all gates are both row vectors or column vectors;
[0016] Step 3.2, based on the same row vector or the same column vector, the internal driving matrix and the new output driving matrix are spliced into a total output driving matrix for representing the connection relationship between the output ports of all gates and the output ports of all gates and circuits;
[0017] Step 3.3, obtaining connection information of the output port of each gate according to the values of the matrix elements of the total output driving matrix;
[0018] Step 3.4, create a list of gates to be connected;
[0019] Step 3.5, replace the elements of the vectors used by the internal driving matrix to represent the output ports of all gates with the connection information corresponding to the output ports to obtain a new internal driving matrix;
[0020] Step 3.6, based on the same row vector or the same column vector, the new internal driving matrix and the input driving matrix are spliced into an input-output driving matrix;
[0021] Step 3.7, generating information of each gate and its corresponding input port connection and output port connection based on the input-output driving matrix;
[0022] Step 3.8, add type information and formatting information for each door;
[0023] Step 3.9, output all gates and their corresponding information to the new netlist file.
[0024] Further, generating the new output drive matrix includes:
[0025] Step 3.1.1, determine whether the rows or columns used by the output drive matrix to represent the gate and the rows or columns used by the internal drive matrix to represent the output port of the gate are both row vectors, or whether they are both column vectors. If not, transpose the output drive matrix and proceed to the next step; if yes, proceed directly to the next step;
[0026] Step 3.1.2, judging whether a gate has multiple output ports according to the vectors used to characterize all output ports of all gates, if a gate has multiple output ports, duplicating the row or column corresponding to the gate in the output driving matrix so that the number of rows or columns corresponding to the gate is consistent with the number of its output ports;
[0027] Step 3.1.3, replacing the gates in the row vector or column vector in the copied output driving matrix with the output ports of the gates respectively;
[0028] Step 3.1.4, replacing the row elements or column elements corresponding to the output port of each gate in the replaced output driving matrix that are inconsistent with the output port information with 0 to form the new output driving matrix.
[0029] Furthermore, the step of expressing the circuit connection relationship of the gate circuit corresponding to the original netlist file by using a driving matrix comprises the following steps:
[0030] Step 1.1, read the original netlist file;
[0031] Step 1.2, creating a first data structure based on the original netlist file to store the connection ports and the connections of the gates, and classifying the connection ports and the connections into rows or columns in the first data structure according to the gates to which they belong;
[0032] Step 1.3, creating a second data structure to store the gate, the circuit input port, and the circuit output port respectively;
[0033] Step 1.4, traverse the elements of the first data structure based on the elements of the second data structure, find the elements corresponding to the driving matrix therefrom, and generate the driving matrix.
[0034] Further, generating the internal driving matrix includes:
[0035] Step 1.1.1: Create the internal drive matrix;
[0036] Step 1.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;
[0037] Step 1.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;
[0038] Step 1.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.1.3; if the output port of the current gate is matched, return to step 1.1.2 until the output ports of all gates are matched.
[0039] Further, generating the input drive matrix includes:
[0040] Step 1.2.1: Create the input drive matrix;
[0041] Step 1.2.2: Read a circuit input port in the second data structure as the current circuit input port;
[0042] Step 1.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;
[0043] Step 1.2.4: Return to step 1.2.2 to read the next circuit input port as the current circuit input port until all circuit input ports are read.
[0044] Further, generating the output drive matrix includes:
[0045] Step 1.3.1: Create the output drive matrix;
[0046] Step 1.3.2: Read a circuit output port in the second data structure as the current circuit output port;
[0047] Step 1.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;
[0048] Step 1.3.4: Return to step 1.3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
[0049] The computer storage medium proposed in the present invention is used to store a computer program, and when the computer program is running, the gate-level netlist processing method described in the above technical solution is executed.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1. The driving matrix and vector can fully describe the gate circuit, unambiguously represent the connection relationship between the internal and external gates, 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.
[0052] 2. 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.
[0053] 3. 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.
[0054] 4. Since the present invention uses a driving matrix to represent the gate circuit, the efficiency of the operation of the original netlist file can be improved, and through the driving matrix corresponding to the gate circuit after the operation, a new gate-level netlist file can be obtained very quickly and conveniently, and the information of the new gate-level netlist file is very comprehensive, providing detailed information for subsequent simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention is described in detail below with reference to the embodiments and accompanying drawings, wherein:
[0056] Figure 1(a) to Figure 1(c) is an example of a gate circuit and the corresponding directed graph and adjacency matrix.
[0057] Figure 2 yes Figure 1(a) to Figure 1(c) An embodiment of an internal driving matrix corresponding to the gate circuit.
[0058] Figure 3 yes Figure 1(a) to Figure 1(c) An embodiment of an input drive matrix corresponding to the gate circuit.
[0059] Figure 4 yes Figure 1(a) to Figure 1(c) An embodiment of an output driving matrix corresponding to the gate circuit.
[0060] Figure 5 yes Figure 1(a) to Figure 1(c) An embodiment of a gate circuit corresponding to two vectors of gates and their device types.
[0061] Figure 6 It is a flow chart of the present invention for generating a new netlist file based on a driver.
[0062] Figure 7 It is a flow chart of generating a new output driving matrix according to the present invention.
[0063] Figure 8 is a transposed output driving matrix according to an embodiment of the present invention.
[0064] Fig. 9This is the process of transposing and simplification of the output driving matrix in another embodiment of the present invention.
[0065] Fig.10 It is a new output driving matrix according to an embodiment of the present invention.
[0066] Fig.11 is a total output driving matrix according to an embodiment of the present invention.
[0067] Fig.12 This is a structure obtained by splicing an internal driving matrix and an input driving matrix according to an embodiment of the present invention.
[0068] Fig.13 It is a wiring flow chart of the input port of the gate of the present invention.
[0069] Fig.14 It is the subordinate relationship of the output port of the gate of the present invention and the corresponding connection information.
[0070] Fig.15 It is a wiring flow chart of the output port of the gate of the present invention. DETAILED DESCRIPTION
[0071] 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.
[0072] 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.
[0073] The principle of the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0074] like Figure 1(a) to Figure 1(c) As shown, the present invention provides an example of a specific gate circuit. The present invention will be explained based on the circuit of this example. Since the gate circuit of the present invention is divided into a gate circuit before operation represented by an original netlist and a gate circuit after operation, in order to facilitate understanding, the circuit of this example will be used as both a gate circuit before operation and a gate circuit after operation to explain the detailed technical ideas of the present invention.
[0075] FIG. 1( a ) shows the specific devices constituting 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).
[0076] Figure 1(b) shows the directed graph of the gate circuit shown in Figure 1(a) and the corresponding adjacency matrix. 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 ports connected 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.
[0077] FIG1(c) shows a directional drive diagram for representing the gate circuit shown in FIG1(a). In the directional drive diagram, the present invention defines as follows:
[0078] Vertex, define each vertex represents a door, that is, a vertex is a door, vertex U1-vertex U4 is also called door U1-U4;
[0079] Input boundary vertices, each of which is defined to represent a circuit input port, that is, an input boundary vertex is a circuit input port of the current gate circuit, such as the current gate circuit needs to be input from the output port of another gate circuit, etc.;
[0080] Output boundary vertices, each of which is defined to represent a circuit output port, that is, an output boundary vertex is a circuit output port of the current gate circuit, and the circuit output port can be an input port of other gate circuits or a load terminal;
[0081] Nodes belong to the corresponding vertices, and each node is defined to represent an output port of a gate, that is, a node is an output port of a gate;
[0082] 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, such as a name.
[0083] 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 with 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 (such as names) at the corresponding positions in the graph, such as drawing the names A and B of the corresponding input ports on the lines 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.
[0084] 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.
[0085] 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 point solution vertex of other circuit parts. In other words, the circuit output ports OUTA and OUTB are visualized as an output boundary vertex.
[0086] pass Figure 1(a) to Figure 1(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.
[0087] The above-mentioned directed drive graph is generated based on a part of the present invention. The following is a detailed description of the gate-level netlist processing method of the present invention.
[0088] The gate-level netlist processing method of the present invention is mainly applied to the processing method of the gate circuit represented by the gate-level netlist before simulation, and specifically includes the following steps:
[0089] Step 1, the circuit connection relationship of the gate circuit corresponding to the original netlist file is represented by a driving matrix, wherein the row vector and column vector of the driving matrix are selected from the following two: gate, information of the same type of connection port corresponding to the gate, such as name, 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 set of information of the port connected to the gate and the connection port. Since the meaning represented by the matrix is not affected even if the rows and columns of the matrix are interchanged, the present invention does not affect the meaning expressed by the matrix elements of the driving matrix whether the gate is used as the row vector of the driving matrix, the connection port of the same type corresponding to the gate is used as the column vector of the driving matrix, or the gate is used as the column vector of the driving matrix, and the connection port of the same type corresponding to the gate is used as the row vector of the driving matrix, and all of them are included in the protection scope of the present invention.
[0090] Step 2, based on the three driving matrices used to characterize the gate circuit corresponding to the original netlist file, the gate circuit is operated, such as segmenting or grouping the gate circuit, etc., to obtain a driving matrix used to characterize the gate circuit after the operation. The specific operation process is not the focus of the present invention. When operation is required, the elements of the driving matrix that are not 0 are set to 1 to perform the operation. The existing algorithms in the prior art can be used to segment or group the gate circuit.
[0091] Step 3, based on the driving matrix corresponding to each gate circuit after operation, a new netlist file of each gate circuit after operation is rebuilt. Each gate circuit after operation can also be represented by the above three driving matrices. Figure 1(a) to Figure 1(c) When the gate circuit in the example is a gate circuit after segmentation, the driving matrix obtained after the operation is as follows: Figures 2 to 4 shown.
[0092] In a specific embodiment, the driving matrix includes three types of driving matrices, namely, an internal driving matrix, an input driving matrix and an external driving matrix.
[0093] like Figure 2 As shown, the internal driving matrix represents the connection relationship between all gates of the corresponding gate circuit and all output ports of all gates. The rows and columns of the internal driving matrix are selected from the following two: all output ports of all gates, all gates. In one embodiment, each row of the internal driving matrix represents one output port of one gate, and each column represents one gate. When an output port of a gate is connected to one or more input ports of another gate, the value of the matrix element pointed to by the output port of the gate and the other gate in the internal driving matrix is the name of the input port of another vertex. For example Figure 2In the internal driver matrix inst_drv_matrix shown, 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, and the elements in it are the output ports of each gate in the netlist. The length of this column vector is the sum of the number of output ports of all gates in the netlist, and the value of the element of the column vector is "the name of each gate instantiated in the netlist_the output port name of this gate". The output port Z of gate U1 is connected to the input port A of gate U2, so the value of the matrix element where the row representing U1_Z intersects with the column representing U2 is the input port name A of gate U2. The output port Z of gate U2 is connected to both the input port A and the input port B of gate U3, so the value of the matrix element where the row representing U2_Z intersects with the column representing U3 is the two input port names AB of gate U3.
[0094] like Figure 3 As shown, the input drive matrix is used to represent the connection relationship between all gates of the corresponding gate circuit and all circuit input ports. The rows and columns of the input drive matrix are one of the following two: all circuit input ports, all gates that have a connection relationship with the circuit input port. 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 drive matrix is the information of the input port of the gate. Figure 2 In a specific embodiment, a column vector input_drv is defined, wherein the elements are each circuit input port, 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 circuit input port 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 name of the input port of each gate connected to this input boundary vertex. If this circuit input port is not connected to a certain gate, the value of the matrix element at the intersection with this gate is 0. In particular, if this input boundary vertex is connected to two or more ports of a certain gate, the value of the matrix element at the intersection with this gate 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 gate 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 gate U4 in the input drive matrix input_drv_matrix is the input port name B of vertex U4.
[0095] like Figure 4As shown, the output drive matrix is used to characterize the connection relationship between all gates of the corresponding gate circuit and all circuit output ports, and the rows and columns of the output drive matrix are respectively one of the following two: all circuit output ports, all gates connected to the circuit output port. 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 drive matrix is the information of the output port of the gate. In one embodiment, a column vector drv_output is defined, and the elements therein are each circuit output port, that is, each output boundary vertex. A row of the output drive 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 port, 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 value of the matrix element corresponding to this gate position is 0. For example, if the circuit output port OUTA is connected to the output port Z of the gate U3, then the value of the matrix element pointed to by the output drive matrix OUTA and the gate U3 is Z.
[0096] The present invention also provides specific method steps for generating the above three driving matrices.
[0097] Step 1.1, read the original netlist file;
[0098] Step 1.2, creating a first data structure based on the original netlist file to store the connection ports and their connections of each gate, and classifying the connection ports and their connections into rows or columns in the first data structure according to the gates to which they belong;
[0099] Step 1.3, creating a second data structure to store the gate, the circuit input port, and the circuit output port respectively;
[0100] Step 1.4, traverse the elements of the first data structure based on the elements of the second data structure, find the elements corresponding to the driving matrix therefrom, and generate the driving matrix.
[0101] Taking Python's data structure as an example, before generating any driving matrix, it is necessary to do the corresponding preparation work, that is, read the data of the original gate-level netlist. Specifically, read the original gate-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, gates 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, and 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 gate 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-line 2, which is the line between the input port A of vertex U1 and the circuit input port. Since line 2 is the line between the input boundary vertex and the boundary vertex, the specific name of line 2 in this embodiment is INA[0]. The key-value pairs related to vertex U1 also include B-line 3 and O-line 4, where B-line 3 is actually B_INB, which is the line between the input port of vertex U1 and the circuit input port INB. O-line 4 is the line 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.
[0102] Next, the detailed steps for generating each drive matrix are introduced.
[0103] The specific process of generating the internal drive matrix is as follows:
[0104] Step 1.1.1: Create the internal drive matrix;
[0105] Step 1.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;
[0106] Step 1.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;
[0107] Step 1.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.1.3; if the output port of the current gate is matched, return to step 1.1.2 until the output ports of all gates are matched.
[0108] The process of generating the input drive matrix is as follows:
[0109] Step 1.2.1: Create the input drive matrix;
[0110] Step 1.2.2: Read a circuit input port in the second data structure as the current circuit input port;
[0111] Step 1.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 with 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 gate in the input driving matrix as the input port information of the gate;
[0112] Step 1.2.4: Return to step 1.2.2 to read the next circuit input port as the current circuit input port until all circuit input ports are read.
[0113] The process of generating the output drive matrix is as follows:
[0114] Step 1.3.1: Create the output drive matrix;
[0115] Step 1.3.2: Read a circuit output port in the second data structure as the current circuit output port;
[0116] Step 1.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 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 gate in the output driving matrix as the information of the output port of the gate;
[0117] Step 1.3.4: Return to step 1.3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
[0118] Then Figure 1(a) to Figure 1(c) The gate circuit in the example is used as the gate circuit obtained by operation to introduce the process of rebuilding the new netlist file of the gate circuit after operation. For the specific flow chart, please refer to Figure 6 .
[0119] Step 3.1, converting the output driving matrix into a new output driving matrix used to characterize the connection relationship between the output ports of all gates of the corresponding gate circuit and the output ports of all circuits, and taking the row vectors and column vectors of the internal driving matrix as the reference, the new output driving matrix and the internal driving matrix are used to characterize the vectors of the output ports of all gates, which are both row vectors or column vectors.
[0120] like Figure 7 As shown, generating a new output drive matrix specifically includes the following steps:
[0121] Step 3.1.1, determine whether the rows or columns used by the output drive matrix to represent the gate and the rows or columns used by the internal drive matrix to represent the output port of the gate are both row vectors, or whether they are both column vectors. If not, transpose the output drive matrix and proceed to the next step; if yes, proceed directly to the next step. Figure 2 , Figure 3 Taking the internal drive matrix and output drive matrix shown in as an example, the row vector of the current output drive matrix drv_output_matrix is the circuit output port, and the row vector is all gates. In order to further transform all gates into the relationship between the output ports of all gates and the output ports of the circuit, it is necessary to transpose the output drive matrix to form Figure 8 The transposed output driver matrix shown
[0122] drv_output_transpose_matrix. If the output driver matrix itself is Figure 8 If the structure shown is correct, there is no need to transpose and you can proceed directly to the next step.
[0123] Step 3.1.2, determine whether a gate has multiple output ports based on the vector used to represent all output ports of all gates. If a gate has multiple output ports, copy the row or column corresponding to the gate in the output drive matrix so that the number of rows or columns corresponding to the gate is consistent with the number of its output ports.
[0124] In this step, further, the rows of the transposed output driver matrix drv_output_transpose_matrix are indexed by the gate output port vector inst_drv instead of the gate vector inst_name. If there are multiple output ports in the gate output port vector inst_drv belonging to the same gate (i.e., the fields before the last "_" are the same in this embodiment), the rows corresponding to the gate in the transposed output driver matrix drv_output_transpose_matrix are copied into N rows to correspond to the N output ports of the gate.
[0125] If the copied row has two or more non-zero elements, it means that the gate corresponding to this row has two or more output ports connected to the circuit output port. After changing to index by the gate output port vector inst_drv, the content of the transposed output driver matrix drv_output_transpose_matrix needs to be simplified. In the copied row, only the elements that are consistent with the output port name of the current row where the gate output port vector inst_drv is located (the field after the last "_") are retained, and the other elements are changed to 0. For example, if the outputs Z1 and Z2 of a circuit u1 are connected to the output ports of the module, then Fig. 9 The replication and singling process of the transposed output drive matrix drv_output_transpose_matrix in is shown in the figure.
[0126] In step 3.1.3, the gates in the row vector or column vector in the copied output driving matrix are replaced by the output ports of the gates.
[0127] Step 3.1.4, replace the row elements or column elements corresponding to the output port of each gate in the replaced output driving matrix that are inconsistent with the output port name with 0 to form the new output driving matrix. Fig. 9 The method shown will Figure 8 The rows of the transposed output driver matrix drv_output_transpose_matrix are indexed by the gate vector inst_name instead of the gate output port vector inst_drv. After the corresponding rows are copied and simplified according to the gate output port vector inst_drv, the final new output driver matrix inst_drv_output_matrix is obtained, as shown in Fig.10 shown.
[0128] Step 3.2: Based on the same row vector or the same column vector, the internal driving matrix and the new output driving matrix are concatenated into a total output driving matrix for characterizing the connection relationship between the output ports of all gates and the output ports of all gates and circuits.
[0129] According to the rules of Verilog HDL structured description, the connection information from the output port of a gate to the input port of other gates can be named arbitrarily without restrictions; while the connection information from the output port of a gate to the output port of a module must be the name of the module output port to represent its connection relationship. After the output driver matrix drv_out_matrix is transposed, copied, and simplified, the number of rows of the generated new output driver matrix inst_drv_output_matrix is consistent with the number of rows of the internal driver matrix inst_drv_matrix. The internal driver matrix inst_drv_matrix and the new output driver matrix inst_drv_output_matrix are spliced into a large matrix in the form of one row and two columns, and the total output driver matrix inst_drv_concat can be obtained, as shown Fig.11 shown.
[0130] Step 3.3, obtaining the connection information of the output port of each gate according to the values of the matrix elements of the total output driving matrix.
[0131] A row of the total output driver matrix inst_drv_concat after concatenation indicates all the connection relationships between an output port of a gate and the input and output ports of other gates. When the new output driver matrix inst_drv_output_matrix in this row is all zero (all elements are zero), it means that the output port of the gate is not connected to the output port of the circuit. At this time, the connection information connecting the output port of the gate can be named arbitrarily. Suppose it can be named "net_" + inst_drv current row element, for example, for Fig.11 The output port vector inst_drv of the middle gate is u1_Z, and the connection information can be "net_u1_Z".
[0132] When there is a non-zero element in the new output driver matrix inst_drv_output_matrix in this row (due to the simplification operation, there is only one non-zero element here), the connection must be named according to the element in the circuit output port vector drv_output corresponding to the column where this element is located, that is, the output port name of the module connected to this output port of this gate is used as the connection information. Fig.11 For the output port u3_Z of the gate, the connection information must be "outa"; for the output port u4_Z of the gate, the connection information must be "outb".
[0133] Each row generates a wire information, and all rows generate a wire information vector inst_drv_wire. Determine the wire information of the output port of the gate.
[0134] Step 3.4, create a list of gates to be connected. In this embodiment, according to the length of the gate vector inst_name, a list of gates to be connected is created, namely, gates U1 to U4.
[0135] Step 3.5, replace the elements of the vector used by the internal driving matrix to represent the output ports of all gates with the connection names corresponding to the output ports to obtain a new internal driving matrix; according to the method for generating the connection information vector inst_drv_wire, the generated connection information vector inst_drv_wire can be used to replace the circuit output port vector inst_drv to index the rows of the internal driving matrix inst_drv_matrix. The gate vector inst_name, the circuit input port vector input_drv, and the input driving matrix input_drv_matrix represent the connection relationship between the input port of the gate circuit module and the internal circuit. Figure 3 shown.
[0136] Step 3.6, based on the same row vector or the same column vector, the new internal driving matrix and the input driving matrix are spliced into an input-output driving matrix;
[0137] In this embodiment, the row-column correspondence between the internal drive matrix inst_drv_matrix and the input drive matrix input_drv_matrix is consistent, that is, each column in the matrix represents the connection relationship between the same gate, and each row in the matrix represents the connection relationship between the same driver and all gates. After replacing the gate vector inst_drv with the wire information vector inst_drv_wire, each row of the two matrices represents the connection relationship between the wire with the same name (the information of the circuit input port is also used as the wire name) and all gates. The two matrices can be spliced together in a two-row and one-column manner to form a large matrix, such as Fig.12 shown.
[0138] Step 3.7, based on the input-output driver matrix, generate information about each gate and its corresponding input port connection and output port connection.
[0139] Each row of the concatenated matrix indicates Fig.12To which input end of each gate is the named line on the left connected? Read in each row of the spliced large matrix in turn, and add input ports and lines to each gate in the list of gates to be connected in the order of columns. If the element of a column is "0", it means that the current gate has no connection and no need to add; if the element of a column is non-zero, add ".Port information (connection information)", "port information" is the non-zero element value of this column (that is, the value of the element), and "connection information" is the element value of the current row in the connection information vector inst_drv_wire or the circuit input port vector input_drv. If the value of an element in a column contains two or more port information, such as multiple port names, split the port names into individual port names and add them to the gate respectively. The final connection result obtained in this embodiment is shown in Table 1. The above process of connecting the input port of the gate is as shown in Table 1. Fig.13 shown.
[0140]
[0141] Table 1 Fig.12 The connection result of the matrix
[0142] The field before the last “_” of each element in the gate output port vector inst_drv indicates the information of the gate to which it belongs. In this embodiment, it is the name of the gate. The field after “_” indicates the name of the current output port of this gate. The element at the corresponding position in the wire information vector inst_drv_wire indicates the information of the wire connected to this output port, such as Fig.14 shown.
[0143] Add the output ports and connections belonging to the same gate to the same gate in the list of gates to be connected in sequence in the form of ".port information (connection name)". Fig.14 The wiring results of the vectors are shown in Table 2. The process of wiring the output port of the gate is as follows Fig.15 shown.
[0144] Door Original input port connection that has been added Newly added output port connection U1 .B(ina[1]),.A(ina[0]) .Z(net_u1_Z),.O(net_u1_O) U2 .A(net_u1_Z),.B(net_u1_O) .Z(net_u2_Z) U3 .A(net_u2_Z),.B(net_u2_Z) .Z(outa) U4 .A(net_u1_O),.B(inb) .Z(outb)
[0145] Table 2 Fig.14 The result of connecting the vectors shown
[0146] Step 3.8, add type information and format information for each door. Figure 5The vector arrangement rules shown in the figure read the gate vector inst_name and the type vector inst_ref, and insert the gate name and gate type in front of each gate connection in the list of gates to be connected. Read the circuit input port vector input_drv, the circuit output port vector drv_output, and the connection information vector inst_drv_wire, and add the circuit input and output port names, type declarations, and internal connection declarations required by the gate circuit module. Add keywords such as module and endmodule.
[0147] Step 3.9, finally output all gates and their corresponding information to the new netlist file.
[0148] The present invention also protects a computer storage medium for storing a computer program, which executes the netlist processing method in the above technical solution when running.
[0149] 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.
[0150] 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 method for processing a gate-level netlist, characterized in that: include: Step 1, the circuit connection relationship of the gate circuit corresponding to the original netlist file is represented by a driving matrix, wherein the row vector and the column vector of the driving matrix are selected from the following two types respectively, and the row vector and the column vector are selected from different types: a gate, and information of 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 set of information of the port connected to the gate and the connection port; Step 2, operating the gate circuit based on the driving matrix used to characterize the gate circuit corresponding to the original netlist file, to obtain a driving matrix used to characterize the gate circuit after the operation; Step 3, based on the driving matrix corresponding to each gate circuit after calculation, rebuild a new netlist file for each gate circuit after calculation; The driving matrix that can characterize the circuit connection relationship of any gate circuit includes: an internal driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all output ports of all gates, an output driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all circuit output ports, and an input driving matrix that characterizes the connection relationship between all gates of the corresponding gate circuit and all circuit input ports.
2. The method for processing a gate-level netlist according to claim 1, characterized in that: The operation includes segmenting or grouping gate circuits corresponding to the original netlist file.
3. The method for processing a gate-level netlist according to claim 1, characterized in that: The new netlist file of the gate circuit after reconstruction operation includes: Step 3.1, converting the output driving matrix into a new output driving matrix used to characterize the connection relationship between the output ports of all gates of the corresponding gate circuit and the output ports of all circuits, and taking the row vector and column vector of the internal driving matrix as the reference, so that the vectors used by the new output driving matrix and the internal driving matrix to characterize the output ports of all gates are both row vectors or column vectors; Step 3.2, based on the same row vector or the same column vector, the internal driving matrix and the new output driving matrix are spliced into a total output driving matrix for representing the connection relationship between the output ports of all gates and the output ports of all gates and circuits; Step 3.3, obtaining connection information of the output port of each gate according to the values of the matrix elements of the total output driving matrix; Step 3.4, create a list of gates to be connected; Step 3.5, replace the elements of the vectors used by the internal driving matrix to represent the output ports of all gates with the connection information corresponding to the output ports to obtain a new internal driving matrix; Step 3.6, based on the same row vector or the same column vector, the new internal driving matrix and the input driving matrix are spliced into an input-output driving matrix; Step 3.7, generating information of each gate and its corresponding input port connection and output port connection based on the input-output driving matrix; Step 3.8, add type information and formatting information for each door; Step 3.9, output all gates and their corresponding information to the new netlist file.
4. The method for processing a gate-level netlist according to claim 3, characterized in that: Generating the new output drive matrix comprises: Step 3.1.1, determine whether the rows or columns used by the output drive matrix to represent the gate and the rows or columns used by the internal drive matrix to represent the output port of the gate are both row vectors, or whether they are both column vectors. If not, transpose the output drive matrix and proceed to the next step; if yes, proceed directly to the next step; Step 3.1.2, judging whether a gate has multiple output ports according to the vectors used to characterize all output ports of all gates, if a gate has multiple output ports, duplicating the row or column corresponding to the gate in the output driving matrix so that the number of rows or columns corresponding to the gate is consistent with the number of its output ports; Step 3.1.3, replacing the gates in the row vector or column vector in the copied output driving matrix with the output ports of the gates respectively; Step 3.1.4, replacing the row elements or column elements corresponding to the output port of each gate in the replaced output driving matrix that are inconsistent with the output port information with 0 to form the new output driving matrix.
5. The method for processing a gate-level netlist according to any one of claims 1 to 4, characterized in that: The step of expressing the circuit connection relationship of the gate circuit corresponding to the original netlist file by using a driving matrix comprises the following steps: Step 1.1, read the original netlist file; Step 1.2, creating a first data structure based on the original netlist file to store the connection ports and the connections of the gates, and classifying the connection ports and the connections into rows or columns in the first data structure according to the gates to which they belong; Step 1.3, creating a second data structure to store the gate, the circuit input port, and the circuit output port respectively; Step 1.4, traverse the elements of the first data structure based on the elements of the second data structure, find the elements corresponding to the driving matrix therefrom, and generate the driving matrix.
6. The method for processing a gate-level netlist according to claim 5, characterized in that: Generating the internal driving matrix includes: Step 1.1.1: Create the internal drive matrix; Step 1.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.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.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.1.3; if the output port of the current gate is matched, return to step 1.1.2 until the output ports of all gates are matched.
7. The method for processing a gate-level netlist according to claim 5, characterized in that: Generating the input drive matrix comprises: Step 1.2.1: Create the input drive matrix; Step 1.2.2: Read a circuit input port in the second data structure as the current circuit input port; Step 1.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 1.2.4: Return to step 1.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 processing a gate-level netlist according to claim 5, characterized in that: Generating the output drive matrix comprises: Step 1.3.1: Create the output drive matrix; Step 1.3.2: Read a circuit output port in the second data structure as the current circuit output port; Step 1.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 1.3.4: Return to step 1.3.2 to read the next circuit output port as the current circuit output port until all circuit output ports are read.
9. A computer storage medium for storing a computer program, characterized in that: The computer program executes the gate-level netlist processing method according to any one of claims 1 to 8 when running.
