real time embedded systems-introduction

Upload: yeshwanthk

Post on 10-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Real Time Embedded Systems-Introduction

    1/23

    REAL TIME EMBEDDED SYSTEMS

  • 8/8/2019 Real Time Embedded Systems-Introduction

    2/23

    Introduction

    Real Time Systems:

    A system is a mapping of a set of inputs into a set

    of outputs.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    3/23

    Typical real-time control

    system including inputs from

    sensors and imaging devicesand producing control signals

    and display information

    A classic representation of a

    real-time system as a

    sequence of jobs to be

    scheduled.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    4/23

    Response Time : The time between the

    presentation of a set of inputs to a system

    (stimulus) and the realization of the required

    behavior (response), including the availability

    of all associated outputs, is called the

    response time of the system. Real-time System: A system that must satisfy

    explicit (bounded) response-time constraints

    or risk severe consequences, including failure. Failure : a system that cannot satisfy one or

    more of the requirements stipulated in the

    formal system specification.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    5/23

    Or

    A real-time system is one whose logical

    correctness is based on both the correctness ofthe outputs and their timeliness.

    Real-time systems are often reactive orembedded systems.

    Reactive systems are those in which scheduling isdriven by ongoing interaction with theirenvironment;

    When Is a System Real-Time? it must respond within a certain time or there

    could be an academic or financial disaster.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    6/23

    Soft Real Time: A soft real-time system is one inwhich performance is degraded but not

    destroyed by failure to meet response-timeconstraints.

    Hard Real-time Systems : A hard real-time systemis one in which failure to meet a single deadline

    may lead to complete and catastrophic systemfailure.

    A firm real-time system :is one in which a fewmissed deadlines will not lead to total failure, but

    missing more than a few may lead to completeand catastrophic system failure.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    7/23

    Events and Determinism:

    A change in state results in a change in theflow-of-control of the computer program.

    The decision block represented by the

    diamond suggests that the stream of program

    instructions, can take one of two paths,

    depending on the response in question.

    If-then, goto, and case statements in any

    language represent a possible change in

    flow-of-control.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    8/23

    A simple program flowchart showing a branch as a change in flow-of-control, represented by the diamond icon.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    9/23

    Any occurrence that causes the program

    counter to change non-sequentially is

    considered a change of flow-of-control, andthus an event.

    In scheduling theory, the release time of a

    job is similar to an event. The release time is the time at which an

    instance of a scheduled task is ready to run,

    and is generally associated with an interrupt. Events are slightly different from jobs in that

    events can be caused by interrupts as well as

    conditional and unconditional branches.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    10/23

    Synchronous and Asynchronous Events:

    Synchronous events are those that occur at

    predictable times in the flow-of-control, such asthat represented by the decision box in theflowchart.

    The change in flow-of-control, represented by a

    conditional branch instruction, or by theoccurrence of an internal trap interrupt,

    can be anticipated.

    Asynchronous events occur at unpredictable

    points in the flow-of-control and are usuallycaused by external sources.

    Events that do not occur at regular intervals (orperiods) are called aperiodic or sporadic.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    11/23

    A periodic but synchronous event is onerepresented by a sequence of invocation of tasks

    in a repeated, circular fashion, otherwise knownas cyclic code.

    A branch instruction that happens infrequently,say, on the detection of some exceptional

    condition, is both sporadic and synchronous.

    Interrupts that are generated irregularly

    (randomly) by an external device are classified aseither asynchronous aperiodic or sporadic,depending on whether the interrupt is generatedfrequently or not with respect to the systemclock.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    12/23

    Determinism:

    Software control of any real-time system and

    associated hardware is maintained when the nextstate of the system, given the current state and aset of inputs, is predictable.

    In other words, the goal is to anticipate how a

    system will behave in all possible circumstances. Or:

    A system is deterministic if, for each possible

    state and each set of inputs, a unique set of

    outputs and next state of the system can

    be determined.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    13/23

    if in a deterministic system the response time

    for each set of outputs is known, then, the

    system also exhibits temporal determinism.

    A side benefit of designing deterministic

    systems is that guarantees can be given that

    the system will be able to respond at anytime, and in the case oftemporally

    deterministic systems, when they will

    respond. This reinforces the association ofcontrol with real-time systems.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    14/23

    CPUUtilization:

    The (CPU) utilization or time-loading factor, U, isa measure of the percentage of non-idleprocessing.

    A system is said to be time-overloaded if

    U>100%.

    Systems that are too highly utilized areundesirable because changes or additions cannotbe made to the system without risk of time-overloading.

    Systems that are not sufficiently utilized are notnecessarily good, because this implies that thesystem was over-engineered and that costs canbe reduced with less expensive hardware.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    15/23

    Suppose a system has n 1 periodic tasks, each

    with an execution period ofpi, and hence,

    execution frequency, fi= 1/pi

    If task i is known to have (or has been estimated

    to have) a maximum (worst case) execution time

    ofei, then the utilization factor, ui, for task eiis:ui= ei/pi (1.1)

    Then the overall system utilization is

    (1.2)in

    i

    i

    n

    i

    i peuU /11

    !!

    !!

  • 8/8/2019 Real Time Embedded Systems-Introduction

    16/23

    The deadline for the periodic task i, di is thenext cycle or the time period, which is a

    critical design factor constrained by ei , whichis difficult to determine in many cases.

    For aperiodic and sporidic tasks ui is calculated

    by assuming some worst case delay betweenthe event occurrences, which can inflate theutilization factor.

    The utilization factor is the number of micro

    instructions per second that can be processedbased on some predetermined instructionmix.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    17/23

    Real Time System Design Issues

    Real time systems are strongly influenced bycontrol theory, software engineering andoperations research.

    The figure shows some of the disciplines ofcomputer science and electrical engineering thataffect the design and analysis of real timesystems, which makes it a highly specialized area.

    The design and implementation of real timesystems requires attention to the numerousproblems:

  • 8/8/2019 Real Time Embedded Systems-Introduction

    18/23

  • 8/8/2019 Real Time Embedded Systems-Introduction

    19/23

    The selection of hardware and software andevaluation of the trade-off needed for cost

    effective solution including dealing withdistributed computing systems and issues ofparallelism and synchronization.

    Specification and design of real time systemsand correct representation of the temporalbehavior.

    Understanding the nuances of the

    programming language(s) and the real-timeimplications resulting from their translationinto machine code.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    20/23

    Maximizing of system fault tolerance and

    reliability through careful design.

    The design and administration of tests, and the

    selection of test and development equipment.

    Taking advantage of open systems technology

    and interoperability with open system standards,such as the CORBA real-time standard.

    Measuring and predicting response time and

    reducing it, performing a schedulability analysis,

    for determining and guaranteeing deadline

    satisfaction, a priori, of most of scheduling

    theory.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    21/23

    Sample systems

  • 8/8/2019 Real Time Embedded Systems-Introduction

    22/23

    The inertial measurement system of an

    aircraft:

    The software specifications states that the

    software to receive x , y and z accelerometer

    pulses at a 10 millisecond rate from special

    hardware, determining the accelerations in eachdirection and the roll, pitch and yaw of the

    aircraft.

  • 8/8/2019 Real Time Embedded Systems-Introduction

    23/23

    The software will also receive information such astemperature at a 1-second rate.

    The task of the software is to compute actual velocityvector based on the orientations, accelerometerreadings and various compensation factors at a 40-millisecond rate.

    The system is to output true acceleration, velocity and

    position vectors to a pilots display every 40-millisecond rate, but using a different clock.

    These tasks execute at four different rates in theinertial measurement system and need tocommunicate and synchronize.

    The accelerometer readings must be time-relative orcorrelated; i.e., it is undesirable to mix anxaccelerometerpulse from t with z and y pulses fromtime t + 1.

    These are critical design issues for this system.