WCET Analysis of ARM Processors using Real-Time Model Checking - - PowerPoint PPT Presentation

wcet analysis of arm processors using real time model
SMART_READER_LITE
LIVE PREVIEW

WCET Analysis of ARM Processors using Real-Time Model Checking - - PowerPoint PPT Presentation

WCET Analysis of ARM Processors using Real-Time Model Checking Andreas Engelbredt Dalsgaard Mads Christian Olesen Martin Toft Ren e Rydhof Hansen Kim Guldstrand Larsen { andrease,mchro,mt,rrh,kgl } @cs.aau.dk Department of Computer Science


slide-1
SLIDE 1

WCET Analysis of ARM Processors using Real-Time Model Checking

Andreas Engelbredt Dalsgaard Mads Christian Olesen Martin Toft Ren´ e Rydhof Hansen Kim Guldstrand Larsen

{andrease,mchro,mt,rrh,kgl}@cs.aau.dk

Department of Computer Science Aalborg University Denmark

June 22, 2009

slide-2
SLIDE 2

Introduction The METAMOC Method Experiments Future Work Further Information

Our Contribution

Modular method for finding Worst-Case Execution Times Handles a real-world modern processor Tested on real programs; the M¨ alardalen benchmark programs Efficient implementation

2/23

slide-3
SLIDE 3

Introduction The METAMOC Method Experiments Future Work Further Information

Introduction

RTSs need WCETs for all processes, for reliable scheduling WCETs need to be approximated: Overapproximation, but not pessimistic

3/23

slide-4
SLIDE 4

Introduction The METAMOC Method Experiments Future Work Further Information

The METAMOC Method

4/23

slide-5
SLIDE 5

Introduction The METAMOC Method Experiments Future Work Further Information

Prototype Implementation

ARM9TDMI processor core

ARM920T ARM922T ARM940T

Five stage pipeline Separate instruction and data caches Does not suffer from timing anomalies

Assume local worst-case 5/23

slide-6
SLIDE 6

Introduction The METAMOC Method Experiments Future Work Further Information

Prototype Implementation

6/23

slide-7
SLIDE 7

Introduction The METAMOC Method Experiments Future Work Further Information

Prototype Implementation

7/23

slide-8
SLIDE 8

Introduction The METAMOC Method Experiments Future Work Further Information

Path Analysis

Reconstruct CFG from binary Construct path model based on CFG Combine with pipeline, cache and main memory models Model check combined timed automata

sup: cyclecounter 8/23

slide-9
SLIDE 9

Introduction The METAMOC Method Experiments Future Work Further Information

Path Analysis

Timed automaton for every function Transitions emulate instruction execution

instradr[PFS] = 0, instrtype[PFS] = INSTR_OTHER, dataadr[PFS] = INVALID_ADDRESS, ... loop_counter_1 = 0 ... fib_branch! i0x50_bx_lr MORE FUNCTION BODY i0x4_push_lr_ i0x0_cmp_r0_1 fib_branch? fetch! fetch!

Functions handled flow-sensitively

9/23

slide-10
SLIDE 10

Introduction The METAMOC Method Experiments Future Work Further Information

Path Analysis

Assembly level jumps

fetch! ... fetch! fetch! fetch! ... loop_counter == loop_bound ... ... loop_counter++ ... loop_counter < loop_bound fetch!

10/23

slide-11
SLIDE 11

Introduction The METAMOC Method Experiments Future Work Further Information

Cache Analysis

Concrete cache model

Unknown memory block Write allocate/Write back No write allocate/Write through Replacement policy Size parameters

Always miss cache model Abstract cache model

Abstract cache analysis like Wilhelm et al. 11/23

slide-12
SLIDE 12

Introduction The METAMOC Method Experiments Future Work Further Information

Abstract Cache Analysis

Avoid non-determinism Smaller state space Calculate which memory blocks MUST be in the cache at a CFG-node At join-points merge the results from the predecessors

12/23

slide-13
SLIDE 13

Introduction The METAMOC Method Experiments Future Work Further Information

Abstract Cache Analysis

12/23

slide-14
SLIDE 14

Introduction The METAMOC Method Experiments Future Work Further Information

Abstract Cache Analysis

Implemented using model checking

Clocks and stop watches

Already done Works well with FIFO replacement policy Not integrated (difficult)

New data type in UPPAAL 13/23

slide-15
SLIDE 15

Introduction The METAMOC Method Experiments Future Work Further Information

Value Analysis

