precise continuous non-intrusive measurement-based execution … · 2016. 9. 30. · multi-core...

98
Precise Continuous Non-Intrusive Measurement-Based Execution Time Estimation Boris Dreyer, Christian Hochberger, Simon Wegener, Alexander Weiss

Upload: others

Post on 03-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Precise Continuous Non-Intrusive Measurement-Based

Execution Time Estimation

Boris Dreyer, Christian Hochberger, Simon Wegener, Alexander Weiss

Page 2: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

This work was funded within the project CONIRAS by the German Federal Ministry for Education and Research with the funding ID 01IS13029. The responsibility for the content remains with the authors.

Page 3: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The Setting

Page 4: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The Timing Problem

Page 5: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Problem Solved?

Reinhard Wilhelm et al.: The Worst-case Execution Time Problem

— Overview of Methods and Survey of Tools

ACM Transactions on Embedded Computing Systems, Vol. 7, No. 3, April 2008.

CONCLUSIONS

„The problem of determining upper bounds on execution

times for single tasks and for quite complex processor

architectures has been solved. Several commercial WCET

tools are available and have experienced very positive

feedback from extensive industrial use.“

Page 6: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Well, almost…

Unpredictable delays due to interference on multi-cores

Unpredictable hardware (e.g. random replacement policies for caches)

Undocumented hardware

⇒Very pessimistic results!

Page 7: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Multi-core Interference-Sensitive WCET Analysis

Leveraging Runtime Resource Capacity Enforcement

ECRTS’14

Page 8: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

PREDATOR : ICT project in the 7th Framework Program of the EU

Predictability Considerations in the Design

of Multi-core Embedded Systems

ERTS 2010

Page 9: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurements?

Karsten Schmidt et al.:

Non-Intrusive Tracing at First Instruction

SAE Technical Paper 2015-01-0176

“In the selected use case, a simple regression test, first a

function trace for a longer time span, and then later on an

instruction trace for a dedicated time span were generated.

This approach (instead of tracing everything across a long

time span) is necessary due to the limited bandwidth to

components outside of the microcontroller.”

Page 10: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Catching the Worst Case

Page 11: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Catching the Worst Case

Page 12: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurements?

Karsten Schmidt et al.:

Non-Intrusive Tracing at First Instruction

SAE Technical Paper 2015-01-0176

“The art of tracing lies in the selection of the proper

abstraction level and time in order to perform safe

regression tests or identify potential issues as fast as

possible. Especially when working under high time pressure

with high costs related to the tests, or when working under

extreme conditions, […], efficiency in tracing is crucial.”

Page 13: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Time stamps

MPSoC (4 CPUs)

Data read

Instructions

CP

U 0

Data written

Time stamps

Data read

Instructions

CP

U 1

Data written

Time stamps

Data read

Instructions

CP

U 2

Data written

Time stamps

Data read

Instructions

CP

U 3

Data written

Bandwith (average): 0,3 .. 4 Bit / Instruction (non-cycle accurate)5 .. 8 Bit / Instruction (cycle accurate)8 Bit / Instruction (data trace)

MPSoC, 4 CPUs, 1 GHzCycle accurate instruction + data trace4 x 14 Bit x 1 GHz => approx. 28 Gbit/s ( + timestamps)( + bus master trace)( + peak bandwidth)

embedded trace based emulation system

Emulator Target

MPSoC

CPUs

peripherals

Emb

edd

ed

trac

e

trace data

Offline analysis

State of The Art: Embedded Trace

Page 14: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Trace Recording and Offline Processing

SoC

Traceport

CPU0

CPU1

CPU2

CPU3

Per

Per

Mem

Mem

Trace tool

SDRAM

Host

Hard disc

Trace data processing

(offline)

SoC vendor’s responsibility

Tool vendor’s responsibility

Results

Drawbacks:

- Not all trace messages go through the SoC‘s trace port due to limited bandwidth - Processing bandwidth of host trace port is smaller than trace port bandwidth - Huge latency for the detection of MPSoC internal states - Restricted to on-chip trigger logic

