Constraint Systems used in Worst-Case Execution Time Analysis Andreas Ermedahl Dept. of Information Technology Uppsala University.

Slides:



Advertisements
Similar presentations
Evaluation and Validation
Advertisements

Approximation of the Worst-Case Execution Time Using Structural Analysis Matteo Corti and Thomas Gross Zürich.
© 2004 Wayne Wolf Topics Task-level partitioning. Hardware/software partitioning.  Bus-based systems.
Approximating the Worst-Case Execution Time of Soft Real-time Applications Matteo Corti.
Xianfeng Li Tulika Mitra Abhik Roychoudhury
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
MATH 224 – Discrete Mathematics
Architecture-dependent optimizations Functional units, delay slots and dependency analysis.
ECE 454 Computer Systems Programming Compiler and Optimization (I) Ding Yuan ECE Dept., University of Toronto
Modeling shared cache and bus in multi-core platforms for timing analysis Sudipta Chattopadhyay Abhik Roychoudhury Tulika Mitra.
1 IIES 2008 Thomas Heinz (Saarland University, CR/AEA3) | 22/03/2008 | © Robert Bosch GmbH All rights reserved, also regarding any disposal, exploitation,
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Fall 2006CENG 7071 Algorithm Analysis. Fall 2006CENG 7072 Algorithmic Performance There are two aspects of algorithmic performance: Time Instructions.
Eliminating Stack Overflow by Abstract Interpretation John Regehr Alastair Reid Kirk Webb University of Utah.
Memory Systems Performance Workshop 2004© David Ryan Koes MSP 2004 Programmer Specified Pointer Independence David Koes Mihai Budiu Girish Venkataramani.
1 Intermediate representation Goals: –encode knowledge about the program –facilitate analysis –facilitate retargeting –facilitate optimization scanning.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
3/17/2008Prof. Hilfinger CS 164 Lecture 231 Run-time organization Lecture 23.
How to Improve Usability of WCET tools Dr.-Ing. Christian Ferdinand AbsInt Angewandte Informatik GmbH.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Computer Science 12 Design Automation for Embedded Systems ECRTS 2011 Bus-Aware Multicore WCET Analysis through TDMA Offset Bounds Timon Kelter, Heiko.
Universität Dortmund  P. Marwedel, Univ. Dortmund, Informatik 12, 2003 Hardware/software partitioning  Functionality to be implemented in software.
Structural Coverage Verilog code is available to help generate tests o Code can be analyzed statically and/or simulated Easier to detect “additive” design.
EECE **** Embedded System Design
Pipelines for Future Architectures in Time Critical Embedded Systems By: R.Wilhelm, D. Grund, J. Reineke, M. Schlickling, M. Pister, and C.Ferdinand EEL.
A Modular and Retargetable Framework for Tree-based WCET analysis Antoine Colin Isabelle Puaut IRISA - Solidor Rennes, France.
WCET Analysis for a Java Processor Martin Schoeberl TU Vienna, Austria Rasmus Pedersen CBS, Denmark.
Unit III : Introduction To Data Structures and Analysis Of Algorithm 10/8/ Objective : 1.To understand primitive storage structures and types 2.To.
Lecture 4. RAM Model, Space and Time Complexity
Evaluation and Validation Peter Marwedel TU Dortmund, Informatik 12 Germany 2013 年 12 月 02 日 These slides use Microsoft clip arts. Microsoft copyright.
Complexity of Algorithms
CS 363 Comparative Programming Languages Semantics.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
The minimum cost flow problem. Simplifying assumptions Network is connected (as an undirected graph). – We can consider each connected component separately.
Timing Analysis of Embedded Software for Speculative Processors Tulika Mitra Abhik Roychoudhury Xianfeng Li School of Computing National University of.
CS 211: Computer Architecture Lecture 6 Module 2 Exploiting Instruction Level Parallelism with Software Approaches Instructor: Morris Lancaster.
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion University.
Optimised C/C++. Overview of DS General code Functions Mathematics.
6. A PPLICATION MAPPING 6.3 HW/SW partitioning 6.4 Mapping to heterogeneous multi-processors 1 6. Application mapping (part 2)
Processor Architecture
A Unified WCET Analysis Framework for Multi-core Platforms Sudipta Chattopadhyay, Chong Lee Kee, Abhik Roychoudhury National University of Singapore Timon.
Compiler Optimizations ECE 454 Computer Systems Programming Topics: The Role of the Compiler Common Compiler (Automatic) Code Optimizations Cristiana Amza.
Static WCET Analysis vs. Measurement: What is the Right Way to Assess Real-Time Task Timing? Worst Case Execution Time Prediction by Static Program Analysis.
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Hy-C A Compiler Retargetable for Single-Chip Heterogeneous Multiprocessors Philip Sweany 8/27/2010.
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
Optimal Superblock Scheduling Using Enumeration Ghassan Shobaki, CS Dept. Kent Wilken, ECE Dept. University of California, Davis
ECE 720T5 Fall 2011 Cyber-Physical Systems Rodolfo Pellizzoni.
Real-time aspects Bernhard Weirich Real-time Systems Real-time systems need to accomplish their task s before the deadline. – Hard real-time:
High Performance Embedded Computing © 2007 Elsevier Lecture 10: Code Generation Embedded Computing Systems Michael Schulte Based on slides and textbook.
CSE 522 WCET Analysis Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
On the Relation Between Simulation-based and SAT-based Diagnosis CMPE 58Q Giray Kömürcü Boğaziçi University.
Algorithm Analysis 1.
Software Testing.
Structural testing, Path Testing
CSCI1600: Embedded and Real Time Software
Evaluation and Validation
Programming Fundamentals (750113) Ch1. Problem Solving
Estimating Timing Profiles for Simulation of Embedded Systems
Hyesoon Kim Onur Mutlu Jared Stark* Yale N. Patt
Pointer analysis.
Dynamic Hardware Prediction
CSE 373: Data Structures and Algorithms
Processor Pipelines and Static Worst-Case Execution Time Analysis
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Constraint Systems used in Worst-Case Execution Time Analysis Andreas Ermedahl Dept. of Information Technology Uppsala University

