Q uantitative E valuation of E mbedded S ystems QUESTION DURING CLASS? Email : [email protected].

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

Transcript of Q uantitative E valuation of E mbedded S ystems QUESTION DURING CLASS? Email : [email protected].

Quantitative Evaluation of Embedded Systems

QUESTION DURING CLASS?Email : [email protected]

FAIL!

Thank you, Dimitrios Chronopoulos!

Quantitative Evaluation of Embedded Systems

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

Quantitative Evaluation of Embedded Systems

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

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...

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.

Recall!

302

01

11

230

121

301

20

ΙA

AAA0

n

n

times

Calculation rules

BAAB

yAmaxxAymaxxA

BCACAB

αxAαxA

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

Quantitative Evaluation of Embedded Systems

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

Monotonicity

yAxAyx thenIf

332211

3y

2y

1y

3x

2x

1x

yxyxyx

andandiffDefine :

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

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

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

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.

Quantitative Evaluation of Embedded Systems

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

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

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

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 α

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 α

Find an eigenpair…

A B

C1ms 2ms

x3 y

x1

x2

3ms

1

545

22

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

Eigenvalues

λCxnλy(n)

Tim

e (s

)

TokensλCx

λ

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.

Quantitative Evaluation of Embedded Systems

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

Eigenvalues and the MCM

A B

C1ms 2ms

x3 y

x1

x2

3ms

(n)x

1

545

22

1)(nx

(n)x1y(n)

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: ik

nk)(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...

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

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

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.

Simulate 6 firings

Give the (max,+) matrix equations

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

Calculate the MCM

Determine a periodic schedule for arbitrary µ

Plot the latency for a period µ

Optimize the periodic schedule for µ = 15

Optimize the periodic schedule for arbitrary µ

Plot the delayed latency for a period µ

Plot the minimal delay for a period µ

Optimize the periodic schedule for arbitrary µ