A time series analysis method, device, equipment and medium based on graph traversal

Through the static timing analysis based on graph traversal, the calculation redundancy and long running time problems caused by multiple graph traversals in traditional methods are solved, and efficient topological sorting and loop detection are realized, which improves the stability of the circuit and Design efficiency.

CN117787163BActive Publication Date: 2024-12-06SUZHOU YIGE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311842888.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2024-12-06
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

The traditional static timing analysis method requires multiple graph traversals, resulting in computational redundancy and long run time, limiting its application in large-scale integrated circuit design.

Method used

Through the method based on graph traversal, the description file of the target circuit is obtained to generate a directed node graph, determine the starting node and perform traversal access, remove directed edges of the repeated access node, and fall back to the previous access node until all nodes have accessed. Get topological sorting results to complete static timing analysis.

Benefits of technology

Loop detection and topological sorting are realized in one traversal, avoiding the problems of computational redundancy and long running time, improving the stability and predictability of the circuit, and reducing the calculation cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117787163B_ABST
    Figure CN117787163B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of static timing analysis, and discloses a timing analysis method, device, equipment and medium based on graph traversal. The method comprises: obtaining a directed node graph corresponding to a target circuit, wherein the directed edges of each node in the graph are used to connect the successor nodes of each node; determining a starting node, and traversing and visiting each node based on the directed edges of each node; when a node is repeatedly visited, removing the corresponding directed edge, and falling back to the last visited node to continue traversing; if the current node does not have an unvisited successor node, it is determined that the node has been visited, and falling back to the last visited node to continue traversing until all nodes have been visited, and a topological sorting result is obtained according to the time sequence of the completed visits; static timing analysis is performed on the target circuit based on the topological sorting result. The present invention realizes loop detection and loop breaking through a graph traversal once, obtains the final topological sorting result, and thus performs timing analysis, and solves the problems of computational redundancy and long running time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of static timing analysis, and in particular to a timing analysis method, device, equipment and medium based on graph traversal. Background Art

[0002] As integrated circuit design continues to evolve, the requirements for circuit timing performance have become increasingly stringent. Static timing analysis is a critical task that is used to evaluate the timing performance of signal transmission in integrated circuits. In the process of static timing analysis of circuits, topological sorting, loop detection, and loop breaking are three indispensable steps that directly affect the reliability and performance of the circuit.

[0003] The importance of topological sorting in circuit design cannot be ignored. Since the circuit diagram contains a large number of logic gates and interconnects, the transmission order of signals is crucial for correct timing analysis. At the same time, the existence of loops may lead to uncertainty and instability in signal transmission, so loop detection has also become crucial in circuit design. Loop breaking, as a key step, further ensures the stability and predictability of the circuit by eliminating loops.

[0004] In the prior art, traditional static timing analysis methods usually require multiple graph traversals, where topological sorting and loop detection are performed in different stages. Such staged processing leads to computational redundancy and long running time, limiting the application of static timing analysis in large-scale integrated circuit design. Summary of the invention

[0005] In view of this, the present invention provides a timing analysis method, apparatus, device and medium based on graph traversal to solve the problems of computational redundancy and long running time when performing static timing analysis on circuits.

[0006] In a first aspect, the present invention provides a timing analysis method based on graph traversal, the method comprising:

[0007] Obtain a description file of the target circuit, and generate a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node;

[0008] Determine a starting node, and traverse and visit each node in the directed node graph based on the starting node and directed edges of each node;

[0009] During the traversal and access process, when a repeated access node appears, the directed edge between the repeated access node and the last access node is removed, and the traversal and access is continued by returning to the last access node;

[0010] If the current node does not have an unvisited successor node, it is determined that the current node has been visited, and the traversal is continued to the previous visited node of the current node until all nodes have been visited, and the topological sorting result for the target circuit is obtained according to the time sequence of the completion of the visit of each node;

[0011] Static timing analysis is performed on the target circuit based on the topological sorting result.

