01 Session U1
01 Session U1
Savitha
SJCIT 1
Real-time Systems
There are a set of distinguishing features which can assist with
an outline classification schema to identify real-time
applications
1. Specified limit on system response latency
2. Event driven scheduling
3. Low-level programming
4. Software tightly coupled to special hardware
5. Dedicated specialized functions
6. The computer may be inside a control loop
7. Volatile variable
8. Multitasking implementation
9. Run-time scheduling
SJCIT 2
Real-time Systems
11. Unpredictable environment
12. System intended to run continuously
13. Life critical applications
SJCIT 3
Timing
• Most common definitions of a real-time system “correct
results within specified period of time”
• Meet deadlines, it is required that the application has to finish
certain tasks within the time boundaries it has to respect
SJCIT 4
Low-level Programming
• The C language is still favorite for writing device drivers for
new hardware
• But high level languages, including C, do not have the
necessary instructions to handle interrupt processing, it has
been common for programmer to use assembler level
language to carry out this type of coding
SJCIT 5
Specialized Hardware
• Most real-time systems work within or at least close beside
specialized electronic and mechanical devices
Example:
• Small embedded microcontrollers required to perform critical
component parts within a feedback control loop
• The oven power controller could employ an integrated
microcontroller to monitor the oven temperature and adjust the
electrical power accordingly
• Such applications place a heavy responsibility on the
programmer to fully understand the functional role of the
software and its contribution to the feedback delay which
govern the system response
SJCIT 6
Specialized Hardware
• This leads the programmer into other disciplines like electrical
theory, mechanics, acoustics, physiology, optics, etc
Desired Temp
Heater
DAC OVEN
Driver
ADC
Signal Conditioning
SJCIT 7
Volatile Data
• There are variables which change their value from moment to
moment due to the action of external devices or agents through
interrupts or DMA
• This is distinguished from the situation where input data is
obtained from a disk file or from the keyboard under program
control
• Example: input channels operate autonomously to bring in
new values for memory variables when data arrives at an input
port
• The software must then be structured to check for changes at
the correct rate so as not to miss a data update
SJCIT 8
Multitasking
• Real-time systems are often expected to involve multitasking
• Here several processes or tasks cooperate to carry out the
overall job
• There is a clear distinction drawn between the static
aggregation of groups of instructions into functions for
compilation and the dynamic sequencing of tasks which takes
place at runtime
• Advantage of multitasking is that it simplifies the
programmers in their work
• It is widely accepted that many computer systems have
become so complex that it is necessary to decompose them
into components to help people to understand and build them
SJCIT 9
Run-time Scheduling
• The separation of activity into several distinct, semi-
autonomous tasks leads to question of task sequencing
• The major part of sequencing takes place at run-time and is
accomplished by the OS through the action of the scheduler
• This is most interesting feature of the real-time systems
• The manner in which the various activities are evoked in the
correct order is quite different from that of traditional data-
processing systems where data records arrival is
predetermined and fixed
SJCIT 10
Unpredictability
• Being event driven, real-time systems are at the mercy of
unpredictable changes in their environments
• It is not feasible to anticipate with 100% certainty all the
permutations of situations which may arise
• The exact ordering or sequencing of all the functions which
deal with these interactions has to be decided at run-time by
the scheduler
• Considerable effort is now put into extensive simulation
testing in order to trap as many of these bugs as possible, even
before the designs are released
SJCIT 11
Life Critical Applications
• Real-time systems can involve serious risks in critical
applications
• A failure to run correctly may result in death or injury to the
user and others
• Such applications are becoming more and more common with
the aircraft and automobile industries converting their
products to ‘fly-by-wire’ processor technology
• This removes from the driver/pilot all direct control over the
physical mechanism, relying entirely on digital control
systems to carry out their commands
• Commercial viability
– Cost
– Acceptance
SJCIT 12
Real-time Systems - Definitions
1. Oxford dictionary of computing: Any system in which the
output produced is significant
– This is because the input corresponds to some movement in the
physical world and the output has to relate to that same movement
– The lag from the input time to the output time must be sufficiently
small for acceptable timeliness
– Examples:
• Process control
• Embedded computer systems
• Computer aided testing
• Workstations running under UNIX OS
• Aircraft engine control systems (critical application)
SJCIT 13
Real-time Systems - Definitions
Cooling(1991)
• Real-time systems are those which must produce correct
responses within a definite time limit. Should computer
responses exceed these time bounds then the performance
degradation and/or malfunction results
SJCIT 14
Real-time Systems - Definitions
• A real-time system reads inputs from the plant and sends
control signals to the plant at times determined by the plant
operational considerations – not at times limited by the
capabilities of the computer system
SJCIT 15
Real-time Systems - Definitions
• A real-time system is a system that must satisfy explicit
(bounded) response-time constraints or risk severe
consequences (including failure)
SJCIT 16
Real-time Systems - Definitions
• In general a real-time program is
– A program for which the correctness of operation depends both on the
logical results of the computation and the time at which the results are
provided
SJCIT 17
Types of Real-time Systems
• Soft real-time system: is one in which the performance is
degraded but not destroyed by failure to meet the response
time
• Hard real-time system: is one in which failure to meet a
single deadline may lead to complete and catastrophic system
failure
• Firm real-time system: is one in which a few missed
deadlines will not lead to total failure, but missing more than a
few may lead to complete and catastrophic system failure
SJCIT 18
Types of Real-time Systems
Real- Examples
time
Soft ATM, TV Channel Missing even many deadlines will
not lead to catastrophic failure,
only performance is degraded
Firm Robot Weed Missing critical navigation
Killer deadlines causes robot to veer
hopelessly out of control and
damage crops
Hard Air-to-air Missile Missing the deadline to launch the
missile within a specified time after
pressing the button can cause the
target to be missed which will
result in catastrophy
SJCIT 19
Summary
• There are a set of distinguishing features which can assist with
classification schema to identify real-time applications
• Most common definitions of a real-time system “correct
results within specified period of time”
• The C language is still favorite for writing device drivers for
new hardware
• Most real-time systems work within or atleast close beside
specialized electronic and mechanical devices
• Real-time systems are often expected to involve multitasking
• Being event driven, real-time systems are at the mercy of
unpredictable changes in their environments
SJCIT 20