RTOS Session1
RTOS Session1
Purushotham BV
[email protected]
1
Agenda
1. Typical Real - Time Applications
1.1 Digital Control
1.2 High Level Controls
1.3 Signal Processing
1.4 Other Real – Time Applications
2. Hard v/s Soft Real – Time Systems
2.1 Jobs and Processors
2.2 Release Times, Deadlines, and Timing Constraints
2.3 Hard and Soft Timing Constraints
2.4 Hard Real – Time Systems
2.5 Soft Real – Time Systems
• Summary
2
Introduction: Real-Time System
• Real-time
– Does not denote speed/fast
– But meet the timing constraints or deadlines
• A real-time system must deliver services in a timely
manner
– Not necessarily fast, but must meet some timing deadline
• Many real-time and embedded systems exist, often
without the awareness of their users
– Washing machine, photocopier, mobile phone, car, aircraft,
industrial plant, microwave oven, toothbrush, CD player,
medical devices, etc.
3
Introduction: Real-Time System (Contd.,)
4
Introduction: Real-Time System (Contd.,)
• Real-time system
Respond to external events in a timely fashion and the response time is
guaranteed
5
Introduction: Real-Time System (Contd.,)
6
Introduction: Real-Time System (Contd.,)
Controlling
System
input output
Controlled Controlled
System System
Controlled
System
output input
7
Real-Time Systems (Contd.,)
9
Real-Time Systems Examples (Contd.,)
10
Real-Time Systems Examples (Contd.,)
• DVD player
– Controlling system
• DVD player must decode both the video and audio streams from the
disc simultaneously.
– Controlled system
• Remote control is viewed as a sensor to feed pause and language
selection events into DVD player
11
Characteristics of Real-Time Systems
• Characteristics
– Must produce correct computational results, called logical
or functional correctness
– These computations must conclude within a predefined
period, called timing correctness
12
Representative Classes of Real-Time and
Embedded System
• Digital control
– Sampled data systems
• High-level controls
– Planning and policy above low level control
• Signal processing
– Digital filtering, video compression & encryption, radar
signal processing
• Other real-time applications
– Real-time databases, multimedia applications
13
Digital Control
14
Digital Control (Contd.,)
15
Digital Control Applications
16
Sampled Data Systems
17
Inside a Sampled Data System
• Periodically the analogue sensors are sampled (read)
and the readings digitized.
• Each period the control-law computations are carried
out on the digitized readings.
• The computed digital results are then converted back
to an analogue form needed for the actuators.
• This sequence of operations is repeated periodically.
18
Computing the Control Law for a
Sampled Data System
19
Effect of Sampling Period
21
More Complex Control-law
Computations
• The simplicity of our digital controller depends on three
assumptions:
1. Sensors give accurate estimates of the state-variable values
being monitored and controlled. This is not always true given
noise or other factors.
2. Sensor data give the state of the system. In general sensors
monitor some observable attributes and the values of state
variables have to be computed from the measured values.
3. All parameters representing the dynamics of the system are
known.
22
A More Complex Digital Controller
23
A More Complex Digital Controller (Contd.,)
• Deadbeat Control
• A discrete time control scheme that has no continuous
time equivalence is called deadbeat control.
• Kalman Filter
• Used to improve the accuracy of measurements and to
estimate model parameters in the presence of noise and
uncertainity.
24
High-Level Controls
25
Examples of Control Hierarchy
26
Examples of Control Hierarchy (Contd.,)
27
Guidance and Control
• Digital controller deals with some dynamic behavior of the physical
plant
• A second level perform typically guidance and path planning functions
• It tries to find one of the most desirable trajectories among all the
trajectories that meet the constraints of the system.
• The trajectory is most desirable because it optimizes cost functions as
the algorithm used for finding the solution generates optimized results.
• Guidance and control should take care of the complexity and timing
requirements to solve non linear systems.
• Higher level control systems leads to many additional complicated
control algorithms.
28
Real – Time Command and Control
30
Signal Processing Bandwidth Demands
31
More Complex Signal Processing
32
Radar Signal Processing
33
Radar Signal Processing (Contd.,)
• The system comprises an I/O subsystem that samples and
digitizes the echo signal from the radar and places the sampled
values in shared memory.
• An array of digital signal processors process these values.
• The data produced are analysed by one or more data processors
which not only interface to the display system but also feed
back commands to control the radar and select parameters for
the signal processors to be used for the next sampling period.
• Tracking, Gating, Data Association are the stages in Radar
Signal Processing
34
Other Real-Time Applications: Databases
• Stock exchange price
database systems
• Air traffic control databases
• What makes it real-time?
– The data is ‘perishable’
– The data values are updated
periodically
– After a while the data has
reduced value
– There needs to be temporal
consistency as well as normal
data consistency
35
Real-Time Databases: Absolute
Temporal Consistency
• Real-time data has parameters such as age and temporal
dispersion.
• The age of an object measures how up-to-date the
information is?
• The age of an object whose value is computed from other
objects is equal to that of the oldest of those objects.
• A set of data objects is said to be absolutely temporally
consistent if the maximum age in the set is no greater
than a certain threshold.
36
Real-Time Database: Relative Temporal
Consistency
• A set of data objects is said to be relatively temporally
consistent if the maximum difference in the ages is
less than the relative consistency threshold used by the
application.
• For some applications the absolute age is less
important than the differences in ages.
37
Real-time Databases: Consistency
Models
• Concurrency control mechanisms such as 2-phase locking
have been used to ensure serializability of read and update
transactions and maintain data integrity of non-real-time
databases.
• These mechanisms can make it more difficult for updates to
be completed in time.
• Late updates may cause data to become temporally
inconsistent.
• Weaker consistency models are sometimes used to ensure the
timeliness of updates and reads.
38
Real-time Databases: Consistency Models
(Contd.,)
• For instance we may require updates to be serializable
but allow read-only transactions not to be serializable.
• Usually the more relaxed the serialization requirement,
the more flexibility the system has in interleaving the
read and write operations from different transactions,
and the easier it is to schedule transactions so that they
complete in time.
39
Real-time Databases: Consistency
Models (Contd.,)
• Kuo and Mok proposed that ‘similarity’ may be a
suitable correctness criterion in some real-time
situations.
• Two views of a transaction are ‘similar’ if every
read operation gets similar values of every data
objects read by the transaction, where ‘similar’
means that the data values are within an
acceptable threshold from the point of view of
every transaction that may read the object.
40
Other Real-Time Applications:
Multimedia Applications
• One of the most
frequently encountered
real-time application
• Multimedia may process,
store, transmit and
display any number of
video streams, audio
streams, images, graphics
and text
41
Other Real-Time Applications:
Multimedia Applications (Contd.,)
• MPEG Compression / decompression
• Video compression standard MPEG make use of three
techniques:
– Motion compensation for reducing temporal redundancy
– Discrete cosine transform for reducing spatial redundancy
– Entropy encoding for reducing the no. of bits required to
encode all the information
42
Summary of Real-Time Applications
43
Hard v/s Soft Real – Time Systems
Jobs and Processors
46
Release Times, Deadlines and Timing
Constraints
• Release time of a job
– the instant of time at which the job becomes available for
execution
– Job can be scheduled and executed at any time at or after its
release whenever its data and control dependency conditions
are met
– Jobs have no release time if all the jobs are released when
the system begins execution
• Response time
– The length of time from the release time of the job to the
instant when it completes
47
Release Times, Deadlines and Timing
Constraints (Contd.,)
• Relative deadline
– The maximum allowable response time of a job
• Deadline or Absolute Deadline
– The instant of time by which its execution is required to be completed
– Equal to the release time plus the relative deadline
– A job has no deadline if its deadline is at infinity
• Timing Constraints
– A constraints imposed on the timing behavior of a job
– Specified in terms of release time or deadline
– Periodic Tasks: Time-driven recurring at regular intervals.
– Aperiodic: event-driven.
48
Hard Real-Time System
• Degree of tolerance of missed deadline
– Extremely small or zero
• Usefulness of computed results after missed deadlines
– Likely useless
• Severity of the penalty incurred for failing to meet deadlines
– catastrophe
• Failure to meet constraint is a fatal fault. Validation system
always meets timing constraints.
– Deterministic constraints
– Probabilistic constraints
– Constraints in terms of some usefulness function.
49
Hard Real-Time System (Contd.,)
50
Soft Real-Time System
Value
Deadline
Soft RTS
Hard RTS
Time
53
Summary of Hard v/s Soft Real-time
Systems
• Jobs and Processors
• Release Times
• Deadlines
• Timing Constraints
• Hard real-time systems
• Soft real-time systems
54