[0012] By traversing the directed node graph corresponding to the target circuit diagram, the directed edges corresponding to the repeatedly visited nodes can be removed during one traversal process to achieve the purpose of breaking the loop, and in a convenient process, the nodes are sorted according to the traversal access status of each node to obtain the final topological sorting result for static timing analysis. Only one traversal of the graph is required to complete the loop breaking and obtain the topological sorting result, which greatly avoids the problems of computational redundancy and long running time.

[0013] In an optional implementation, the traversing and accessing each node in the directed node graph based on the starting node and the directed edges of each node includes:

[0014] Starting from the starting node, the traversal visit is performed, and after the current node is visited, the node status of the current node is updated to visited;

[0015] Determine the successor node of the current node according to the directed edge of the current node, and traverse and visit the successor node.

[0016] By updating the states of visited nodes during the traversal process, the repeatedly visited nodes can be determined during the traversal process, so as to accurately determine the repeatedly visited nodes and ensure the accuracy of subsequent removal of directed edges.

[0017] In an optional implementation, when a repeated visit node appears during the traversal access, removing the directed edge between the repeated visit node and the last visit node, and returning to the last visit node to continue the traversal access, includes:

[0018] During traversal access, when the first node whose node status is visited is accessed, the first node is determined to be a repeatedly visited node, the directed edge between the repeatedly visited node and the last visited node is removed, and then backtracking to the last visited node is performed to traverse and access other successor nodes of the last visited node.

[0019] When a node is visited repeatedly, the directed edge between the node and the previous node is removed to obtain a broken-loop graph, thereby ensuring the stability and predictability of the circuit and obtaining the final topological sorting result.

[0020] In an optional implementation, the step of returning to the last visited node of the current node and continuing the traversal visit includes:

[0021] According to the traversal access process, fall back to the last visited node of the current node, and traverse and access other unvisited successor nodes of the last visited node.

[0022] When the current node has no successor node, it goes back to the previous node to continue traversing to ensure that all nodes in the graph can be traversed to avoid missing nodes.

[0023] In an optional real-time mode, obtaining a topological sorting result for a target circuit according to the time sequence of completion of visits to each node includes:

[0024] The node that is visited first is placed at the end of the topological sorting, and the topological sorting result is obtained from back to front according to the time sequence in which each node is visited.

[0025] The nodes are sorted according to the time sequence of the node visits. The node that is visited first corresponds to the last result of the topological sorting, thus obtaining an accurate topological sorting result.

[0026] In an optional implementation, the performing static timing analysis on the target circuit based on the topological sorting result includes:

[0027] Calculate the arrival time and the latest migration time of each node according to the topological sorting result and the signal transmission status in the target circuit;

[0028] Static timing analysis is performed on the target circuit based on the arrival time and the latest transition time.

[0029] According to the topological sorting results, the arrival time and the latest migration time of each node can be accurately obtained, which ensures the accuracy of the calculation results and the effectiveness of static timing analysis.

[0030] In an optional implementation manner, the calculating the arrival time and the latest migration time of each node according to the topological sorting result and the signal transmission status in the target circuit includes:

[0031] Calculate the arrival time of each node based on the topological sorting result and the time required for the signal to be transmitted between nodes in the target circuit;

[0032] The latest migration time of each node is calculated according to the reverse order of the topological sorting result and the time required for the signal to be transmitted between each node in the target circuit.

[0033] The arrival time and the latest migration time are calculated by two opposite sortings to ensure the validity of the calculation of these two data.

[0034] In a second aspect, the present invention provides a timing analysis device based on graph traversal, the device comprising:

[0035] A node graph generation module, used to obtain a description file of a target circuit, and generate a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node;

[0036] A traversal access module, used to determine a starting node, and perform a traversal access to each node in the directed node graph based on the starting node and directed edges of each node;

[0037] A loop break processing module is used to remove the directed edge between the repeated access node and the last access node when a repeated access node appears during the traversal access, and to return to the last access node to continue the traversal access;

[0038] A topological sorting module is used to determine that the current node has been visited if there is no unvisited successor node of the current node, and to return to the previous visited node of the current node to continue traversing and visiting until all nodes have been visited, and to obtain a topological sorting result for the target circuit according to the time sequence of the completion of the visit of each node;

