Quantitative Evaluation of Embedded Systems Dataflow and Max-Plus Algebra
Feb 14, 2016
Quantitative Evaluation of Embedded Systems
Dataflow and Max-Plus Algebra
Consider a car manufacturing line consisting of...
Exercise:Model a car manufacturing line
• Four assembly robots: A,B,C and D• A production unit that needs 20 minutes to produce a chassis• A production unit that needs 10 minutes to produce a steering installation• A production unit that needs 10 minutes to produce a breaking system• A production unit that needs 20 minutes to produce a body• Three painting units that each need 30 minutes to paint a body• A production unit that needs 15 minutes to produce a radio• Robot A compiles the chassis and the steering installation in 4 min. and sends it to B• Robot B adds the breaking system in 3 min. and sends it to C• Robot C adds a painted body in 5 min. and sends it to D• Robot D adds a radio in 1 min. and sends the car out of the factory• For safety reasons, there can be at most 3 ‘cars’ between A and C, and only 2 between B and D• Every robot can only deal with one of each of the assembled components at a time
Exercise: calculate the first 3 firings of each actor
A B C D
10min
20min 10min 20min
30min20min
5min3min4min
15min
1min
Disclaimer: no actual car assembly line was studied in order to make this model.
Answer: Model a car manufacturing line
The algebraic approach:Measuring traffic
10min
20min 10min 20min
30min20min
5min3min4min
15min
1min
Counters v.s. Loggers
Time (s)
Toke
nsTi
me
(s)
Tokens
Tim
e (s
)
Tokens
Counting tokensLogging events
Logging traffic
A B
C10ms 15ms
25ms
u x1
x2
y
x5
x3
x4
Logging traffic
A B
C10ms 15ms
25ms
u x1
x2
y
x5
x3
x4
0 0ny
0 0nx0 2nx0 0nx0 1nx0 0nx
5
4
3
2
1
15 nx ,nxmax ny
15 nx ,nxmax nx 25 nx ,nxmax 2nx
10 nx ,numax nx 15 nx ,nxmax 1nx
10 nx ,numax nx
21
215
534
43
212
41
Logging traffic
A B
C10ms 15ms
25ms
u
x2
y
x4x’4
0 nx
0 nx0 1nx
4
2
11
4
25u(n)15,nx 25,nxmax ny
50u(n)40,nx 50,nxmax nx nx 1nx
25u(n)15,nx 25,nxmax 1nx
24
244
44
242
Detour: Linear Algebra
)x(a)x(a)x(a)x(ax)x(a)x(a)x(a)x(ax)x(a)x(a)x(a)x(ax)x(a)x(a)x(a)x(ax
44,434,324,214,14
43,433,323,213,13
42,432,322,212,12
41,431,321,211,11
Detour: Linear algebra
4
3
2
1
4,44,34,24,1
3,43,33,23,1
2,42,32,22,1
1,41,31,21,1
4
3
2
1
xxxx
aaaaaaaaaaaaaaaa
xxxx
Detour: Linear systems theory
(n))x(a(n))x(a(n))x(a(n))x(a1)(nx(n))x(a(n))x(a(n))x(a(n))x(a1)(nx(n))x(a(n))x(a(n))x(a(n))x(a1)(nx(n))x(a(n))x(a(n))x(a(n))x(a1)(nx
44,434,324,214,14
43,433,323,213,13
42,432,322,212,12
41,431,321,211,11
Detour: Linear systems theory
(n)
xxxx
aaaaaaaaaaaaaaaa
1)(n
xxxx
4
3
2
1
4,44,34,24,1
3,43,33,23,1
2,42,32,22,1
1,41,31,21,1
4
3
2
1
Detour: (max,+) algebra
(n))x(n))max(ax(n))max(ax(n))max(ax(a1)(nx(n))x(n))max(ax(n))max(ax(n))max(ax(a1)(nx(n))x(n))max(ax(n))max(ax(n))max(ax(a1)(nx(n))x(n))max(ax(n))max(ax(n))max(ax(a1)(nx
44,434,324,214,14
43,433,323,213,13
42,432,322,212,12
41,431,321,211,11
Detour: (max,+) systems theory
(n)
xxxx
aaaaaaaaaaaaaaaa
1)(n
xxxx
4
3
2
1
4,44,34,24,1
3,43,33,23,1
2,42,32,22,1
1,41,31,21,1
4
3
2
1
Question: calculate this product!
4105
5226243625351201
?x
Question: what is now a unit matrix?
xx?
Detour: Linear Systems Theory
u(n)dmax(n)xccccy(n)
u(n)
bbbb
maxnx
aaaaaaaaaaaaaaaa
1nx
4321
4
3
2
1
4,44,34,24,1
3,43,33,23,1
2,42,32,22,1
1,41,31,21,1
Detour: (max,+) systems theory
u(n)Dmax(n)xCy(n)u(n)Bmax(n)xA1)(nx
Matrix equations
A B
C10ms 15ms
25ms
u
x2
y
x4x’4
25u(n)15,nx 25,nxmax ny
50u(n)40,nx 50,nxmax nx nx 1nx
25u(n)15,nx 25,nxmax 1nx
24
244
44
242
Matrix equations
A B
C10ms 15ms
25ms
u
x2
y
x4x’4
u(n)25max(n)x'xx
2515y(n)
u(n)50
25max(n)
x'xx
50400
25151)(n
x'xx
4
4
2
4
4
2
4
4
2
Matrix equations
A B
C10ms 15ms
25ms
u
x2
y
x4x’4
u(n)25max(n)x'xx
2515y(n)
u(n)50
25max(n)
x'xx
50400
25151)(n
x'xx
4
4
2
4
4
2
4
4
2
The entries in a (max,+) algebra matrixrepresent the longest* token-free pathsfrom one initial token to another.
* Where ‘longest’ is means ‘greatest total execution time’.
E
DC
BA
F
Exercise: Determine the matrix equations
u
y
5 ms
15 ms
7 ms
0 ms 1 ms
2 ms
E
DC
BA
F
2
3
u
y
5 ms
0 ms
7 ms
15 ms 2 ms
1 ms