Table of Contents
This section desribes how to use TORSCHE for analysis of real-time systems. The area of real-time scheduling is quite broad and currently only the basics are supported. We are working on addition of more advanced methods to the toolbox.
The real-time system we consider a set of periodic tasks (see Section 5, “Periodic Tasks”). The sections bellow describe various algorithms that work on sets of real-time tasks.
Algorithms in this section assume that the tasks have assigned fixed
Weight). The higher number, the
The resptime function implements an algorithm that calculates response times for periodic tasks in a set. It is assumed, that these tasks are scheduled by a preemtive, fixed priority scheduler on one processor. Currently, this algorithm doesn't support any kind of synchronization between tasks. The syntax of the command is:
[resp, schedulable] = resptime(taskset)
resp is array of response-times. There is
one element for each task in the taskset. The parameter
schedulable is non-zero if the system is schedulable,
assuming the deadlines are equal to periods.
Fixed Priority Scheduling (fps) is an algorithm
that schedules periodic tasks in taskset according to their fixed
Weight of task).
r = fps(TS)
FPS algorithm is demonstrated on the example shown in next example code. The resulting schedule is shown in the next figure.
>> t1=ptask('t1',3,7); t1.Weight = 3; >> t2=ptask('t2',3,12); t2.Weight = 2; >> t3=ptask('t3',5,20); t3.Weight = 1; >> ts=taskset([t1 t2 t3]); >> s=fps(ts); >> plot(s, 'Proc', 1);
Figure 8.2. PT_FPS example code