[0039] A timing analysis module is used to perform static timing analysis on the target circuit based on the topological sorting result.

[0040] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the graph traversal-based timing analysis method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the graph traversal-based timing analysis method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 is a flow chart of a timing analysis method based on graph traversal according to an embodiment of the present invention;

[0044] Figure 2 is a flowchart of another timing analysis method based on graph traversal according to an embodiment of the present invention;

[0045] Figure 3 is an example diagram of a topological sorting code according to an embodiment of the present invention;

[0046] Figure 4 is an example directed node graph according to an embodiment of the present invention;

[0047] Figure 5 An example diagram of node state changes according to an embodiment of the present invention;

[0048] Figure 6 An example graph of a broken-loop directed node according to an embodiment of the present invention;

[0049] Figure 7 is a structural block diagram of a timing analysis device based on graph traversal according to an embodiment of the present invention;

[0050] Figure 8 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0052] With the continuous development of integrated circuit design, the requirements for circuit timing performance have become increasingly stringent. Therefore, static timing analysis of circuits is becoming more and more important. Static timing analysis is used to evaluate the timing performance of signal transmission in integrated circuits. In the process of static timing analysis of circuits, topological sorting, loop detection, and loop breaking are three indispensable steps, which directly affect the reliability and performance of the circuit.

[0053] Since the circuit diagram contains a large number of logic gates and interconnects, the transmission order of signals is crucial for correct timing analysis, so the importance of topological sorting in circuit design cannot be ignored. At the same time, the existence of loops may lead to uncertainty and instability in signal transmission, so loop detection has also become crucial in circuit design. Loop breaking, as a key step, further ensures the stability and predictability of the circuit by eliminating loops.

[0054] In the prior art, traditional static timing analysis methods usually require multiple graph traversals, where topological sorting and loop detection are performed in different stages. Such staged processing leads to computational redundancy and long running time, limiting the application of static timing analysis in large-scale integrated circuit design.

[0055] To this end, an embodiment of the present invention provides a static timing analysis method based on graph traversal. By completing loop detection and breaking the loop in a process of traversing the directed node graph corresponding to the target circuit, a topological sorting result is finally obtained, and static timing analysis is performed on the target circuit according to the topological sorting result. This can solve the problems of computational redundancy and long running time caused by multiple graph traversals required in traditional static timing analysis.

[0056] According to an embodiment of the present invention, an embodiment of a timing analysis method based on graph traversal is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0057] In this embodiment, a timing analysis method based on graph traversal is provided, which can be used for the above-mentioned static timing analysis. Figure 1 is a flowchart of a timing analysis method based on graph traversal according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:

[0058] Step S101, obtaining a description file of a target circuit, and generating a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node.

[0059] When performing static timing analysis on the target circuit, it is first necessary to obtain the circuit description information from the description file of the target circuit, for example, read the description information from the netlist file, so as to generate a directed node graph corresponding to the target circuit. For example, in the generated directed node graph, each circuit element or its pin in the target circuit corresponds to a node in the directed node graph. Each node is connected by a directed edge, and the directed edge is used to represent the dependency relationship between each circuit element. The dependency relationship can be understood as the flow relationship of the signal in the circuit. Each node is connected to the successor node of the node through a directed edge. The successor node can be understood as the next node that the signal in the circuit may pass through after passing through the node.

[0060] Step S102, determining a starting node, and traversing and accessing each node in the directed node graph based on the starting node and directed edges of each node.

[0061] A starting node is determined in the obtained directed node graph. The starting node is usually set to the node corresponding to the circuit element where the signal in the circuit is first transmitted. However, different starting nodes can also be set randomly. Different starting nodes may lead to different topological sortings. However, when performing static timing analysis, static timing analysis can also be completed according to different topological sorting results.

[0062] After determining the starting node, the nodes in the graph are traversed from the starting node. Each node, including the starting node, can determine its subsequent node through the corresponding directed edge. When traversing the nodes, the nodes in the graph are traversed and visited based on the depth-first principle.

[0063] Step S103, when a node is visited repeatedly during the traversal, the directed edge between the node is removed and the last visited node is returned to the last visited node to continue the traversal.

