Exercise #1 Report
Exercise #1 Report
Q1. Given three services S1, S2, and S3 with (T1, C1) = (3, 1), (T2,
C2) = (5, 2), (T3, C3) = (15, 3) where all times are in milliseconds,
Where T1, T2, T3 are the request time periods (deadlines), and
C1, C2, C3 are the WCETs (Worst Case Execution Times) of
the three services S1, S2 and S3 respectively.
Rate Monotonic (RM) Fixed Policy states that services which
share a CPU core should multiplex it based on priority, where
highest priority is assigned to the most frequently requested
service and lowest priority is assigned to the least frequently AND
total share CPU core utilization must preserve some margin (not to
be fully utilized or overloaded).
As per RM Fixed Policy, the timing diagram for the service set (S1,
S2, S3) is as follows:
From inspection, we can see from above timing diagram that the
service set S1, S2, S3 is feasible with RM Fixed Policy Schedule.
There is no deadline miss of any service within the LCM period of
all services i.e. LCM of 3, 5, 15 milliseconds = 15 milliseconds time
period. As the schedule is invariant indefinitely as per the RM Fixed
Policy, the above RM Schedule is safe i.e. it is unlikely to ever miss
a deadline.
Utilization Factor of the processor is defined to be the fraction of
processor time spent in the execution of the task set.
Where U = Utilization Factor,
Ci = Execution Time of Service i,
RM LUB
1
0.95
0.9
CPU utility
0.85
0.8
0.75
0.7
1
10
Assumptions:
1. The requests for all tasks for which hard deadlines exist are
periodic, with constant interval between requests.
2. The tasks are independent in that requests for a certain task do
not depend on the initiation or the completion of requests for
other tasks.
3. Run-time for each task is constant for that task and does not
vary with time. Run-time here refers to the time which is taken
by a processor to execute the task without interruption.
Problems in Fixed Priority LUB derivation:
1. (THEOREM 2) If a feasible priority assignment exists for some
task set, the ratemonotonic priority assignment is feasible for
that task set.
Q3. Below is the screenshots for Build and Code Execution of POSIX
Clock Linux code:
a.
b.
Q4. Below are the screenshots for Code Execution of Simple Thread
and Example-Sync codes:
a.) Screenshot of Simple Thread Code (Build and Run) on
Ubuntu Linux - Altera DE1-SoC Development Board:
b.)
Screenshot
of Example-Sync Code (Build) on Ubuntu Linux - Altera DE1SoC Development Board:
Screenshot of Example-Sync Code (Run) on Ubuntu Linux Altera DE1-SoC Development Board:
Starte
2
3
4
5
Stop
6
7
8
8 => Idle Time Completion which is also the Stop of LCM Invariant
Schedule
Stop => Stop of LCM Invariant Schedule
All the above described bubbles map with the Event Analysis Timing
Diagram as shown in figure below.
VxWorks RTOS Code Description:
Initially a higher priority task called Sequencer is spawned inside
Start() function. Sequencer task creates a middle priority task called
serviceF10 and a low priority task called serviceF20. It also
initializes two binary semaphore locks semF10 and semF20
respectively. serviceF10 and serviceF20 tasks takes semF10 and
semF20 semaphore locks respectively and waits till those locks are
released by Sequencer task.
Sequencer task releases semF10 and semF20 locks in such an
order that it generates a LCM Invariant Schedule as shown below.
Starte
1
Stop
2
After fixing this issue, then the second challenge was to tweak the
iteration values inside fib10, fib20 functions such that it matches
with the timing diagram mentioned in the Exercise requirements.
The iteration values differed from Virtual Box Ubuntu and Ubuntu
and Altera DE1-SoC Development Board.