W2- 1- Basic Real Time Concepts

Embed Size (px)

Citation preview

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    1/21

    Basic Real Time Concepts

    Systems Concepts

    Real-Time Definitions

    Events and Determinism

    CPU Utilization

    Real-Time System Design Issues

    Example Real-Time Systems

    Common Misconceptions

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    2/21

    Systems Concepts

    Definition: A system is a mapping of a set of inputs into a set of outputs.

    When the internal details of the system are not of interest, the mapping

    function can be considered as a black box

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    3/21

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    4/21

    Note: that in its realization there is some delay betweenpresentation of the inputs (stimulus) and appearance of theoutputs (response). This fact can be formalized as follows:

    Definition: The time between the presentation of a set ofinputs to a system (stimulus) and the realization of therequired behavior response), including the availability of allassociated outputs, is called the response time of thesystem.

    How fast the response time needs to be, depends on thepurpose of the system.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    5/21

    Real-Time Definitions

    Definition: A real-time system is a system thatmust satisfy explicit (bounded) response-timeconstraints or risk severe consequences, including

    failure. Definition: A failed system is a system that

    cannot satisfy one or more of the requirementsstipulated in the formal system specification.

    Definition: A real-time system is one whoselogical correctness is based on both thecorrectness of the outputs and their timeliness.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    6/21

    When Is a System Real-Time?

    It can be argued that all practical systems are real-time systems.Even a batch-oriented systemfor example, grade processing atthe end of a semester or a bimonthly payroll runis real-time.Although the system may have response times of days or weeks(e.g., the time that elapses between submitting the grade or payroll

    information and issuance of the report card or check), it mustrespond within a certain time or there could be an academic orfinancial disaster. Even a word-processing program should respondto commands within a reasonable amount of time (e.g., 1 second),or it will become torturous to use. Most of the literature refers tosuch systems as soft real-time systems.

    Definition: A soft real-time system is one in which performance isdegraded but not destroyed by failure to meet response-timeconstraints.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    7/21

    Cont .

    Definition: A hard real-time system is one inwhich failure to meet a single deadline maylead to complete and catastrophic system

    failure. Definition: A firm real-time system is one in

    which a few missed deadlines will not lead tototal failure, but missing more than a few maylead to complete and catastrophic systemfailure.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    8/21

    Ilustration of Different Types of RTS

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    9/21

    The Nature of Time

    Deadlines are instants in time. But the questionarises, Where do the deadlines come from?

    Based on the underlying physical phenomena of the

    system under control.

    For example, in animated displays, images mustbe updated at approximately 30 frames per

    second to provide continuous motion, becausethe human eye can resolve updating at a slowerrate.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    10/21

    Events and Determinism In software systems, a change in state results in a

    change in the flow-of-control of the computerprogram.

    In flow chart, the decision block represented by thediamond suggests that the stream of program

    instructions, can take one of two paths, depending onthe response in question. if-then, goto, and casestatements in any language represent a possiblechange in flow-of-control.

    Invocation of procedures in C and Ada representchanges inflow-of-control. In object-orientedlanguages, instantiation of an object or the invocationof a method causes the change in sequential flow-of-control. In general, consider the following definition.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    11/21

    Cont

    Definition: Any occurrence that causes theprogram counter to change non-sequentially isconsidered a change of flow-of-control, and

    thus an event. Definition: The release time is the time at

    which an instance of a scheduled task is readyto run, and is generally associated with aninterrupt. (application wise)

    Events are slightly different from jobs in that events can be caused byinterrupts as well as conditional and unconditional branches.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    12/21

    Synchronous and Asynchronous

    Events

    An event can be either synchronous orasynchronous.

    Synchronous events are those that occur at

    predictable times in the flow-of-control, suchas that represented by the decision box inflow chart.

    Asynchronous events occur at unpredictablepoints in the flow-of-control and are usuallycaused by external sources.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    13/21

    Aperiodic - Irregular Interval

    Aperiodic events that tend to occur very infrequently are calledsporadic.

    For example, an interrupt generated by a periodic external clockrepresents a periodic but asynchronous event.

    A periodic but synchronous event is one represented by a

    sequence of invocation of tasks in a repeated, circular fashion,otherwise known as cyclic code.

    A typical conditional or unconditional branching instruction2 that isnot part of a code block and that runs repeatedly at a regular raterepresents a synchronous but aperiodic event.

    A branch instruction that happens infrequently, say, on thedetection of some exceptional condition, is both sporadic andsynchronous.

    Finally, interrupts that are generated irregularly (randomly) by anexternal device are classified as either asynchronous aperiodic orsporadic, depending on whether the interrupt is generated

    frequently or notwith respect to the system clock.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    14/21

    Mapping Them

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    15/21

    Determinism

    For any physical system certain states existunder which the system is considered to beout of control; the software controlling such a

    system must therefore avoid these states. the next state of the system, given the current

    state and a set of inputs, must predictable.

    In other words, the goal is to anticipate how asystem will behave in all possiblecircumstances

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    16/21

    Deterministic Behavior

    Definition: A system is deterministic if, for each possiblestate and eachset of inputs, a unique set of outputs andnext state of the system can be determined.

    Finally, if in a deterministic system the response time foreach set of outputs is known, then, the system also exhibitstemporal determinism.

    A side benefit of designing deterministic systems is thatguarantees can be given that the system will be able to

    respond at any time, and in the case of temporallydeterministic systems, when they will respond. Thisreinforces the association of control with real-time systems.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    17/21

    CPU Utilization

    The final and most important term to be definedis a critical measure of real-time systemperformance. Because in the von Neumannparadigm, the CPU continues to fetch, decode,

    and execute instructions as long as power isapplied, the CPU will execute either no-ops orinstructions or instructions that are not related tothe satisfaction of a deadline (for example,

    noncritical housekeeping). The measure of thetime spent doing idle processing, in a sense,indicates how much real-time processing isoccurring.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    18/21

    CPU Util. defn

    Definition:

    The (CPU) utilization or time-loading factor,

    U, is a measure of the percentage of nonidle

    processing.

    A system is said to be time-overloaded if

    U >100%.

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    19/21

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    20/21

    REAL-TIME SYSTEM DESIGN ISSUES

  • 8/10/2019 W2- 1- Basic Real Time Concepts

    21/21