[0064] In the process of traversing and visiting the nodes in the graph, we can determine which nodes in the graph have been visited and which have not been visited. When a node is visited repeatedly, it means that a loop has occurred. At this time, we need to remove the directed edge between this node and the previous visited node corresponding to this node to achieve the purpose of breaking the loop and ensure the predictability of the circuit. Then we return to the previous visited node and continue to traverse and visit its successor nodes.

[0065] Step S104, if the current node does not have an unvisited successor node, it is determined that the current node has been visited, and the traversal is continued to the last visited node of the current node until all nodes have been visited, and the topological sorting result for the target circuit is obtained according to the time sequence of the completion of the visit of each node.

[0066] During the traversal visit, each time after visiting a node, the node's successor node will be visited according to the directed edge. After removing the directed edge between the current node and the repeatedly visited node, if the current node does not have an unvisited successor node, it means that the node has been visited and the backtracking starts. Backtrack to the previous node of the node for visit. If the previous node still has an unvisited successor node, the traversal visit will continue until the current node in the traversal visit process has no unvisited successor node. According to the above content, it is determined that the node has been visited and the backtracking starts; if the previous node does not have an unvisited successor node, it is considered that the previous node has also been visited, and the backtracking continues, and the above steps are repeated until all nodes have been visited. At this time, the topological sorting result for the target circuit can be obtained according to the time sequence of the completion of the visit of each node.

[0067] Step S105 , performing static timing analysis on the target circuit based on the topological sorting result.

[0068] After obtaining the topological sorting result for the target circuit, various data required for topological analysis can be obtained based on the topological sorting result, so as to perform static timing analysis on the target circuit and determine the timing performance of signal transmission in the target circuit.

[0069] The graph traversal-based timing analysis method provided in this embodiment completes loop detection and breaks the loop during a traversal of the directed node graph corresponding to the target circuit, and finally obtains a topological sorting result, thereby performing static timing analysis on the target circuit according to the topological sorting result. This can solve the problems of computational redundancy and long running time caused by multiple graph traversals required in traditional static timing analysis.

[0070] According to an embodiment of the present invention, another timing analysis method embodiment based on graph traversal is provided, which can be used for the above-mentioned static timing analysis. Figure 2 is a flowchart of another timing analysis method based on graph traversal according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0071] Step S201, obtain the description file of the target circuit, generate a corresponding directed node graph according to the description file, and the directed edges of each node in the directed node graph are used to connect the successor nodes of each node. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0072] Step S202, determining a starting node, and traversing and accessing each node in the directed node graph based on the starting node and directed edges of each node.

[0073] Specifically, in the above step S202, based on the starting node and the directed edges of each node, each node in the directed node graph is traversed and accessed, including:

[0074] Start traversing from the starting node, and after the current node is visited, update the node status of the current node to visited;

[0075] Determine the successor node of the current node according to the directed edge of the current node, and traverse and visit the successor node.

[0076] It can be understood that when traversing and accessing the nodes in the directed node graph, the state of each node can be set, and after each node is accessed, its state will be updated to visited. For example, before starting to access, the state of each node in the directed node graph is not visited, and the state of each node can be set to 0 to indicate that the node has not been visited. When a node with a node state of 0 is accessed, its node state will be updated to visited, that is, the node state is updated to 1, indicating that the node state of the node is visited.

[0077] After visiting a node, that is, after the node state is updated to 1, the corresponding successor node of the node is determined according to the directed edge of the node, so as to visit its successor node. The whole visiting process repeats the above steps until a node is visited repeatedly or there is no unvisited successor node.

[0078] By updating the states of visited nodes during the traversal process, the repeatedly visited nodes can be determined during the traversal process, so as to accurately determine the repeatedly visited nodes and ensure the accuracy of subsequent removal of directed edges.

[0079] Step S203, when a node is visited repeatedly during the traversal, the directed edge between the node visited repeatedly and the last visited node is removed, and the traversal is continued by returning to the last visited node.

