Hardware Reference
In-Depth Information
Typical values used for the time resolution can vary from 1 to 50 milliseconds. To
have a strict control on task deadlines and periodic activations, all time parameters
specified on the tasks should be multiple of the system tick. If the tick can be selected
by the user, the best possible tick value is equal to the greatest common divisor of all
the task periods.
The timer interrupt handling routine has a crucial role in a real-time system. Other than
updating the value of the internal time, it has to check for possible deadline misses
on hard tasks, due to some incorrect prediction on the worst-case execution times.
Other activities that can be carried out by the timer interrupt handling routine concern
lifetime monitoring, activation of periodic tasks that are in idle state, awakening tasks
suspended by a delay primitive, checking for deadlock conditions, and terminating
tasks in zombie state.
In DICK, the timer interrupt handling routine increments the value of the sys clock
variable, checks the system lifetime, checks for possible deadline misses on hard tasks,
awakes idle periodic tasks at the beginning of their next period and, at their deadlines,
deallocates all data structures of the tasks in zombie state. In particular, at each timer
interrupt, the corresponding handling routine
saves the context of the task in execution;
increments the system time;
generates a timing error, if the current time is greater than the system lifetime;
generates a time-overflow error, if the current time is greater than some hard
deadline;
awakens those idle tasks, if any, that have to begin a new period;
calls the scheduler, if at least a task has been awakened;
removes all zombie tasks for which their deadline is expired;
loads the context of the current task; and
returns from interrupt.
The runtime overhead introduced by the execution of the timer routine is proportional
to its interrupt rate. In Section 10.7 we see how this overhead can be evaluated and
taken into account in the schedulability analysis.
Search WWH ::




Custom Search