0% found this document useful (0 votes)
18 views6 pages

Embedded Systems Scheduling Solutions

The document is a sample solution to exercises from a course on embedded systems. It provides solutions to 4 tasks involving scheduling operations on resources to minimize latency, exploring the design space tradeoff between latency and cost, analyzing marked graphs representing operations on data streams, and using list scheduling to schedule operations on available resources for a given sequence graph. The minimal latency is calculated for different numbers of resources and the optimal additional resource is determined to further reduce latency.

Uploaded by

quoctrung244
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Embedded Systems Scheduling Solutions

The document is a sample solution to exercises from a course on embedded systems. It provides solutions to 4 tasks involving scheduling operations on resources to minimize latency, exploring the design space tradeoff between latency and cost, analyzing marked graphs representing operations on data streams, and using list scheduling to schedule operations on available resources for a given sequence graph. The minimal latency is calculated for different numbers of resources and the optimal additional resource is determined to further reduce latency.

Uploaded by

quoctrung244
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Networked Embedded Systems Lab

Prof. Marco Zimmerling

Introduction to Embedded Systems – WS 2022/23


Sample Solution to Exercise 7: Architecture Synthesis I

Task 1: Scheduling

Consider the sequence graph in Figure 1.

NOP 0

1 2 6 8 10

3 7 9 11

n
NOP

Figure 1: Sequence graph

All the operations are handled by the same resource type and have the same execution time:
D∗ = D− = D< = D+ = 1.

a) Set up a system of inequations which represent the constraints to valid schedules.

b) Set up an optimization model for the optimization of the latency L. Resource constraints need not
be taken into account. (Hint: add an objective function to the system of inequations to get a linear
program).

c) What is the minimal achievable latency

• if there is only one resource unit which handles all operations?

• if there are unlimited resource units?

Indicate valid starting times for the operations in both cases and check the validity of the schedules by
means of the system of inequations determined previously.

1
Solution to Task 1:

System of inequations:

τ (v3 ) >= τ (v1 ) + 1


τ (v3 ) >= τ (v2 ) + 1
τ (v4 ) >= τ (v3 ) + 1
τ (v5 ) >= τ (v4 ) + 1
τ (v5 ) >= τ (v7 ) + 1
τ (v7 ) >= τ (v6 ) + 1
τ (v9 ) >= τ (v8 ) + 1
τ (v11 ) >= τ (v10 ) + 1

τ (v1 ) >= τ (v0 )


τ (v2 ) >= τ (v0 )
τ (v6 ) >= τ (v0 )
τ (v8 ) >= τ (v0 )
τ (v10 ) >= τ (v0 )

τ (vn ) >= τ (v5 ) + 1


τ (vn ) >= τ (v9 ) + 1
τ (vn ) >= τ (v11 ) + 1

Initial condition:
τ (v0 ) = 0

Objective function:
min τ (vn ) − τ (v0 )

Minimum latency and valid starting times:

• One resource: Lmin = 11

• Unlimited resources: Lmin = 4

1 resource: e.g.
τ (v1 ) = 0; τ (v2 ) = 1; τ (v3 ) = 2; τ (v4 ) = 3; τ (v6 ) = 4;

τ (v7 ) = 5; τ (v5 ) = 6; τ (v8 ) = 7; τ (v9 ) = 8; τ (v10 ) = 9;

τ (v11 ) = 10; τ (vn ) = L = 11

Unlimited resources: e.g.

2
NOP 0

Time 1 1 2 6 8 10

3 7 9 11
Time 2

4
Time 3

5
Time 4

n
NOP

Figure 2: Starting times of operations for unlimited resources

Task 2: Design Space Exploration

Consider again the sequence graph and the specification of task 1. Assume that there is only one resource
type which can compute all operations (+, −, <, ∗) and has an area of 1. The cost of an implementation is
given by the total required area. The goal is to find the Pareto-points of the design space which is given by
the parameters cost and latency. The number of allocated resources is not yet fixed.

a) Compute a lower and an upper bound for the latency in order to limit the possible Pareto-points.

b) Find a lower and an upper bound for the cost in order to limit the possible Pareto-points.

c) Find all Pareto-points and represent them in a diagram.

Solution to Task 2:

Latency bounds: 4 ≤ L ≤ 11. Cost bounds: 1 ≤ c ≤ 5. Pareto-points: see Figure 3.

Cost c

10
9
8
7
6
5 Bounds
4 Pareto-points
3
2
Latency L
1
1 2 3 4 5 6 7 8 9 10 11

Figure 3: Pareto-points

3
Task 3: Marked Graphs

Consider the marked graph in Figure 4. The node labeled with + represents an addition of the two input
values.

I) At the input a a sequence of numbers is read in, with a(k) representing the k-th number. Determine
the outgoing sequence b(k) as function of the input values.

II) The initial mark with the value s is replaced by n marks s1 , ..., sn . Determine a recursive formula for
the output sequence b(k).

Input Output

Figure 4: Marked Graph 1

Solution to Task 3:

I) b(1) = a(1) + s
b(k) = a(k) + b(k − 1) for k > 1
with s being the data value of the initial mark

II) For n = 0 the output sequence is empty.


For n > 0:
b(k) = a(k) + sk for k <= n
b(k) = a(k) + b(k − n) for k > n
with s1 , ..., sn being the data values of the initial marks.

Task 4: List Scheduling

Given the sequence graph in Figure 5.

