48
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Performance Analysis of Embedded Systems Lothar Thiele ETH Zurich

Performance Analysis of  Embedded Systems

Embed Size (px)

DESCRIPTION

Performance Analysis of  Embedded Systems. Lothar Thiele ETH Zurich. Overview. Review of General Aspects Modular Performance Analysis Real-Time Calculus Modeling Application Scenarios. Communication Templates. Computation Templates. DSP. SDRAM. ECU. RISC. CAN interface. m C. - PowerPoint PPT Presentation

Citation preview

Page 1: Performance Analysis of  Embedded Systems

1Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Performance Analysis of Embedded Systems

Lothar Thiele

ETH Zurich

Page 2: Performance Analysis of  Embedded Systems

2Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Review of General Aspects

Modular Performance Analysis

Real-Time Calculus

Modeling

Application Scenarios

Page 3: Performance Analysis of  Embedded Systems

3Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

System Composition

Scheduling and ArbitrationTemplates

proportionalshareWFQ

staticdynamicfixed priority

EDFTDMA

FCFS

Communication Templates Computation Templates

DSPDSP

CC CANinterface

CANinterface

SDRAMSDRAM

RISCRISCECUECU

Architecture

RISCRISCSDRAM

SDRAM

ECUECU

priority

EDF

ECUECU

Page 4: Performance Analysis of  Embedded Systems

4Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Role of Performance Estimation

Design validation:• equivalence of specification and

implementation• validation of non-functional aspects (power

consumption, throughput, delay)

Prerequisite for design space exploration:• part of feedback cycle in design

Performance estimation methods:• use of simulation, trace-based estimation

and analytic methods

Page 5: Performance Analysis of  Embedded Systems

5Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Design Space Exploration

Application Architecture

Mapping

Estimation

Takes place on several levels of abstractionTakes place on several levels of abstraction

Page 6: Performance Analysis of  Embedded Systems

6Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Why Is Estimation Difficult ?Non-determinism: • Uncertain system environment (different load

scenarios, unknown (worst case) input patterns).• Data dependent functional behavior.

Analyzability:• Complex hardware and software interactions in

processing nodes, communication components, scheduling and arbitration policies.

• Use of abstractions in analysis -> non-determinism.Interference: • Internal data streams interact on computing and

communication resources.• This interference determines stream characteristics

(cyclic dependency).

Page 7: Performance Analysis of  Embedded Systems

7Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Why is Estimation Difficult ?

EPUEPU

EPUEPU

EPUEPU

EPUEPU

applicationstructure

hardwareplatform

Page 8: Performance Analysis of  Embedded Systems

8Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Bounds, Guarantees and Predictability

t0 bestcase

worstcase

upperbound

lowerbound

variation of execution time

w.c. performance

w.c. guarantee

best case predictability worst case predictability

Page 9: Performance Analysis of  Embedded Systems

9Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Review of General Aspects

Composable Performance Analysis

Real-Time Calculus

Modeling

Application Scenarios

Page 10: Performance Analysis of  Embedded Systems

10Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

A Four-Step Approach

1. Abstraction: Build abstract models for “first class citizens”event streams -> abstract event streamsarchitecture elements -> resource modulesapplication processes -> performance modules

2. Performance Components: Combine performance modules using resource sharing information

3. Performance Network: Combine all models to a network that represents the performance aspects

4. Analysis

Page 11: Performance Analysis of  Embedded Systems

11Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

The “Big Picture”

Application Specification

Abstract Application

Abstract Architecture

Architecture Specification

Performance Network

T1 T2 T3

ARM9 DSP

loadscenario

s

architecture

elements

mapping relations

application

process

event streams

resourcemodules

performancemodules

abstract event

streams

abstract load

scenarios

performance

components

Page 12: Performance Analysis of  Embedded Systems

12Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 1: Abstract Application Model

From a functional model…

event stream applicationprocess

(e.g. StateCharts … )

Page 13: Performance Analysis of  Embedded Systems

13Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 1: Abstract Functional Units

… to an abstract application model

performance

moduleabstract

event stream

abstractresource stream

How do we calculate with abstract event streams and resources units?How do we calculate with abstract

event streams and resources units?

We use Real-Time Calculus!(min-max algebra)