[0080] Specifically, in the above step S203, when a repeated access node appears during the traversal access, the directed edge between the repeated access node and the last access node is removed, and the traversal access is continued by returning to the last access node, including:

[0081] During traversal access, when the first node whose node status is visited is visited, the first node is determined to be a repeatedly visited node, the directed edge between the repeatedly visited node and the last visited node is removed, and then backtracking to the last visited node is performed to traverse and access other successor nodes of the last visited node.

[0082] It can be understood that when performing traversal access, the successor node of the current node may be a node that has been visited, that is, the first node with a node status of visited is visited, which indicates that there is an internal loop in the entire directed node graph, and loop breaking processing is required. The first node is defined as a repeated visit node, and the directed edge between it and the expected corresponding last visit node is removed, which is loop breaking processing, and the traversal is rolled back to the last visit node to continue the traversal access. At this time, the successor nodes of the last visit node other than the repeated visit node are visited.

[0083] When a node is visited repeatedly, the directed edge between the node and the previous node is removed to obtain a broken-loop graph, thereby ensuring the stability and predictability of the circuit and obtaining the final topological sorting result.

[0084] Step S204, if the current node does not have an unvisited successor node, it is determined that the current node has been visited, and the traversal is continued to the last visited node of the current node until all nodes have been visited, and the topological sorting result for the target circuit is obtained according to the time sequence of the completion of the visit of each node.

[0085] Specifically, in the above step S204, returning to the previous visited node of the current node to continue traversing and visiting includes:

[0086] According to the traversal access process, go back to the last visited node of the current node, and traverse and access other unvisited successor nodes of the last visited node.

[0087] It can be understood that after the directed edge between the current node and the repeatedly visited successor node is eliminated in step S203, if the current node has no unvisited successor node, for example, in the initial node graph, all successor nodes of the current node are visited nodes, but the directed edges between the current node and these visited nodes have been removed, and the node is returned to the current node. If the current node has no unvisited successor node at this time, that is, a successor node with a state of 0, it is determined that the current node has been visited and the state of the node can be set to 2.

[0088] Then, we go back to the last visited node. There may be three types of successor nodes of the last visited node. One is a node with a node status of 1. We can continue to visit this node and perform the above-mentioned loop breaking process. After the loop breaking process, we go back to this node. Another is a visited node with a status of 0. We can continue to traverse and visit according to the above content. Another is a visited node with a status of 2. If there is no unvisited node after the previous node performs loop breaking process on all the corresponding visited nodes, that is, a successor node with a status of 0, the status of the node is also updated to visit completed, that is, its status is updated to 2. At this time, we continue to go back and repeat the above steps until the node status of all nodes is visit completed. At this time, we get the topological sorting result for the target circuit according to the time sequence of the completion of the visit of each node.

[0089] When the current node has no successor node, it goes back to the previous node to continue traversing, to ensure that every successor node of the node is traversed and visited during the access process, to avoid missing nodes.

[0090] Specifically, in the above step S204, the topological sorting result for the target circuit is obtained according to the time sequence of completion of the visit of each node, including:

[0091] The node that is visited first is placed at the end of the topological sorting, and the topological sorting result is obtained from back to front according to the time sequence in which each node is visited.

[0092] It can be understood that the node that first updates its node status to completed visit is determined as the last node in the topological sorting, and is sorted based on this. Every time a node that has been visited appears, the node is set in the topological sorting sequence from the back to the front, and finally the topological sorting result is obtained.

[0093] The nodes are sorted according to the time sequence of the node visits. The node that is visited first corresponds to the last result of the topological sorting, thus obtaining an accurate topological sorting result.

[0094] In one example, due to different choices of starting nodes, some nodes may not be traversed during the traversal process, and the network returns to the original starting node. At this time, the nodes that have not been visited in the node graph can be visited, and the traversal can continue according to the process corresponding to the above method until all nodes in the node graph are traversed to obtain the final topological sorting result.

[0095] Step S205 , performing static timing analysis on the target circuit based on the topological sorting result.

[0096] Specifically, refer to Figure 2 , the above step S205 includes:

[0097] Step S2051: Calculate the arrival time and the latest migration time of each node according to the topological sorting result and the signal transmission status in the target circuit.

