Static WCET Analysis: Methods and Tools

Similar documents
Evaluating Static Worst-Case Execution-Time Analysis for a Commercial Real-Time Operating System

Status of the Bound-T WCET Tool

The Worst-Case Execution-Time Problem Overview of Methods and Survey of Tools

ait: WORST-CASE EXECUTION TIME PREDICTION BY STATIC PROGRAM ANALYSIS

The Worst-Case Execution Time Problem Overview of Methods and Survey of Tools

Static Memory and Timing Analysis of Embedded Systems Code

History-based Schemes and Implicit Path Enumeration

Modeling Hardware Timing 1 Caches and Pipelines

WCET-Aware C Compiler: WCC

Timing Analysis. Dr. Florian Martin AbsInt

Towards Automation of Timing-Model Derivation. AbsInt Angewandte Informatik GmbH

Hardware-Software Codesign. 9. Worst Case Execution Time Analysis

On the Use of Context Information for Precise Measurement-Based Execution Time Estimation

Data-Flow Based Detection of Loop Bounds

Sireesha R Basavaraju Embedded Systems Group, Technical University of Kaiserslautern

Last Time. Response time analysis Blocking terms Priority inversion. Other extensions. And solutions

Efficient Microarchitecture Modeling and Path Analysis for Real-Time Software. Yau-Tsun Steven Li Sharad Malik Andrew Wolfe

Embedded Systems Lecture 11: Worst-Case Execution Time. Björn Franke University of Edinburgh

Timing Anomalies Reloaded

Chronos: a Timing Analyzer for Embedded Software

Applying Multi-Core Model Checking to Hardware-Software Partitioning in Embedded Systems

Evaluation and Validation

HW/SW Codesign. WCET Analysis

Automatic flow analysis using symbolic execution and path enumeration

Transforming Execution-Time Boundable Code into Temporally Predictable Code

Precise and Efficient FIFO-Replacement Analysis Based on Static Phase Detection

The Heptane Static Worst-Case Execution Time Estimation Tool

Eliminating Stack Overflow by Abstract Interpretation

Caches in Real-Time Systems. Instruction Cache vs. Data Cache

Trickle: Automated Infeasible Path

Caches in Real-Time Systems. Instruction Cache vs. Data Cache

Quick Reference Card. Timing and Stack Verifiers Supported Platforms. SCADE Suite 6.3

Design and Analysis of Real-Time Systems Microarchitectural Analysis

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit


Modeling Control Speculation for Timing Analysis

Timing analysis and timing predictability

Classification of Code Annotations and Discussion of Compiler-Support for Worst-Case Execution Time Analysis

Timing Analysis of Parallel Software Using Abstract Execution

Parametric Timing Analysis for Complex Architectures

Timing Analysis Enhancement for Synchronous Program

CISC / RISC. Complex / Reduced Instruction Set Computers

Tutorial 11. Final Exam Review

Computer Systems A Programmer s Perspective 1 (Beta Draft)

Advance CPU Design. MMX technology. Computer Architectures. Tien-Fu Chen. National Chung Cheng Univ. ! Basic concepts

Improving Timing Analysis for Matlab Simulink/Stateflow

EE382V: System-on-a-Chip (SoC) Design

Worst-Case Execution Time Analysis for Dynamic Branch Predictors

Joint Entity Resolution

CMSC 411 Computer Systems Architecture Lecture 13 Instruction Level Parallelism 6 (Limits to ILP & Threading)

ECE902 Virtual Machine Final Project: MIPS to CRAY-2 Binary Translation

CS6303 Computer Architecture Regulation 2013 BE-Computer Science and Engineering III semester 2 MARKS

Outline EEL 5764 Graduate Computer Architecture. Chapter 3 Limits to ILP and Simultaneous Multithreading. Overcoming Limits - What do we need??

Hardware-Software Codesign

In examining performance Interested in several things Exact times if computable Bounded times if exact not computable Can be measured

A Tool for the Computation of Worst Case Task Execution Times

Chapter 4. The Processor

Algorithms for Integer Programming

COMPUTER ORGANIZATION AND DESIGN

CS377P Programming for Performance Single Thread Performance Out-of-order Superscalar Pipelines

FIFO Cache Analysis for WCET Estimation: A Quantitative Approach

Typical Processor Execution Cycle

Execution-based Prediction Using Speculative Slices

Retiming. Adapted from: Synthesis and Optimization of Digital Circuits, G. De Micheli Stanford. Outline. Structural optimization methods. Retiming.

Dissecting Execution Traces to Understand Long Timing Effects

VIII. DSP Processors. Digital Signal Processing 8 December 24, 2009

FROM TIME-TRIGGERED TO TIME-DETERMINISTIC REAL-TIME SYSTEMS

Bound T timing analysis tool. Reference Manual. Tid rum. Version 6.2

Fast and Accurate Source-Level Simulation Considering Target-Specific Compiler Optimizations