Page 15: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Solution: Online Analysis of Trace Data

Real-time processing trace tool

Event processing

SoC

Traceport

CPU0

CPU1

CPU2

CPU3

Per

Per

Mem

Mem

Mes

sage

pro

cess

ing

Instrumentation Trace

Data Trace

Ownership Trace

Watchpoint Trace

InstructionInstrution

Reconstruction

Configurable generic event

processing structures Custom

programmable FPGA fabric

Custom programmable

processor

con

figu

rati

on

HLL propositions

compiler

CoreSight / Nexus via parallel, Aurora, PCIe lanes

up to 20 Gbit/s

- Trace bandwidth ≤ processing bandwidth - µs latency for detection of MPSoC internal states - Parallel processing / parallel oberservations

Page 16: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Our Approach

Page 17: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Workflow

Page 18: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Workflow

Page 19: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Page 20: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

Events are generated for each basic block.

Page 21: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

The address of the basic block‘s first instruction.

Page 22: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

A custom field used to efficiently address statistic records in memory

Page 23: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

The loop nesting level of the basic block.

Page 24: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

A field to distinguish two loops with the same nesting level that lie directly after another.

Page 25: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

Is another routine called in the basic block?

Page 26: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

Is a routine entered with this basic block?

Page 27: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

Is a routine exited with this basic block?

Page 28: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Events

(address, tag, level, distinctor, call, entry, exit, return)

Did a return from a called routine happen?

Page 29: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Enter f, Call g

(0x1004, 1, 0, 0, 1, 1, 0, 0)

Page 30: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Enter g, Enter L1

(0x2000, 2, 1, 0, 0, 1, 0, 0)

Page 31: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Enter L2

(0x202c, 3, 2, 0, 0, 0, 0, 0)

Page 32: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Leave L2, Enter L3

(0x2050, 5, 2, 1, 0, 0, 0, 0)

Page 33: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Measurement Configurator

Leave g

(0x207c, 8, 0, 0, 0, 0, 1, 0)

Page 34: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Workflow

Page 35: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Page 36: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x1004

8 cycles

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Page 37: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x2034

2 cycles

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Page 38: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x2034

1 cycle

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Page 39: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x2034

1 cycle

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Pure maximisation gives 2 cycles.

Page 40: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x2034

1 cycle

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Pure maximisation gives 2 cycles.

We want to take typical cache behaviour into account!

Page 41: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Execution Time

of BB @ 0x2034

1 cycle

Event Stream

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

Pure maximisation gives 2 cycles.

Idea: Distinguish between first and all other loop iterations.

Page 42: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Loop Iteration State Machine

A state is a data structure that keeps track of the call stack, the loop nesting level and whether we are in the first or in a later iteration of a loop.

Calling a routine / returning from a routine changes the state.

Entering / leaving a loop changes the state.

Page 43: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The pointer to the active row.

States

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Page 44: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Is the row valid?

States

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Page 45: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The id identifies a loop or a routine.

States

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Page 46: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The index discriminates between first and further iterations.

States

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Page 47: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

State Transformations

(0x1004, 1, 0, 0, 1, 1, 0, 0)

(0x2000, 2, 1, 0, 0, 1, 0, 0)

Routine Call,

Increased Loop Nesting Level

Page 48: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

State Transformations

(0x1004, 1, 0, 0, 1, 1, 0, 0)

(0x2000, 2, 1, 0, 0, 1, 0, 0)

Routine Call,

Increased Loop Nesting Level

Page 49: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

State Transformations

(0x2000, 2, 1, 0, 0, 1, 0, 0)

(0x202c, 3, 2, 0, 0, 0, 0, 0)

Entering a loop

Page 50: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 0

0 0 0

1 1 0

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

State Transformations

(0x2000, 2, 1, 0, 0, 1, 0, 0)

(0x202c, 3, 2, 0, 0, 0, 0, 0)

Entering a loop

Page 51: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 0

0 0 0

1 1 0

State Transformations

