Method for querying connection relationship based on netlist hierarchy, electronic device and medium
By using a top-down query method based on a netlist hierarchy, a set of candidate port groups is generated and connectivity paths are determined. This solves the problem of low query efficiency caused by the increase in the number of netlist nodes in chip design and achieves efficient verification of connectivity relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 成都融见软件科技有限公司
- Filing Date
- 2024-07-05
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, as chip design complexity increases, the number of nodes in the netlist grows explosively, making it inefficient to query the logical connection relationships between nodes and unable to efficiently verify the accuracy of the design and synthesis.
A connection relationship query method based on a netlist hierarchy is adopted. By obtaining the instance object of the target port in the design under test, the candidate connection path is determined, a set of candidate port groups is generated, and the connection path is traversed and judged. The connection relationship is queried from top to bottom, and the query process is optimized by using preset storage space.
This significantly reduces the number of node traversals, improves the query speed and efficiency of connection relationships in the netlist, and enables efficient verification of connection relationships.
Smart Images

Figure CN118862767B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip technology, and in particular to a method, electronic device, and medium for querying connection relationships based on a netlist hierarchy. Background Technology
[0002] After the Register Transfer Level (RTL) code in chip design is synthesized to obtain the netlist data, it is usually necessary to verify the accuracy of the design and synthesis by tracing the logical connections between points in the netlist. However, with the advancement of chip manufacturing processes, the complexity of chip design has increased exponentially, and the number of nodes in the netlist has exploded. Therefore, the performance requirements for EDA (Electronic Design Automation) queries of logical connections between points have become particularly important. Current technologies require traversing all nodes that may be connected to the target node to determine the connections between them, requiring the querying of a large amount of data and resulting in low query efficiency. Therefore, improving the query efficiency of connection relationships in the netlist has become an urgent technical problem to be solved. Summary of the Invention
[0003] The purpose of this invention is to provide a method, electronic device, and medium for querying connection relationships based on a netlist hierarchical structure, thereby improving the query efficiency of connection relationships in a netlist.
[0004] According to a first aspect of the present invention, a method for querying connection relationships based on a network list hierarchy is provided, comprising:
[0005] Step S1: Obtain the instance object A1 of the first target port in the DUT and the instance object A2 of the second target port in the DUT.
[0006] Step S2: Determine whether there are candidate connection paths for A1 and A2 in the DUT. If they exist, proceed to step S3; otherwise, proceed to step S7.
[0007] Step S3: The xth candidate path L based on A1 and A2 x Generate the corresponding candidate port group set {(P1) x Q1 x ),(P2 x Q2 x ),...,(P i x Q i x ),...,(P g(x) x Q g(x) x )};
[0008] Among them, (P) i x Q i x ) for L x The corresponding i-th candidate port group, where i ranges from 1 to g(x), and g(x) is L x The total number of corresponding candidate port groups, P i x Q is the first port in the i-th candidate port group. i x For the second port in the i-th candidate port group, P i x Q i x All in L x Above, and P i x Q i x They all belong to the same instance object M in the Design Under Test (DUT). i x ;
[0009] (P1 x Q1 x The corresponding M i x If the first destination port is not A1, then P1 x Q1 is the port of the submodule A1 where the first target port is located. x Port A1 is used; otherwise, port P1 is used. x =Q1 x =First target port;
[0010] (P g(x) x Q g(x) x The corresponding M i x If the second target port is not A2, then Q g(x) x P is the port of the submodule A2 where the second target port is located. g(x) x Port A2 is used; otherwise, P is used. g(x) x =Q g(x) x =Second target port;
[0011] When i = 2, 3, ..., g(x)-1, P i Q i All are M i x The port;
[0012] Step S4, Traverse L x The corresponding candidate port group set, determine (P) i x Q i x In M i x Does there exist a connected path in L? x Each corresponding group (P) i x Q i x In M i x If there is a connected path in both, proceed to step S5; otherwise, proceed to step S7.
[0013] Step S5: Determine the first target port and P1 x Whether it is connected, the second target port and Q g(x) x Whether the connection is established depends on whether the first target port and P1 are connected. x Connected and the second target port and Q g(x) x If the connection is established, proceed to step S6; otherwise, proceed to step S7.
[0014] Step S6: Connect the first target port to P1 x L x Second target port to Q g(x) x The concatenated path is determined to be the connection path between the first target port and the second target port, and the process ends;
[0015] Step S7: Determine that there is no connected path between the first target port and the second target port.
[0016] According to a second aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in the first aspect of the present invention.
[0017] According to a third aspect of the present invention, a computer-readable storage medium is provided, storing computer-executable instructions for performing the method described in the first aspect of the present invention.
[0018] Compared with existing technologies, this invention has significant advantages and beneficial effects. Through the above technical solution, the connection relationship query method, electronic device, and medium provided by this invention based on a netlist hierarchical structure achieve considerable technological advancement and practicality, and have broad industrial application value. It has at least the following beneficial effects:
[0019] This invention enables querying the connection relationship between two nodes based on the hierarchical structure of a netlist, significantly reducing the number of nodes that need to be traversed, improving the query speed of the connection relationship between two nodes, and thus improving the query efficiency of the connection relationship in the netlist. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart illustrating the connection relationship query method based on a netlist hierarchical structure provided in this embodiment of the invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] This invention provides a method for querying connection relationships based on a network list hierarchy, such as... Figure 1 As shown, it includes:
[0024] Step S1: Obtain the instance object A1 of the first target port in the DUT and the instance object A2 of the second target port in the DUT.
[0025] The netlist refers to the netlist obtained by synthesizing the RTL code of the chip design. It should be noted that A1 and A2 are sub-modules of the DUT. The first target port may be a port on A1 or a port of a component module within A1; the second target port may be a port on A2 or a port of a component module within A2. In practical applications, the node whose connection relationship needs to be queried can be a port or a component module. When the node to be queried is a component module, the port of the component module can be used as the target port for the query.
[0026] Step S2: Determine whether there are candidate connection paths for A1 and A2 in the DUT. If they exist, proceed to step S3; otherwise, proceed to step S7.
[0027] It should be noted that the candidate connection paths of A1 and A2 refer to the paths that may connect A1 and A2. In the DUT, it is only necessary to spend a small amount of computation to determine whether there are candidate connection paths of A1 and A2 in the DUT, and to quickly obtain the candidate connection paths of A1 and A2. Moreover, if there are no candidate connection paths of A1 and A2 in the DUT, it can be directly determined that there is no connected path between the first target port and the second target port, without the need for subsequent operations. Compared with the existing technology, this greatly reduces the number of nodes that need to be traversed.
[0028] Step S3: The xth candidate path L based on A1 and A2 x Generate the corresponding candidate port group set {(P1) x Q1 x ),(P2 x Q2 x ),...,(P i x Q i x ),...,(P g(x) x Q g(x) x )}.
[0029] Among them, (P) i x Q i x ) for L x The corresponding i-th candidate port group, where i ranges from 1 to g(x), and g(x) is L x The total number of corresponding candidate port groups, P i x Q is the first port in the i-th candidate port group. i x For the second port in the i-th candidate port group, P i x Q i x All in L x Above, and P i x Q i x They all belong to the same instance object M in the Design Under Test (DUT). i x .
[0030] (P1 x Q1x The corresponding M i x If the first destination port is not A1, then P1 x Q1 is the port of the submodule A1 where the first target port is located. x Port A1 is used; otherwise, port P1 is used. x =Q1 x = First destination port, that is, when the first destination port is the port of A1, P1 x =Q1 x = First target port, as a variation of the embodiment, in this case (P1) may not be included. x Q1 x Add the candidate port group to the set. Correspondingly, in step S5, the first target port and P1 can also be directly determined. x Connected.
[0031] (P g(x) x Q g(x) x The corresponding M i x If the second target port is not A2, then Q g(x) x P is the port of the submodule A2 where the second target port is located. g(x) x Port A2 is used; otherwise, P is used. g(x) x =Q g(x) x = Second destination port, that is, when the second destination port is the port of A2, P g(x) x =Q g(x) x = Second target port, as a variation of the embodiment, in this case (P) may not be required. g(x) x Q g(x) x Add it to the candidate port group set. Correspondingly, in step S5, the second target port and Q can also be directly determined. g(x) x Connected.
[0032] When i = 2, 3, ..., g(x)-1, P i Q i All are M i x The port.
[0033] It should be noted that candidate paths are not necessarily connected paths. Therefore, it is necessary to further determine whether candidate paths are connected. To determine whether candidate paths are connected, it is necessary to first determine whether each port group of the candidate path aggregation is connected.
[0034] Step S4, Traverse L x The corresponding candidate port group set, determine (P) i x Q i x In M i x Does there exist a connected path in L? x Each corresponding group (P) i x Q i x In M i x If there is a connected path in both, proceed to step S5; otherwise, proceed to step S7.
[0035] It should be noted that when judging (P) i x Q i x In M i x When determining whether a connected path exists, it is necessary to base it on M. i x The connection relationship between submodules is used to determine this. If based on M... i x The connection relationships between submodules cannot be directly concluded, so further analysis based on M is required. i x The connection relationship between the submodules of the submodule is used to determine the connection relationship until a conclusion can be reached. That is, the embodiment of the present invention adopts a top-down approach and queries the connection relationship based on the netlist hierarchy.
[0036] Furthermore, {(P1) can be executed in parallel. x Q1 x ),(P2 x Q2 x ),...,(P i x Q i x ),...,(P g(x) x Q g(x) x In )}, determine each (P) i x Q i x In M i xTo further improve query efficiency, we need to determine whether there is a connected path.
[0037] Step S5: Determine the first target port and P1 x Whether it is connected, the second target port and Q g(x) x Whether the connection is established depends on whether the first target port and P1 are connected. x Connected and the second target port and Q g(x) x If the connection is established, proceed to step S6; otherwise, proceed to step S7.
[0038] It should be noted that if the first target port is inside A1 and the second target port is inside A2, then a further judgment needs to be made within A1 and A2 to determine the first target port and P1. x Whether it is connected, the second target port and Q g(x) x Whether it is connected or not, therefore, step S5 needs to be set in determining L. x Execute the query after the connection is established to improve the query efficiency of network table join relationships.
[0039] Step S6: Connect the first target port to P1 x L x Second target port to Q g(x) x The concatenated path is determined as the connection path between the first target port and the second target port, and the process ends.
[0040] Step S7: Determine that there is no connected path between the first target port and the second target port.
[0041] As one embodiment, in step S4, it is determined that (P) i x Q i x In M i x Does a connected path exist in the network, including:
[0042] Step S41: Determine M in the current netlist i x Is it in the unfolded state? If yes, proceed to step S42; otherwise, proceed to step S43.
[0043] Step S42, if P i x With Q i x If all the modules in between are basic units, then they are directly based on P. i x With Q i xModule judgment between (P) i x Q i x In M i x Does a connected path exist in P? Otherwise, P i x As the primary target port, Q i x As the second target port, M i x As the design under test (DUT), execute steps S1-S7. If (P i x Q i x If a connected path exists, then obtain M. i x China (P) i x Q i x The port names corresponding to all connected paths, and M i x China (P) i x Q i x The port names corresponding to all connected paths are stored in (P) i x Q i x The corresponding set of connected path ports B i x middle;
[0044] Step S43: Determine the M state in the unfolded state. i x Does P exist in it? i x Q i x The corresponding basic unit connection path, P i x Q i x All modules in the corresponding basic unit's connected path are basic units; if they exist, then (P) is determined. i x Q i x In M i x If a connected path exists, then further expand M. i x until it can be determined (P) i x Q ix In M i x Whether there is a connected path, the basic unit is a basic component unit that does not include sub-modules.
[0045] It should be noted that if M in the current netlist i x To be in the expanded state, M needs to be obtained. i x China (P) i x Q i x The port names corresponding to all connected paths in the current network table, if M i x If it is not in an expanded state, then only M needs to be checked. i x China P i x Q i x To determine connectivity, first check if M is connected. i x Does P exist in it? i x Q i x The corresponding basic unit connection path, in the presence of P i x Q i x When the corresponding basic unit is connected, the number of nodes that need to be traversed can be further reduced, thus improving query efficiency.
[0046] To further improve efficiency, the conclusion obtained in step S43 can also be stored in a preset storage space, that is, stored in the preset storage space (P). i x Q i x The system can determine whether a connected path exists, and in subsequent steps, such as S43, it can first query the preset storage space. If the conclusion already exists, then there is no need to execute step S43 again, thereby further improving query efficiency.
[0047] As one embodiment, step S42 includes:
[0048] Step S421, Place (P) i x Q i x ) and B i x Stored in the preset storage area, if the netlist contains a match with M i xOther instances with the same module definition will also have their interconnected port groups and corresponding connection path port sets generated and stored in the preset storage area.
[0049] It should be noted that the preset storage space and the preset storage area are different storage locations. By using (P) i x Q i x ) and B i x Storing it in the preset storage area achieves (P) i x Q i x ) and B i x Information reuse avoids repeatedly retrieving each group (P) i x Q i x The corresponding B i x This operation further improves query efficiency. In this embodiment of the invention, the interconnected port groups and corresponding connected path port sets corresponding to other instances are also synchronously generated and stored in the preset storage area. This enables information reuse between instances with the same module definition, further reducing the number of nodes that need to be traversed and improving query efficiency.
[0050] As one embodiment, the steps preceding step S42 include:
[0051] Step S40: Determine whether (P) exists in the preset storage area. i x Q i x The preset storage area is used to store the determined interconnected port groups and the corresponding connected path port sets. If they exist, they are directly retrieved from the preset storage area (P). i x Q i x The corresponding B i x Otherwise, proceed to step S42.
[0052] It should be noted that step S40 can further accelerate the query efficiency of join relationships in the netlist.
[0053] As one embodiment, the following is performed before executing step S43:
[0054] Step S430: Determine whether (P) exists in the preset storage area. ix Q i x If it exists, then determine (P) i x Q i x In M i x If a connected path exists, step S43 will not be executed; otherwise, step S43 will be executed.
[0055] It should be noted that information stored in a preset storage area can also be directly used to determine (P) i x Q i x In M i x To determine if there is a connecting path, further improve query efficiency.
[0056] As one embodiment, in step S5, P1 is... x As the second target port, with A1 as the design under test (DUT), execute steps S1-S7 to determine the first target port and P1. x Is it connected? (Place Q) g(x) x Using A2 as the first target port and the design under test (DUT) as the DUT, execute steps S1-S7 to determine the second target port and Q. g(x) x Is it connected?
[0057] It is understandable that the first target port and P1 are determined. x Whether it is connected, determine the second target port and Q. g(x) x Whether the connection is established is also determined based on steps S1-S7, which is also a top-down approach.
[0058] As one embodiment, the method further includes:
[0059] Step S8: Execute all B obtained during steps S1-S7. i x The union of these sets determines the set of ports corresponding to the final connected path.
[0060] It should be noted that all B obtained during steps S1-S7 i x The union of these is the name of all ports corresponding to all connection paths of the original first and second target ports in the current netlist for executing steps S1-S7.
[0061] As one embodiment, the method further includes:
[0062] Step S9: Generate the final connected path in the netlist based on the port set corresponding to the final connected path.
[0063] It should be noted that if there is a need to display the final connected path, the connection relationship between all ports in the port set corresponding to the connected path can be directly constructed based on the interconnection relationship between ports to generate the final connected path. The interconnection relationship between ports is known information.
[0064] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0065] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in this invention.
[0066] This invention also provides a computer-readable storage medium storing computer-executable instructions for performing the methods described in this invention.
[0067] The embodiments of the present invention can query the connection relationship between two nodes based on the hierarchical structure of the netlist, which greatly reduces the number of nodes that need to be traversed, improves the query speed of the connection relationship between two nodes, and thus improves the query efficiency of the connection relationship in the netlist.
[0068] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for querying join relationships based on a hierarchical network list structure, characterized in that, include: Step S1: Obtain the instance object A1 of the first target port in the DUT and the instance object A2 of the second target port in the DUT. Step S2: Determine whether there are candidate connection paths for A1 and A2 in the DUT. If they exist, proceed to step S3; otherwise, proceed to step S7. Step S3: The xth candidate path L based on A1 and A2 x Generate the corresponding candidate port group set {(P1) x Q1 x ),(P2 x Q2 x ),...,(P i x Q i x ),...,(P g(x) x Q g(x) x )}; Among them, (P) i x Q i x ) for L x The corresponding i-th candidate port group, where i ranges from 1 to g(x), and g(x) is L x The total number of corresponding candidate port groups, P i x Q is the first port in the i-th candidate port group. i x For the second port in the i-th candidate port group, P i x Q i x All in L x Above, and P i x Q i x They all belong to the same instance object M in the Design Under Test (DUT). i x ; (P1 x Q1 x The corresponding M i x If the first destination port is not A1, then P1 x Q1 is the port of the submodule A1 where the first target port is located. x Port A1 is used; otherwise, port P1 is used. x =Q1 x =First target port; (P g(x) x Q g(x) x The corresponding M i x If the second target port is not A2, then Q g(x) x P is the port of the submodule A2 where the second target port is located. g(x) x Port A2 is used; otherwise, P is used. g(x) x =Q g(x) x =Second target port; When i = 2, 3, ..., g(x)-1, P i Q i All are M i x The port; Step S4, Traverse L x The corresponding candidate port group set, determine (P) i x Q i x In M i x Does there exist a connected path in L? x Each corresponding group (P) i x Q i x In M i x If there is a connected path in both, proceed to step S5; otherwise, proceed to step S7. Step S5: Determine the first target port and P1 x Whether it is connected, the second target port and Q g(x) x Whether the connection is established depends on whether the first target port and P1 are connected. x Connected and the second target port and Q g(x) x If the connection is established, proceed to step S6; otherwise, proceed to step S7. Step S6: Connect the first target port to P1 x L x Second target port to Q g(x) x The concatenated path is determined to be the connection path between the first target port and the second target port, and the process ends; Step S7: Determine that there is no connected path between the first target port and the second target port.
2. The method according to claim 1, characterized in that, In step S4, it is determined that (P) i x Q i x In M i x Does a connected path exist in the path? include: Step S41: Determine M in the current netlist i x Is it in the unfolded state? If yes, proceed to step S42; otherwise, proceed to step S43. Step S42, if P i x With Q i x If all the modules in between are basic units, then they are directly based on P. i x With Q i x Module judgment between (P) i x Q i x In M i x Does a connected path exist in P? Otherwise, P i x As the primary target port, Q i x As the second target port, M i x As the design under test (DUT), execute steps S1-S7. If (P i x Q i x If a connected path exists, then obtain M. i x China (P) i x Q i x The port names corresponding to all connected paths, and M i x China (P) i x Q i x The port names corresponding to all connected paths are stored in (P) i x Q i x The corresponding set of connected path ports B i x middle; Step S43: Determine the M state in the unfolded state. i x Does P exist in it? i x Q i x The corresponding basic unit connection path, P i x Q i x All modules in the corresponding basic unit's connected path are basic units; if they exist, then (P) is determined. i x Q i x In M i x If a connected path exists, then further expand M. i x until it can be determined (P) i x Q i x In M i x Whether there is a connected path, the basic unit is a basic component unit that does not include sub-modules.
3. The method according to claim 2, characterized in that, Step S42 includes: Step S421, Place (P) i x Q i x ) and B i x Store in the preset storage area. If the netlist contains a match with M... i x Other instances with the same module definition will also have their interconnected port groups and corresponding connection path port sets generated and stored in the preset storage area.
4. The method according to claim 3, characterized in that, Before step S42, the following is included: Step S40: Determine whether (P) exists in the preset storage area. i x Q i x The preset storage area is used to store the determined interconnected port groups and the corresponding connected path port sets. If they exist, they are directly retrieved from the preset storage area (P). i x Q i x The corresponding B i x Otherwise, proceed to step S42.
5. The method according to claim 3, characterized in that, Before executing step S43, execute the following: Step S430: Determine whether (P) exists in the preset storage area. i x Q i x If it exists, then determine (P) i x Q i x In M i x If a connected path exists, step S43 will not be executed; otherwise, step S43 will be executed.
6. The method according to claim 2, characterized in that, In step S5, P1 x As the second target port, with A1 as the design under test (DUT), execute steps S1-S7 to determine the first target port and P1. x Is it connected? Q g(x) x Using A2 as the first target port and the design under test (DUT) as the DUT, execute steps S1-S7 to determine the second target port and Q. g(x) x Is it connected? 7. The method according to claim 6, characterized in that, The method further includes: Step S8: Execute all B obtained during steps S1-S7. i x The union of these sets determines the set of ports corresponding to the final connected path.
8. The method according to claim 7, characterized in that, The method further includes: Step S9: Generate the final connected path in the netlist based on the port set corresponding to the final connected path.
9. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, the instructions being configured to perform the method of any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for performing the method of any one of claims 1-8.
Citation Information
Patent Citations
Layout optimization method and deice, terminal and storage medium
CN107315863A
Logic synthesis method and device, electronic equipment and storage medium
CN113255258A