CS 501: Software Engineering Fall 1999 Lecture 25 Real Time Systems
Administration Examination schedule
Real Time System A real time system is a software system whose correct functioning depends upon the results produced and the time at which they are produced. A soft real time system is degraded if the results are not produced within required time constraints A hard real time system fails if the results are not produced within required time constraints
Embedded Systems Software and hardware are combined to provide an integrated unit, usually dedicated to a specific task Digital telephone Automobile engine control GPS Scientific instruments The software may be embedded in the device in a manner that can not be altered after manufacture
Autonomous Land Vehicle GPS Steer Sonar Model Control signals Throttle Laser Controls Sensors Signal processing
Other Applications Response critical Network router Telephone switch Seat bag controller Shared systems Multi-user data processing Time sharing
Techniques Special purpose hardware Multi-threading and multi-tasking Parallel processing => digital signal processing Interrupts => levels and priorities
Multi Threading Several similar threads operating concurrently Re-entrant code -- separation of pure code from data for each thread Testing -- single thread and multi thread May be real time (e.g., telephone switch) or non-time critical
Real Time Executive Schedules and dispatches tasks in a real time system Real time clock Interrupt handler Scheduler Resource manager Dispatcher Must be extremely reliable
Timing Timing mechanisms Synchronous (clocked) -- periodic stimuli Asynchronous -- wait for next signal Example: Communications protocols may be synchronous or asynchronous
Hardware v. Software Design of embedded systems requires close understanding of hardware characteristics Special purpose hardware requires special tools and expertise. Some functions may be implemented in either hardware of software (e.g., floating point unit) Design requires separation of functions Distinction between hardware and software may be blurred
Dartmouth Time Shared System Central processor Communications processor I/O Mulitplexor Central processor Communications processor Central processor
Software Considerations Resource considerations may dictate software design and implementation: Low level language (e.g., C) where programmer has close link to machine Inter-process communication may be too slow (e.g., C fork). May implement special buffering, etc., to control timings
Example: CD Controller 4 3 1 Input block 5 2 Output block 6 7 Circular buffer
Continuous Operation Many embedded systems must operate continuously Software update while operating Hardware monitoring and repair Alternative power supplies, networks, etc. Remote operation These functions must be designed into the fundamental architecture
Routers and Other Network Computing Interoperation with third party devices Support for several versions of protocols Restart after total failure Defensive programming -- must survive => erroneous or malicious messages => extreme loads Time outs, dropped packets, etc. Evolution of network systems
Software Development Testing and debugging need special tools and environments Debuggers, etc., can not be used to test real time performance Simulation of environment may be needed to test interfaces -- e.g., adjustable clock speed General purpose tools may not be available
Software Engineering for Real Time The special characteristics of real time computing require extra attention to good software engineering principles: Requirements analysis and specification Development of tools Modular design Exhaustive testing Heroic programming will fail!
Reading Before the examination, read Sommerville Chapters 25, 26 and 27