(0x2034, 4, 2, 0, 0, 0, 0, 0)

(0x202c, 3, 2, 0, 0, 0, 0, 0)

Recursively entering a loop

Page 52: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

valid id index

→ 1 3 0

1 2 0

0 0 0

1 1 0

State Transformations

(0x2034, 4, 2, 0, 0, 0, 0, 0)

(0x202c, 3, 2, 0, 0, 0, 0, 0)

Recursively entering a loop

Page 53: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

State Transformations

(0x202c, 3, 2, 0, 0, 0, 0, 0)

(0x2050, 5, 2, 1, 0, 0, 0, 0)

Entering a different loop

Page 54: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 0

1 2 0

0 0 0

1 1 0

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

State Transformations

(0x202c, 3, 2, 0, 0, 0, 0, 0)

(0x2050, 5, 2, 1, 0, 0, 0, 0)

Entering a different loop

Page 55: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 0

0 0 0

1 1 0

State Transformations

(0x2050, 5, 2, 1, 0, 0, 0, 0)

(0x206c, 7, 1, 0, 0, 0, 0, 0)

Leaving a loop

Page 56: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

valid id index

→ 1 5 1

1 2 0

0 0 0

1 1 0

State Transformations

(0x2050, 5, 2, 1, 0, 0, 0, 0)

(0x206c, 7, 1, 0, 0, 0, 0, 0)

Leaving a loop

Page 57: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

State Transformations

(0x206c, 7, 1, 0, 0, 0, 0, 0)

(0x207c, 8, 0, 0, 0, 0, 1, 0)

Leaving a loop

Page 58: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

→ 1 8 0

1 1 0

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

State Transformations

(0x206c, 7, 1, 0, 0, 0, 0, 0)

(0x207c, 8, 0, 0, 0, 0, 1, 0)

Leaving a loop

Page 59: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

→ 1 8 0

1 1 0

State Transformations

(0x207c, 8, 0, 0, 0, 0, 1, 0)

(0x101c, 9, 0, 0, 0, 0, 1, 1)

Leaving a routine

Page 60: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

valid id index

0 0 0

0 0 0

→ 1 8 0

1 1 0

State Transformations

(0x207c, 8, 0, 0, 0, 0, 1, 0)

(0x101c, 9, 0, 0, 0, 0, 1, 1)

Leaving a routine

Page 61: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Example

Page 62: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 0 0 0

Example

(?, ?, ?, ?, 1, ?, ?, ?)

first further

1 0 0

2 0 0

3 0 0

4 0 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 63: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Example

(?, ?, ?, ?, 1, ?, ?, ?)

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

first further

1 0 0

2 0 0

3 0 0

4 0 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 64: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

Example

(0x1004, 1, 0, 0, 1, 1, 0, 0) @ t+0

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

first further

1 8 0

2 0 0

3 0 0

4 0 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 65: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 0

0 0 0

1 1 0

Example

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+8

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

first further

1 8 0

2 22 0

3 0 0

4 0 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 66: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 0

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+30

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

first further

1 8 0

2 22 0

3 16 0

4 0 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 67: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

Example

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+46

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

first further

1 8 0

2 22 0

3 16 0

4 2 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 68: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+48

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

first further

1 8 0

2 22 0

3 16 8

4 2 0

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 69: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 0

0 0 0

1 1 0

Example

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+56

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 70: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 0

1 2 0

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+57

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 0 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 71: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 0

1 2 0

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+59

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+71

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 0

6 0 0

7 0 0

8 0 0

9 0 0

Page 72: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 0

0 0 0

1 1 0

Example

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+71

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+73

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 0

6 2 0

7 0 0

8 0 0

9 0 0

Page 73: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 0

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+73

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+79

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 6

6 2 0

7 0 0

8 0 0

9 0 0

Page 74: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 0

0 0 0

1 1 0

Example

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+79

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+80

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 6

6 2 1

7 0 0

8 0 0

9 0 0

Page 75: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 0

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+80

(0x206c, 7, 1, 0, 0, 0, 0, 0) @ t+83

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 6

