analysis (ii) modular performance analysis (real-time ... · acm trans. embed. comput. syst.,...
TRANSCRIPT
Kai Huang
Analysis (II) Modular Performance Analysis
(Real-Time Calculus)
Timing analysis in general
Real-Time Calculus
MPA
1/2/2014 Kai.Huang@tum 2
Outline
1/2/2014 Kai.Huang@tum 3
Timing Analysis Overview
R. Wilhelm, J. Engblom, A. Ermedahl, N. Holsti, S. Thesing, D. Whalley, G. Bernat, C. Ferdinand, R. Heckmann, T. Mitra, F. Mueller, I. Puaut, P. Puschner, J. Staschulat, and P. Stenstr om. The worst-case execution-time problem—overview of methods and survey of tools. ACM Trans. Embed. Comput. Syst., 7(3):1–53, 2008
Formal Analysis vs. Simulation
e.g. delay
Real System Simulation Formal analysis
Best-Case
Worst-Case upper bound
lower bound
1/2/2014 4 Kai.Huang@tum
Analysis and Design
Analysis: Infer system properties from subsystem properties.
Design: Build a system from subsystems while meeting requirements.
Embedded System = Computation + Communication + Resource Interaction
1/2/2014 5 Kai.Huang@tum
Modular Performance Analysis
Service Model (Resources)
Load Model (Environment)
Performance Model
Processing Model (HW/SW)
Analysis
Analysis Results
Input traces
Formal specification
System Model
Application Architecture
Mapping Scheduling
UML sequence diagrams
Task graphs UML/SysML
diagrams
Formal specification
Component simulation
Measure- ments
Data sheets
1/2/2014 6 Kai.Huang@tum
Abstract Models for Performance Analysis
Concrete Instance
Abstract Representation
Processor
Task
Input Stream
Service Model
Load Model
Processing Model
1/2/2014 7 Kai.Huang@tum
Modular System Composition CPU BUS DSP
RM TDMA
GPC GPC
GPC GPC
GPC GSC
TDMA
1/2/2014 8 Kai.Huang@tum
Abstract Models for Performance Analysis
Concrete Instance
Abstract Representation
Processor
Task
Input Stream R(t) R’(t)
C(t)
Service Model
Load Model
Processing Model ()
()
1/2/2014 9 Kai.Huang@tum
Timing analysis in general
Real-Time Calculus
MPA
1/2/2014 Kai.Huang@tum 10
Outline
Event Stream Model: Arrival Curves
4
2 3
time [ms]
events Event Stream
maximum / minimum arriving demand in any interval of length 2.5 ms
2.5
Arrival Curve demand
interval [ms] 2.5
number of events in in t=[0 .. 2.5] ms
1/2/2014 11 Kai.Huang@tum
Service Model (Resources)
t [ms]
availability
Resource Availability
maximum/minimum available service in any interval of length 2.5 ms
available service in t=[0 .. 2.5] ms
2.5
Service Curves service
D [ms] 2.5
1/2/2014 12 Kai.Huang@tum
A common event pattern that is used in literature can be specified by the parameter triple (p, j, d), where p denotes the period, j the jitter, and d the minimum inter-arrival distance of events in the modeled stream.
Example 1: Event Arrival Model
periodic
p
periodic jitter
p j d
1/2/2014 13 Kai.Huang@tum
Example 1: Periodic (with Jitter)
periodic periodic with jitter
1/2/2014 14 Kai.Huang@tum
Example 1: (p, J, d) model
1/2/2014 15 Kai.Huang@tum
Consider a real-time system consisting of n applications that are executed on a resource with bandwidth B that controls resource access using a TDMA policy.
Analogously, we could consider a distributed system with n communicating nodes, that communicate via a shared bus with bandwidth B, with a bus arbitrator that implements a TDMA policy.
TDMA policy: In every TDMA cycle of length , one single resource slot of length si is assigned to application i.
Example 2: TDMA Resource
c c
appl.1 appl.2 appl. n appl.1 appl.2 appl. n
sn
... ...
1/2/2014 16 Kai.Huang@tum
Service curves available to the applications / node i:
Example 2: TDMA Resource
B si
c si c-si c 2
1/2/2014 17 Kai.Huang@tum
Event and Resource Models
1/2/2014 18 Kai.Huang@tum
Examples: o computation (event – task instance, resource –
computing resource [tasks/second]) o communication (event – data packet, resource –
bandwidth [packets/second])
Greedy Processing Component (GPC)
remaining resources
FIFO buffer input event
stream
output event
stream
available resources
1/2/2014 19 Kai.Huang@tum
Behavioral Description o Component is triggered by
incoming events.
o A fully preemptable task is instantiated at every event arrival to process the incoming event.
o Active tasks are processed in a greedy fashion in FIFO order.
o Processing is restricted by the availability of resources.
Greedy Processing Component
GPC
1/2/2014 20 Kai.Huang@tum
Greedy Processing Component (GPC)
Conservation Laws
GPC R(t)
C(t)
R’(t)
C’(t) t
C(t)
R(t)
R’(t)
1/2/2014 21 Kai.Huang@tum
For all times u t we have R’(u) R(u) (conservation law). We also have R’(t) R’(u)+C(t)–C(u) as the output can not
be larger than the available resources. Combining both statements yields R’(t) R(u) + C(t) –
C(u).
Let us suppose that u* is the last time before t with an empty buffer. We have R(u*) = R’(u*) at u* and also R’(t) = R’(u*) + C(t) – C(u*) as all available resources are used to produce output. Therefore, R’(t) = R(u*) + C(t) – C(u*).
As a result, we obtain
Greedy Processing
t u*
B(t)
1/2/2014 22 Kai.Huang@tum
Abstract Models for Performance Analysis
Concrete Instance
Abstract Representation
Processor
Task
Input Stream R(t) R’(t)
C(t)
Service Model
Load Model
Processing Model ()
()
1/2/2014 23 Kai.Huang@tum
Abstraction
time domain cumulative functions
time-interval domain variability curves
GPC GPC
1/2/2014 24 Kai.Huang@tum
is called min-plus convolution
is called min-plus de-convolution
For max-plus convolution and de-convolution:
Relation between convolution and deconvolution
»
Some Definitions and Relations
1/2/2014 25 Kai.Huang@tum
The arrival and service curves provide bounds on event and resource functions as follows:
We can determine valid variability curves from cumulative functions as follows:
One proof:
Arrival and Service Curve
1/2/2014 26 Kai.Huang@tum
Abstraction
time domain cumulative functions
time-interval domain variability curves
GPC GPC
1/2/2014 27 Kai.Huang@tum
The output stream of a component satisfies:
The output upper arrival curve of a component satisfies:
The remaining lower service curve of a component satisfies:
The Most Simple Relations
1/2/2014 28 Kai.Huang@tum
Two Sample Proofs
1/2/2014 29 Kai.Huang@tum
The greedy processing component transforms the variability curves as follows:
Tighter Bounds
Without proof ... .
[al, au]
[bl, bu]
[bl’, bu’]
[al’, au’]
GPC
1/2/2014 30 Kai.Huang@tum
Backlog & Delay Schedulability Close-form solution Modular and composition
Performance Analysis Based on Arrival Curves
1/2/2014 31 Kai.Huang@tum
Delay and Backlog
maximum delay D
maximum backlog B
l
u
[al, au]
[bl, bu]
[bl’, bu’]
[al’, au’] GPC
1/2/2014 32 Kai.Huang@tum
Proof of Backlog Bound
maximum backlog B
l
u
1/2/2014 33 Kai.Huang@tum
Timing analysis in general
Real-Time Calculus
Modular Performance Analysis
1/2/2014 Kai.Huang@tum 34
Outline
System Composition CPU BUS DSP
GPC GPC
GPC GPC
GPC
How to inter- connect service?
RM TDMA
Scheduling!
1/2/2014 35 Kai.Huang@tum
Scheduling and Arbitration
FP/RM
GPC
GPC
EDF
EDF
RR
RR
GPS
GPC
GPC
sum
share
TDMA
GPC
GPC
TDMA
1/2/2014 36 Kai.Huang@tum
New HW behavior New SW behavior New scheduling scheme ...
Extending the Framework
’
’
RTC
This is the hard part…!
Find new relations:
1/2/2014 37 Kai.Huang@tum
1/2/2014 Kai.Huang@tum 38
Wave Field Synthesis Example
Analysis model System view
Duration of Analysis Model Generation and Calibration
1/2/2014 Kai.Huang@tum 39
Wave Field Synthesis Example