Wost (Worst Case Execution Time) and related analysis methods

xiaoxiao2021-03-06  129

About Wost (Worst Case Execution Time I have read some articles, summarizing the following: 1. First, the concept of WCET, in programming, especially in real-time systems, is important for the worst case time calculation, This may affect the operation of the software and the entire system. It can be seen from this term, this concept refers to a hypothesis of a certain possibility. It is assumed that some problems may happen, and how much time may be required. For example, for branches A and the case B, there is already this concept (WCET). Of course, the branch structure is only one of all program structure, and Other of course, there is of course also included a loop. There is such a concept in the data structure algorithm to be average running time, and there is no contact between them. The average running time is considering the runtime of the overall program to take into account the worst case, considering the overall efficiency, and the WCET refers to the operation of a certain segment, considering the occurrence of a particular situation. These two concepts have no essential difference. 2. There are several factors affecting the WCET: 1. The branch jump, circulation of the program itself; two, the hardware structure of the target machine, such as PIPELINE, CACHE, etc., may be the impact of the compiler or external environment. 3. The unreliability and analysis method of WCET: Since the dynamic WCET analysis is unreliable because there may be different circumstances, dynamic WCET analysis is unreliable. Today is a static analysis method. The main key of the static analysis method is a set fixed value, determines the program run path, and then analyzes the WCET. 4. Static analysis has two levels, one is a high-level analysis and the other is the underlying analysis. High-level analysis is mainly analyzed for program paths, including many analytical methods and algorithms, and the visualization method is one of them, of course, there are many contents in the visualization method, such as code segment extraction algorithm and maximum / small time estimation algorithm. For program this layer, the most basic WCET formula is: WCET (S1; S2) = WCET (S1) WCET (S2); WCET (IF (C) S1; Else S2) = WCET (C) Max ( WCET (S1), WCET (S2)); WCET (FOR (C) S1) = (n 1) * WCET (C) N * WCET (S1) In this case n has been fixed to a value (Static Analysis). 5. High-level analysis: This is also an analysis of the program structure. Generally, from the smallest continuous code segment, it will be analyzed. At this time, it may be used to extract the algorithm. Now we don't consider these, suppose that there is a program is a judge in the loop, This code can draw each judgment of the condition into a 2 fork tree, then connect these 2 forks according to the program structure, write the maximum and minimum number of possible loops in the branch of each tree, and find out the entire woods The maximum number of runs can get the WCET of this code segment. The specific algorithm is finally given. Bottom analysis: This is about the analysis method of hardware structure, the main analysis content has cache, pipeline. Everyone knows that cache has lost efficiency, but often Wcet is the statistics of its failure.

About Pipeline, generally not caused resource such as Register, WCET running on the two consecutive code segments is the concateation. 6. Visual analysis method: Recently, some people have proposed a visual analysis WCET Method, it extracts its code by extracting its code from the assembly code to be analyzed from its compiler, then the maximum or minimum time analysis is performed by the algorithm, and display the results with graphics, of course Some complete visual analysis software can graphically. This method has the advantage of extracting code segments in assembly code that has been compiled, which can be considered a method combined with high-level and underlying analysis, and is easy to implement. There is also its visibility, which can realize the process-based time analysis. Of course, due to the limitations of the complexity of the analysis algorithm and the limitations of the automatic selection program path, this is still taken for an industrial analysis. Maximum time algorithm: input: StartBlock, Endblock, program's binary tree structure, program voice quote; output: maximum time. The algorithm process is as follows: Step 1. Dialectability judgment, when and only when the start block is equal to the stop block, Alternatively, when the start block arrives at the terminating block after the finish block is reached, set to false; step 2. If the reachability flag is true, turn step 3; otherwise quit, and It is given to the unreachable information; Step 3. Traverse the program structure binary tree as a block node according to the order, and evaluate the number of basic block nodes and special basic block nodes TIME; step 4. The recursive algorithm is used, and the maximum time maximum of various blocks is calculated according to the calculation rules of the maximum time maxtime of various blocks in Table 2; Step 5. Since the following algorithm, the maximum number of times of the specified block: method = σ (i = 0-> n) Next (i) (startblock) .Maxtime, where next (0) (block) = block, Next (1) (block) = block.nextblock, Next (i 1) (block) = NEXT (Nexti (block)). Step 6. Return to maximum time maxTime. #

转载请注明原文地址:https://www.9cbs.com/read-102371.html

New Post(0)