6 2 1

7 0 0

8 0 0

9 0 0

Page 76: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 1

0 0 0

1 1 0

Example

(0x206c, 7, 1, 0, 0, 0, 0, 0) @ t+83

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+91

first further

1 8 0

2 22 0

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 77: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 1

0 0 0

1 1 0

Example

(0x2000, 2, 1, 0, 0, 1, 0, 0) @ t+91

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+102

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 78: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 0

1 2 1

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+102

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+110

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 79: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 1

0 0 0

1 1 0

Example

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+110

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+112

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 80: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 1

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+112

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+119

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 81: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 3 1

1 2 1

0 0 0

1 1 0

Example

(0x2034, 4, 2, 0, 0, 0, 0, 0) @ t+119

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+120

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 82: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 0

1 2 1

0 0 0

1 1 0

Example

(0x202c, 3, 2, 0, 0, 0, 0, 0) @ t+120

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+122

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 83: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 0

1 2 1

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+122

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+126

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 84: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 1

0 0 0

1 1 0

Example

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+126

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+127

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 6

6 2 1

7 8 0

8 0 0

9 0 0

Page 85: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 1

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+127

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+135

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 0

8 0 0

9 0 0

Page 86: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

→ 1 5 1

1 2 1

0 0 0

1 1 0

Example

(0x205c, 6, 2, 1, 0, 0, 0, 0) @ t+135

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+136

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 0

8 0 0

9 0 0

Page 87: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

→ 1 2 1

0 0 0

1 1 0

Example

(0x2050, 5, 2, 1, 0, 0, 0, 0) @ t+136

(0x206c, 7, 1, 0, 0, 0, 0, 0) @ t+139

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 0

8 0 0

9 0 0

Page 88: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

→ 1 8 0

1 1 0

Example

(0x206c, 7, 1, 0, 0, 0, 0, 0) @ t+139

(0x207c, 8, 0, 0, 0, 0, 1, 0) @ t+143

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 4

8 0 0

9 0 0

Page 89: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 1 1 0

Example

(0x207c, 8, 0, 0, 0, 0, 1, 0) @ t+143

(0x101c, 9, 0, 0, 0, 0, 1, 1) @ t+149

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 4

8 6 0

9 0 0

Page 90: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

valid id index

0 0 0

0 0 0

0 0 0

→ 0 0 0

Example

(0x101c, 9, 0, 0, 0, 0, 1, 1) @ t+149

(?, ?, ?, ?, ?, ?, ?, 1) @ t+155

first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 4

8 6 0

9 6 0

Page 91: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Example first further

1 8 0

2 22 11

3 16 8

4 2 1

5 12 8

6 2 1

7 8 4

8 6 0

9 6 0

Overall execution time estimate:

Our method: 191 cycles

Context insensitive: 258 cycles

Page 92: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Implementation

Page 93: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

FPGA Implementation

We are currently building a prototype based on a Xilinx Virtex 7 FPGA (xc7v585t) and RLDRAM.

Most complicated part is the connection to the SoC‘s trace interface (i.e. event generation).

Page 94: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Resource Usage on FPGA

Loop Iteration State Machine (~ 180 MHz)

3 BRAMs

470 Registers

398 LUTs

Statistics Module (~ 130 MHz)

7 BRAMs

481 Registers

406 LUTs

Page 95: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

Conclusion

Page 96: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The CONIRAS Approach

Precise

We account for typical (instruction) cache behaviour.

Continuous

We perform direct online aggretation at runtime.

Non-intrusive

We use the hardware support of modern SoCs.

Measurement-Based Execution Time Estimation

Page 97: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

The CONIRAS Approach

⇒ Reduced pessimism

⇒ Improved observability

⇒ Scalability

⇒ Statistics instead of piles of data

Page 98: Precise Continuous Non-Intrusive Measurement-Based Execution … · 2016. 9. 30. · Multi-core Interference-Sensitive WCET Analysis Leveraging Runtime Resource Capacity Enforcement

98