Real-Time Systems – Basics 1.1 Definition Real-Time Systems Summer term 2015 ▸ Examples for use of real-time systems: ▸ Different application domains Mostly embedded systems Real-Time Systems 1. Chapter Basics Prof. Matthias Werner Operating Systems Group ▸ summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.1 Definition 2 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Example: Pacemaker Example: BMW 7 Series source: BMW Group Munich source: WikiCommons ▸ ▸ one processor ca. 500 000 LoC summer term 2015 ⋅ M. Werner ▸ ▸ 3 / 30 osg.informatik.tu-chemnitz.de ca. 70 control units, in part with multiple processors ca. 100 million LoC summer term 2015 ⋅ M. Werner 4 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Real-Time Systems – Basics 1.1 Definition Example: Boeing 777 What is Real Time / a Real-Time System? ▸ ▸ There exist quit a lot, partly confusing beliefs, what are the properties of a real-time system Real-time systems have to... ▸ ▸ ▸ ▸ ▸ ▸ be fast? be predictable? provide results in a timely manner? be secure? act error-free? operate even in presence of a failure? á Need for a definition source: J.M. Dibbs / Air France ▸ ▸ ca. 1200 processors ca. 4 billion LoC summer term 2015 ⋅ M. Werner 5 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition summer term 2015 ⋅ M. Werner 6 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Definitions Definitions (cont.) DIN 44300: Real-Time Operation Echtzeitbetrieb ist ein Betrieb eines Rechensystems, bei dem Programme zur Verarbeitung anfallender Daten st¨andig betriebsbereit sind derart, dass die Verarbeitungsergebnisse innerhalb einer vorgegebenen Zeitspanne verf¨ugbar sind. Approx. translation: Real-time operation of a computer system is an operation mode, where programs that process data are always ready in the way, that allows to provide the results within a given period of time. KOPETZ Real-time computer system A real-time computer system ist a computer system, in which the correctness of the system behavior depends not only on the logical results of the computation, but also on the physical instant at which these results are produced. KRISHNA & SHIN: Real-time system Wikipedia: Real-Time Computing [...] real-time computing (RTC), or reactive computing, is the study of hardware and software systems that are subject to a “real-time constraint” – i.e., operational deadlines from event to system response. Real-time programs must execute within strict constraints on response time. summer term 2015 ⋅ M. Werner 7 / 30 osg.informatik.tu-chemnitz.de Any system where a timely response by the computer to a external stimuli is vital is a real-time system. summer term 2015 ⋅ M. Werner 8 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Real-Time Systems – Basics 1.1 Definition Socratic Dialogue∗ Socratic Dialogue SOCRATES: Does “deadline” mean that any task really has to be finished by that time? SOCRATES: What means “timely”? Answer: Answer: Not necessarily. It means that tasks in a real-time system have to obey a deadline. Sometimes yes: If landing of an airplane is controlled by a computer, missing a deadline may lead to a crash. Sometimes no: In a video game, nothing (really) bad happens in this case. ∗ inspired by [KS97] summer term 2015 ⋅ M. Werner 9 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.1 Definition 9 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Socratic Dialogue Socratic Dialogue SOCRATES: SOCRATES: Does “deadline” mean that any task really has to be finished by that time? What means “finished”? Is there an exact criterion when a task is finished? Answer: Answer: Not necessarily. Not necessarily. Sometimes yes: In a nuclear reactor delayed reaction may lead to a disaster. Sometimes yes: For example, transferring money from one account to another may depend on calculating the sum of different accounts. Sometimes no: Getting a single measurement to late may not be a problem if the next measurement is on time. Sometimes no: If an application calculates the value of π it may decide to stop earlier and use a less accurate result. summer term 2015 ⋅ M. Werner 9 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner 9 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Real-Time Systems – Basics 1.1 Definition Socratic Dialogue Different Time-Value Functions SOCRATES: value value deadline Again to the deadline: What happens if a task does not obey its deadline? Will it be terminated then? deadline Answer: It differs. time time If you are passenger of an airplane that crashes due to a missed deadline than this is not relevant both for you and the computer. On the other hand, for a video conference it may be useful not to skip a delayed frame. value value deadline In general the value of a tasks result is decreasing for missed deadlines – in some cases slowly, in other cases abrupt. time time summer term 2015 ⋅ M. Werner 9 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.1 Definition deadline 10 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Socratic Dialogue Socratic Dialogue SOCRATES: SOCRATES: Doesn’t this imply that any computer is a real-time system? If it includes all computer, isn’t the defintion senseless? Answer: Somehow yes. Taking the definition very precisely, any computer is a real-time system because nobody wants to wait forever for a result, e.g., in response to a keystroke. Answer: Okay, in order to stop this discussion, here is a new definition: Refined Definition A real-time system is any system that the lecturer sees as such. In general, considerable work in real-time system design is spend on how timing constraints can be met. summer term 2015 ⋅ M. Werner 11 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner 11 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Real-Time Systems – Basics 1.1 Definition Misconceptions Misconceptions (cont.) “Misconceptions about Real-Time Systems” [Sta88] ▸ ▸ “There is no science in real-time-system design.” ▸ ▸ ▸ We will that reconsider later... ▸ Argument of a salesman: “Buy a faster computer!” But: In case of a deadlock, this is not an improvement... ▸ ▸ 12 / 30 osg.informatik.tu-chemnitz.de ▸ ▸ ▸ (b) any Microsoft hardware accompanying the SOFTWARE will be free from defects in materials and workmanship under normal use and service for a period of one (1) year from the date of receipt. This is no reason not to improve the design. A system is as weak as the weakest element: It is our goal to ensure that operating system or control software are not that weakest element. ▸ summer term 2015 ⋅ M. Werner 14 / 30 osg.informatik.tu-chemnitz.de Consider the following guarantee: PC Manufacturer warrants that (a) the SOFTWARE will perform substantially in accordance with the accompanying written materials for a period of ninety (90) days from the date of receipt, and In computer science usually peak performance or average performance are of interest. Operation research usually deals with stochastical models. “It is not meaningful to talk about guaranteeing real-time performance when things can fail.” ▸ osg.informatik.tu-chemnitz.de What is the Problem? “Real-time problems have all been solved in other areas of computer science or or operations research.” ▸ 13 / 30 Real-Time Systems – Basics 1.1 Definition Misconceptions (cont.) ▸ Timeliness is more important than speed. summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.1 Definition ▸ This may be necessary in some cases but as always in computer science we want to automate as much as possible. Real time needs conceptual understanding. “Real time is performance engineering.” ▸ summer term 2015 ⋅ M. Werner No. Time needed for computation has to be predictable. “Real-time programming is assembly coding and driver programming.” ▸ “Advances in supercomputing hardware will take care of real-time requirements.” ▸ “Real-time computing is equivalent to fast computing.” ▸ Access via https://www.tu-chemnitz.de/∼werne/restricted-docs/Stankovic88Misconceptions.pdf Hardware may fail, software is often faulty from beginning á software crisis summer term 2015 ⋅ M. Werner 15 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.1 Definition Real-Time Systems – Basics 1.2 Time What is the Problem? (cont.) ▸ ▸ Something is next to trivial, something is impossible We are interested in the area in between ▸ ▸ What is time? Window of scarcity Example multimedia “If nobody ask me what time is I know it, if I want to explain it, I don’t know it.” AURELIUS AUGUSTINUS Physical View NEWTON: Absolute dimension (beside space) where reality exists. EINSTEIN: Relative dimension as part of space-time. Today: Direction of entropy’s increase. Source: Anderson et al: Support for Continuous Media in the DASH System, 1990. summer term 2015 ⋅ M. Werner 16 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.2 Time osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.2 Time NEWTON’s Concept of Time EINSTEINs Concept of Time (1905) ▸ Time is . . . ▸ ▸ ▸ Law of inertia is valid with respect to an (acceleration less) inertial systems ▸ Different inertial systems that are related to each other á there is one absolute time (and space) ▸ ▸ Philosophiae Naturalis Principia Mathematica, 1686 ▸ ▸ Absolute, true, and mathematical time, from its own nature, passes equably without relation the anything external, and thus without reference to any change or way of measuring of time (e.g., the hour, day, month, or year). neither independent nor constant part of the space-time (Minkowski space) Constant here: speed of light Consequences: ▸ There is no space-independent simultaneity Speed of time depends on state of observer Example: Lorentz transformation Moving at speed of v in direction x t − v2 x t′ = √ c , 2 1 − vc2 summer term 2015 ⋅ M. Werner 17 / 30 18 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner x − vt x′ = √ 2 1 − vc2 19 / 30 y ′ = y, z′ = z osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.2 Time Real-Time Systems – Basics 1.2 Time Thermodynamic Arrow of Time ▸ Mathematization Laws of nature usually not differentiate between past and future ▸ Newton’s concept of time is usually mathematical reduced as follows: á Symmetry (CPT (charge, parity and time) symmetry, PAULI, 1955) ▸ However: CP-Symmetry (charge and parity) can be broken ▸ Corresponds to Second Law of Thermodynamics (CLAUSIUS, 1854) Inversion of the Second Law to define time: direction of entropy’s increase defines thermodynamic arrow of time ▸ For practical reasons usually Newton’s concept of time is still in use (e.g., in this lecture). summer term 2015 ⋅ M. Werner 20 / 30 Time is a set M of discrete, distinguishable points in time with the relation “<” (“temporally before”) that is defined as follows: Trichotomy: ∀x, y ∈ M exactly one of the following conditions holds: (x < y), (y < x), (x = y) Transitivity: ∀x, y, z ∈ M ∶ (x < y) ∧ (y < z) ⇒ (x < z) Irreflexivity: ∀x ∈ M ∶ ¬(x < x) Densitity: ∀x, y ∈ M ∶ (x < y) ⇒ ∃z ∶ (x < z < y) ▸ osg.informatik.tu-chemnitz.de Trichotomy, transitivity, and irreflexivity imply that “<” is a strong total order summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.2 Time Subdivisions ▸ Measuring of time is a problem since time can not be repeated ▸ Issue of standardization First attempt: astrological phenomena 22 / 30 ▸ Naive division of day (and night) into 12 hours; fixed phenomena: sun raise and sun set ▸ ▸ Day: Duration between two sun zeniths (solar day) Year: Duration that the Sun takes to return to the same position in the cycle of seasons, e.g., for example, the time from vernal equinox to vernal equinox (tropical year) Month: period of the Moon’s phases summer term 2015 ⋅ M. Werner osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.2 Time Measuring Time ▸ 21 / 30 osg.informatik.tu-chemnitz.de In use until 15th century Issue: length of hours differs; except equinoxes ▸ Compensation by introduction of the mean solar day ▸ Second: 1 86400 of the mean solar day summer term 2015 ⋅ M. Werner 23 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.2 Time Real-Time Systems – Basics 1.3 Real-Time Entity SI Second Real-Time Entity ▸ Astronomic phenomenons are not “precise enough” ▸ Remedy: definition without help of astronomy ▸ Embedded system: overall system consist of computer and non-computing components ▸ The state of the non-computing components (and of the environment) are of interest á state variables Second due to SI (1967) ▸ A second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom. ▸ Examples: position of robot manipulator, speed, ... Relevant state variables are called real-time entities ▸ Relevance due to two reasons: ▸ ▸ ▸ summer term 2015 ⋅ M. Werner 24 / 30 osg.informatik.tu-chemnitz.de The application want to manipulate it It manipulates/has impact to the application Statements are valid for certain time only summer term 2015 ⋅ M. Werner Real-Time Systems – Basics 1.3 Real-Time Entity 25 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics 1.3 Real-Time Entity "#$%#&'%#() Real-Time Image ▸ >?8$32- Mapping with help of sensors; sometimes multiple transformations =3** The mapping result is called real-time image ▸ ▸ ▸ ▸ 0#&%'&*+#(1#234&56#&% The real-time entity is mapped to a state of the computation system ▸ ▸ Accuracy The applications uses always the image, but tries to impact the real-time entity Mapping results may differ from real-time entity in value and time Difference in time: temporal accuracy interval %9:- %&;6 %&;!(((((%&<%4-# 7#3'(8&/# The goodness of the real-time image is an important design parameter @ @ summer term 2015 ⋅ M. Werner 26 / 30 osg.informatik.tu-chemnitz.de @ A#,45-B426%('#%,%#(C&-%9$&#(D$#*#2% 7CE(=#$(:#9:3*+%#%#2(78()2%&%. Figure: accuracy+&-%9$. interval (from [Kop97] ) 7C& ,4/(0#&%B426%(%(&-%(#&2#(5#9$=2#%#(F#25#(G92(0#&%B426%#2(H%&I(%&;!I(JJJI(%&;6 ! LM25#(=summer 3**<,D% &E; ⋅,D% &;6E(5&:%(,#&%'J(1#234&56#&%(32 term 2015 M. Werner 27 / 30 osg.informatik.tu-chemnitz.de 78(N/35#(&-%(,#&%'J(5#234(,4/(0#&%B426%(%&I(O#22(#PJ(%Q !(7C&R("3'4#D78 N/3 Real-Time Systems – Basics 1.3 Real-Time Entity Real-Time Systems – Basics 1.3 Real-Time Entity Sphere of Control ▸ Example Each real-time entity may exist within a sphere of control (SoC) ▸ ▸ Within a SoC, a real-time entity can be influenced Influence works indirectly (via actors) á Out of a SoC, a real-time entity may be observed, but not controlled ▸ environment Example car: ▸ ▸ ▸ controlled system Real-time entities: traffic light, other cars, own speed Traffic lights, other cars, their speeds, etc. can be observed Own speed can be controlled á Sphere of control summer term 2015 ⋅ M. Werner 28 / 30 osg.informatik.tu-chemnitz.de Real-Time Systems – Basics Literatur [KS97] C. M. Krishna and Kang G. Shin. Real-Time Systems. McGraw-Hill, 1997, Chapter 1 until Section 1.3 [Kop97] Hermann Kopetz. Real-Time Systems – Design Principles for Distributed Embedded Applications. Kluver Academic, 1997, Section 1.1 and Chapter 5 [Sta88] John A. Stankovic. “Misconceptions About Real Time Computing – A Serious Problem for Next-Generation Systems”. In: IEEE Computer 21.10 (1988), pp. 10–19 [Mag96] A.P. Magalh˜aes. “A Survey on Estimating the Timing Constraints of Hard Real-Time Systems”. In: Design Automation for Embedded Systems 1 (1996), pp. 213–230. URL: http://www.ingentaconnect.com/content/klu/daem/1996/00000001/ 00000003/00114860 summer term 2015 ⋅ M. Werner 30 / 30 osg.informatik.tu-chemnitz.de summer term 2015 ⋅ M. Werner 29 / 30 osg.informatik.tu-chemnitz.de
© Copyright 2024