[0098] When the signal in the circuit is transmitted, according to the signal transmission situation in the target circuit, that is, the delay of the signal transmission between different nodes, the arrival time and the latest migration time of each node are calculated based on the topological sorting result and the delay of signal transmission.

[0099] Specifically, according to the topological sorting result and the signal transmission situation in the target circuit, the arrival time and the latest migration time of each node are calculated, including:

[0100] Calculate the arrival time of each node based on the topological sorting result and the time required for the signal to be transmitted between nodes in the target circuit;

[0101] According to the inverse order of the topological sorting results and the time required for the signal to be transmitted between nodes in the target circuit, the latest migration time of each node is calculated.

[0102] It can be understood that, according to the topological sorting result, the arrival time corresponding to the signal transmission to each node is calculated from the order corresponding to the topological sorting result and the time required for signal transmission between each node. In some scenarios, it is also called AT (arrival time). When calculating the arrival time, in the node graph corresponding to the target circuit, a node may have multiple previous nodes, and there will be multiple arrival times. At this time, the maximum value of the arrival time is determined as the arrival time of the node.

[0103] When calculating the latest migration time corresponding to each node, which is also called RT (required time) in some scenarios, the calculation method is similar to the above method. It is also calculated based on the sorting and signal transmission time between nodes, but it is calculated in reverse sorting, and when calculating the latest migration time, the time corresponding to the minimum value is used as the latest migration time.

[0104] Step S2052: Perform static timing analysis on the target circuit based on the arrival time and the latest migration time.

[0105] The specific analysis method is determined according to the circuit type. For some circuits, the timing analysis result is qualified when the difference between the two is positive; for some circuits, the timing analysis result is qualified when the difference between the two is negative, or in some cases, when the difference is 0, it is also judged to be qualified. The specific analysis method is determined according to the specific situation and is not limited here.

[0106] The timing analysis method based on graph traversal provided by the embodiment of the present invention obtains the directed node graph corresponding to the target circuit, traverses and visits each node, and performs loop breaking processing during the visit, and finally performs topological sorting according to the order in which the nodes are visited. Finally, static timing analysis is performed based on the topological sorting result. The final topological sorting result can be obtained by traversing the graph only once, which can solve the problems of computational redundancy and long running time.

[0107] In order to facilitate understanding of the method embodiments provided by the present invention, a specific illustrative example is provided, such as Figure 3 As shown in FIG. 1 , a topological sorting code example diagram according to an embodiment of the present invention is provided. In the diagram, a code method is provided to implement the topological sorting part of the above method embodiment. At the same time, an exemplary directed node graph is provided, such as Figure 4 As shown, it is an example diagram of a directed node according to an embodiment of the present invention. Figure 5 is an example diagram of a node state change according to an embodiment of the present invention, Figure 5 With the above Figure 3 and Figure 4 The code provided corresponds to a directed node graph.

[0108] by Figure 4 Take point A in the graph as the starting node and refer to Figure 5 , the node status of each node before access is 0. First, visit point A, and the node status of point A becomes 1. The successor nodes of A are B and C. Then, select B to visit during traversal, and the node status of B becomes 1. Perform the same process on D and E; the successor node of E is F, and the successor node of F is C. Perform the same process on them. At this time, visit node C, whose successor node is E. Visit E and find that E has been visited, and its status is 1. Disconnect the directed edge between C and E, and get the following Figure 6 The example graph of the broken loop directed node is shown in the figure, and it is rolled back to point C. At this time, C has no unvisited successor node, and the node state of node C is updated to 2, that is, the visit is completed, and it is rolled back. During the rollback process, the node states of F, E, D, B, and A nodes are updated to 2, and the final topological sorting is obtained. Figure 5 ABDEFC shown.