Dynamic Control Hazard Avoidance

Short-term Memory for Self-collecting Mutators. Martin Aigner, Andreas Haas, Christoph Kirsch, Ana Sokolova Universität Salzburg

Lecture Topics. Principle #1: Exploit Parallelism ECE 486/586. Computer Architecture. Lecture # 5. Key Principles of Computer Architecture

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

COMPUTER ORGANIZATION AND DESI

Approximation of the Worst-Case Execution Time Using Structural Analysis. Matteo Corti and Thomas Gross Zürich

Exploitation of instruction level parallelism

Introduction to Embedded Systems

Real-Time and Embedded Systems (M) Lecture 19

Eliminating Annotations by Automatic Flow Analysis of Real-Time Programs

CISC 662 Graduate Computer Architecture Lecture 13 - Limits of ILP

Our Strategy for Learning Fortran 90

COS 140: Foundations of Computer Science

Overview Implicit Vectorisation Explicit Vectorisation Data Alignment Summary. Vectorisation. James Briggs. 1 COSMOS DiRAC.

Mike Martell - Staff Software Engineer David Mackay - Applications Analysis Leader Software Performance Lab Intel Corporation

Hardware Speculation Support

Algorithmic "imperative" language

Verification of Quantitative Properties of Embedded Systems: Execution Time Analysis. Sanjit A. Seshia UC Berkeley EECS 249 Fall 2009

Timing Anomalies and WCET Analysis. Ashrit Triambak

Evaluation and Validation

Inthreads: Code Generation and Microarchitecture

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

LECTURE 3: THE PROCESSOR

Superscalar Processors

HEPTANE (Hades Embedded Processor Timing ANalyzEr) A Modular Tool for Sta>c WCET Analysis

Lecture 7 Instruction Level Parallelism (5) EEC 171 Parallel Architectures John Owens UC Davis

Operating System. Operating System Overview. Layers of Computer System. Operating System Objectives. Services Provided by the Operating System

Operating System Overview. Operating System

Problem with Scanning an Infix Expression

Allowing Cycle-Stealing Direct Memory Access I/O. Concurrent with Hard-Real-Time Programs

3 INTEGER LINEAR PROGRAMMING

Transcription:

Static WCET Analysis: Methods and Tools Timo Lilja April 28, 2011 Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 1 / 23

1 Methods 2 Tools 3 Summary 4 References Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 2 / 23

Methods Methods Static methods do not rely on executing the code on HW or simulator but combine the code with abstract model of the system to produce an upper bound WCET Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 3 / 23

Value Analysis Methods compute possible ranges for registers and local variables determine loop bounds detect infeasible paths Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 4 / 23

Control-Flow Analysis Methods collect information on possible execution paths the exact set of paths is nite since termination must be guaranteed superset of exact set is a safe approximation goal is to calculate upper bound paths not in the WCE-path can be eliminated easier on source code than on machine code input output dicult to map results to machine code due to changes to the control ow caused by optimizations and linking call graph and control-ow graph possibly bounds for the input and loop variable data annotated syntax tree for structure based approaches set of ow facts for other methods Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 5 / 23

Methods Control-Flow Analysis Approaches pattern matching (structure-based approach) nd the set of instructions typically used for loop initialization and counters by the compiler analyze the loop bounds with this information drawback: optimizations and compiler evolution might change the patterns so that recognition fails computation modelling use ane equations and inequalities (Presburger Arithmetic) to nd the variables that act as loop counters Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 6 / 23

Methods Processor-Behavior Analysis (1/2) abstract model of processor, buses, memory subsystem and peripherals execution of an instruction depends on the context of the processor which depends on the execution history analysis done on linked executable since it is the only thing containing all necessary information analysis is conservative approximation never giving time less than what can be observed with actual HW feasible for simple 8- and 16-bit CPUs but very hard on advanced CPUs exhibiting timing anomalies Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 7 / 23

Methods Processor-Behavior Analysis (2/2) execution time of an instruction dependant on the state of the CPU history of the processor state is analyzed by seeking the execution paths leading to the instruction consider ow context which express which paths through loops and calls arrive at the instruction if CPU execution information is missing, a conservative approach must be made use Data Flow Analysis with Abstract Interpretation form invariants for each ow context invariants hold for a set of execution paths and all sets form a partition of the executions leading to the program point this partitions are called calling contexts assume the worst case behavior and reduce the upper bound by consider the state of processor components (functional units, pipeline, memory) not safe due to the timing anomalies Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 8 / 23

Methods Timing Anomalies (1/2) contra-intuitive inuences to the local or global execution unknown parts of the CPU state lead to nondeterministic behavior example reason instruction load assuming it is unknown if it is in cache subsequent instruction load assuming the instruction is in the cache on CPU with timing anomalies the latter execution may lead to longer task execution time CPU speculates the outcome of a conditional branch CPU mispredicts it and all eects must be undone misprediction exceeds the cots of a cache miss this is called speculation-caused anomaly scheduling anomalies sequence of instructions can be scheduled dierently on HW resources such as pipeline units may lead to dierent execution times Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 9 / 23