September 2000ASTEC/WCET2 Definition of WCET  WCET = Worst possible execution time for a program running on target hardware  One program in isolation  No interrupts or context switches  Other estimates:  Best Case ET = Best case, Inverse of WCET, hard  Average Case ET = Soft real-time, not hard 0tighter safe BCET estimates safe WCET estimates actual BCET actual WCET possible execution times

September 2000ASTEC/WCET3 Uses of WCET Estimates  Hard real-time systems  Scheduling  Schedulability analysis  System dimensioning  Formal verification  Program performance tuning void foo(int j, int a[]) { int i; for(i=100, i>0; i--) { if(j>50) a[i] = 2 * i; else a[i] = i; }  ?

September 2000ASTEC/WCET4 Static WCET Analysis  Don’t run the program - analyze it!  Guaranteed safe WCET  Trying to be as tight as possible  Provided all input is correct 0tighter safe BCET estimates safe WCET estimates actual BCET actual WCET possible execution times Static analysis will give results in the safe area Measurement will give results in the unsafe area

September 2000ASTEC/WCET5 Static WCET Analysis  Flow analysis  Determine the dynamic behavior of program  Low level analysis  Determine execution time for program parts on the hardware  Calculation  Combine flow and low-level times to give a WCET estimate. Compiler Object Code Target Hardware Reality program Actual WCET Low level analysis Calculation Flow analysis Analysis WCET Estimate Actual WCET WCET Estimate

September 2000ASTEC/WCET6 WCET Analysis Architecture Compiler Program Flow Analysis Intermediate Code Cache Analysis Cache Info Simulator Pipeline Analysis WCET Calculation Constraint Problem Flow Info Object Code  Modularization of WCET analysis  Several separate analysis steps  Make the analysis more retargetable Flow Fact Conversion  All analysis results are converted to constraints

September 2000ASTEC/WCET7 Example program Flow Info Characteristics do { if(...) do { if(...)... else... if(...)... else... } while(...) else... } while(...)... Basic finiteness Statically allowed Actual feasible paths // A // B // C // D // E // F // G // H // I // J Structurally possible flows (infinite) Relation between possible executions and flow info max = 10 max = 20 samepath(D,G) WCET found here = desired result A B C D F G H E Basic block graph J I WCET found here = overestimation overestimation

September 2000ASTEC/WCET8  Program model:  Basic block graph: nodes and edges  Execution count variable (x entity ) holds number of times entity gets executed Foo() C A B D E F G end Count Variables XAXAXAXA XBXBXBXB XCXCXCXC XDXDXDXD XEXEXEXE XFXFXFXF XGXGXGXG  x node for nodes X GA X AB X BC X BD X DE X EG X CE X EF X FG X fooA  x edge for edges

September 2000ASTEC/WCET9  Constraints: Foo() C A B D E F G end Constraints Generated XAXAXAXA XBXBXBXB XCXCXCXC XDXDXDXD XEXEXEXE XFXFXFXF XGXGXGXG X GA X AB X BC X BD X DE X EG X CE X EF X FG X fooA X foo =1 X end =1  Start and end condition X AB =X A X E =X CE +X DE X A =X fooA +X GA X BC +X BD =X B  Program structure X A <=100  Loop bounds X C +X F <=X A  Other flow information

September 2000ASTEC/WCET10 A B Pipeline Analysis  Time for a basic block:  Time from first instruction enters pipeline to last instruction leaves pipeline t A = 7 B IF EX M F t B = 5 IF EX M F A IF EX M F

September 2000ASTEC/WCET11 A B Pipeline Analysis  Pipeline overlap between basic blocks  Timing effect of going from A to B is negative to indicate pipeline overlap  We use a general purpose simulator to extract times for nodes and edges t A = 7 B IF EX M F t B = 5 t AB = 10  AB = -2  AB = t AB - t A - t B = = IF EX M F 10 IF EX M F A IF EX M F

September 2000ASTEC/WCET12 Pipeline Analysis Result Result: Foo() C A B D E F G end  Each edge annotated with pipeline timing effect t GA =-1 t AB =-2 t BC =-3 t BD =-5 t DE =-2 t EG =-2 t CE =-1 t EF =-3 t FG =-3 t fooA =-4  Each basic block annotated with its execution time t A =7 t D =2 t B =5 t C =12 t E =4 t F =8 t G =20

September 2000ASTEC/WCET13  WCET= max  (x entity * t entity )  Where each x entity satisfies all constraints Foo() C A B D E F G end t A =7 t D =2 t B =5 t C =12 t E =4 t F =8 t G =20 IPET Calculation XAXAXAXA XBXBXBXB XCXCXCXC XDXDXDXD XEXEXEXE XFXFXFXF XGXGXGXG X GA X AB X BC X BD X DE X EG X CE X EF X FG X fooA X foo =1 X AB =X A X E =X CE +X DE X A =X fooA +X GA X BC +X BD =X B X A <=100 X C +X F =100

September 2000ASTEC/WCET14  Solution methods:  Integer linear programming  Constraint satisfaction  Solution:  Counts for each individual node and edge  The value of the WCET Foo() C A B D E F G end Calculation methods X A =100 X B =100 X C =100 X D =0 X E =100 X F =0 X G =100 WCET=4800 X foo =1 X end =1

September 2000ASTEC/WCET15  Some flow information complicates the picture  Examples:  Local semantics: “For each entry of inner loop...”  Partially valid flow info: “During iterations 5 to 10 of inner loop it holds that...”  Loop dependencies: ”Number of iterations of inner loop depends on current iteration of outer”  Non-linear constraints: ”If D was taken then K will be taken once” B C D E G H I F J A LK Complicating Flow Information

September 2000ASTEC/WCET16 scope foo scope loop Local semantics  Create entry count variable: x entry(scope) holds number of times loop is entered  Local flow info are raised to the global level  For example: loop:[ ]:X H  10 gets converted to: gets converted to: X H  10 * X entry(loop) X H  10 * X entry(loop) B C D E G H I F J A Scope graph “For each entry of the loop block H will be executed at most 10 times” “Block H can not be executed more than 10 * the number of times the loop is entered” x entry(loop)

September 2000ASTEC/WCET17 scope loop Partial Flow Information B A C D F  Facts can (partially) overlap scope:range  Virtual scopes: scope:range let facts be valid for complete range of iterations G E Loop bound: 20 loop : 1..5 : X C =5 (f1) loop : : X C + X F  8 (f2) loop:1..2 {f1} loop:3..5 {f1,f2} loop:6..10 {f2} loop: { } X C = X C + X C + X C + X C X C + X C =5 (f1)

September 2000ASTEC/WCET18 scope loop Partial Flow Information B A C D F  Graph is unrolled according to overlapping flow info  Can generate large graphs  Flow information often local (but can stretch over loop borders)  Dependent flow info can be used to consider subpart of graph in isolation G E loop:1..2 {f1} loop:3..5 {f1,f2} loop:6..10 {f2} Fact f1 and f2 only overlaps iterations 1..10

September 2000ASTEC/WCET19  Some flow info generates non-linear constraints  ”Number of iterations of inner loop depends on current iteration of outer” outer: X B  55 or outer: X A * X A  X B  ”If D was taken then K will be taken once” if X D > 0 then X K > 0 and if X D = 0 then X K = 0  More powerful solver needed? B C D E G H I F J A LK Non-linear Constrains

September 2000ASTEC/WCET20 WCET Tool Prototype  Prototype tool implemented  Works over whole program or use flow info to work bottom up over smaller program parts  Fast solution times when testing with CPLEX or similar solver (a network flow problem?)  We use integer linear programming (ILP) and lp_solve()  Not all flow information can be handled  Rather fast calculation times  Flow information sometimes generates large graphs and solution times  Other WCET research: Expressing hardware effects using constraints generates huge constraint systems and large solution times

September 2000ASTEC/WCET21 Experimental Results  Small programs: fast calculation (even with complex structure and flow)  Larger programs: Flow information slows down but increase precision  Example program: Nsichneu  Automatically generated program with massive amount of if-statements (> 250)

September 2000ASTEC/WCET22 Questions  What constraint solver should we use?  Are the generated constraints of a certain type?  More comments....

The End!