TuBound A tool for Worst-Case Execution Time Analysis

Similar documents
TUBOUND A CONCEPTUALLY NEW TOOL FOR WORST-CASE EXECUTION TIME ANALYSIS 1 Adrian Prantl, 2 Markus Schordan 2 and Jens Knoop 2

TuBound A Conceptually New Tool for Worst-Case Execution Time Analysis 1

An Evaluation of WCET Analysis using Symbolic Loop Bounds

Keywords: Worst-case execution time (WCET) analysis, annotation languages, WCET annotation language challenge.

r-tubound: Loop Bounds for WCET Analysis (tool paper)

Loop Bound Analysis based on a Combination of Program Slicing, Abstract Interpretation, and Invariant Analysis

ALF A Language for WCET Flow Analysis. Jan Gustafsson, Andreas Ermedahl, Björn Lisper, Christer Sandberg, and Linus Källberg

A Tool for the Computation of Worst Case Task Execution Times

ALF A LANGUAGE FOR WCET FLOW ANALYSIS Jan Gustafsson 1, Andreas Ermedahl 1, Björn Lisper 1, Christer Sandberg 1, and Linus Källberg 1

Comparing WCET and Resource Demands of Trigonometric Functions Implemented as Iterative Calculations vs. Table-Lookup

Symbolic Loop Bound Computation for WCET Analysis

Abstract. 1. Introduction

D 5.7 Report on Compiler Evaluation

Principles for Value Annotation Languages

SCCP/x - A Compilation Profile to Support Testing and Verification of Optimized Code

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

Data-Flow Based Detection of Loop Bounds

WCET TOOL CHALLENGE 2008: REPORT

-- the Timing Problem & Possible Solutions

IST ARTIST2 Network of Excellence on Embedded Systems Design. JPIA-Platform Platform-based Code Optimization and Verification

Arrays and Functions

Abstract. 1. Introduction

Symbolic Methods for the Timing Analysis of Programs

Cache-Aware Instruction SPM Allocation for Hard Real-Time Systems

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

for Task-Based Parallelism

Formal Verification of Loop Bound Estimation for WCET Analysis

Automatic Calculation of Coverage Profiles for Coverage-based Testing

WCET-Aware C Compiler: WCC

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Lecture 2: Control Flow Analysis

Automatically Adapting the Structure of Audio Similarity Spaces

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

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler so far

Quicksort. Repeat the process recursively for the left- and rightsub-blocks.

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

What is a compiler? Xiaokang Qiu Purdue University. August 21, 2017 ECE 573

The role of semantic analysis in a compiler

Run Time Environment. Activation Records Procedure Linkage Name Translation and Variable Access

LECTURE 3. Compiler Phases

Modeling Hardware Timing 1 Caches and Pipelines

OpenMP Device Offloading to FPGA Accelerators. Lukas Sommer, Jens Korinth, Andreas Koch

Arrays, Vectors Searching, Sorting

Removing Infeasible Paths in WCET Estimation: The Counter Method. Work made during the ANR Project W-SEPT ( )

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End

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

Fixed Point Library Based on ISO/IEC Standard DTR for Atmel AVR Microcontrollers. Wilfried Elmenreich, Maximilian Rosenblattl, Andreas Wolf

ST. XAVIER S COLLEGE

Variable Neighborhood Search for Solving the Balanced Location Problem

Cpt S 122 Data Structures. Sorting

COS 320. Compiling Techniques

Administration CS 412/413. Why build a compiler? Compilers. Architectural independence. Source-to-source translator

Fast and Precise WCET Prediction by Separated Cache and Path Analyses

Basic programming knowledge (arrays, looping, functions) Basic concept of parallel programming (in OpenMP)

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

ELEC 876: Software Reengineering

Multi-architecture Value Analysis for Machine Code

Enabling Compositionality for Multicore Timing Analysis

Single-Path Programming on a Chip-Multiprocessor System

Efficient Computing in Cyber-Physical Systems

Copyright 2009, Artur Czumaj 1

Lecture Compiler Middle-End

Incremental Flow Analysis. Andreas Krall and Thomas Berger. Institut fur Computersprachen. Technische Universitat Wien. Argentinierstrae 8

A compiler framework for the reduction of worst-case execution times

