[Paper Review] Computation of WCET using Program Slicing and Real-Time Model-Checking
This paper presents a fully automatic method for computing Worst-Case Execution Time (WCET) using program slicing and real-time model-checking with Uppaal. It constructs control flow graphs from binary code and models hardware (e.g., ARM920T) as timed automata, synchronizing them with the program to reduce WCET analysis to a reachability problem, achieving high accuracy with relative errors below 5% on real hardware measurements.
Computing accurate WCET on modern complex architectures is a challenging task. This problem has been devoted a lot of attention in the last decade but there are still some open issues. First, the control flow graph (CFG) of a binary program is needed to compute the WCET and this CFG is built using some internal knowledge of the compiler that generated the binary code; moreover once constructed the CFG has to be manually annotated with loop bounds. Second, the algorithms to compute the WCET (combining Abstract Interpretation and Integer Linear Programming) are tailored for specific architectures: changing the architecture (e.g. replacing an ARM7 by an ARM9) requires the design of a new ad hoc algorithm. Third, the tightness of the computed results (obtained using the available tools) are not compared to actual execution times measured on the real hardware. In this paper we address the above mentioned problems. We first describe a fully automatic method to compute a CFG based solely on the binary program to analyse. Second, we describe the model of the hardware as a product of timed automata, and this model is independent from the program description. The model of a program running on a hardware is obtained by synchronizing (the automaton of) the program with the (timed automata) model of the hardware. Computing the WCET is reduced to a reachability problem on the synchronised model and solved using the model-checker UPPAAL. Finally, we present a rigorous methodology that enables us to compare our computed results to actual execution times measured on a real platform, the ARM920T.
Motivation & Objective
- To address the challenge of computing precise WCET for modern embedded systems with complex architectures like pipelining and caching.
- To eliminate manual CFG construction and loop bound annotation by automatically deriving the control flow graph from binary code.
- To decouple hardware modeling from program analysis by using a modular timed automata model of the processor.
- To enable accurate WCET estimation by comparing computed results with actual execution times on real platforms.
- To support flexible hardware retargeting by changing only the hardware model, not the analysis algorithm.
Proposed method
- Automatically infers the control flow graph (CFG) from binary code using program slicing, without requiring source code or compiler internals.
- Models the target hardware (e.g., ARM920T) as a product of timed automata, capturing pipeline stages, cache behavior, and memory access times.
- Synchronizes the program’s execution model with the hardware model to form a composite timed automaton representing program execution on that hardware.
- Reduces WCET computation to a reachability query in Uppaal, where the longest path corresponds to the worst-case execution time.
- Uses symbolic execution and model-checking to explore all feasible program paths efficiently, even with complex data-dependent instruction timing.
- Applies a rigorous experimental protocol to measure actual execution times on real ARM920T hardware for validation.
Experimental results
Research questions
- RQ1Can a fully automatic method compute accurate WCET without manual CFG construction or loop bound annotation?
- RQ2Can hardware-specific timing behavior (e.g., pipelining, caching) be modeled independently and composed with program models to enable precise WCET analysis?
- RQ3How does the WCET computed via model-checking compare to actual execution times measured on real hardware?
- RQ4Can the approach be easily adapted to different processors by modifying only the hardware model?
- RQ5What is the achievable tightness of WCET bounds when using symbolic model-checking on complex programs with data-dependent instruction timing?
Key findings
- The method automatically constructs the control flow graph from binary code, eliminating the need for manual annotation or compiler-specific knowledge.
- The average relative error between computed and measured WCET across 18 programs was 2.4%, with the highest error at 5.4% for matmult-O2.
- For single-path programs, the relative error ranged from 0.42% to 3.8%, indicating high precision in predictable execution scenarios.
- For multiple-path programs like insertsort-O0 and ns-O0, the relative error remained low at 0.8% and 0.8% respectively, demonstrating scalability to complex control flow.
- The framework supports hardware retargeting by simply replacing the hardware model, as shown by the consistent results on ARM920T with different optimization levels.
- The model-checking approach successfully computed WCET for programs with over 10 million states (e.g., matmult-O0 with 10.5M states), showing scalability to large state spaces.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.