Real Time
Real Time
Real Time
Abstract.
1 Introduction
In this paper we discuss the requirements and specifications for a Real-Time
Operating System (RTOS) from the point of view of its capabilities to support
embedded applications in meeting safety, particularly real-time requirements on
modern many/multicore systems. As this paper is related to a multiprocessor and
distributed real-time operating system this is rather unique as most RTOS are
designed for single processor systems and if not, they assume a shared memory
architecture. In such cases, the RTOS is only concerned with the local scheduling
on each processor with interprocessor synchronisation and communication being
left to a middleware layer. In view of modern many/multicore architectures this
is no longer adequate as resources are globally shared on the highly integrated
chip and any activity on any processor has a potential impact on the scheduling
on another processor. We outline how simple real-time requirements are ad-
dressed by using static scheduling schemes. While predictable they are prone to
catastrophic failure, which in the case of the highly concentrated functionality
and performance in many/multicore chips can be catastrophic for the whole sys-
tem. Moreover, their behaviour is increasingly statistical in nature, hence soft
real-time rather than hard real-time. We show how a more dynamic approach
can make better use of the available resources and can allow fault containment as
well as recovery from errors. This extends the traditional real-time requirements
into a wider concept that we call Quality of Service (QoS). In order to meet QoS
levels, system components (on-chip or distributed) must meet certain criteria.
We call this the Assured Reliability and Resileience Level (ARRL) and link it
with the QoS. We use the formally developed network-centric OpenComRTOS
as a reference.
2 Background of OpenComRTOS
The initial purpose for developing OpenComRTOS [1] was to provide a soft-
ware runtime environment supporting a coherent and unified systems engineer-
ing methodology based on “Interacting Entities”, currently further developed
and commercialised by Altreonic [2]. In this methodology requirements result in
concrete specifications that are fulfilled in the architectural domain by concrete
“entities” or sets of entities. Entities can be decomposed as well as grouped to
fulfil the specifications. In order to do so, we also need to define “interactions”,
basically the actions that coordinate the entities. In practice these interactions
can be seen as protocols whereby the entities synchronise and exchange data.
Interactions and entities are first of all abstractions used during the mod-
elling phase. As such, a specified functionality can first be simulated as part
of a simulation model, critical properties can be formally verified using formal
techniques and finally an implementation architecture can be defined using the
architectural modelling tools of the target domain. In our case we try to keep
the semantics unified from early requirements till implementation. In the tar-
geted embedded systems domain this means that the final architecture is likely a
concurrent or parallel software program running on one or more programmable
processors. Some functionality might be implemented on specific hardware enti-
ties. Such entities will be integrated in the input or output subsystem or will be
designed as co-processing blocks. In most cases these hardware entities will be
controlled from a software driver running on a processor.
In an embedded system, and in most systems, two additional systems must
be taken into consideration. The first one is the “environment” in which the em-
bedded system is placed. This will often generate inputs to the system or accept
outputs from it or it will influence the operating conditions, not necessarily in a
fully predictable way. A second system that is often present is the “operator”,
who also will generate inputs or process the outputs. If this is a human oper-
ator, we have to deal with an entity whose behaviour is not necessarily always
predictable. Often the “operator” might be another embedded system and then
the behaviour should be more predictable, at least if well specified. However,
systems are layered. If we “open” the embedded system or consider the system
under development with its environment and its operator as a new system, we
can see that each system can be a component in a larger system and often it
will be composed itself of “subsystem components”, resulting in specific require-
ments in order to reuse them. For this paper we stay at the level where such
components are programmable processors or software implemented functions.
The use of a concurrent (parallel by extension) programming paradigm em-
bodied in an RTOS is a natural consequence of the interacting entities paradigm.
Programming in a concurrent way implies that the abstract entities (that fulfil
specifications) are mapped onto RTOS “tasks” (also called processes or threads
in the literature) and that interactions are mapped onto services used by the
tasks to synchronize and to communicate. In principle, this abstract model
maps equally well to hardware as to software but we focus here on the soft-
ware. The target domain ranges from small single chip micro-controllers over
multi-core CPUs to widely distributed heterogeneous systems that include sup-
port for legacy technology. The goal is to program such systems in a transparent
way, independently of the processor or communication medium used.
Fig. 1. The context of systems engineering.
A precursor to OpenComRTOS was the Virtuoso RTOS [3]. It had its origin in
the pioneering INMOS transputer [4,5], a partial hardware implementation of
Hoare’s Communicating Sequential Processes (CSP) process algebra [6]. Later
Virtuoso was ported to traditional processors but mostly parallel DSPs. The
transputer was a rather unusual RISC like processor with unique support for on-
chip concurrency and inter-processor communication. On-chip it had a scheduler
with two priority levels, each level supporting round-robin scheduling between
the compile time generated processes. It also had hardware support for inter-
process communication and synchronization using ”channels”. For distributed,
embedded real-time applications, it raised two major issues:
– Two levels of priority are not enough for hard real-time applications. Typi-
cally at least 32 levels of priority are needed with full support for pre-emption
and priority inheritance.
– Topology independence: although the transputer had interprocessor links,
the communication between processors had to be manually routed at the
application level. The issue is here mostly one of maintenance. Every little
change in the topology could result in major reprogramming efforts.
It is useful for the remainder of this paper to present in short our view on em-
bedded real-time programming. The reader can find a wide range of literature
related to real-time and embedded programming elsewhere if he wants to inves-
tigate in more depth.
Let’s start with the term “real-time”. The intuitive notion of real-time is
often a subjective one using terms like “fast” or “fast enough”. Such systems
can often be considered as “soft” real-time, because the real-time criteria are not
clearly defined and are often statistical. However, when the system that must
be controlled is physical, often the deadlines will be absolute. An example of a
soft real-time system is a video system. The processing rate is determined by
the frame rate, often a minimum of 25 Hz and determined by the minimum rate
needed for the eye to preceive the frames as a continuous image. The human
eye will itself filter out late arriving frames and can even tolerate a missing
frame. Even more soft real-time are on-line transaction systems. Users expect
them to respond with e.g. one second, but accept that occasionally it takes
tens of seconds. Of course, if a soft real-time application repeatedly violates the
expected real-time properties the Quality of Service will suffer and at some point
that will be considered a failure as well.
On the other hand hard real-time systems that miss deadlines can cause
physical damage or worse, can result in deadly consequences if the application
is safety critical, even when a “fail-safe” mode has been designed in. Typical
examples are dynamic positioning systems, machine control, drive-by-wire and
fly-by-wire systems. In these cases often the term ”hard real-time” is used to
differentiate. From the point of view of the requirements, hard real-time means
”predictable” and ”guaranteed” and a single deadline miss is considered a failure
whether its design can tolerate some deviations or not.
Two conclusions can be drawn. First of all, a hard real-time system can
provide “soft” real-time behaviour, but the opposite is not true. Secondly, when
safety critical, a hard real-time system must remain predictable even in the
presence of faults. In the worst case it could fail, but the probability from this
happening must be low enough to be considered an acceptable risk.
Strictly speaking, no RTOS is needed to achieve real-time behaviour in an
embedded system. It all depends on the complexity of the application and on the
additional requirements. E.g. if the system only has to periodically read samples
from a sensor, do some processing and transmit the processed values, a simple
loop that is executed forever will be sufficient. Sources of complexity are for
example:
– Putting the processor to sleep in between processing to conserve energy.
– Managing several 100’s of sensors.
– Executing a high number of other tasks with different time constraints.
– Detecting a failure in the sensor circuit.
– Detecting a fault in the processor.
Such requirements are difficult if not impossible to handle when a simple polling
loop is used, but as most processors will have support for interrupt handling, the
developer can separate the I/O from the processing. This essentially means that
most embedded systems will have a “hardware” level of priorities and a “soft-
ware” level of priorities. The highest priority level is provided by the Interrupt
Service Routines that effectively interrupts the lower priority (background) loop.
However, the extra functionalities listed above might already require multiple in-
terrupts and priorities. The sleep mode of the processor requires that the circuit
generates an interrupt to wake up the processor and a timer supporting a time-
out mechanism might be needed for detecting a failure. Also the transmission
of the processed values might require some interrupts. Hence the question arises
how each interrupt must be prioritised. In the simple example given, this is not
much of an issue as long as we assume that the system is periodic and always
has spare time between samples. What happens however if multiple interrupt
sources are present and if they can be triggered at any moment in time, even
simultaneously?
RMA was first put forward in 1973 by Liu and Layland [7]. Although it doesn’t
solve all issues it provides a good framework that is simple and most of the time
it is applicable. The algorithm states that given N tasks with a fixed workload
that must be active with a fixed periodicity (with the beginning of the next
period being considered as the deadline for the previous period), all deadlines
will be met if the total processor workload remains below a value of 69% and a
pre-emptive scheduler is used with each task receiving a priority that is higher
if the task has a higher periodicity. The upper bound of 69% is obtained for an
infinite number of tasks. For a finite number of tasks and especially when the
periods are harmonic, the upper bound can be a lot higher, often even observed
to be above 95%. Figure 4 illustrates RMA scheduling of two tasks. In general
RMA defines the scheduleability criterium (on a single processor) as follows:
n
X Cj 1
≤ U (n) = n · 2 n − 1 (1)
j=1
Tj
with:
Fig. 4. Two periodic tasks scheduled with RMA.
A small note however on the assignment of the priorities. In our case, these
are assigned at design time and the scheduler is a straightforward Highest pri-
ority First one. Research on dynamic priority assignment [11] have shown that
algorithms that use Earliest Deadline First (EDF) algorithms (the priority be-
comes higher for the tasks whose deadline is the nearest) can tolerate a workload
of up to 100%. There are however three reasons why this option was not fur-
ther considered. The first one is that the implementation of an EDF scheduler
is not trivial because measuring how far a task is from its deadline requires
that the hardware supports measuring this. As this is often not the case, one
has to fall back on software based solutions that periodically record the task’s
progress. For reasons of software overhead, this must be done with a reasonable
frequency, typically about one millisecond which means that fine-grain microsec-
ond EDF is not feasible (one millisecond can be quite long for a lot of embedded
applications). The second reason is that no algorithms are known that allow
to calculate the EDF schedule on a distributed or multicore target. The third,
but fundamental reason is that an EDF schedule has no graceful degradation.
If a task continues beyond its deadline, it can bring the whole system down by
starvation, whereas a static priority scheme will still allow higher priority tasks
to run. The highest priority task can be activated by a time-out mechanism so
that it can terminate such a run-away task before the other, still well behaving
tasks are starved. Hence, if EDF scheduling is used, it is better to restrict this to
a maximum priority level within a standard priority based scheduling scheme.
A similar observation will be made in the next section when discussing priority
inheritance schemes.
A general remark must be made here. An RTOS in itself does not guarantee
that all real-time requirements will be met. Designers must use scheduleability
analysis tools and other analyses like simulation and profiling to verify this before
the application tasks are executed. However, an RTOS must provide the right
support for executing the selected schedule. In general, this means a consequent
scheduling policy based on priorities with pre-emption capability and with sup-
port for priority inheritance. OpenComRTOS provides this complemented with
a runtime tracing function allowing to profile the time behaviour at runtime.
4.6 The issue of priority inversion and its inadequate solution
– A shared buffer that must be read out before new data is written into it,
– hardware status registers that set a peripheral in a specific state,
– a peripheral that can handle only one request at a time.
Is there a cure for this problem (assuming that the system architect did his
best in minimising the need for resource locking)? The answer is unfortunately
no, but the symptoms can be relieved. The solution is actually very simple. When
the system detects that a task with a higher priority than the one currently
owning the resource is requesting it, it temporarily boosts the priority of the
current owner task, so that it can proceed further. Priority inversion will be
avoided. In practice different algorithms were tried out, but in general the only
change made is that the boosting of the priority is limited to a certain application
specific ceiling priority. Else, the scheduling order of other tasks requiring a
different set of resources can be affected as well. Using the ceiling level, we
can also garantee that higher priority tasks (like monitor tasks) will run when
activated and not being blocked by a lower priority task that was boosted.
If we analyse the issue of blocking in the context of a real system, we can see
however that the priority inheritance algorithm does not fully solve the blocking
issue. It relieves the symptoms by reducing the blocking times but a good design
can maybe avoid them in the first place. The resource blocking issue is part of
a more general issue. In essence, a concurrent real-time system is full of implicit
resource requests. For example, if a high priority task is waiting to synchronise
with a lower priority task, should the kernel also not boost its priority? To make
it worse, if such a task is further dependent on other tasks and we would boost
the priority can this not result in a snowball effect whereby task priorities are
boosted for all tasks and of course, we would have no gain. Or assume that
the task is waiting for a memory block while a lower priority task owns such a
memory block. Or assume that a task acquires a resource, which makes it ready
and is put on the ready list. But while it waits to be scheduled a higher priority
task becomes ready first and requests the same resource. Which means that the
first task that was ready should be descheduled again and the resource given to
the higher priority one.
While all these observations are correct, often such situations can be con-
tained by a good architectural design. The major issue is that implementing
this extra resource management functionality is not for free and the tests they
require are executed every time, resulting in a non-negligible overhead. The con-
clusion is that in practice resource based protection must be avoided by design
and that priority inheritance support is best limited to the traditional blocking
situations. In the case of the implicit resource blocks, if they pose an issue to
the application, they can be reduced to a classical priority inversion problem
by associating a resource with the implicit resource. E.g. if a memory block is
critical, associate a resource at the application level and normal support for pri-
ority inheritance will limit the blocking time. Else make sure that the system
has additional memory blocks available from the beginning.
Fig. 5. Three tasks sharing a resource first without and then with priority inheritance
support
4.7 Distributed priority inheritance in OpenComRTOS
While implementing support for priority inheritance for a single processor RTOS
is straightforward, implementing it in a distributed RTOS is more complicated
because task states are distributed and change over time. On a single proces-
sor, the RTOS scheduler will examine the resource current owner when a task
is requesting a resource. If the owner’s priority is lower, then it will put the
requesting task in the resource waiting list and boost the priority of the current
owner. When the owner releases the resource, the RTOS scheduler will assign it
to the highest priority task in the waiting list.
On a multi-processor system (single chip many/multicore, networked), on
each node the kernel scheduler is managing the resources residing on its node.
Requests for the resource can come from local tasks, remote tasks, the owner
task can be residing on the same node or on another node, can be waiting on
still another node or it can be in transit from one node to another. Hence, the
local kernel scheduler must determine where the task resides at the moment of
the resource request, send a priority boost request to the node where the task is
residing and when the resource is released, lower the owner task’s priority to its
original priority.
While this approach works well, the inherent communication delay of the
inter-node communication can result in side-effects. For example the owner task
might have issued a request that is forwarded to another node just before the
boost request arrives. In practice this means that the distributed priority in-
heritance implementation is a best effort approach. The effects are mitigated
if all tasks involved have a relative high priority, whereby the blocking is less
problematic and if the network has relatively low communication delays. The
boosting and reduction of the blocking time is the greatest when the owner task
has a relatively low priority versus the requesting task. In that case, the pri-
oritised communication layer will automatically assure that the priority boost
request arrives first. This also means that such a priority boosting mechanism
is most useful if the use of the resource is relatively long, i.e. longer than the
transmission latency in the network.
In the first part of this paper, we have limited ourselves to the handling of real-
time requirements. An unspoken assumption was that the system is fully defined
at compile time. For most embedded applications this is the case. However, as
applications are becoming more dynamic and adaptive, the complexity increases
as well. In such applications, meeting stringent real-time requirements is still
often a prime requirement but it is not sufficient. The real-time requirements
will have to be met when multiple applications execute simultaneously with a
variable amount of available resources. In the extreme, this also means in the
presence of faults resulting in a number of resources no longer being available
on a permanent or temporary basis.
We will illustrate this with two use cases for which the network-centric Open-
ComRTOS could provide the system level software.
The first use case is a next generation electric car. Such a car will be fully
controlled by software and electronic components (“drive-by-wire”) and likely
have a distributed power and wheel control architecture whereby for each wheel
traction control is combined with active suspension control, stability, anti-slip
control and even braking. Many components can fail or show intermittent fail-
ures, e.g. sensors can fail, wires can break, connectors can give micro-cuts (very
short absence of electrical contact due to vibrations), memory can become cor-
rupted, processors can fail, etc. While the design should be robust enough to
make such failures very low probability events, over the lifetime of the car such
occurrences are certain. Practically speaking this means that while the system
can be designed assuming that all resources are always available, the designer
must provide additional operating modes that take into account that some re-
sources are not available for meeting all requirements. In the simplest case this
can mean that when one wheel controller fails, the processing is immediately
redistributed over the three still fully functional units. Or this can mean that
the system switches to a degraded mode of operation with a different set of tasks
using less compute intensive algorithms.
The second use case is a next generation mobile platform. It is envisioned
that such a platform will have tens of processing nodes, execute multiple applica-
tion functions with some functions showing a variable processing load depending
on the data being processed (typical for multimedia and image processing). In
the worst case, the processing load can even surpass temporarily the available
processing power. On the other hand such applications can often tolerate a few
missed deadlines. However, such a mobile platform loaded with a dynamic set of
tasks, poses additional constraints. E.g. when using wireless connections, band-
width will vary over time, processing power might be variable because of voltage
and frequency scaling techniques to minimise power consumption and available
memory will vary depending on the use by other applications. Many of the pro-
cessors used for such applications are so-called many- or multicore chips and
are essentially chips with in silicon networks (NoCs) over which CPUs as well as
high performance peripherals are connected. The NoC as well as the peripherals,
the on-chip as well as off-chip memory are all resources that can be shared. In
the Figure 6 such an advanced multicore chip supported by OpenComRTOS is
shown. Newer versions also include a quad-core ARM processor.
What these two use cases illustrate is that an embedded real-time application
is becoming more challenging for following reasons:
The result is that such an embedded system becomes “layered” and time as
a resource is not the only one that must be scheduled. Such a system will need
to schedule the use of several types of resources, although the final criterium
remains meeting the various real-time requirements. In the guaranteed mode
of operation we find back the traditional real-time scheduling. Rate Monotic
Scheduling provides for meeting the time properties whereas compile-time anal-
ysis assures that all other resources are available. In the extreme case this in-
cludes providing for fault tolerance because the system has to be designed with
enough redundant resources to cope with major failures.
The next layer is then a best-effort mode in which the properties are guar-
anteed most of the time, eventually with degraded service levels. For the time
properties this means we enter the domain of soft real-time, but often at the
application level this means that the system offers a statistically defined level of
quality of service level. A typical example is generating an image with less reso-
lution because not enough processing power was available during the frame time.
In the extreme case this corresponds with a fail-safe mode of operation whereby
the quality of services is reduced to a minimum level that is still sufficient to
stop the system in a safe way.
Finally, the last layer is one where essentially nothing is guaranteed. The
system will only make resources available if there are any left. Statistically, this
can still be most of the time unless a critical resource like power is starting to
fail, and the system then was designed to put the processor in a “sleep” mode
to e.g. stretch battery time.
What we witness here is a transition from a statically defined hard real-time
system with fully predictable time behaviour, but possibly catastrophically fail-
ing, towards a system where the design goal is defined as a statistical quality of
service (QoS) at the application level. Such a system must still be able to meet
hard real-time constraints in a predictable way but must also offer different op-
erating modes corresponding with a graceful degradation of the services offered
by the system as a whole. Practically speaking, when a processor fails, it will of-
ten be catastrophically although processors with a MMU (Memory Management
Unit) and appropriate system software can contain the failure to the erroneous
task or process without affecting the rest of the application, unless there are
dependencies. Most embedded processors however will need a hard reset to re-
cover from such a fault. Hence, such a system will need redundancy of hardware
resources, be it as part of a distributed system, be it as part of a multicore chip.
These next generation requirements were not addressed in the orginal Open-
ComRTOS project, but the fact that OpenComRTOS supports programming
a multicore and distributed system in a transparent way facilitates addressing
such requirements.
6 An approach for QoS resource scheduling
If a system needs more resources in a worst case application scenario than avail-
able, does it mean that it is not a feasible system? As we have seen above, this
needs not to be the case. The step to make is to assign the priorities not only
in terms of meeting real-time constraints (as dictated by RMS) but also as a
function of the criticality level of the task. In essence, we can distinguish three
levels whereby we map the criticality level to a QoS level:
– QoS-3: Tasks that must run and never miss any deadline: this is the hard
real-time domain.
– QoS-2: Tasks that must run but can miss a deadline if not too often: this is
the soft real-time domain of best effort.
– QoS-1: Tasks that must run but only when resources are left over: this is the
domain of no garantees.
– QoS-1 is the level where is no garantee that there will be resources to provide
the service. This implies tasks with no strict real-time constraints and often
covenience functions. It also applies to tasks where the output is more or less
time-independent. If no update can be calculated, the previous output will
be sufficient. This does not mean that for a service to remain usable, that a
certain level of updating must be possible. A typical example application is
a video phone with a bad connection. In the worst case, the user can switch
off the video transmission to improve the audio quality. Hence a fault like
resource exhaustion does not result in a fatal condition but mostly in a lower
level of service provided. The limit case is the one whereby the quality has so
much deteriorated that it becomes fully unusable. Of course, this should not
happen more often than specified. This might be the case when the system
has been underspecified from the very beginning.
– QoS-2 is the level where the tasks must produce a result within a statisti-
cally acceptable interval. This means that the tasks have no hard real-time
constraints but should still meet them most of the time, hence we can de-
fine quality attributes like probability of reaching the deadline within a time
interval, probability of sucessive misses, etc. Hence a fault like resource ex-
haustion results in a statistically predictable failure rate. Upon a fault, the
application must define what an acceptable behaviour is. Typical behaviour
is: abort and drop the result, extrapolate from a previous result, etc. Hence
the service degradation has been specified and must be met.
– QoS-3 is the level whereby the system does not tolerate missing a deadline.
If a such a fault occurs, all service can be lost. While the consequences are
application specific, the application must be capable to capture the fault
and prevent it from generating system errors, switch the system to a safe
state or initiate actions to restart the system. This is typically the domain of
safety, often requiring hardware support. We can distinguish two subdomains
depending on the hardware architecture. If no redundancy is available, the
system must be brought into a safe state after the fault happened. Hence,
it is part of the system specification. If hardware redundancy is available,
then the redundancy can be used to still provide a valid output. Hence, the
system will have degraded but the service level will have been maintained.
Of course, a subsequent fault can now be fatal, hence the safety assurance
will now be lower.
Note that above classification is very generic and does not prescribe in detail
how the system should handle the faults. This is often application specific. How-
ever it shows that in general a system can host several applications or functions
with a different level of QoS. It also points to a different approach in safety
design. Rather than making sure in a static way that an application has all the
resources defined at build time, we only need to garantee this for QoS3 level
applications. Fault tolerance can be considered as its limit case. If the system
has serious issues with resource exhaustion, then all resources should be assigned
to meet QoS3 specifications. In the worst case, this means keeping the system
alive as long as possible with minimal resources to prevent greater catastrophic
failures.
This is in line with the concept of Rate Monotic Scheduling whereby priority
is used to assign automatically the CPU time to the highest priority tasks and
whereby priority inheritance is used to unblock the resources as fast as possible
so that higher priority task an use them.
Given that we have different QoS levels, a clear requirement is that errors in
one level must not result in errors in another, in particularly higher QoS level.
But also inside each level, measures must be taken to prevent error propagation
from one function to another. This should be pursued in a systematic way and
requires several layers of defense.
To conclude we can see that the various defense mechanisms are intertwined
and a good trade-off decision will depend as well on the application as on the
available hardware. However, two factors dominate. The first one is that an
adequate programming model is a pre-condition. The second one is that simple
hardware error detection and protection mechanisms can be very beneficial. In
all cases is the key challenge to share the available resources in the best possible
way.
– The quantum must be large enough to offset the overhead associated with
allocating a quantum.
– The quantum should be small enough to avoid starvation for other applica-
tion functions.
We can illustrate this with the case of a shared communication link between
two or more nodes. Assuming we transmit and receive a communication unit of
N bytes at a time, following parameters are of importance:
The next problem to tackle is to define scheduling strategies that allow to keep a
maximum of QoS when faults occur whereby resources become depleted. This is
complex because the decisions must be taken switfly, often based on incomplete
information. We can define following rules (amongst others):
– Applications with QoS level N have priority over applications with a QoS
level lower than N.
– QoS-3 requires redundancy.
– QoS-2 must have an abort mechanism for safely releasing resources.
– If the fault is intermittent, then recovery can be attempted.
The first observation to make is that the enabling of the caches has a serious
impact on the performance. When all caches are enabeled, the performance gain
is about a factor of 50. This is maily due to the access speed to the external
memory. On the otehr hand, the cache flushing has less impact than one would
expect. This is due to the architectural implementation of the cache ogic whereby
a complete cashline (32 bytes) is cashed whenever non-cached data or code is
accessed. Hence, this mechanism mitigates the effect although we still see that
interrupt latencies jump with a factor 5 (but way below the values with no
caching).
This was confirmed by executing a few measurements using the on-chip per-
formance monitor unit. This unit allows to meausure the time more accurately
and also records instruction and data caches misses.
– Ten data accesses (read operations) from consecutive locations takes 122
instructions executed in 167 CPU cycles when caches are enabled.
– Ten data accesses from non-consecutive locations takes 140 instructions ex-
ecuteed in 8959 cycles when both caches are disabled.
– Ten data accesses from non-consecutive locations takes 137 instructions ex-
ecuteed in 1234 cycles. when all caches are fully enabled.
– Caches disabled
–
– Port interactions: 214.658
– Event interactions: 211.081
– Semaphore interactions: 210.940
– Fifo interactions: 214.663
– L2 enabled
–
– Port interactions: 102.592
– Event interactions: 100.980
– Semaphore interactions: 100.820
– Fifo interactions: 102.407
–
– L1 and L2 enabled
– Port interactions: 4.003
– Event interactions: 3.963
– Semaphore interactions: 3.955
– Fifo interactions: 4.053
When comparing with the QoS levels, one can see that a component or system
must meet minimum levels of ARRL to enable a minimum QoS level whereby
we consider resource exhaustion as a fault.
Hence, the ARRL levels allow us to define rules and requirements that com-
ponents must be met in order to be usable for meeting a specified QoS level.
The implications:
Current single chip designs have shared resources, hence only ARRL-3 can
be reached, whereas to reach ARRL-4 and ARRL-5, each processor must have a
dedicated set of resources (CPU, memory, power, ...). ARRL-4 or ARRL-5 level
must also be reached for the inter node communication mechanism.
8 Conclusion
Modern advanced many/multicore chips introduce the need to take into account
their complexity of shared resources and their statistical nature of executing
applications. This means that traditional real-time and safety thinking (that
assumes that everything is mostly static and predictable) is no longer fully ap-
plicable, unless the on-chip resources are severily under-utilised. This paper pro-
poses to consider meeting real-time constraints as part of the QoS offered by an
application, even in the presence of faults. The result is a scheme whereby grace-
ful degradation is defined as a design requirement, especially in the presence of
faults. The design path to a working solution is to consider most, if not all on-
chip shared resources, as resources for which the application functions compete
at runtime constrained by their relative priority derived from their QoS level.
In this case we can reuse the priority inheritance protocol for managing access
to the resources. However, unless the chip designers have taken specific precau-
tions, this means that for the higher safety levels physical partitioning is still a
must. This paper does not yet present a complete solution on how to define the
runtime scheduling and resource sharing parameters for a given application. We
envision a process whereby first order approximations are derived from a static
approach with runtime profiling allowing to improve upon the selected param-
eters. However, it remains a trade-off exercise as full optimisation is not likely
due to the statistical nature of the problem domain. Finally, we have shown
how different safety integrity levels (SIL) are related to quality of service (QoS),
whereby a criterium (ARRL) was formulated that components must meet to be
used in certain quality of service levels.
References
1. E. Verhulst, R.T. Boute, J.M.S. Faria, B.H.C. Sputh, and V. Mezhuyev. For-
mal Development of a Network-Centric RTOS. Software Engineering for Reliable
Embedded Systems. Springer, Amsterdam Netherlands, 2011. 2
2. Altreonic, January 2011. http://www.altreonic.com, last visited:
20.01.2011. 2
3. Eric Verhulst. Virtuoso : providing sub-microsecond context switching on dsps
with a dedicated nanokernel. in international conference on signal processing ap-
plications and technology, santa clara september, 1993. 1993. 3
4. Wikipedia. Transputer — wikipedia, the free encyclopedia, 2011. [Online; accessed
1-February-2011]. 3
5. Inmos, January 2011. http://www.inmos.com, last visited: 20.01.2011. 3
6. C.A.R. Hoare. C.A.R. Hoare. Communicating Sequential Processes. Prentice-Hall,
1985. 3
7. C. L. Liu and James W. Layland. Scheduling algorithms for multiprogramming in
a hard-real-time environment. J. ACM, 20:46–61, January 1973. 4.4
8. Loic P. Briand and Daniel M. Roy. Meeting Deadlines in Hard Real-Time Systems:
The Rate Monotonic Approach. IEEE, 1999. 4.4, 4.5
9. Mark Klein, Thomas Ralya, Bill Pollak, Ray Obenza, and Michael González Har-
bour. A Practitioner’s Handbook for Real-Time Analysis: Guide to Rate Monotonic
Analysis for Real-Time Systems. Springer, August 1993. 4.4
10. Mast, January 2011. http://mast.unican.es, last visited: 20.01.2011. 4.4
11. A. Styenko. Real-Time Systems: Scheduling and Structure Af.Sc. Thesis. Univer-
sity of Toronto, 1985. 4.5
12. M.B. Jones. What really happened on mars, 1997. 4.6
13. Iec 61508 edition 2.0, 2010. [Online; accessed 19-March-2013]. 7