Integrated Modulo Scheduling and Cluster Assignment for TMS320C64x+ Architecture 1

From High Level to Machine Code. Compilation Overview. Computer Programs

Introduction. Introduction. Description of Algorithms. Peaks. Algorithms and Data Structures Peaks Algorithm 1 Algorithm 2 Algorithm 3

Hybrid SPM-Cache Architectures to Achieve High Time Predictability and Performance

CSE 307: Principles of Programming Languages

Randomized Algorithms: Selection

Pondering the Problem of Programmers Productivity

LooPo: Automatic Loop Parallelization

CS321 Languages and Compiler Design I. Winter 2012 Lecture 1

Computer Architecture

The Design and Implementation of Gnu Compiler Collection

Data Blocks: Hybrid OLTP and OLAP on compressed storage

Debugging Program Slicing

Generating Code for Assignment Statements back to work. Comp 412 COMP 412 FALL Chapters 4, 6 & 7 in EaC2e. source code. IR IR target.

CS 506, Sect 002 Homework 5 Dr. David Nassimi Foundations of CS Due: Week 11, Mon. Apr. 7 Spring 2014

Algorithm Analysis. Jordi Cortadella and Jordi Petit Department of Computer Science

Introduction to Algorithms

8/2/10. Looking for something COMP 10 EXPLORING COMPUTER SCIENCE. Where is the book Modern Interiors? Lecture 7 Searching and Sorting TODAY'S OUTLINE

Sireesha R Basavaraju Embedded Systems Group, Technical University of Kaiserslautern

Searching in General

GIGAS. GEOSS INSPIRE & GMES an Action in Support

Programming Support for Heterogeneous Parallel Systems

Static WCET Analysis: Methods and Tools

Priority queues. Priority queues. Priority queue operations

Pioneering Compiler Design

Programming Language Concepts 1982, 1987, Outline. Period

Run Times. Efficiency Issues. Run Times cont d. More on O( ) notation

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

Math 501 Solutions to Homework Assignment 10

UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. M.Sc. in Computational Science & Engineering

EI326 ENGINEERING PRACTICE & TECHNICAL INNOVATION (III-G) Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

Intermediate Code & Local Optimizations

AC64/AT64 DESIGN & ANALYSIS OF ALGORITHMS DEC 2014

The Complexity of Algorithms (3A) Young Won Lim 4/3/18

Binding and Storage. COMP 524: Programming Language Concepts Björn B. Brandenburg. The University of North Carolina at Chapel Hill

Transcription:

TuBound A Conceptually New Tool for Worst-Case Execution Time Analysis 1 Adrian Prantl, Markus Schordan, Jens Knoop {adrian,markus,knoop}@complang.tuwien.ac.at Institut für Computersprachen Technische Universität Wien computer lang uages WCET 08, Prague July 1, 2008 1 This work has been partially supported by the Austrian Science Fund (Fonds zur Förderung der wissenschaftlichen Forschung) under contract P18925-N13, Compiler Support for Timing Analysis, http://costa.tuwien.ac.at/, the ARTIST2 Network of Excellence, http://www.artist-embedded.org/ and research project Integrating European Timing Analysis Technology (ALL-TIMES) under contract No 215068 funded by the 7th EU R&D Framework Programme.

Requirements for WCET analysis tools WCET analysis Depends on manual annotations Results from static analysis may not be sufficient User may have additional domain-specific knowledge WCET analysis Must be performed on the final low-level machine code

How to bring both worlds together want to annotate Source Code + Annotations Compiler TuBound want to analyze Object Code + Transformed Annotations Bridge the gap between desired annotation level and analysis level

TuBound TuBound is a WCET analysis tool developed at TU Vienna. New Concepts Source-based Annotations Source-based Optimization FlowTrans to transform flow constraints alongside the compiler

Architecture Overview Three Phases Start-up and Annotation Program Optimization and WCET Annot. Transformation Compilation and WCET calculation C Source Code C Source Code with Annotations EDG C++ Front End Rose C++ Back End SATIrE Interval Analysis TeBo (Term-based Loop Bound Analysis) Termite/Prolog Fortran D High-level Loop Optimizer PAG Rose Compiler FlowTrans (Flow Constraint Transformation) Prolog Flow Constraintpreserving GNU C Compiler Annotated C167 Assembler Code Calc WCET 167 Worst-case Execution Time

