Overview
Introduction Characteristics and Challenges of Real-Time Computing Systems Definitions, Issues and Comparisons Tasks and Scheduling Worst-Case Execution Time Analysis Real-Time Software
Real-Time Operating Systems Middleware
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
[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 for safety, reliability, limited hardware capacity etc
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 3
Characteristics and Challenges of RTS [Crnkovic 2002]
Real-time systems are computing systems in which the meeting of timing constraints is essential to correctness. If the system delivers the correct answer, but after a certain deadline, it could be regarded as having failed.
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 4
Types of Real-Time Systems
Hard real-time system
A system where “something very bad” happens if the deadline is not met
Examples: 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 acceptable if the deadline is missed
Example: multimedia system
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 5
Utility Function (Task Value Function) [Kim 2005]
Utility 1
Task with a hard deadline Task with a soft deadline
0
deadline
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Time
Page 6
Issues in Real-Time Computing [Liu 2000]
Real-time computing deals with all problems in computer architecture, fault-tolerant computing and operating systems are also problems in real-time computing, with the added complexity of having to meet real-time constraints Real-time computer systems differ from generalpurpose systems
They are more specific in their applications
The consequences of their failure are more drastic Emphasis is placed on meeting task deadlines
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 7
Example Problems in Real-Time Computing
Example 1: Task Scheduling
General-purpose system can use round-robin scheduling
This is NOT suitable for real-time systems because high-priority tasks may miss their deadlines with roundrobin scheduling
A priority mechanism is necessary
Example 2: Cache Usage Scheduling
A general-purpose system typically allows the process that is currently executing the right to use the entire cache area
This keeps the cache miss rate low Side effect: task run times are less predictable
– Thus, not so desirable for real-time systems Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 8
Comparison of Typical Systems [Liu 2000]
Jet Engine Control System
Designer knows precise workload to be executed System must be designed to meet task deadlines
If a deadline is not met, the jet engine may explode
General-Purpose Computer Workstation
Workload is not known in advance
System should be designed to be fast on the average
Task execution time variance is less important
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 9
Tasks [Crnkovic 2002]
Real-time systems can be constructed [out] of sequential programs, but typically they are built [out] of concurrent programs, called tasks. Tasks are usually divided into:
Periodic tasks: consist of an infinite sequence of identical activities, called instances, which are invoked within regular time periods. Non-periodic [or aperiodic] : are invoked by the occurrence of an event. [Sporadic : aperiodic tasks with a bounded interarrival time]
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
The scheduler has complete knowledge of the task set and its constraints. Make their scheduling decisions during run-time. Is the maximum time within which the task must complete its execution with respect to an event. Real-time systems are divided into two classes, hard and soft real-time systems
Online scheduling:
Deadline:
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 11
Schedulability Analysis [Crnkovic 2002]
At this point we must check that the temporal requirements of the system can be satisfied, assuming time budgets assigned in the detailed design stage. In other words, we need to make a schedulability analysis of the system based on the temporal requirements of each component
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 12
WCET Verification [Crnkovic 2002]
Performing a worst-case analysis can either be based on measurements or on a static analysis of the source code. What is more interesting in the test cases is the execution time behavior shown as a function of input parameters as shown in the following slide.
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 13
An Execution Time Graph [Crnkovic 2002]
The execution time shows different values for the different input sub-domains.
Execution time
Input domain 1 domain 2 domain 3
Page 14
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Maximum execution time per sub-domain [Crnkovic 2002]
Execution time
Input domain 1
domain 2
domain 3
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 15
Composition of Components [Crnkovic 2002]
New Component (Cnew) Component 1 (C1)
in1_Cnew
in_C1
out_C1 out1_Cn out1_Cnew out2_Cnew
in2_Cnew
in2_Cn
Component n (C2)
out2_Cn
in3_Cnew in4_Cnew
in1_C2 in2_C2
Component 2 (C3)
out_C2
out3_Cnew
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Are set such that the system requirements are fulfilled in the 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 since its parts may be executing with different periods.
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 17
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, it may be rejected If a new task would result in deadline violations for other tasks, it may be rejected Vrtx – Mentor Graphics Systems VxWorks and pSOS – Wind River Systems RTLinux – FSMLabs, later acquired by Wind River Systems
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Example commercial operating systems
Page 18
Real-Time Middleware
ObjectWeb defines middleware as: "The software layer that lies between the operating system and the applications on each side of a distributed computing system in a network." [Wikipedia]
Time-triggered Message-triggered Object (TMO)
System developed at the University of California at Irvine
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 19
Essence of RT Programming: Time-Triggered Action [Kim 2005]
At time T do S
{ = Start S during [T - , T + ] }
• A fundamental & distinguishing part of real-time programming
• If S is a function, a control signal for activation of the function in a node is derived from the progression of real-time;
• Whenever the real-time clock within a node reaches a preset value T specified in a scheduling table, a control signal is generated; • In principle, S may be a single assignment statement, a compound statement, or a function.
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 20
Essence of RT Programming: Time-Triggered Action [Kim 2005]
• Factors impacting response times
- Application, Middleware, OS, Hardware, Comm Network Real-time objects
Middleware for real-time support
Middleware for real-time support
Middleware for real-time support
OS
H/W
OS
H/W
OS
H/W
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 21
Essence of RT Programming: Time-Triggered Action (cont) [Kim 2005]
If there are many factors impacting response times, analysis of response times becomes very complicated and often impossible unless every contributing factor has been very carefully designed. => Conventional response
Avoid most of the software layers Implement application software in assembly or C programs
Very low design productivity !!!
This practice CAN NOT continue in the 2nd half of 21st Century !!! (except in unusual circumstances)
Page 22
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Facilities in TMO for Time-Triggered Actions [Kim 2005]
TMO := Time-Triggered Message-Triggered Object
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Time-triggered Message-triggered Object (TMO)
Initiated in early 1990's Meant to be a natural easy-to-use extension of the C++/Java object Can support Hard-RT DC Software Engineering (SE) as well as Non-RT
C++ object
var AAC AAC
SpM 1 SpM 2
DC SE
Contains only high-level intuitive and yet precise expressions of timing
SvM 1 SvM 2
requirements
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 24
New-Generation RT DC Component [Kim 2005]
High-Level RT Object:
Time-triggered Message-triggered Object (TMO)
Meant to be a natural easy-to-use extension of the C++/Java object Can support Hard-RT DC SE as well as
Non-RT DC SE Contains only high-level intuitive and yet precise expressions of timing requirements
C++ object
var AAC AAC
SpM 1 SpM 2
Formulated from the beginning with the objective of enabling design-
SvM 1 SvM 2
time guaranteeing of timely actions
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 25
TMO Network Structuring [Kim 2005]
All conceivable RT DC applications and Non-RT applications can be Structured as TMO networks .
Middleware
FT support NT service TMOSM
Middleware
FT support NT service TMOSM
Middleware
FT support NT service TMOSM
Kernel ( e.g. NT kernel )
H/W
Kernel ( e.g. NT kernel )
H/W
Kernel
( e.g. NT kernel ) H/W
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 26
Some New-Generation Applications [Kim 2005]
F
Distributed multi-media processing
Next-generation RT VR (Virtual Reality) Multi-party multi-media conferencing and collaboration
Distributed orchestra (?)
Drive-by-wire & Tele-driving & Telematics Military command-control Missile defense (ground targets, airborne targets, shipNon-stop borne targets) and service, please sub-division level command-control !!! Time-sensitive health care Monitoring of in- & out-patients Remotely controlled surgery Non-stop web servers Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Precisely timed actions, please !!!
Page 27
Ex 2
Telematics in a Car Fleet [Kim 2005]
Base Intf TMO
ODSS1 SpM1
An example of a TMO network
Base Intf TMO
ODSS1 SpM1
SvM1
SvM1
Car Intf TMO
ODSS1 SpM1
SvM1
Car Intf TMO
ODSS1 SpM1
Car Intf TMO
ODSS1 SpM1
SvM1
SvM1
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems
Page 28
References
Jane Liu, Real-Time Systems, Prentice-Hall, Upper Saddle River, 2000. Ivica Crnkovic and Magnus Larsson, Building Reliable Component-Based Software Systems, Artech House Publishers, July 2002. PowerPoint slides from http://www.idt.mdh.se/cbse-book/presentations/13chapterWC.ppt Kane (K. H.) Kim, PowerPoint slides used for undergraduate class: “ECES 123: Introduction to Real-Time Distributed Programming” taught at the University of California at Irvine, http://dream.eng.uci.edu
Building Reliable Component-based Systems
EECE 426 - Embeddede Systems