Suppose that two adders (r1 ) and a multiplier (r2 ) are available as resources. Addition takes one time unit and
multiplication takes two time units. The first operation starts at t = 0 and the top node (’nop’) is executed
within zero time units. The priority is assigned for each operation as maximal distance to the bottom node
(’nop’).

a) Fill out Table 1 using the list scheduling algorithm. For a timestep t, Ut,k denotes the set of operations
that are ready to be scheduled on resource rk (to be more specific, the set of operations that can be
mapped on resource rk and whose predecessors are all completed). St,k denotes the set of operations
that starts at time t on resource rk , while Tt,k is the set of operations in execution at time t on resource
rk .

b) What is the calculated latency?

c) Suppose that area costs for the adder and multiplier are 1 and 2 respectively. If it is allowed to spend
additional hardware by 2 area units, which resource should be added to shorten the latency? Two adders
or one multiplier? Explain why.

d) What is the new latency with the additional resource?

4
Figure 5: Sequence graph for Task 4

e) In case of unlimited hardware resources, what is the minimal latency?

Solution to Task 4:

a) See Table 1.

b) L = 8.

c) Multiplier because the critical path (1 → 6 → 8 → 10 → 11) is not delayed by adder but multiplier.

d) L = 7.

e) L = 7.

5
t k Ut,k Tt,k St,k
r1 ν1 , ν2 , ν3 , ν4 — ν1 , ν2
0
r2 ν5 — ν5
r1 ν3 , ν4 — ν3 , ν4
1
r2 ν6 ν5 —
r1 ν7 — ν7
2
r2 ν6 , ν9 — ν6
r1 — — —
3
r2 ν9 ν6 —
r1 ν8 — ν8
4
r2 ν9 — ν9
r1 ν10 — ν10
5
r2 — ν9 —
r1 — — —
6
r2 ν11 — ν11
r1 — — —
7
r2 — ν11 —
r1 — — —
8
r2 — — —
r1 — — —
9
r2 — — —
r1 — — —
10
r2 — — —
r1 — — —
11
r2 — — —

Table 1: Schedule for Task 4

Common questions

Powered by AI

The initial condition τ(v0) = 0 establishes a uniform starting point from which all subsequent operations’ schedules are derived. It serves as the reference point for calculating the delays and ensuring that each operation starts after its preceding operations. This condition simplifies the formulation of inequations by providing a clear baseline, which is critical for maintaining consistency across the scheduling model .

The bounds for cost and latency are determined by the resource availability and task requirements. Cost bounds (1 ≤ c ≤ 5) depend on the minimal and maximal number of resources required. Latency bounds (4 ≤ L ≤ 11) are influenced by the fastest and slowest possible execution paths given the constraints. Understanding these bounds is crucial for identifying Pareto-points that reflect optimal trade-offs between competing objectives in system design .

Optimizing latency directly enhances the system’s performance by reducing the time taken to execute all operations, thereby increasing throughput. Lower latency ensures faster response times, which is crucial for real-time embedded systems. This can lead to more efficient power use and resource management, ultimately improving the system's speed and responsiveness to external stimuli .

In design space exploration, cost is directly linked to the number of resources used, whereas latency refers to the time taken for task completion. Achieving a balance involves finding Pareto-points which minimize both cost and latency. In the given scenario, with latency bounds of 4 ≤ L ≤ 11 and cost bounds of 1 ≤ c ≤ 5, it’s crucial to identify designs that minimize these two conflicting objectives simultaneously. Such analysis helps in understanding the trade-offs and choosing configurations that meet design requirements effectively .

To determine the minimum latency achievable with unlimited resources, one must calculate the shortest possible critical path, considering only the dependency constraints without resource limitations. In Task 4, the minimum latency is 7. This is calculated by scheduling operations as soon as their dependencies are fulfilled, without waiting for resource availability, hence taking full advantage of parallel execution .

The sequence graph approach is crucial in architecture synthesis because it visualizes the order and dependencies of operations, facilitating the formulation of scheduling and resource allocation strategies. It helps identify parallelizable tasks and critical paths, which are essential for optimizing latency and resource usage. This approach allows designers to derive systems of inequations to test various scheduling models, thereby optimizing performance and efficiency of the embedded system designs .

A system of inequations can model the precedence constraints between operations in a sequence graph. These inequations represent the rule that an operation cannot start until all its predecessors have finished. For example, τ(v3) >= τ(v1) + 1 ensures that operation v3 can only start after v1 has completed, considering the specific execution time of 1 unit for all operations. By setting up such inequations, it is possible to compute valid starting times for each operation, thus creating valid schedules .

When considering additional resources to minimize latency, it is critical to analyze the critical path of operations. For instance, adding a multiplier in Task 4 is more beneficial than adding adders, as the critical path involves multiplication operations (1 →6 →8 →10 →11). Since a multiplier has a higher impact on reducing the latency of the critical path than an adder, priority should be given to the resource that most effectively shortens this path, reducing overall latency .

Identifying the critical path in list scheduling is crucial as it determines the minimum time required for completion of all tasks. This path governs the overall latency as tasks on it cannot be delayed by using additional resources optimally. Any improvement in the scheduling method, such as including extra multiplier or adder resources, should aim to reduce bottlenecks on the critical path to effectively minimize latency .

Initial markings in a marked graph indicate the starting conditions with specific data values. These help in deriving recursive formulas that calculate output sequences. For example, when initial marks are replaced by n marks, the recursive formula for the output sequence b(k) becomes b(k) = a(k) + sk for k <= n and b(k) = a(k) + b(k −n) for k > n. These formulas account for the flow of data influenced by the initial mark conditions and the defined operations on nodes .

You might also like