real time computing

Upload: gurusodhii

Post on 04-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Real Time Computing

    1/18

    Real-Time Computing

    Sunggu Lee

    EE Dept., POSTECH

  • 7/29/2019 Real Time Computing

    2/18

    Page 2Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Overview

    Introduction

    Characteristics and Challenges of Real-Time ComputingSystems

    Definitions, Issues and Comparisons

    Tasks and Scheduling

    Worst-Case Execution Time Analysis

    Real-Time Software

    Real-Time Operating Systems

    Middleware

  • 7/29/2019 Real Time Computing

    3/18

    Page 3Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Introduction [Crnkovic 2002]

    Embedded computers

    [Examples:] Medical control equipment, mobile phones,and vehicle control systems.

    Most [] such embedded systems can also be

    characterized as real-time systems.

    They must usually meet stringent specifications forsafety, reliability, limited hardware capacity etc

  • 7/29/2019 Real Time Computing

    4/18

    Page 4Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Characteristics and Challenges of RTS

    [Crnkovic 2002]

    Real-time systems are computing systems in which themeeting of timing constraints is essential tocorrectness.

    If the system delivers the correct answer, but after a

    certain deadline, it could be regarded as having failed.

  • 7/29/2019 Real Time Computing

    5/18

    Page 5Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Types of Real-Time Systems

    Hard real-time system

    A system where something very bad happensif the deadline is not metExamples: control systems for aircraft, nucluear reactors,

    chemical power plants, jet engines, etc.

    Soft real-time system

    A system where the performance is degraded

    below what is generally considered acceptableif the deadline is missedExample: multimedia system

  • 7/29/2019 Real Time Computing

    6/18

    Page 6Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Utility Function (Task Value Function) [Kim

    2005]

    deadline Time0

    1

    Task with a hard deadlineTask with a soft deadline

    Utility

  • 7/29/2019 Real Time Computing

    7/18

    Page 7Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Issues in Real-Time Computing [Liu 2000]

    Real-time computing deals with all problems incomputer architecture, fault-tolerant computing andoperating systems are also problems in real-timecomputing, with the added complexity of having to meetreal-time constraints

    Real-time computer systems differ from general-purpose systems

    They are more specific in their applications

    The consequences of their failure are more drastic

    Emphasis is placed on meeting task deadlines

  • 7/29/2019 Real Time Computing

    8/18

    Page 8Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Example Problems in Real-Time Computing

    Example 1: Task Scheduling

    General-purpose system can use round-robinscheduling

    This is NOT suitable for real-time systems becausehigh-priority tasks may miss their deadlines with round-

    robin schedulingA priority mechanism is necessary

    Example 2: Cache Usage Scheduling

    A general-purpose system typically allows the processthat is currently executing the right to use the entirecache areaThis keeps the cache miss rate low

    Side effect: task run times are less predictable

    Thus, not so desirable for real-time systems

  • 7/29/2019 Real Time Computing

    9/18

    Page 9Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Comparison of Typical Systems [Liu 2000]

    Jet Engine Control System

    Designer knows preciseworkload to be executed

    System must be

    designed to meet taskdeadlinesIf a deadline is not met, the jet

    engine may explode

    General-Purpose ComputerWorkstation

    Workload is not known inadvance

    System should bedesigned to be fast onthe averageTask execution time variance is

    less important

  • 7/29/2019 Real Time Computing

    10/18

    Page 10Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Tasks [Crnkovic 2002]

    Real-time systems can be constructed [out] ofsequential programs, but typically they are built [out] ofconcurrent programs, called tasks.

    Tasks are usually divided into:

    Periodic tasks: consist of an infinite sequence ofidentical activities, called instances, which are invokedwithin regular time periods.

    Non-periodic [or aperiodic] : are invoked by theoccurrence of an event.

    [Sporadic : aperiodic tasks with a bounded interarrivaltime]

  • 7/29/2019 Real Time Computing

    11/18

    Page 11Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Scheduling [Crnkovic 2002]

    Offline scheduling:

    The scheduler has complete knowledge of the task setand its constraints.

    Online scheduling:

    Make their scheduling decisions during run-time.

    Deadline:

    Is the maximum time within which the task mustcomplete its execution with respect to an event.

    Real-time systems are divided into two classes, hardand softreal-time systems

  • 7/29/2019 Real Time Computing

    12/18

    Page 12Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Schedulability Analysis [Crnkovic 2002]

    At this point we must check that the temporalrequirements of the system can be satisfied, assumingtime budgets assigned in the detailed design stage.

    In other words, we need to make a schedulabilityanalysis of the system based on the temporalrequirements of each component

  • 7/29/2019 Real Time Computing

    13/18

    Page 13Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    WCET Verification [Crnkovic 2002]

    Performing a worst-case analysis can either be basedon measurements or on a static analysis of thesource code.

    What is more interesting in the test cases is theexecution time behavior shown as a function of inputparameters as shown in the following slide.

  • 7/29/2019 Real Time Computing

    14/18

    Page 14Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    End-To-End Deadlines [Crnkovic 2002]

    End-to-end deadlines

    Are set such that the system requirements are fulfilled inthe same way as the time budgets are set

    Should be specified for the input to and output from the

    component since the WCET cannot be computed sinceits parts may be executing with different periods.

  • 7/29/2019 Real Time Computing

    15/18

    Page 15Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Real-Time Operating System

    Multi-tasking OS designed to permit tasks (processes)to complete within precisely stated deadlines

    If deadline constraints cannot be met for a new task, itmay be rejected

    If a new task would result in deadline violations for othertasks, it may be rejected

    Example commercial operating systems

    Vrtx Mentor Graphics Systems

    VxWorks and pSOS Wind River Systems RTLinux FSMLabs, later acquired by Wind River

    Systems

  • 7/29/2019 Real Time Computing

    16/18

    Page 16Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    Real-Time Middleware

    ObjectWeb defines middleware as: "The software layerthat lies between the operating system and theapplications on each side of a distributed computingsystem in a network." [Wikipedia]

    Collection of Tools for Real-Time Programming Real-Time Java

    Real-Time Middleware Systems

    Real-Time CORBA

    CORBA: Component Object Request Broker Architecture

    Time-triggered Message-triggered Object (TMO)

    System developed at the University of California at Irvine

    http://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Operating_system
  • 7/29/2019 Real Time Computing

    17/18

    Page 17Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    An example of a TMO

    network

    Base Intf TMO

    SpM1

    SvM1

    ODSS1

    Car Intf TMO

    SpM1

    SvM1

    ODSS1

    Base Intf TMO

    SpM1

    SvM1

    ODSS1

    Car Intf TMO

    SpM1

    SvM1

    ODSS1 Car Intf TMO

    SpM1

    SvM1

    ODSS1

    Ex 2

    Telematics in a Car Fleet [Kim 2005]

  • 7/29/2019 Real Time Computing

    18/18

    Page 18Building Reliable Component-based SystemsEECE 426 - Embeddede Systems

    References

    Jane Liu, Real-Time Systems, Prentice-Hall, Upper SaddleRiver, 2000.

    Ivica Crnkovic and Magnus Larsson, Building ReliableComponent-Based Software Systems, Artech House

    Publishers, July 2002. PowerPoint slides fromhttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppt

    Kane (K. H.) Kim, PowerPoint slides used for undergraduateclass: ECES 123: Introduction to Real-Time Distributed

    Programming taught at the University of California at Irvine,http://dream.eng.uci.edu

    http://www.idt.mdh.se/~icc/http://www.idt.mdh.se/~mlo/http://hhp.bvdep.com/artechhouse/default.asp?http://hhp.bvdep.com/artechhouse/default.asp?http://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://www.idt.mdh.se/cbse-book/presentations/13-chapterWC.ppthttp://hhp.bvdep.com/artechhouse/default.asp?http://hhp.bvdep.com/artechhouse/default.asp?http://www.idt.mdh.se/~mlo/http://www.idt.mdh.se/~icc/