You are on page 1of 4

Embedded Systems Design

Assignment 4
Nouman Ali [PhDEE-21004] Dated: 9th Jun, 2022
Nazish Khalid [MSEE-20010]

Question 1
Given are eight aperiodic tasks 𝐽1 , … , 𝐽8 with their arrival times, deadlines, and execution times
as shown in the table below, with the precedence constraints as follows:
𝐽1 → 𝐽2 , 𝐽2 → 𝐽5 , 𝐽5 → 𝐽8 , 𝐽6 → 𝐽3 , 𝐽3 → 𝐽8

1. Construct the precedence graph.

J1 J2 J5
J8

J6 J3

J4

J7

2. Modify the arrival times and deadline based on EDF* algorithm.

Firstly, we will modify the arrival times using the formula


𝑟𝑗∗ = max(𝑟𝑗 , 𝑚𝑎𝑥(𝑟𝑖∗ + 𝐶𝑖 : 𝐽𝑖 → 𝐽𝑗 ))
We can see that jobs 𝐽1 , 𝐽4 , 𝐽6 , 𝐽7 don’t have any predecessors. So their arrival times will remain as
it is. So,

𝑟1∗ =0
𝑟4∗ =0
𝑟6∗ =1
𝑟7∗ =0
𝑟2∗ = max(𝑟2 , 𝑟1∗ + 𝐶1 ) = max(3 , 0 + 2) = 3
𝑟5∗ = max(𝑟5 , 𝑟2∗ + 𝐶2 ) = max(0 , 3 + 3) = 6
𝑟3∗ = max(𝑟3 , 𝑟6∗ + 𝐶6 ) = max(4 , 1 + 2) = 4
𝑟8∗ = max(𝑟8 , 𝑟3∗ + 𝐶3 , 𝑟5∗ + 𝐶5 ) = max(5 , 4 + 2 , 6 + 2) = 8

Now, we will modify the deadlines using the formula


𝑑𝑖∗ = min(𝑑𝑖 , 𝑚𝑖𝑛(𝑑𝑗∗ − 𝐶𝑗 : 𝐽𝑖 → 𝐽𝑗 ))
As, 𝐽4 , 𝐽7 & 𝐽8 don’t have any successors, so their deadlines will remain same. So,

𝑑4∗ = 16
𝑑7∗ = 10
𝑑8∗ = 15
𝑑3∗ = min(𝑑3 , 𝑑8∗ − 𝐶8 ) = min(15 , 15 − 1) = 14
𝑑5∗ = min(𝑑5 , 𝑑8∗ − 𝐶8 ) = min(10 , 15 − 1) = 10
𝑑6∗ = min(𝑑6 , 𝑑3∗ − 𝐶3 ) = min(10 , 14 − 2) = 10
𝑑2∗ = min(𝑑2 , 𝑑5∗ − 𝐶5 ) = min(7 , 10 − 2) = 7
𝑑1∗ = min(𝑑1 , 𝑑2∗ − 𝐶2 ) = min(3 , 7 − 3) = 3

𝑱𝟏 𝑱𝟐 𝑱𝟑 𝑱𝟒 𝑱𝟓 𝑱𝟔 𝑱𝟕 𝑱𝟖
𝒓𝒊 0 3 4 0 6 1 0 8
𝒅𝒊 3 7 14 16 10 10 10 15
𝑪𝒊 2 3 2 3 2 2 1 1

3. Using the updated arrival times and deadlines, construct the EDF schedule using the figure
below:
Question 2
Consider the following set of periodic tasks executing on the processor under EDF:

Two TBS servers S1 and S2 having utilization Us1 and Us2 respectively execute on the processor along
with the above periodic tasks.
1
1. Given that 𝑈𝑠1 = 15, what can be the maximum value of 𝑈𝑠2 such that the whole set (i.e.,
periodic tasks together with S1 and S2) is schedulable by EDF?

For a Total Bandwidth Server


𝑈𝑠 + 𝑈𝑝 = 1
So,
𝐶1 𝐶2
𝑈𝑆1 + 𝑈𝑆2 + + =1
𝑇1 𝑇2
1 1 3
+ 𝑈𝑆2 + + = 1
15 5 9
𝑼𝑺𝟐 = 𝟎. 𝟒

2. Now assume 𝑼𝒔𝟏 = 𝟎. 𝟐 and 𝑼𝒔𝟐 = 𝟎. 𝟏𝟓. Construct the EDF schedule using the figure below
in the case in which one aperiodic request 𝐽𝑎 (𝑟𝑎 = 1, 𝐶𝑎 = 2) is served by S1 , and two
aperiodic requests 𝐽𝑏 (𝑟𝑏 = 2, 𝐶𝑏 = 3) and 𝐽𝑐 (𝑟𝑐 = 15, 𝐶𝑐 = 1) are served by S2. Assume that
the arrival time of the first instance/job of each periodic task is 0.

Firstly, we’ll find the deadlines of Aperiodic Tasks.

As, 𝐽𝑎 is only served by S1


So,
𝐶𝑎 2
𝑑𝑎 = max(𝑟𝑎 , 𝑑𝑝𝑟𝑒𝑣 ) + =1+ = 11
𝑈𝑆1 0.2
And 𝐽𝑏 & 𝐽𝑐 both are served by S2
So,
𝐶𝑏 3
𝑑𝑏 = max(𝑟𝑏 , 𝑑𝑝𝑟𝑒𝑣 ) + = max(2 , 11) + = 22
𝑈𝑆2 0.15
𝐶𝑐 1
𝑑𝑐 = max(𝑟𝑏 , 𝑑𝑐 ) + = max(15 , 22) + = 28.67
𝑈𝑆2 0.15
𝐽𝑐
𝐽𝑏

𝐽𝑎

𝜏2

𝜏1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

You might also like