On Systematic Testing for Execution-Time Analysis

Daniel Bundala, Sanjit A. SeshiaarXiv 2015

Introduction

Estimating the Worst-Case Execution Time (WCET) is a cornerstone of verifying real-time embedded systems. However, traditional static analysis often produces overly pessimistic bounds and requires exhaustive hardware specifications that are frequently unavailable due to intellectual property restrictions. This leaves engineers working with "black-box" platforms where timing behavior is difficult to predict.

Measurement-based approaches, such as the GameTime system, attempt to bridge this gap by learning timing models from end-to-end path measurements. Yet, these systems often rely on a predefined hardware parameter ($\mu_{max}$) to bound timing variations like cache misses. This paper introduces a measurement-based approach that eliminates the need for such a priori knowledge while providing tighter, mathematically rigorous error bounds.

Modeling and Methodology

The core of the proposed approach involves modeling a program as a Directed Acyclic Graph (DAG). In this model, edges represent basic blocks or segments of code, and the goal is to find the path through the graph that maximizes execution time.

Figure 1: A program modeled as a Directed Acyclic Graph (DAG), where edges represent basic blocks and conditional branches.

The methodology proceeds through several key stages:

  • Hardware Variation Inference: Instead of guessing a variation parameter, the system formulates a Linear Program (LP) to find the minimum timing variation ($D$) consistent with observed measurements. This allows the platform's timing repeatability to be inferred directly from data.
  • Longest-Path Extraction: An Integer Linear Program (ILP) identifies the longest path in the DAG where edge weights align with measured basis paths and the estimated variation $D$.
  • Iterative Refinement: An algorithm selectively generates and measures new paths until a user-defined accuracy threshold is reached.
  • Input Generation: The Z3 SMT solver generates concrete program inputs to trigger specific paths, ensuring the predicted worst-case behavior is actually executable.

Basis Paths and Path Exploration

To build an accurate model, the system measures a set of "basis paths." These paths are chosen to cover the program's structure effectively. By analyzing the execution times of these paths on actual hardware, the ILP solver can bound the execution time of all other possible paths, including those not yet measured.

Figure 3: Visualization of different execution paths (x0 through x3) used to build and refine the timing model.

Key Results and Insights

The algorithm was evaluated using standard real-time benchmarks, including the Mälardalen and PapaBench suites. Key findings include:

  • Improved Accuracy: The ILP-based approach provided tighter estimates than previous state-of-the-art methods using the same initial measurements.
  • Discovery of True Worst-Cases: In half of the benchmarks, the algorithm identified longer execution paths than prior methods.
  • Reliable Guard Bands: The actual measured time of predicted worst-case paths always fell within the calculated error bounds ($T \pm \text{error}$).

While the increased accuracy comes with higher computational costs—processing complex benchmarks like sm can take nearly an hour—the ability to provide a "guard band" with mathematical guarantees is a significant advancement for safety-critical systems.

Conclusion

This research demonstrates that hardware timing variation can be inferred rather than guessed, allowing for systematic testing of black-box platforms. While currently limited to deterministic, loop-free programs, the framework offers a tunable trade-off between testing time and precision, providing a robust path forward for execution-time analysis in industrial settings.

Summary updated

BibTeX
@misc{bundala2015systematic,
  author = {Daniel Bundala and Sanjit A. Seshia},
  title = {{On Systematic Testing for Execution-Time Analysis}},
  year = {2015},
  eprint = {1506.05893},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1506.05893},
}
Figure