The cache analysis needs concrete memory addresses Registers are used as base and offset in many memory accesses Value analysis: Find an overapproximation of possible register values at all execution points of a process Weighted push-down systems (WPDSs) used for inter-procedural, control-flow sensitive value analysis Presented by Reps et al. in Program Analysis using Weighted Push-Down Systems

14/23

slide-16
SLIDE 16

Introduction The METAMOC Method Experiments Future Work Further Information

Value Analysis

WPDS: Push-down system (PDS), weight domain, and mapping between PDS rules and weight domain elements Weighted Automata Library (WALi) implements a number of WPDS algorithms WPDSs allow taking the inter-procedural control-flow into account Implemented simple value analysis, using:

Loop unrolling Simple register-value tracking No tracking of values in memory Finds good amount of values for some programs, but could be much better 15/23

slide-17
SLIDE 17

Introduction The METAMOC Method Experiments Future Work Further Information

Pipeline Analysis

Pipeline analysis: Take the effect of pipelining into account in order to determine sharper WCETs Five stages in the ARM9TDMI processor core Stalls due to inter-dependencies

ARM decode Thumb decode

  • Reg. address

decode

  • Reg. address

decode Register read Register read

Decode Writeback Memory

Memory data access

Execute

ALU Shifter load data writeback ALU result and/or

Fetch

Fetch instruction from instruction cache

  • r main memory

16/23

slide-18
SLIDE 18

Introduction The METAMOC Method Experiments Future Work Further Information

Pipeline Analysis

Modelled as a network of timed automata in UPPAAL Synchronisation between function automata and the fetch stage automaton Synchronisation between stage automata for the instructions to “flow” through the data path Cyclic stage automata

17/23

slide-19
SLIDE 19

Introduction The METAMOC Method Experiments Future Work Further Information

Pipeline Analysis

Time must be bounded for sup: cyclecounter to give non-trivial guarantees A signaling system is needed

18/23

slide-20
SLIDE 20

Introduction The METAMOC Method Experiments Future Work Further Information

Experiments

Conducted on the concrete implementation for the ARM920T processor Examine three qualities:

Size and complexity of processes How much sharper WCETs are found by taking caching into account Resource usage (time and memory)

No evaluation of the pipeline No reference WCETs available Benchmark programs from the WCET Analysis Project by M¨ alardalen Real-Time Research Center

Wide selection of computation tasks Used to benchmark WCET analysis methods 19/23

slide-21
SLIDE 21

Introduction The METAMOC Method Experiments Future Work Further Information

Experiments

The most interesting findings:

Taking the instruction cache into account yields WCETs that are up to 97% sharper (78% on average at -O2) Taking the data cache into account yields WCETs that are up to 68% sharper (31% on average at -O2) Almost all results are obtained within five minutes 20/23

slide-22
SLIDE 22

Introduction The METAMOC Method Experiments Future Work Further Information

Experiments

The most interesting findings:

Taking the instruction cache into account yields WCETs that are up to 97% sharper (78% on average at -O2) Taking the data cache into account yields WCETs that are up to 68% sharper (31% on average at -O2) Almost all results are obtained within five minutes

Some programs fail due to

State space explosion (9) Write to program counter (2) Floating point operations Value analysis problems 20/23

slide-23
SLIDE 23

Introduction The METAMOC Method Experiments Future Work Further Information

Experiments

The most interesting findings:

Taking the instruction cache into account yields WCETs that are up to 97% sharper (78% on average at -O2) Taking the data cache into account yields WCETs that are up to 68% sharper (31% on average at -O2) Almost all results are obtained within five minutes

Some programs fail due to

State space explosion (9) Write to program counter (2) Floating point operations Value analysis problems

We are able to analyse 14 out of the 25 non-floating point benchmarks!

20/23

slide-24
SLIDE 24

Introduction The METAMOC Method Experiments Future Work Further Information

Future Work

Integration of abstract caches Improve the path analysis Better value analysis Explore other ways to model the hardware platform Support for floating point operations Support for other hardware architectures Incorporate schedulability analysis

Reducing schedulability analysis to reachability like in the Schedulability Analyzer for Real-Time Systems (SARTS) tool by Bøgholm et al. 21/23

slide-25
SLIDE 25

Introduction The METAMOC Method Experiments Future Work Further Information

Further Information

The extended abstract, our master’s thesis, the accompanying source code, and these slides are available at http://metamoc.martintoft.dk Questions?

22/23

slide-26
SLIDE 26

THE END

slide-27
SLIDE 27

THE END