1 / 72

REAL-TIME SYSTEMS

REAL-TIME SYSTEMS. Reny Sebastian, SEG, ER&DCI, TVM. Sessions. Introduction to Real-Time Concepts. 2. Real-Time Operating Systems. 3. Case Study. . Session 1. Introduction to Real-Time Concepts. Real-Time System. Definition

kiri
Download Presentation

REAL-TIME SYSTEMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. REAL-TIME SYSTEMS Reny Sebastian, SEG, ER&DCI, TVM Real-Time Systems

  2. Sessions Introduction to Real-Time Concepts. 2. Real-Time Operating Systems. 3. Case Study. Real-Time Systems

  3. Session 1 Introduction to Real-Time Concepts. Real-Time Systems

  4. Real-Time System • Definition A real-time system (defined by IEEE) is a system whose correctness includes its response time as well as its functional correctness. In other words, in a real-time system, it not only matters that the answers are correct, but it matters when the answers are produced. A Late Answer is a Wrong Answer! Real-Time Systems

  5. Real-Time Systems - Categories 1. Hard Real-Time Systems 2. Soft Real-Time Systems Real-Time Systems

  6. Hard Real-Time Systems • Hard real-time means that the system (i.e., the entire system including OS, middleware, application, HW, communications, etc.) must be designed to GUARANTEE that response requirements are met. • Hard Real-Time doesn’t mean fast execution. Real-Time Systems

  7. Examples • Electronic Engines • Automotive and Flight Control Systems • Medical Systems • Industrial Control Systems • Robotics Real-Time Systems

  8. Soft-Real Time Systems Soft real-time is exactly the same as hard real-time in its infrastructure requirements, but it is not necessary for system success that EVERY time constraint be met. Real-Time Systems

  9. Example • Telecommunication Systems • Internet Video • ATM Real-Time Systems

  10. The Real-Time Spectrum Real-Time Systems

  11. Real-Time Design Issues • How many things are under control? • How “hard” are the timing constraints? • Will there be user interaction? • What is the mix of synchronous vs. asynchronous threads of control? Real-Time Systems

  12. Real-Time Design Approaches • There are two primary techniques used in real-time designs - Super- loops One program running -Multitasking Many programs running, taking turns Real-Time Systems

  13. Super-Loops • Also called Foreground/Background Systems • There is a background loop that is always running anytime an ISR isn’t executing • The CPU is always busy • Can be taken to the extreme of an idle loop and all of the work being done in the ISRs Real-Time Systems

  14. Super-Loop Background Foreground ISR Time ISR ISR Real-Time Systems

  15. Multi-Tasking Operation • With multi- tasking, multiple tasks or threads compete for the CPU based on a scheduling policy • This scheduling policy is implemented in the Kernel • The tasks give up the CPU: -Voluntarily: cooperative multi- tasking Developer determined via system call - Involuntarily: preemptive multi- tasking Process scheduling algorithm Real-Time Systems

  16. Multi-Tasking Real-Time Systems

  17. Session 2 Real-Time Operating Systems Real-Time Systems

  18. What Is An RTOS? • A Real- Time Operating System is software that allows a program to: – Communicate with peripherals and other tasks – React in a deterministic way to external events – Share the CPU and resources in a rigidly established manner between competing threads of execution Real-Time Systems

  19. Commercial RTOSs • VxWorks • pSOS System • QNX • Nucleus • Windows CE • MircoC/OS-II Real-Time Systems

  20. Commercial RTOS Shortcomings • Can be very expen$ive • High, per- seat costs • Royalties • Access to source Real-Time Systems

  21. Free RTOSs • Embedded Linux • Real-Time Linux • RTAI • RTEMS • eCOS Real-Time Systems

  22. Multi-Tasking Revisited • Multitasking is the process of scheduling and switching the CPU between several tasks • Maximizes the utilization of the CPU • Facilitates modular construction of applications • Simplifies the design of application programs Real-Time Systems

  23. Task • A task (thread) is a simple program that thinks it has the CPU all to itself. • A Real-Time application consists of several tasks executing concurrently. • Each task is assigned a priority, its own set of CPU registers, and its own stack area. Real-Time Systems

  24. Task States Waiting Dormant Ready Running ISR Real-Time Systems

  25. Context Switch • Occurs when a Multi-Tasking kernel decides to run a different task. • Steps involved in a context switch 1.Save current task’s context(CPU registers) in the current tasks context storage area(it’s stack) 2.Restore the new task’s context from it’s storage area(it’s stack). 3.Resume execution of the new task’s code. Real-Time Systems

  26. Multiple Tasks TASK 1 TASK 2 TASK n Stack Stack Stack Task Control Block Task Control Block Task Control Block Status Status Status SP SP SP Priority Priority Priority MEMORY CPU Registers CPU SP Real-Time Systems

  27. Kernel • Definition Kernel is the part of the multi-tasking system responsible for the management of tasks and communication between tasks. • Services - Context switching - Inter task communication services(Semaphore management, mail boxes, queues, time delays, etc.) Real-Time Systems

  28. Scheduler • Scheduler is the part of the kernel responsible for determining which task will run next • Most real-time kernels are priority based • Each task is assigned a priority based on its importance • The priority of each task is application specific • Control is always given to the highest priority task ready to run. Real-Time Systems

  29. Kernel There are two types of priority based kernels • Non-Preemptive Kernel • Preemptive Kernel Real-Time Systems

  30. Non-Preemptive Kernel • Require that each task does something to explicitly give up the control of the CPU • Also called cooperative multitasking • ISR always returns to the interrupted task • Advantages - Low interrupt latency - It can use Non-Reentrant functions • Disadvantages - Responsiveness is very law • Very few kernels are non-preemptive Real-Time Systems

  31. Non-Preemptive Kernel Low Priority Task ISR ISR makes the higher priority task ready Time High Priority Task Low-priority task relinquishes the CPU Real-Time Systems

  32. Preemptive Kernel • It is used when system responsiveness is important. • High priority task ready to run is always given control of the CPU • Most real-time kernels are preemptive. • Application code using a preemptive kernel should not use non-reentrant functions or an appropriate mutual exclusion method should be applied to prevent data corruption. Real-Time Systems

  33. Preemptive Kernel Low Priority Task ISR High Priority Task ISR makes high priority task ready Time Real-Time Systems

  34. Reentrancy • A reentrant function can be interrupted at any time and resumed at a later time without loss of data. • It either uses local variables or protects data when global variables are used. • It can be used by more than one task without fear of data corruption. Real-Time Systems

  35. Mutual Exclusion • Mutual Exclusion is used to ensure the exclusive access to a shared resource without data corruption. • Common Methods are • Disabling interrupts • Disabling scheduling • Using Semaphores Real-Time Systems

  36. Intertask Communication • Common Inter task Communication methods are 1. Message Queues 2. Mail Boxes 3. Semaphores Real-Time Systems

  37. Session 3 Case Study TETRA Mobile Real-Time Systems

  38. Tetra Air Interface • Tetra Systems use TDMA protocol. • TDMA defines time slots of duration 14.167 ms • A TDMA Frame contains 4 time slots • Each time slot is a physical channel which may be used for signaling or traffic. • There is an offset of two time slots between uplink and downlink slots. Real-Time Systems

  39. TDMA Structure Real-Time Systems

  40. What is the real-time requirement? 1 2 3 4 1 2 3 4 1 2 3 4 8.46 ms for uC 6.65 msfor DSP Offset of 2 slots Total Processing Time (15.11 ms) Real-Time Systems

  41. Hardware Architecture • Texas TMS320VC5472 (Orion Processor) Processor • External RAM 8 MB SDRAM • Flash Memory 8 MB Real-Time Systems

  42. Orion Processor Integrates • A DSP subsystem based on the TMS320C54x architecture and a • RISC microcontroller subsystem based on the AR7TDMI core. Real-Time Systems

  43. DSP Subsystem Includes • TMS320C54X DSP Core • 74K X 16 Bit internal SRAM • ARM Port Interface • Two multi channel buffered serial ports(McBSPs) • Timer • DMA • Programmable wait-state generator • External Memory Interface Real-Time Systems

  44. MCU Subsystem • ARM7TDMI Core • Memory interface for external SRAM, Flash, ROM and SDRAM. • On-chip 16K-byte zero wait-state SRAM. • General purpose I/Os (GPIOS), including support for an 8x8 keyboard. • Three Timers(Two generic, one watchdog) • Two UARTs • Interrupt Handler Subsystem Real-Time Systems

  45. API Interface Orion DSP Subsystem ARM7TDMI API Memory API Interface TMS320C54x Real-Time Systems

  46. Software Architecture The software is split up into five major components • DSP • MMI (Man Machine Interface) • PEI (Peripheral Equipment Interface) • Protocol Stack • RTOS (uC/OS-II) Real-Time Systems

  47. Software Architecture Real-Time Systems

  48. ARM Software Architecture Real-Time Systems

  49. uC/OS-II uC/OS-II is a real-time operating system developed by Jean J. Labrosse. Characteristics • Preemptive • Multi-tasking • Romable • Scalable Real-Time Systems

  50. uCOS-II • Maximum number of Tasks is 64 • Task priority levels can be 4 –56 • Task priority should be unique. • Supports fixed block memory management. • Supports Inter task communication methods such as Message Queues, Mail Boxes etc. Real-Time Systems

More Related