Critical path analysis method and electronic device
By performing series sorting and batch analysis of critical paths, combined with integrated circuit simulation programs and Monte Carlo algorithms, the problem of inefficient static timing analysis is solved, and faster critical path analysis and static timing analysis results are achieved. .
Patent Information
- Application Number
- CN202310537647.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2024-11-12
AI Technical Summary
Existing static timing analysis methods are inefficient when analyzing the critical paths of digital circuits, resulting in too long analysis time and the data delivery delay problem cannot be discovered in time.
A critical path analysis method is proposed. By obtaining multiple critical paths, sorting them according to the path series and analyzing them in batches, using integrated circuit simulation programs and Monte Carlo algorithms to accelerate the analysis process, and establish probabilities The distribution model reduces the number of samples and improves the analysis speed.
The total time of critical path analysis is significantly shortened through sorting and batch analysis, improving analysis efficiency, and accelerating the simulation process by reducing the number of samples, achieving faster static timing analysis results.
Smart Images

Figure CN118940692A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to static timing analysis of digital circuits, and in particular to a critical path analysis method capable of improving speed. Background Art
[0002] Static Timing Analysis (STA) is a workflow for calculating the timing of digital circuits. Consider a logic circuit between two flip-flops. This logic circuit contains multiple logic gates, each with its own delay. There are multiple paths for data to go from the previous logic gate to the next logic gate, and the path with the largest delay is called the critical path. When data cannot be transferred to the next flip-flop in time due to delay, it does not meet the specification requirements. Static timing analysis can analyze whether the timing of data transfer between two flip-flops meets the specification requirements without actually inputting signals to the circuit. Summary of the invention
[0003] The embodiment of the present disclosure provides a critical path analysis method applicable to a computer system. The critical path analysis method includes: obtaining multiple critical paths related to a digital circuit; sorting the critical paths according to the levels of the critical paths and dividing the critical paths into multiple batches; and sequentially analyzing the batches using an integrated circuit simulation program to generate static timing analysis results related to the critical paths.
[0004] From another perspective, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, wherein the processor is communicatively connected to the memory. The memory stores a plurality of instructions, and the processor is used to execute these instructions to complete the above critical path analysis method.
[0005] The critical path analysis process can be accelerated by the above method and electronic device.
[0006] In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 FIG. 4 is a schematic diagram illustrating obtaining a critical path from a digital circuit according to an embodiment.
[0008] Figure 2 FIG. 5 is a partial circuit diagram of a combinational logic circuit according to an embodiment.
[0009] Figure 3 The flowchart of a critical path analysis method is shown according to an embodiment.
[0010] Figure 4The diagram is a schematic diagram illustrating dividing critical paths into batches and then analyzing them in batches according to an embodiment.
[0011] Figure 5 is a schematic diagram illustrating establishing a probability distribution model according to an embodiment.
[0012] Figure 6 is a schematic diagram illustrating an electronic device according to an embodiment. DETAILED DESCRIPTION
[0013] The terms “first”, “second”, etc. used herein do not particularly refer to an order or sequence, but are only used to distinguish elements or operations described with the same technical terminology.
[0014] Figure 1 FIG. 1 is a schematic diagram illustrating how to obtain a critical path from a digital circuit according to an embodiment. Figure 1 , the digital circuit includes a trigger 110 and a trigger 120, a combinational logic circuit 130 is set between the output terminal Q of the trigger 110 and the input terminal D of the trigger 120, and the timing signal CLK is provided to the trigger 110 and the trigger 120. Here, the critical path between the trigger 110 and the trigger 120 can be obtained, which can be obtained by calculating the slack value, which is defined as the required time minus the arrival time. The arrival time is defined as the time required for the data to arrive at the trigger 120 after the timing signal CLK is provided. The required time is the latest time that the data needs to arrive at the trigger 120 so that the data can be correctly captured when the timing end of the trigger 120 is triggered.
[0015] Figure 2 FIG. 1 is a partial circuit diagram of a combinational logic circuit according to an embodiment. Figure 2 Take the circuit of as an example, in which logic gates 201 to 208 are shown, and the numbers inside the logic gates represent delays. For example, there is a delay of 1 unit time between the input and output of logic gate 201; there is a delay of 5 units time between the upper input and output of logic gate 203, there is a delay of 1 unit time between the lower input and output of logic gate 203, and so on. This circuit has multiple paths, each path contains multiple logic gates, for example, logic gates 201, 202, and 204 form one path, logic gates 201, 203, and 206 form another path, and so on. By calculating the relaxation value, it can be obtained that path 210 composed of logic gates 201, 203, 205, and 207 has the largest delay, and this path 210 is called the critical path. If the relaxation value of the critical path 210 is less than 0, it means Figure 2The circuit does not meet the timing specification. A person with ordinary knowledge in the art can understand the calculation of the relaxation value, and will not repeat it here.
[0016] The above calculations consider the level of logic gates. However, if the level of transistors is taken into account, the assistance of the Simulation Program with Integrated Circuit Emphasis (SPICE) tool is required to consider the delay changes of each logic gate under a process condition. For example, under certain process conditions, the delay of logic gate 207 will be slightly greater than 5, and under another process condition, the delay of logic gate 207 will be slightly less than 5. Process conditions may include specific component sizes, masks, temperatures, etc., and the present disclosure is not limited thereto. Since process conditions cover many parameters, it is impossible to exhaustively simulate all parameters. In some embodiments, the integrated circuit simulation program can be combined with a Monte Carlo algorithm. The Monte Carlo algorithm can generate multiple samples, each sample represents a process condition. If the number of samples is large enough, the accuracy of the simulation will also be improved. For a certain critical path, multiple process conditions need to be simulated to determine whether the relaxation value under the corresponding conditions is still greater than 0. The entire circuit may include multiple triggers, and there may be a critical path between each trigger pair. It takes a lot of time to analyze so many critical paths. The present invention proposes a critical path analysis method that can speed up the above analysis procedure.
[0017] In the above embodiment, the integrated circuit simulation program is used in conjunction with the Monte Carlo algorithm, but the present disclosure is not limited thereto. In some embodiments, the process conditions can also be set according to a preset probability distribution, template, or test set, and then the delay of each logic gate is determined according to the integrated circuit simulation program.
[0018] Figure 3 is a flowchart of a critical path analysis method according to an embodiment. Figure 3 In step 310, multiple critical paths of the digital circuit are first obtained. The critical paths have been described above, and any known static timing analysis method can be used to obtain the critical paths. Each critical path has a stage count, which is also equal to the number of cells. For example, Figure 2 The number of levels of the critical path 210 is 4, and the 4 units are logic gates 201, 203, 205 and 207 respectively.
[0019] The greater the level of the critical path (also called a longer critical path), the longer the time required for analysis. If the long path and the short path are assigned to the same batch for analysis, it will happen that the short path has been analyzed but still needs to wait for the long path to be analyzed before the next batch can be executed. These waiting times will increase the overall time spent. Therefore, in this embodiment, critical paths with similar levels are divided into the same batch for analysis to reduce waiting time. Specifically, in step 320, the critical paths are sorted according to the levels of these critical paths and these critical paths are divided into multiple batches. Next, in step 330, these batches are analyzed in sequence using an integrated circuit simulation program. Figure 4 is a schematic diagram illustrating dividing the critical paths into batches and analyzing them in batches according to an embodiment. Figure 4 , batches 411 to 413 represent the batch results of known technologies (before sorting), each batch contains multiple critical paths to be analyzed (e.g., critical path 401), the length of critical path 401 in the figure represents the level, the larger the length, the larger the level, and the longer the time required for analysis. Batches 411 to 413 are executed in sequence (time order). In the same batch, after the short path analysis is completed, the next batch can only be executed after the long path analysis is completed. For example, in batch 413, after the critical path 402 analysis is completed, the critical path 403 analysis must still be completed before batch 413 can be ended. According to the present invention, all critical paths are sorted first, and batches 421 to 423 are generated in the order of the levels. From another perspective, critical path 404 in batch 421 has the largest level, and critical path 405 in batch 422 has the smallest level, but the level of critical path 404 is smaller than that of critical path 405. Since the levels of critical paths in the same batch are similar, the waiting time is shortened. Compared with the result without sorting, the total time length is shortened by 430 after sorting.
[0020] Here we prove that after sorting, the execution time can be minimized. Assume that there are n critical paths, divided into m batches, where n and m are positive integers. After sorting, the levels of these n critical paths are represented as {a1, a2, …, a n}, where a1≤a2≤…≤a n-1 ≤a n Each batch has n / m critical paths. Here, we divide the critical paths into multiple batches from small to large. The critical paths in the first batch have the following levels: {a1, a2, …, a n / m}, the levels of the critical paths in the second batch are {a n / m+1 ,a n / m+2 ,…,a 2n / m}, the levels of the critical paths in the mth batch are {a (m-1)n) / m+1 ,a(m-1)n) / m+2 ,…,a n Therefore, the maximum number of levels T1 in the first batch is calculated as follows: m As calculated by the following mathematical formula 3.
[0021] [Mathematical formula 1]
[0022] T1=max{a1,a2,…,a n / m} = a n / m ,
[0023] [Mathematical formula 2]
[0024] T2=max{a n / m+1 ,a n / m+2 ,…,a 2n / m} = a 2n / m ,
[0025] [Mathematical formula 3]
[0026] T m =max{a (m-1)n) / m+1, a (m-1)n) / m+2 ,…,a n} = a n .
[0027] If it is not sorted, the first batch must contain a level greater than a n / m , the maximum level of the first batch T′1 is shown in the following mathematical formula 4. Similarly, the maximum level of the second batch T′2 is shown in the following mathematical formula 5. The maximum level of the mth batch T′ m As shown in the following mathematical formula 6.
[0028] [Formula 4]
[0029]
[0030] [Mathematical formula 5]
[0031]
[0032] [Mathematical formula 6]
[0033] T′ m =max{…,a n} = a n =T m .
[0034] Therefore, the total time required after sorting is less than the total time required before sorting, which is expressed as the following mathematical formula 7. This proves that the total time required after sorting is the minimum.
[0035] [Mathematical formula 7]
[0036] T1+T2+…+T m =a n / m +a 2n / m +…+a n ≤T′1+T′2+…+T′ m .
[0037] In some embodiments, the integrated circuit simulation program and the Monte Carlo algorithm are executed by a computer system 440. The computer system 440 can be a personal computer, a server, a distributed system, etc. The computer system 440 includes a plurality of cores 441 to 444, each of which can be an execution thread, a virtual machine, a central processing unit, an operation node, or an operation logic circuit, which can be implemented by hardware or software, and the present disclosure is not limited thereto. Here, the critical paths can be processed in parallel by the cores 441 to 444. Due to limited resources, the number of cores 441 to 444 is usually less than the number of all critical paths in the digital circuit, so these critical paths must be divided into multiple batches for processing. When a certain batch is executed, multiple critical paths in the batch are processed in parallel by these cores 441 to 444. When the total number of critical paths remains unchanged, the fewer the number of batches 421 to 423, the more critical paths there are in the same batch, which means that more critical paths can be processed in parallel at one time, and the total time required can be shortened, but the present disclosure does not limit how many batches the critical paths should be divided into.
[0038] In the above embodiment, each critical path is located between two triggers. However, in other embodiments, the critical path may also be of other types, for example, the critical path may be located between an input port and a trigger, between a trigger and an output port, or between an input port and an output port, etc., and the present disclosure is not limited thereto.
[0039] Please go back Figure 3 In this embodiment, step 330 includes step 331 and step 332. In step 331, a machine learning algorithm is executed to establish a probability distribution model. In step 332, an integrated circuit simulation program is used in combination with a Monte Carlo algorithm for analysis. When a Monte Carlo algorithm is traditionally executed, a large number of samples are generated, which takes a lot of time. The present invention uses a smaller number of samples to establish a probability distribution model, and then uses tail sampling with a smaller probability of occurrence for simulation, which can reduce the number of samples and increase the speed of analysis. Figure 5This is a schematic diagram of establishing a probability distribution model according to an embodiment. To analyze a certain critical path, first generate a plurality of initial samples (such as sample 501). These initial samples can be generated randomly or according to an arbitrary probability distribution. Each initial sample represents a process condition. Under each process condition, the delay of the logic gate is obtained through an integrated circuit simulation program. In other words, the sampling can be used to determine the delay of the logic gate. Then, a probability distribution model 510 is established based on the simulation results (delays) of these initial samples. For example, this probability distribution model 510 is preset to a Gaussian distribution. The mean and variance of the Gaussian distribution can be calculated through the simulation results of the initial samples. In Figure 5 The horizontal axis in the middle is latency, the left side of the horizontal axis represents better performance (lower latency), the right side of the horizontal axis represents worse performance (larger latency, more likely to not meet specifications), and the vertical axis is the probability of sampling. Here, we want to simulate whether the specifications can still be met in extreme cases, so after establishing the probability distribution model 510, multiple tail samples are obtained. These tail samples are located at Figure 5 The right side of the , the probability of occurrence is small but will cause poor performance, then the critical path is simulated based on tail sampling. The above steps can be repeated, each iteration generates a part of the samples, after simulation, the probability distribution model is rebuilt, and then the tail sampling is obtained for the next iteration, so that the focus can be placed on the process conditions that cause low performance, and the number of samples can be reduced compared to the known approach.
[0040] In this embodiment, step 331 is used for acceleration, but in some embodiments, step 331 may be omitted and only the Monte Carlo algorithm may be used to generate samples. In some embodiments, step 330 may also use any improved version of the Monte Carlo algorithm. Alternatively, as mentioned above, in some embodiments, step 330 may not use the Monte Carlo algorithm, and any other means may be used to determine the process conditions to be simulated.
[0041] Reference Figure 3 In step 340, a static timing analysis result about the critical path is generated. In some embodiments, the static timing analysis result includes a slack value of each critical path. If the slack value is less than zero, it is determined that the corresponding critical path does not meet the timing specification.
[0042] Figure 3 The method can be performed by any electronic device. Figure 6 is a schematic diagram of an electronic device according to an embodiment. Figure 6 The electronic device 600 may be a personal computer, a notebook computer, a server, a distributed computer, a cloud server, an industrial computer, or various electronic devices with computing capabilities, but the present invention is not limited thereto. In some embodiments, the electronic device 600 is Figure 4The electronic device 600 includes a processor 610 and a memory 620. The processor 610 is communicatively connected to the memory 620, where the communication connection can be achieved through any wired or wireless communication means, or can also be achieved through the Internet. The processor 610 can be a central processing unit, a microprocessor, a microcontroller, an application-specific integrated circuit, etc. The memory 620 can be a random access memory, a read-only memory, a flash memory, a floppy disk, a hard disk, an optical disk, a pen drive, a magnetic tape, or a database accessible through the Internet, which stores multiple instructions, and the processor 610 executes these instructions to complete Figure 3 Critical path analysis method.
[0043] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person having ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the attached claims.
[0044]
Explanation of symbols
[0045] 110,120: Trigger
[0046] 130: Combinational Logic Circuits
[0047] D: Input terminal
[0048] Q: Output
[0049] CLK: timing signal
[0050] 201 to 208: Logic Gate
[0051] 210: Path
[0052] 310,320,330 to 332,340: Steps
[0053] 401 to 405: Critical Path
[0054] 411 to 413, 421 to 423: batch
[0055] 430: Duration
[0056] 440: Computer Systems
[0057] 441 to 444: Core
[0058] 501: Sampling
[0059] 510: Probability Distribution Model
[0060] 600: Electronic devices
[0061] 610: Processor
[0062] 620: Memory.
Claims
1. A critical path analysis method, applicable to a computer system, comprising: Obtaining a plurality of critical paths about a digital circuit; According to the multiple levels of the multiple critical paths, the multiple critical paths are sorted and divided into multiple batches; as well as The plurality of batches are analyzed sequentially using an integrated circuit simulation program to generate a static timing analysis result about the plurality of critical paths.
2. The critical path analysis method according to claim 1, wherein: One of the plurality of critical paths is located between two flip-flops.
3. The critical path analysis method according to claim 1, wherein: The multiple batches include a first batch and a second batch, and a maximum level of multiple first critical paths in the first batch is smaller than a minimum level of multiple second critical paths in the second batch.
4. The critical path analysis method according to claim 1, wherein: The steps of sequentially analyzing the plurality of batches using the integrated circuit simulation program include: A plurality of third critical paths of one of the plurality of batches are processed in parallel by a plurality of cores of the computer system.
5. The critical path analysis method according to claim 4, wherein: The number of the plurality of cores is less than the number of the plurality of critical paths of the digital circuit.
6. The critical path analysis method according to claim 1, wherein: The steps of sequentially analyzing the plurality of batches using the integrated circuit simulation program include: For one of the plurality of critical paths, generating a plurality of initial samples; Establishing a probability distribution model according to the simulation results of the plurality of initial samples; According to the probability distribution model, obtaining a plurality of tail samples; and The one of the plurality of critical paths is simulated according to the plurality of tail samples.
7. The critical path analysis method according to claim 6, wherein: One of the plurality of critical paths includes a plurality of logic gates, and the plurality of initial samples and the plurality of tail samples are used to determine delays of the plurality of logic gates.
8. The critical path analysis method according to claim 1, wherein: The steps of sequentially analyzing the plurality of batches using the integrated circuit simulation program include: Execute a Monte Carlo algorithm.
9. The critical path analysis method according to claim 1, wherein: The static timing analysis result includes a slack value of one of the plurality of critical paths.
10. An electronic device comprising: a memory storing a plurality of instructions; as well as A processor, communicatively connected to the memory, is configured to execute the plurality of instructions to complete a plurality of steps: Obtaining a plurality of critical paths about a digital circuit; According to the multiple levels of the multiple critical paths, the multiple critical paths are sorted and divided into multiple batches; as well as The plurality of batches are analyzed sequentially using an integrated circuit simulation program to generate a static timing analysis result about the plurality of critical paths.
