Anda di halaman 1dari 41

Real-Time Systems

Dr Shamala Subramaniam
Dept. Communication Technology & Networks Faculty of Computer Science & IT, UPM e-mail : shamala@fsktm.upm.edu.my Phone : 03-89466512

Dr Shamala Subramaniam

Synopsis

Dr Shamala Subramaniam

Real-Time Systems
Dr Shamala Subramaniam
Dept. Communication Technology & Networks Faculty of Computer Science & IT, UPM e-mail : shamala@fsktm.upm.edu.my Phone : 03-89466512

Dr Shamala Subramaniam

Introduction

Dr Shamala Subramaniam

Definition
Any system where a timely response by the computer to external stimuli is vital is a realtime system.
Real-Time System runs task that have deadlines

Not necessary for the task to done within the dateline aircraft vs. video game The statement is True because it is almost Content Free Done Not necessarily to be done , calculating the value of T vs. accounts

What do you do with a realtime tasks that misses its Dr Shamala Subramaniamdeadline?

Definition
A real-time system is one which a substantial fraction of the design effort goes into making sure that task deadlines are met. Oxford Dictionary of Computing
Any system in which the time at which the output is produced is significant. This is usually because the input corresponds to some movement in the physical world, and the output has to relate to the same movement. The lag from the input to the output must be sufficiently small for acceptable timeliness.

Young (1982)
Any information processing activity or system which has to respond to externally generated input stimuli within a finite and specified period.
Dr Shamala Subramaniam 6

Hard versus Soft


HARD: miss a deadline and youre in trouble! (planes, trains, factory control, nuclear facilities, ...) SOFT: try to meet deadlines, but if not, system still works, although with degraded performance (multimedia, thermostat, ...) FIRM: late results are worthless (deadlines can be missed occasionally), but you are not in trouble (no benefit from late delivery)

Dr Shamala Subramaniam

Driving a Car
Relating to a Real-Time System

Dr Shamala Subramaniam

Example: Car-and-Driver
Constraints of the driver Reach destination without colliding and within the speed limit

satisfying the constraints.

Drivers Mission: Reaching the destination safely while Controlled System/Process: Car.

Operating environment: Road conditions and other cars. Controlling System


Human driver: Sensors - Eyes and Ears of the driver. (Real-time Controller) Computer: Sensors - Cameras, Infrared receiver, and Laser telemeter.

Controls: Accelerator, Steering wheel, Break-pedal. Actuators: Wheels, Engines, and Brakes.
Dr Shamala Subramaniam 9

Dr Shamala Subramaniam

10

Quantifying the drivers performance


Measure the outcome of the drivers actions, taken in context of the operating environment.
1. Getting to the destination
Obvious Outcomes 15mph (well?) during snowstorm and on a dry weather Not just the outcome but what caused the driver to get there (landing into a ditch)
11

2. The Time taken to reach to the destination

Dr Shamala Subramaniam

Conclusion Performance
Performance is not an absolute commodity. Performance must be measured instead in terms of what the condition allows. In other words, performance measures the goodness of the outcome relative to the best outcome possible under the circumstances.

Dr Shamala Subramaniam

12

Performance (cont.): The task the driver must perform Critical Task Tuning the Radio vs. Steering and Braking Critical Task varying Deadlines Not Constant; they vary with the operating environment (driving 6pm/am). About the drivers condition: Drivers Physical Condition 1s sleep vs. micro-sleeping Discrimination - on the basis of secondary factors additional fuel consumption

Dr Shamala Subramaniam

13

Try Out !!
Write a detail specification on what the driver must do in each conceivable eventuality & then ensure that the specifications were complete.

Dr Shamala Subramaniam

14

Wouldnt you agree that: Writing out formal specifications and validating them are perhaps the most difficult task in real-time systems. They are also the tasks about which researchers know the least.

Dr Shamala Subramaniam

15

Issues in Real-Time Computing


A real-time computer must be more reliable than its individual hardware and software components. It must be capable of working in : Harsh environments Rich in electromagnetic noise Elementary-particle radiation Face of rapidly changing computation loads. The field of real-time computing is especially rich in research problems.
Dr Shamala Subramaniam 16

Issues in Real-Time Computing (cont.)


Task execution time Cache Example

A executes t1

B executes

A executes T2.2

A preempted by B

A resumes

A completes

Real-Time Systems differs from general purpose counterparts in 2 ways: Much more specific in their applications Consequences of their failure are more drastic

Dr Shamala Subramaniam

17

The Oracle in Delphi, Greece

