q uantitative e valuation of e mbedded s ystems

39
Quantitative Evaluation of Embedded Systems QUESTION DURING CLASS? Email : [email protected]

Upload: azra

Post on 24-Feb-2016

37 views

Category:

Documents


0 download

DESCRIPTION

Q uantitative E valuation of E mbedded S ystems. QUESTION DURING CLASS? Email : [email protected]. FAIL!. Thank you, Dimitrios Chronopoulos !. Q uantitative E valuation of E mbedded S ystems. Matrix equations - revisited Monotonicity Eigenvalues and throughput - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

QUESTION DURING CLASS?Email : [email protected]

Page 2: Q uantitative  E valuation of  E mbedded  S ystems

FAIL!

Thank you, Dimitrios Chronopoulos!

Page 3: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

1. Matrix equations - revisited2. Monotonicity3. Eigenvalues and throughput4. Eigenvalues and the MCM

Page 4: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

1. Matrix equations - revisited2. Monotonicity3. Eigenvalues and throughput4. Eigenvalues and the MCM

Page 5: Q uantitative  E valuation of  E mbedded  S ystems

Recall!

0 ms

y

(n)x(0)y(n)(n)x(0)1)(nx

0y(n)

Cycles with a 0 execution time cause livelocks

But when logging events, this is mathematically okay...

Page 6: Q uantitative  E valuation of  E mbedded  S ystems

Recall!

u(n)Dmax(n)xCy(n)u(n)Bmax(n)xA1)(nx

A B

C D

1ms 2ms

4ms

u y

3ms

Theorem: The number of tokens on any cycle is constant!

Therefore, every cycle must contain at least one token,otherwise a deadlock occurs.

Page 7: Q uantitative  E valuation of  E mbedded  S ystems

Recall!

302

01

11

230

121

301

20

ΙAAAA

0

n

n

times

Page 8: Q uantitative  E valuation of  E mbedded  S ystems

Calculation rules

BAAB

yAmaxxAymaxxABCACAB

αxAαxA

Page 9: Q uantitative  E valuation of  E mbedded  S ystems

Solving the (max,+) matrix equations

u(n)Dmax(n)xCy(n)u(n)Bmax(n)xA1)(nx

u(n)D

u(i)BCAmax

(1)xAC

maxy(n) i1n

ni0

1n

Using induction

Page 10: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

1. Matrix equations - revisited2. Monotonicity3. Eigenvalues and throughput4. Eigenvalues and the MCM

Page 11: Q uantitative  E valuation of  E mbedded  S ystems

Monotonicity

yAxAyx thenIf

332211

3y2y1y

3x2x1x

yxyxyx

andandiffDefine :

Theorem: (max,+) matrix addition is a monotone operator

Page 12: Q uantitative  E valuation of  E mbedded  S ystems

Monotonicity

u(n)Dmax(n)xCy(n)u(n)Bmax(n)xA1)(nx

0D

0BCAmax

0AC

maxy(n) i1n

ni0

1n

Given that x(1) = 0

and for all n : u(n) ≥ 0

0ACy(n) 1n

u(n)D

u(i)BCAmax

(1)xAC

maxy(n) i1n

ni0

1n

Page 13: Q uantitative  E valuation of  E mbedded  S ystems

Best-case approximation…

A B

C1ms 2ms

u x3 y

x1

x2

3ms u(n)max

u(n)

1

4max

(n)x1y(n)

(n)x

1

545

22

1)(nx

Page 14: Q uantitative  E valuation of  E mbedded  S ystems

Best-case approximation

Tim

e (s

)

TokensCx

0ACy(n) n

Theorem: (max,+) matrix addition is a monotone operator

and as a consequence, removing the input gives a best-case approximation of behavior.

Page 15: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

1. Matrix equations - revisited2. Monotonicity3. Eigenvalues and throughput4. Eigenvalues and the MCM

Page 16: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

In linear algebra...

a pair (x, λ) is an eigenpair for a matrix A if:

xλxA with denoting elementwise multiplicationand assuming that

xλ0x

Page 17: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

xλxA xλ

In (max,+) algebra...

a pair (x, λ) is an eigenpair for a matrix A if:

with denoting elementwise addition and assuming that x

Page 18: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

In linear algebra, we find for any eigenpair (x, λ) that

xλxA nn If (x, λ) is an eigenpair then so is (αx, λ), for any scalar α

Page 19: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

And so, in (max,+) algebra we find for any eigenpair (x, λ)

xnλxAn If (x, λ) is an eigenpair then so is (α+x, λ), for any shift α

Page 20: Q uantitative  E valuation of  E mbedded  S ystems

Find an eigenpair…

A B

C1ms 2ms

x3 y

x1

x2

3ms

1

545

22

Page 21: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

u(n)Dmax(n)xCy(n)u(n)Bmax(n)xA1)(nx

for a given eigenpair (x,λ) with x≤0

λ)(Cxnλx)1)λC((n

xACy(n) 1n

u(n)D

i)u(nBCAmax

(1)xAC

maxy(n) i1n

ni0

1n

0ACy(n) n 1

Page 22: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

λCxnλy(n)

Tim

e (s

)

TokensλCx

λ

Page 23: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues

λλCxty(t)

λCx

λ1

Time (s)

Toke

nsTheorem:

The best-case throughput is always smaller than 1/λ, with λ the biggest eigenvalue of the associated matrix.

Page 24: Q uantitative  E valuation of  E mbedded  S ystems

Quantitative Evaluation of Embedded Systems

1. Matrix equations - revisited2. Monotonicity3. Eigenvalues and throughput4. Eigenvalues and the MCM

Page 25: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues and the MCM

A B

C1ms 2ms

x3 y

x1

x2

3ms

(n)x

1

545

22

1)(nx

(n)x1y(n)

Page 26: Q uantitative  E valuation of  E mbedded  S ystems

Eigenvalues are cycle means

A B

C1ms 2ms

x3 y

x1

x2

3ms

xλx1

545

22

x

ii x: ikk)(i,ki, xλxA: iknk)(i,ki,n xnλxA:

kklk)(k,

iklnk)(i,lk,i,mnm

xlλxA

xl)λ(nxA:

where Al(k,k) is the duration of some cycle with l tokens on it

hence λ = Al(k,k)/l is a cycle mean.

Theorem: Every eigenvalue is the cycle mean of some cycle...

Page 27: Q uantitative  E valuation of  E mbedded  S ystems

The MCM is an eigenvalue

A B

C1ms 2ms

x3 y

x1

x2

3ms

Let λ=MCM and xi represent a critical token...

Now given matrix A of a dataflow graph,let us construct the following two matrices:

λn

1n

λ

n

0n

n

0n

λ

Aλ)(AλAmaxA

nλAmaxλAmaxA

In an entry (i,j) representsthe max duration of any path from i to j minus λ for eachtoken on that path.

λA

Page 28: Q uantitative  E valuation of  E mbedded  S ystems

The MCM is an eigenvalue

A B

C1ms 2ms

x3 y

x1

x2

3ms

Since xi represents a critical token: 0i)(i,λA

So for the ith column we find:

),(),(),( )()()( iii λλλ AAmaxA

And consequently:

λ)A(

λ)A(

λ))Aλ)(((A

λ)Aλ)((A)AA(

i),(λ

i),(λ

i),(λ

i),(λ

i),(λ

So is an eigenpair of A λ,)A( i),(λ

Theorem: The maximal cycle mean of a graph

is the maximum eigenvalue of its (max,+) matrix.

In an entry (i,j) representsthe max duration of any path from i to j minus λ for eachtoken on that path.

λA

Page 29: Q uantitative  E valuation of  E mbedded  S ystems

u(n)D

i)u(nBCAmax

(1)xAC

maxy(n) i1n

ni0

1n

Summary:

The maximal cycle mean of a graphis the maximum eigenvalue of its (max,+) matrix

and 1/MCM is the maximal throughput.See the book by [Baccelli, Cohen, Olsder and Quadrat] for more!

Like for the question “can the 1/MCM throughput actually be achieved?”

Every eigenvalue is the cycle mean of some cycle...But not every cycle mean is an eigenvalue!

(max,+) matrix addition is a monotone operatorThus removing the input gives a best-case approximation of behavior.

Page 30: Q uantitative  E valuation of  E mbedded  S ystems

Simulate 6 firings

Page 31: Q uantitative  E valuation of  E mbedded  S ystems

Give the (max,+) matrix equations

𝑥 (𝑛+1 )=(¿ )𝑥 (𝑛)𝑚𝑎𝑥 (¿ )𝑢(𝑛)

Page 32: Q uantitative  E valuation of  E mbedded  S ystems

Calculate the MCM

Page 33: Q uantitative  E valuation of  E mbedded  S ystems

Determine a periodic schedule for arbitrary µ

Page 34: Q uantitative  E valuation of  E mbedded  S ystems

Plot the latency for a period µ

Page 35: Q uantitative  E valuation of  E mbedded  S ystems

Optimize the periodic schedule for µ = 15

Page 36: Q uantitative  E valuation of  E mbedded  S ystems

Optimize the periodic schedule for arbitrary µ

Page 37: Q uantitative  E valuation of  E mbedded  S ystems

Plot the delayed latency for a period µ

Page 38: Q uantitative  E valuation of  E mbedded  S ystems

Plot the minimal delay for a period µ

Page 39: Q uantitative  E valuation of  E mbedded  S ystems

Optimize the periodic schedule for arbitrary µ