We use Real-Time Calculus!(min-max algebra)

Page 14: Performance Analysis of  Embedded Systems

14Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 2: Build Performance Components

How do we do scheduling?How do we do scheduling?

Page 15: Performance Analysis of  Embedded Systems

15Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 2: Scheduling I

Fixed Priorit

y(FP)

Page 16: Performance Analysis of  Embedded Systems

16Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 2: Scheduling II

share

Generalized

Processor Sharing(GPS)

Performance component of a

combined HW/SW/OS module; exposes

performance properties but hides

implementation

Page 17: Performance Analysis of  Embedded Systems

17Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Step 3 and 4: Compose and Analyze

ARM9 DSP2Bus DSP1

’’ ’’ ’ ’

FP GPS FP

GPS GPS FP

’ ’

Application 1

Application 2

How can we compose performance modules ?

How can we compose performance modules ?

How can we add a new application?How can we add a new application?How can we estimate the load on resources?

How can we estimate the load on resources?

How can we estimate delay and memory?How can we estimate delay and memory?

Page 18: Performance Analysis of  Embedded Systems

18Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Dynamic Analytic Models

inputtraces

model ofenvironm

entformalspecific

.

formalspecificatio

n

systemmodel

analysis

datasheets

model ofcomponent

s

program

analysis

estimationresults

Page 19: Performance Analysis of  Embedded Systems

19Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Review of General Aspects

Modular Performance Analysis

Real-Time Calculus

Modeling

Application Scenarios

Page 20: Performance Analysis of  Embedded Systems

20Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Scheduling AbstractionIdea:• unified view of task scheduling, arbitration

and output scheduling in networks:

• methods:• queueing theory (statistical bounds, Markov

chains)• real-time calculus (worst case bounds, min-max

algebra)

Page 21: Performance Analysis of  Embedded Systems

21Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Foundations of Real-Time-Calculus

Linear System Theory [Baccelli, Cohen, Olsder, Quadrat 1992]

Calculus for Networks [Le Boudec 1998, 2001], [Cruz 1991]

Adversarial Queuing Theory [Andrews, Borodin, Kleinberg, Leighton, … 1996]

End-to-end deadlines [Parekh, Gallager 1994]

Page 22: Performance Analysis of  Embedded Systems

22Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Event and Resource Models

How do we describe uncertain event streams and resources?How do we describe uncertain event streams and resources?

Page 23: Performance Analysis of  Embedded Systems

23Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Arrival and Service Curves

Page 24: Performance Analysis of  Embedded Systems

24Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

max: 2 packetsmin: 0 packetsmax: 3 packetsmin: 1 packet

u

l

Event & Resource Models

Use arrival curves to capture packet streams:

time t

max: 1 packetmin: 0 packets

0 1 2

# of packets

1

2

3

Page 25: Performance Analysis of  Embedded Systems

25Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Arrival Curves

Use the concept of arrival curves !

How do we describe uncertain input streams ? How do we describe uncertain input streams ?

maximum/minimum number of packets

in any interval of length 4