Since the consequences are severe


Such systems need to be specified more carefully Their performance validated specification languages and performance measures capable of expressing timing requirements Example : jet engine x general purpose workstation

Structure of A Real-Time System RealThe s/w for the jobs are preloaded scheduling Environment Provides input to the controller, RT computer

Controlled Process

Sensors

Job List

Clock

State of the controlled process and of the Operating Environment is acquired by sensors

used to trigger the execution of individual jobs

Trigger Generator

Actuators
FaultFault-Tolerant techniques output of trigger is fed in the actuators

Execution

Display
can be preloaded or pre=determined

Operator

Structure of A Real-Time System (cont.)


The control computer exhibits dichotomy in terms of the data rates.
Sensors,actuators,displays and input panels LOW RATES Processing of the data into the next stage MIDDLE

Central cluster Control algorithms are executed

Schematic decomposition of a realreal-time control computer

TASK CLASSES
Task can be classified in two ways: Predictability of their arrival Periodic speed of the aircraft aperiodic aircraft turn Consequences of not being executed on time Critical
- every ni iterations of critical period task i

Non Critical - the goal is to maximize no. of jobs

More examples RT System


cars: engine control, ABS, drive-by-wire drive-byplanes: stability, jet engine, fly-by-wire fly-bycomputers: peripherals, applications military: weapons, satellites domestic: microwave, thermostat, dishwasher medical: pacemaker, medical monitoring protection: intruder alarm, smoke/gas detection

Common Misconceptions
real fast is real-time: a computer system may satisfy an applications requirement, but no predictability (no real-time resource management). hardware over-capacity is enough: again, without real-time resource management no appropriate balance of resource distribution.

Issues in Real-Time Programming RealPerformance Measures

Characterizing Real-Time Systems and Task


Dr Shamala Subramaniam
Dept. Communication Technology & Networks Faculty of Computer Science & IT Universiti Putra Malaysia 43400 Serdang, Selangor

Contents
Performance measures for real-time systems Properties of Performance Measures Traditional Performance Measures Performability
Cost Functions & Hard Deadlines

Estimating Program Run Times


Analysis of Source Code Accounting for Pipeline Caches

Introduction
2 Questions ?
Which performance measures are the most appropriate for real-time systems? How can engineers estimate the worst-case run time of a program, given the source code and target architecture?

Performance Measures for Real-Time Systems Real-time systems are used for critical applications Thus, the system must be carefully :
 designed  validated before operation Checking design correctness The choice of using formal and informal performance methods measures Characterizing performance & reliability Preparatory Step:

Performance Measures
The choice of performance measures is crucial Are yardsticks by which characterization is expressed Must be concise encapsulate in very few numbers the performance of a system Analogy:
Languages through which we convey system performance
Natural languages determines how our thoughts gets expressed but also which ideas arise the richness of the vocabulary

Performance Measures (cont.)


Eg: System A and B have system response times with the pdf.

Probability density

Performance have system : weighted sum of the Measures (cont.) Eg: System A and B
mean M and variance V of the response time

a1M + a2(V)

The mean is a measure of the center or most likely value in


a distribution. For N samples x0, x1, x2,....xN-1 from some population, the mean (also sometimes called the average or expected value) is defined as

The variance A measure of the average distance between


each of a set of data points and their mean value; equal to the sum of the squares of the deviation from the mean value.

Example 2.2
Performance perceived by a user depends in a complex way on the system response timeViewpoint of a Typist Performance

Example 2.3
Pocket Pager simple functions Performance metrics :
Not response time Battery Power

Example 2.4
System C special array-processing unit 2 matrices multiplication Clock frequency 5 Mhz
xny0

System D x0y0 - no such unit - Clock frequency 10Mhz


x2y0
0

x1y0
0

+ +
P(2n-2) 0

x1y1 x0y2

x0y1

+
P(2n-1)

x1y2

P0

Example 2.5
Number of instructions executed per second MIPS System E Simple instruction set Machine code twice as long as F 1.5 times faster than F System F Complex instruction set

Points
Quite often even if good performance measure that accurately represents performance as the user perceives it, the application determines how systems are ranked. Frequent possibility for reasonable sounding performance measures to be misleading. Performance perceived by the user depends on so many factors that it is difficult in most cases to find a measure that is perfect in all respects.

Properties of Performance Measures


A good performance measure must:
Represent an efficient encoding of relevant information Provide an objective basis for the ranking of candidate controllers for a given application Provide objective optimization criteria

Anda mungkin juga menyukai