[0109] After obtaining the topological sorting results, calculate the arrival time and the latest migration time calculation: Based on the results of the topological sorting, we calculate the arrival time of each circuit node. The arrival time indicates the time when the signal actually arrives at the node in the circuit. At the same time, in the order of the reverse topological sorting, calculate the latest migration time of the signal at each circuit node. The latest migration time indicates the latest time when the signal must complete processing at this node. Use the calculated arrival time and latest migration time to perform static timing analysis. By comparing the arrival time and the latest migration time, it can be determined whether the signal meets the timing requirements, thereby evaluating the performance and stability of the circuit.

[0110] The above process is an exemplary full process of topological sorting. The timing analysis method based on graph traversal provided by the present invention has produced significant effects in static timing analysis. Compared with the traditional method of multiple traversals, this innovation reduces the number of traversals, eliminates computational redundancy, and improves the stability and predictability of the circuit. First, by simultaneously realizing topological sorting, loop detection and loop breaking through one traversal, the computational redundancy in static timing analysis is successfully eliminated, the operating efficiency of circuit design is greatly improved, and the timing analysis is made faster and more efficient. Secondly, the implementation of this method reduces the computing cost and provides designers with a more economical and efficient means of circuit verification and optimization. In addition, the introduced loop breaking step helps to improve the stability of the circuit and ensure reliable operation under various working conditions. In general, the innovative method of this patent will promote the advancement of electronic design automation (EDA) tools and bring more advanced timing analysis tools to the field of circuit design.

[0111] In this embodiment, a timing analysis device based on graph traversal is also provided. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0112] This embodiment provides a timing analysis device based on graph traversal, such as Figure 7 As shown, including:

[0113] The node graph generation module 401 is used to obtain a description file of the target circuit, and generate a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node;

[0114] A traversal access module 402 is used to determine a starting node, and perform a traversal access to each node in the directed node graph based on the starting node and directed edges of each node;

[0115] The loop breaking processing module 403 is used to remove the directed edge between the repeatedly visited node and the last visited node when a node is repeatedly visited during the traversal access process, and to return to the last visited node to continue the traversal access;

[0116] A topological sorting module 404 is used to determine that the current node has been visited if there is no unvisited successor node of the current node, and to return to the last visited node of the current node to continue traversing and visiting until all nodes have been visited, and to obtain a topological sorting result for the target circuit according to the time sequence of the completion of the visit of each node;

[0117] The timing analysis module 405 is used to perform static timing analysis on the target circuit based on the topological sorting result.

[0118] In some optional implementations, traversing and accessing each node in the directed node graph based on the starting node and the directed edges of each node includes:

[0119] Start traversing from the starting node, and after the current node is visited, update the node status of the current node to visited;

[0120] Determine the successor node of the current node according to the directed edge of the current node, and traverse and visit the successor node.

[0121] In some optional implementations, when a node is repeatedly visited during the traversal, the directed edge between the repeatedly visited node and the last visited node is removed, and the traversal is continued by returning to the last visited node, including:

[0122] During traversal access, when the first node whose node status is visited is visited, the first node is determined to be a repeatedly visited node, the directed edge between the repeatedly visited node and the last visited node is removed, and then backtracking to the last visited node is performed to traverse and access other successor nodes of the last visited node.

[0123] In some optional implementations, returning to the last visited node of the current node to continue traversing and visiting includes:

[0124] According to the traversal access process, go back to the last visited node of the current node, and traverse and access other unvisited successor nodes of the last visited node.

[0125] In some optional implementations, obtaining a topological sorting result for the target circuit according to the time sequence of completion of the visit of each node includes:

[0126] The node that is visited first is placed at the end of the topological sorting, and the topological sorting result is obtained from back to front according to the time sequence in which each node is visited.

[0127] In some optional implementations, static timing analysis is performed on the target circuit based on the topological sorting result, including:

[0128] According to the topological sorting results and the signal transmission conditions in the target circuit, the arrival time and the latest migration time of each node are calculated;

[0129] Perform static timing analysis on the target circuit based on the arrival time and the latest transition time.

[0130] In some optional implementations, the arrival time and the latest migration time of each node are calculated according to the topological sorting result and the signal transmission status in the target circuit, including:

[0131] Calculate the arrival time of each node based on the topological sorting result and the time required for the signal to be transmitted between nodes in the target circuit;

