Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quantitative Evaluation of Embedded Systems

Similar presentations


Presentation on theme: "Quantitative Evaluation of Embedded Systems"— Presentation transcript:

1 Quantitative Evaluation of Embedded Systems
Buffering Opening slide (skipped in actual weblecture)

2 Buffering in streaming applications
Image taken from an online tutorial on the VLC media player In many streaming systems, buffering plays an important role. In particular, buffers should be large enough to handle delays inside the system. Typically, in applications like the VLC media player, buffer values are chosen comfortably large, but if you are developing software for devices that are very resource constrained, which is often the case in embedded systems, then you want to have an idea how small you can make buffers without damaging the system.

3 B S A C Buffering in dataflow graphs 30ms 10ms 26ms
In dataflow graphs, buffering can be modeled by back-edges in the graph. This is the graph we also used in the previous lecture to calculate latency. Now, suppose that in this graph the edge from C to A models some data-link. In principle, this link can contain as many tokens as necessary, so it has an infinite buffering capacity. However, if we add an arc from A to C that has one initial token, then we see that there appears a cycle A-C-A. In the first lecture, we learned that any cycle in a dataflow graph has a constant number of tokens. So now, the connection from C to A can only contain at most one token. -- Half-shot – So now you know that buffering can be represented using back-edges in dataflow graphs. But we want to add buffers in such a way that the behavior of the graph is not altered in any essential way. That is what we focus on in this lecture. -- Back to screen – If we take a buffer-size of only one token between A and C, it might be that the behavior of the graph changes. So, how can we make sure that the throughput and latency guarantees are not altered by this new edge? For that, we have to look at the algorithm for calculating the latency.

4 Invariants in a periodic schedule
Determine the MCM and choose a period μ ≥ MCM For each actor a initialize a start-time Ta := 0 Repeat for each arc a—i—b : Tb := Tb max (Ta + Ea – i μ) until there are no more changes Repeat for each actor a: Ta := min{all arcs a-i-b} (Tb - Ea + i μ) until there are no more changes Delayed latency ≤ Toutput + Eoutput + δ·μ - Tinput i ≥ (Ta - Tb + Ea) / μ Tb ≥ Ta + Ea – i μ The optimization step keeps the statement that Tb >= Ta + Ea – i u invariant! In fact, this is the sole requirement of a periodic schedule. In other words… we can add buffers as long as we keep this invariant… as long as i >= (Ta – Tb + Ea)/u

5 B S A C Retaining the invariant when buffering t0 = 0ms t0 = 34ms
i ≥ (Ta – Tc + Ea)/μ 26ms

6 B S A C Retaining the invariant when buffering t0 = 0ms t0 = 34ms
i ≥ (Ta – Tc + Ea)/μ i ≥ δ 26ms

7 A B Retaining invariant => retaining MCM
By definition of periodic schedule we find for every arc x-#-y that Ty ≥ Tx + Ex – # μ Adding these steps over a path B-X-Y----Z-A we find that TA ≥ TB + E(B-X-Y---Z) – #(B-X-Y---Z-A) μ And so we find that i ≥ (TA - TB + EA)/μ ≥ E(B-X-Y---Z-A) / μ – #(B-X-Y---Z-A) Which means for the cycle mean on the newly created cycle B-X-Y----Z-A-B: E(B-X-Y---Z-A) / (#(B-X-Y---Z-A) + i) ≤ μ A B i

8 A B Retaining MCM => retaining invariant
Reversely, assume that we pick i so that the MCM of the graph does not change. Then for any cycle B-X-Y----Z-A-B we know: E(B-X-Y---Z-A) / (#(B-X-Y---Z-A) + i) ≤ μ By definition of periodic schedule we have for every arc x-#-y that Tx ≤ Ty - Ex + # μ Adding these steps over a path B-X-Y----Z-A we find that TB ≤ TA - E(B-X-Y---Z) + #(B-X-Y---Z-A) μ And so: (TA - TB + EA)/μ ≤ E(B-X-Y---Z-A) / μ – #(B-X-Y---Z-A) ≤ i A B i

9 the periodic schedule stays unchanged the MCM stays unchanged
How large should a buffer be? S A C B i But be aware of δ… i ≥ (TA – TC + EA)/μ if and only if the periodic schedule stays unchanged the MCM stays unchanged


Download ppt "Quantitative Evaluation of Embedded Systems"

Similar presentations


Ads by Google