number of packetsin time interval [0,4]

],[ luR ],[ luR

Page 26: Performance Analysis of  Embedded Systems

26Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Service Curves

Use the concept of service curves !

How do we describe uncertain resources ? How do we describe uncertain resources ?

maximum/minimum computing power in

any interval of length 2

computing powerin time interval [0,2]

],[ luC ],[ luC

Page 27: Performance Analysis of  Embedded Systems

27Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Arrival and Service Curves

What else:• sub- and super-additivity• relation to max-+ algebra• operations correspond to convolution

RR

CC

CC

RR

inf

infsup

sup

Page 28: Performance Analysis of  Embedded Systems

28Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Transformation of Curves by Modules

],[ ul

],[ ul

]','[ ul

Page 29: Performance Analysis of  Embedded Systems

29Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Performance Modules

],[ ul

],[ ul

],[ ul

],[ ul

wvwv0inf

wvwv0sup

wvwv

0sup

wvwv 0

inf

wvwv ,min

uluuu ])([

llull ])[(

0 luu 0 ull

Page 30: Performance Analysis of  Embedded Systems

30Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Compose and AnalyzePDSPI/O bus

fixedprio.

prop.share

fixedprio.

fixedprio.

],[ ua

la

]','[ ua

la

],[ ub

lb

]','[ ub

lb

]','[ //u

OIl

OI ]','[ ubus

lbus ]','[ u

DSPl

DSP ]','[ uP

lP

Page 31: Performance Analysis of  Embedded Systems

31Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Compose and Analyze

delay d

backlog b

service curve l

arrival curve u

b

],[ ul

],[ ul

Page 32: Performance Analysis of  Embedded Systems

32Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Everything Together

App. Model

Architecture Model

PerformanceNetwork

AllocationBinding

Scheduling resourcemodel

performancememory

delay

application structure

inputstreammodel

TDMA

fixedpriorit

y

WFQ

Page 33: Performance Analysis of  Embedded Systems

33Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Review of General Aspects

Modular Performance Analysis

Real-Time Calculus

Modeling

Application Scenarios

Page 34: Performance Analysis of  Embedded Systems

34Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Open QuestionsHow do we model different event types and correlation in event streams ?How do we model type-dependent processing (different modes of operation, example MPEG coding and decoding) ?How do we model caches ?

Use more involved abstractions,for example finite state automataUse more involved abstractions,

for example finite state automata

Page 35: Performance Analysis of  Embedded Systems

35Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Refined Abstractions using FSMs

Page 36: Performance Analysis of  Embedded Systems

36Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Event Stream Model

F#events vs. time interval order of events

Page 37: Performance Analysis of  Embedded Systems

37Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Functional Unit Model

FSM can modelarchitecture detailsprogram flowscheduling policiestype-dependent behavior

Improvement in estimation quality in several application studies.

input_event/resource_demand/output_event

Page 38: Performance Analysis of  Embedded Systems

38Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Additional Analysis MethodsAnalyze timed FSMs with respect to their timing properties. For example:

Applicable methods: minimum cycle mean [Karp], periodic graphs [Cohen, Dubois, Quadrat]

minimal and maximal accumulated delay/demand/eventsfor n consecutive transitions(and its inverse) in a compactrepresentation

minimal and maximal accumulated delay/demand/eventsfor n consecutive transitions(and its inverse) in a compactrepresentation

Page 39: Performance Analysis of  Embedded Systems

39Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Missing Link(s)Link to lower layer analysis methods (like abstract interpretation)

assembler programassembler program model of computer architecture

model of computer architecture

analysisanalysis

a,b,c d,e,f,g

Page 40: Performance Analysis of  Embedded Systems

40Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Overview

Review of General Aspects

Modular Performance Analysis

Real-Time Calculus

Modeling

Application Scenarios

Page 41: Performance Analysis of  Embedded Systems

41Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

ExperiencesNetwork processor modeling (IBM)• Detailed study of a network processor• Good match between simulation and

analytic methods (delay, memory)Use of methodology in other projects and case studies• BridgeCo• Siemens• Netmodule

Implementation and integration into design space exploration

Page 42: Performance Analysis of  Embedded Systems

42Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Application ModelExample of a simple stream processing task structure:

Page 43: Performance Analysis of  Embedded Systems

43Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Architecture ModelIn general, we assume an arbitrary heterogeneous architecture consisting of computing resources, memory and communication resources.

Page 44: Performance Analysis of  Embedded Systems

44Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Design Space Exploration Strategy

Page 45: Performance Analysis of  Embedded Systems

45Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Exploration Cycle

EXPO – Tool architecture

MOSES

EXPO SPEA 2

selectionof “good” architectures

system architectureperformance values

task graph, scenario graph,

flows & resources

Page 46: Performance Analysis of  Embedded Systems

46Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

EXPO - Tool

Tool available online:http://www.tik.ee.ethz.ch/expo/expo.html

Tool available online:http://www.tik.ee.ethz.ch/expo/expo.html

Page 47: Performance Analysis of  Embedded Systems

47Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Results

Performance for encryption/decryption

Performance forRT voice processing

Page 48: Performance Analysis of  Embedded Systems

48Swiss FederalInstitute of Technology

Computer Engineeringand Networks Laboratory

Acknowledgement

The presentation contains contributions by • Samarjit Chakraborty• Matthias Dyer• Simon Künzli• Matthias Gries• Alexander Maxiaguine