[0132] According to the inverse order of the topological sorting results and the time required for the signal to be transmitted between nodes in the target circuit, the latest migration time of each node is calculated.

[0133] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0134] The graph traversal-based timing analysis device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit or an FPGA (Field Programmable Gate Array) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0135] The embodiment of the present invention also provides a computer device having the above Figure 7 The timing analysis device based on graph traversal is shown.

[0136] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 8As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0137] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0138] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0139] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0140] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0141] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0142] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0143] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0144] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A timing analysis method based on graph traversal, characterized in that: The method comprises: Obtain a description file of the target circuit, and generate a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node; Determine a starting node, and traverse and visit each node in the directed node graph based on the starting node and directed edges of each node; During the traversal and access process, when a repeated access node appears, the directed edge between the repeated access node and the last access node is removed, and the traversal and access is continued by returning to the last access node; If the current node does not have an unvisited successor node, it is determined that the current node has been visited, and the traversal is continued to the previous visited node of the current node until all nodes have been visited, and the topological sorting result for the target circuit is obtained according to the time sequence of the completion of the visit of each node; Static timing analysis is performed on the target circuit based on the topological sorting result.

2. The method according to claim 1, characterized in that: The traversing and accessing each node in the directed node graph based on the starting node and the directed edges of each node includes: Starting from the starting node, the traversal visit is performed, and after the current node is visited, the node status of the current node is updated to visited; Determine the successor node of the current node according to the directed edge of the current node, and traverse and visit the successor node.

3. The method according to claim 2, characterized in that When a repeated access node appears during the traversal access, the directed edge between the repeated access node and the last access node is removed, and the traversal access is continued by returning to the last access node, including: During traversal access, when the first node whose node status is visited is accessed, the first node is determined to be a repeatedly visited node, the directed edge between the repeatedly visited node and the last visited node is removed, and then backtracking to the last visited node is performed to traverse and access other successor nodes of the last visited node.

4. The method according to claim 1, characterized in that: The step of returning to the last visited node of the current node and continuing the traversal visit includes: According to the traversal access process, fall back to the last visited node of the current node, and traverse and access other unvisited successor nodes of the last visited node.

5. The method according to claim 1, characterized in that The topological sorting result for the target circuit is obtained according to the time sequence of completion of the visit of each node, including: The node that is visited first is placed at the end of the topological sorting, and the topological sorting result is obtained from back to front according to the time sequence in which each node is visited.

6. The method according to claim 1, characterized in that The performing static timing analysis on the target circuit based on the topological sorting result includes: Calculate the arrival time and the latest migration time of each node according to the topological sorting result and the signal transmission status in the target circuit; Static timing analysis is performed on the target circuit based on the arrival time and the latest transition time.

7. The method according to claim 6, characterized in that The step of calculating the arrival time and the latest migration time of each node according to the topological sorting result and the signal transmission condition in the target circuit includes: Calculate the arrival time of each node based on the topological sorting result and the time required for the signal to be transmitted between nodes in the target circuit; The latest migration time of each node is calculated according to the reverse order of the topological sorting result and the time required for the signal to be transmitted between each node in the target circuit.

8. A timing analysis device based on graph traversal, characterized in that: The device comprises: A node graph generation module, used to obtain a description file of a target circuit, and generate a corresponding directed node graph according to the description file, wherein the directed edges of each node in the directed node graph are used to connect the successor nodes of each node; A traversal access module, used to determine a starting node, and perform a traversal access to each node in the directed node graph based on the starting node and directed edges of each node; A loop break processing module is used to remove the directed edge between the repeated access node and the last access node when a repeated access node appears during the traversal access, and to return to the last access node to continue the traversal access; A topological sorting module is used to determine that the current node has been visited if there is no unvisited successor node of the current node, and to return to the previous visited node of the current node to continue traversing and visiting until all nodes have been visited, and to obtain a topological sorting result for the target circuit according to the time sequence of the completion of the visit of each node; A timing analysis module is used to perform static timing analysis on the target circuit based on the topological sorting result.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the graph traversal-based timing analysis method described in any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the timing analysis method based on graph traversal according to any one of claims 1 to 7.