I. Start-up and Annotation 1/2 1. Parsing EDG C++ front end Output: Rose abstract syntax tree (AST) 2. Interval Analysis SATIrE ICFG Program analyzer generator (PAG) Interprocedural interval analysis Output: Variable value ranges attached to the AST

I. Start-up and Annotation 2/2 3. Loop Bound Analysis (TeBo) Based on the SATIrE term representation of the AST Implemented in Prolog Solves equation system Constraint logic programming Output: Flow constraint annotations (as #pragma nodes) in the AST

II. Program Optimization and WCET Annotation Transformation 1. Fortran D loop optimizer Part of the Rose compiler Source-to-source loop optimizations Output: Optimized program and optimization trace 2. FlowTrans Flow constraint transformation rules Output: Annotated, optimized program

III. Compilation and WCET Calculation 1. Compilation to Assembler Code Flow constraint-aware Compiler: Customized GCC 2.7 for the Infineon C167 microcontroller Input: annotated C sources Preserves the annotations Output: Annotated C167 assembler code 2. WCET Calculation (CalcWCET 167 ) Instruction table lookup to yield WCET of basic blocks Combined equation system: WCET of basic blocks (exec. times) ICFG (connections) Flow constraints (relative frequencies) Integer linear programming (ILP) to find maximal solution

Measurements Analysis Runtime 0.6 0.5 0.4 CalcWCET GCC TeBo PAG-Interval ICFG Rose TuBound: Time spent per phase 0.3 0.2 0.1 0 ns matmult jfdctint fdct whet st sqrt recursion fibcall expint cover bsort100 qurt lcdnum crc cnt Seconds/Benchmark

Measurements Automatically calculated WCET 1e+09 1e+08 unoptimimized loop-opt. lowlevel-opt loop-opt+lowlevel-opt TuBound: Analyzed WCET 1e+07 1e+06 100000 10000 1000 cnt crc qurt lcdnum cover bsort100 st sqrt recursion fibcall expint whet fdct jfdctint ns matmult Cycles/Benchmark

Conclusion Source-based annotations Portable Easy to use Flexible integration of back ends Allow for perpetual refinement Measurements Acceptable performance Optimizations improve WCET WCET Tool Challenge 2008

Thank You! The CoSTA Team Albrecht Kadlec Adrian Prantl Jens Knoop Markus Schordan Raimund Kirner Ingomar Wenzel

Example 1/3 Example Original program 1 int sort ( int * a, int n) { 2 int i,j; 3 for (i = 0; i < n; i ++) { 4 for (j = 0; j < i; j ++) { 5 if (a[i] > a[j]) SWAP (a[i],a[j ]); 6 } 7 } 8 } 9 10 int main () 11 { 12 int a [100]; 13 sort (a, 100); 14 }

Example 2/3 Example After loop bounding 1 int sort ( int * a, int n) { 2 int i, j; 3 for (i = 0; i < n; i ++) { 4 # pragma wcet_loopbound (100) 5 for (j = 0; j < i; j ++) { 6 # pragma wcet_loopbound (99) 7 if (a[i] > a[j]) 8 SWAP (a[i],a[j ]); 9 } 10 } 11 return 0; 12 } 13 14 int main () 15 { 16 int a [100]; 17 sort (a, 100); 18 }

Example 3/3 Example After loop constraint analysis 1 int sort ( int * a, int n) { 2 # pragma wcet_marker ( m1 ) 3 int i, j; 4 for (i = 0; i < n; i ++) { 5 # pragma wcet_marker ( m2 ) 6 # pragma wcet_loopbound (100) 7 # pragma wcet_constraint ( m2=<m1 *100) 8 for (j = 0; j < i; j ++) { 9 # pragma wcet_marker ( m3 ) 10 # pragma wcet_loopbound (99) 11 # pragma wcet_constraint ( m3=<m1 *4950) 12 if (a[i] > a[j]) 13 SWAP (a[i],a[j ]); 14 } 15 } 16 return 0; 17 } 18 19 int main () 20 { 21 int a [100]; 22 sort (a, 100); 23 }