REAL-TIME SYSTEMS: an INTRODUCTION Keep up with the Data Stream from the Landing Radar
Total Page:16
File Type:pdf, Size:1020Kb
R REAL-TIME SYSTEMS: AN INTRODUCTION keep up with the data stream from the landing radar. AND THE STATE-OF-THE-ART However, it was discovered that the missed deadlines were nonfatal, and the scheduler automatically adjusted, INTRODUCTION to meet soft real-time behavior for the landing tasks. Our goal in this article is to give an overview of the broad Periodic and Aperiodic Tasks area of real-time systems. This task daunting because real- Real-time applications are also classified depending on the time systems are everywhere, and yet no generally tasks that comprise the application. In some systems, tasks accepted definition differentiates real-time systems from are executed repetitively within a specified period. A task t non–real-time systems. We will make an attempt at pro- i is characterized as (p ,e), where p its periodicity and e is viding a general overview of the different classes of real- i i i i its (worst-case) execution time. Monitoring patient’s vitals time systems, scheduling of tasks (or threads) in such is an example of such a system. Hard real-time systems are systems, design tools and environments for real-time sys- usually designed using periodic tasks, and static schedul- tems, real-time operating systems, and embedded systems. ing can be used for periodic tasks. We will conclude our discussions with research challenges Aperiodic tasks are tasks that are executed on demand that still remain. (or with unknown period). A task is executed in response to an event, and a task t is characterized as (a ,r,e,d) where Definitions i i i i i ai its the arrival time. ri is the time when the task is ready Hard versus Soft Real-Time Systems for execution, ei is its (worst-case) execution time, and di is the deadline by which the task must complete. It should be Real-time systems are classified as hard or soft real-time noted that the arrival time may not be specified in some systems. Hard real-time systems have very strict time systems, and the ready time is defined by the arrival of an constraints, in which missing the specified deadline is event. Real-time systems that must react to external sti- unacceptable. The system must be designed to guarantee muli will consist of aperiodic tasks, which define the all time constraints. Every resource management system response to the events. Systems that include aperiodic such as the scheduler, input–output (I/O) manager, and tasks fall into the class of soft real-time applications, communications, must work in the correct order to meet the because scheduling may not guarantee completion of tasks specified time constraints. within specified deadlines. Military applications and space missions are typical Real-time applications may also include sporadic tasks, instances of hard real-time systems. Some applications which are defined random arrival times. Sporadic task can with real-time requirements include telecom switching, be characterized by (a ,r,e,d); similar to aperiodic tasks. car navigation, the medical instruments with the critical i i i i time constraints, rocket and satellite control, aircraft con- trol and navigation, industrial automation and control, and Embedded Real-Time Systems robotics. Hard real-time systems typically interface with the physi- Soft real-time systems also have time constraints; how- cal hardware at a low level in an embedded system. The ever, missing some deadline may not lead to catastrophic embedded system is usually a special-purpose system failure of the system. Thus, soft real-time systems are designed to perform a few or even only one dedicated similar to hard real-time systems in their infrastructure function usually with real-time computing constraints. requirements, but it is not necessary that every time con- Antilock brakes on a car is a simple example of an embedded straint be met. In other words, some time constraints are real-time system in which the real-time constraint is the not strict, but they are nonetheless important. A soft real- short time in which the brakes must be released to prevent time system is not equivalent to non-real-time system, the wheel from locking. Other examples include medical because the goal of the system is still to meet as many systems such as heart pacemakers, industrial process con- deadlines as possible. trollers, communication systems, aircraft control systems, Some applications with soft real-time requirements and weapon systems. include web services such as real-time query, call admit- In general, embedded real-time systems are designed as tance in voice over internet protocol and cell phone, digital reactive systems: The system observes changes in the TV transmissions, cable and digital TV set-top-boxes, video environment, computes appropriate actions, and conveys conferencing, TV broadcasting, games, and gaming equip- the actions to various components so that the system as a ment. Multimedia systems in general are examples of soft whole operates correctly while the designated time con- real-time systems (e.g., dropping frames while displaying straint is met. For example, cruise-control systems in auto- video). mobiles must continuously monitor and react to current Even in some typical hard real-time applications, some speed of the vehicle and adjust the engine’s acceleration or functions have soft real-time constraints. For instance, in deceleration appropriately within a prespecified time; long Apollo 11, the lunar module guidance computer could not delays will cause the system to fail in maintaining the 1 2 REAL-TIME SYSTEMS: AN INTRODUCTION AND THE STATE-OF-THE-ART cruising speed. In addition to meeting correctness and concurrent composition of the computing processes with timing constraints, the embedded real-time systems the physical system. must also meet constraints imposed by the embedded nat- ure of such systems. These constrain include (1): SCHEDULING IN REAL-TIME SYSTEMS 1. Nonrecurring engineering costs: The one-time cost of Most real-time systems are designed as concurrent proces- designing system must be as minimal as possible. sing systems, rather than as monolithic control systems. 2. Unit Cost: The cost of each unit must be minimal. The concurrency allows for the system to react to events 3. Size: The physical dimension of the system is limited more easily. The scheduling of concurrent activities (tasks by the environment in which it will be embedded. or threads) is critical to achieving real-time constraints. 4. Power: Because some embedded systems run on bat- Different scheduling approaches are available for different teries, various power management schemes must be types of real-time systems: hard versus soft real-time; employed to minimize the power consumption. periodic, aperiodic or sporadic tasks. Most scheduling algo- 5. Performance: If the system must meet real-time con- rithms aim to meet deadlines associated with tasks while straints, then performance is a critical metric. optimizing the use of resources. Inmanycases,embedded real-time systemsuseapplication- Static Versus Dynamic Priority Scheduling specific hardware [such as Digital Signal Processing (DSP) Classic scheduling theory deals with static scheduling. processors and application specific integrated circuits Static scheduling refers to the fact that the scheduling (ASIC)]. However, more recently, general-purpose proces- algorithm has complete information regarding the task sors along with reconfigurable fabrics [i.e., field program- set, which includes knowledge of deadlines, execution mable gate arrays (FPGAs)] are becoming commonly used times, precedence constraints, and release times. to designing real-time embedded systems. The reconfigur- In rate-monotonic (RM) scheduling, the shorter the able fabric can be used to speed up common functionalities period of a task, the higher is its priority. In deadline- without having to custom design circuits. The reconfigur- monotonic (DM) scheduling, the shorter the relative dead- ability allows flexibility to support multiple functionalities line (i.e., the difference between the deadline and the and added features. Recent technological innovations have current time, also known as the laxity) of a task, the higher led to very powerful general-purpose processors that can be is its priority. This approach investigates schedulability used to meet the performance requirements of modern tests for sets of periodic tasks whose deadlines are per- embedded real-time systems. Such systems also permit mitted to be less than their period. Such a relaxation for power saving options such as dynamic frequency and enables sporadic tasks to be incorporated directly with voltage control, shutting unused subsystems, and reconfi- periodic tasks (7, 8). For arbitrary relative deadlines, gurability of memory [particularly cache (2–5)] subsys- DM outperforms RM in terms of use. tems. Several design tools are currently available either to Real-Time Algorithm Metrics customize the hardware and software subsystems or to use general-purpose processors augmented with FPGA compo- The most important metric of a real-time system is the nents. The nonrecurring costs are higher with the first success ratio of system deadlines. The success ratio is option (ASIC); however, such systems can be designed to defined as the percentage of jobs completed before their meet stringent size, power, and performance requirements. deadlines. However, other metrics, such as the minimized The latter option (FPGA) provides greater flexibility. total (or weighted sum) of the execution times of real-time These tools, however, are designed for use by experts jobs, the minimized average response time, the minimized with a clear understanding of both hardware and software. maximum lateness or tardiness of real-time jobs, and the Tools are needed that permit higher-level abstractions to minimized number of processors required for real-time designers and that automatically optimize lower-level sys- jobs, may be important for real-time systems, especially tems to meet the specified constraints. for soft real-time systems. In soft real-time systems, missing a few deadlines is not Cyber-Physical Systems critical; however, the overall performance and use of resources are important.