21
ECE 697: Real-Time Systems Instructor: C. M. Krishna » [email protected]; (413) 545-0766 » Office Hours (on-campus): Tues: 4:00--4:45 PM Off-campus Contact: By e-mail and telephone Course Grading: » Three in-term tests: 18% each » Final exam (cumulative): 26% » Homework/simulation exercises: 20% Homework is to be done individually

ECE 697: Real-Time Systems

  • Upload
    denna

  • View
    46

  • Download
    0

Embed Size (px)

DESCRIPTION

ECE 697: Real-Time Systems. Instructor : C. M. Krishna [email protected]; (413) 545-0766 Office Hours (on-campus): Tues: 4:00--4:45 PM Off-campus Contact : By e-mail and telephone Course Grading : Three in-term tests: 18% each Final exam (cumulative): 26% - PowerPoint PPT Presentation

Citation preview

Page 1: ECE 697: Real-Time Systems

ECE 697: Real-Time Systems

Instructor: C. M. Krishna» [email protected]; (413) 545-0766» Office Hours (on-campus): Tues: 4:00--4:45 PM

Off-campus Contact: By e-mail and telephone Course Grading:

» Three in-term tests: 18% each» Final exam (cumulative): 26%» Homework/simulation exercises: 20%

Homework is to be done individually

Page 2: ECE 697: Real-Time Systems

Coverage

Introduction to real-time systems Performance measures Task allocation and scheduling techniques Power and energy issues Communication algorithms Fault tolerance and reliability evaluation Clock synchronization

Page 3: ECE 697: Real-Time Systems

Textbook

» C. M. Krishna and K. G. Shin, Real-Time Systems, McGraw-Hill, 1997.

» On-campus students: I’ve put a copy on reserve in the Physical Sciences Library; I’ll make another copy available in the Architecture & Real-Time Lab

» Off-campus students: Check your nearest technical library

» Also available from bookstores (online and traditional)» See the course web page for a pointer to the typo list:

http://www-unix.ecs.umass.edu/~krishna/rtcourse.html

Page 4: ECE 697: Real-Time Systems

Course Notes

A few PowerPoint slides: Will be posted on the course website

Mostly handwritten in class: The more important bits will be scanned and available through the course website after the lecture

Readings beyond the text will be used for » Real-time communication protocols» Energy- and power-aware computing

Page 5: ECE 697: Real-Time Systems

Today’s Topics

What is a real-time system?» General characteristics» Hard and soft real-time systems

Performance Measures» Why are they important?» For general-purpose systems» For real-time systems

Uniprocessor task scheduling

Page 6: ECE 697: Real-Time Systems

What is a Real-Time System?

Any system in which a deadline plays a central role in its perceived performance» But timely response is important for general-purpose

systems, too!» There is no hard-and-fast demarcation between a real-

time system and a general-purpose system» Systems in the control loop are always real-time

Page 7: ECE 697: Real-Time Systems

Types of RTS

Hard Real-Time Systems» Missing a deadline (or series of deadlines) can cause a

significant loss to the application.» Examples: Fly-by-wire, power-plant, and grid control

Soft Real-Time Systems» Missing a deadline causes the quality of service to

degrade, but nothing terrible happens» Examples: Video-on-demand, teleconferencing

Page 8: ECE 697: Real-Time Systems

Example: Fly-by-wire

Used initially in military aircraft» Dynamics time-constants are too small for humans to

be effective controllers» Philosophy:

Pilot sets policy Computer carries out low-level actions to implement that

policy» If too many deadlines are missed in a row, the aircraft

can crash

Page 9: ECE 697: Real-Time Systems

Feedback Loop

(From C. M. Krishna & K. G. Shin: NASA Con. Report 3807, 1984)

Page 10: ECE 697: Real-Time Systems

Impact of Feedback Delay (Simulation Example)

Elevator Deflections During Landing

Page 11: ECE 697: Real-Time Systems

Performance Measures

Traditional Measures» Throughput: Average number of instructions processed

per second» Availability: Fraction of time for which the system is

up» Reliability: Probability that the system will remain up

throughout a designated interval

Page 12: ECE 697: Real-Time Systems

Special-Purpose Measure

Performability» Published by John Meyer in 1980» Identify accomplishment levels, {A0, A1, A2, …, An},

for the application» Determine the probability, P(Ai), that the real-time

system will be able to perform in such a way that Ai will be accomplished

» Performability is the vector (P(A0), P(A1), …, P(An))» Application-focused measure

Page 13: ECE 697: Real-Time Systems

Task Allocation and Scheduling

How to assign tasks to processors and to schedule them in such a way that deadlines are met

Our initial focus: uniprocessor task scheduling

Page 14: ECE 697: Real-Time Systems

Uniprocessor Task Scheduling

Initial Assumptions:» Each task is periodic» Periods of different tasks may be different» Worst-case task execution times are known» Relative deadline of a task is equal to its period» No dependencies between tasks: they are independent» Only resource constraint considered is execution time» No critical sections» Preemption costs are negligible» Tasks must be completed for output to have any value

Page 15: ECE 697: Real-Time Systems

Standard Scheduling Algorithms

Rate-Monotonic (RM) Algorithm:» Static priority» Higher-frequency tasks have higher priority

Earliest-Deadline First (EDF) Algorithm:» Dynamic priority» Task with the earliest absolute deadline has highest

priority

Page 16: ECE 697: Real-Time Systems

RMA

Task priority is inversely proportional to the task period (directly proportional to task frequency)

At any moment, the processor is either» idle if there are no tasks to run, or» running the highest-priority task available

A lower-priority task can suffer many preemptions To a task, lower-priority tasks are effectively

invisible

Page 17: ECE 697: Real-Time Systems

RMA

Example Schedulability criteria:

» Sufficiency condition (Liu & Layland, 1973)» Necessary & sufficient conditions (Joseph & Pandya,

1986; Lehoczky, Sha, Ding 1989)

Page 18: ECE 697: Real-Time Systems

RMA

Critical Instant of a Task: An instant at which a request for that task will have the largest response time

Critical Time-zone of a Task: Interval between a critical instant of that task and the completion time of that task

Critical Instant Theorem: Critical instant of a task T_i occurs whenever T_i arrives simultaneously with all higher-priority tasks

Page 19: ECE 697: Real-Time Systems

RMA: Scheulability Check

The Critical Instant Theorem leads to a schedulability check:» If a task is released at the same time as all of the tasks

of higher priority and it meets its deadline, then it will meet its deadline under all circumstances

Page 20: ECE 697: Real-Time Systems

RMA: Schedulability Test

If a task is released simultaneously with all higher-priority tasks, determine when it will be done

If this completion time is no later than this task’s deadline, we have succeeded with this task

Find a systematic procedure to turn this process into a necessary-and-sufficient schedulability check

Page 21: ECE 697: Real-Time Systems

RMA: Schedulability

Start with a single-task set and obtain its schedulability conditions

Extend this to a two-task set Exploit any intuition gained to generalize this