Methods Timing Anomalies (2/2) incorrect assumption choosing the local worst-case transition produces global worst-case execution time consequences state space becomes large since the analysis must consider several abstract states when a non-deterministic choice between successor states exists absent information expressing all potential states of missing state components must be expressed instead of assuming some initial worst state Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 10 / 23

Methods Estimate Calculation: Structure Based (1/2) traverse syntax tree in bottom-up combine statements according to the type of the statement collapse nodes into a node forming a timing bound for the node some transformations like loop unrolling easily expressible as syntax transformations problems not every control-ow can be expressed, code optimizations hard to describe, no support for additional ow information Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 11 / 23

Methods Estimate Calculation: Structure Based (2/2) Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 12 / 23

Methods Estimate Calculation: Path Based calculate upper bounds by searching the overall path giving the largest execution time of the task execution paths are explicit natural for single loop iteration exponential blow-up occurs when ow information is extended across multiple loop-nesting levels might require heuristic search methods Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 13 / 23

Methods Estimate Calculation: Implicit Path Enumeration (IPET) program ow and basic-block execution time bounds combined into sets of arithmetic constraints the entities are program ow edges and basic blocks time coecient t ent express the upper bound of an entity execution time count variable x ent gives the maximum number of times the entity is executed upper bound is obtained by maximizing sum of products of the execution counts and times x i ent i t i IPET can handle dierent types of ow information use integer linear programming (ILP) or constraint programming (CP) and can have potentially exponential time bounds Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 14 / 23

Methods Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 15 / 23

ait Tools developed by AbsInt Angewandte Informatik input analysis output executable annotations (loop bounds, ow facts, specifying values of registers and variables) control-ow analysis value analysis (abstract interpretation) cache analysis (abstract interpretation) pipeline analysis (abstract interpretation) bound calculation (path analysis, uses ILP) WCET upper bound visualization of the call graph, cache and pipeline behavior a report le that can be integrated with other tools screen shots and more information [1] Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 16 / 23

ait Limitations Tools as described in [1] WCET analyzable task must be sequentially executed with no threads, parallelism, external events, interrupts,... code must be generated by restricted subset of ANSI C, and even more limited on C++ and ADA no support for dynamic allocation (malloc and such) setjmpg/longjmp not supported code must follow standard ABI calling conventions function return addresses must no be modied host platforms: Windows and Linux target platforms: Motorola PowerPC MPC 555/565/755, ColdFire MCF 5307, ARM7 TDMI, HCS12/STAR12, TMS320C33, C166/ST10, Renesas M32C/85, Inneon TriCore 1.3 Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 17 / 23

Bound-T Tools originally developed by Space Systems Finland and currently developed by Tidorum Ltd [2] input analysis output executable with debugging symbols annotations (loop bounds, some loop bounds can be deduced, written to a separate le) control ow loop bounds (Presburger Arithmetic and set of linear transformations) bound calculation (IPET applied to the CFG of the subroutine) text le listing upper bounds call-graph and control-ow graph displayed with the DOT tool Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 18 / 23

Bound-T Limitations Tools task must not be recursive CFG must be reducible dynamic calls analysis only if an unique target address found weak aliasing analysis bounds of an inner loop cannot depend on the index of outer loop rectangular upper bound can be constructed loop-bound analysis doesn't cover multiplication, division, bitwise ops task must use standard calling conventions no cache analysis host platforms: PC x86 Linux, Windows, Mac OS X target platforms: Analog Devices ADSP21021, ARM7 TDMI, Atmel AVR 8-bit, Intel 8051, Renesas H8/300, Sparc V7/ERC32 Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 19 / 23

Chronos Tools research prototype by the National University of Singapore [3] input analysis output task written in C conguration of the target processor uses ILP to bound the number of executions bound calculations are done with IPET statically estimated WCET and SimpleScalar simulated WCET Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 20 / 23

Chronos Tools doesn't support any real HW platform doesn't analyze data caches notes on building GPL licensed but requires registering considerable build-depends (LP solve, old gcc, simplesim) simplesim doesn't compile on x86_64 Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 21 / 23

Summary Summary open-source tools don't seem to be in a mature state e.g. GPL HEPTANE by IRIS seems to be abandoned commercial tools well documented and seem to be mature enough should test them though, we could get an evaluation license? are there any independent benchmark suites (like TPC in SQL) 3rd-party reviews? Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 22 / 23

References I References ait Worst-Case Execution Time Analyzers. http://www.absint.com/ait/. Bound-T time and stack analyzer. http://www.tidorum.fi/bound-t/. Chronos. http://www.comp.nus.edu.sg/~rpembed/chronos/. Timo Lilja () Static WCET Analysis: Methods and Tools April 28, 2011 23 / 23