Realtime Embedded System Design

Slides:



Advertisements
Similar presentations
Introduction to embedded systems and realtime systems
Advertisements

Real-Time Kernels and Operating Systems Basic Issue - Purchase commercial “off-the- shelf” system or custom build one Basic Functions –Task scheduling.
© Copyright 2004 Dr. Phillip A. Laplante 1 Kernel Architectures  Polled Loop  Synchronized Polled Loop  State-Based Model  Cyclic Executives  Foreground/Background.
CENG 324 Embedded Computer Systems Lecture 3 General Concepts of RTOS (Real-Time Operating System) Asst. Prof. Tolga Ayav, Ph.D. Department of Computer.
6/13/2015Page 1 Software Requirements Engineering for RTS and Embedded Systems B. Ramamurthy.
Realtime Systems Fundamnetals
6/26/2015Page 1 Software Requirements Engineering Ch.5 B. Ramamurthy.
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
Introduction to Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 8/17/20151.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
EEL Software development for real-time engineering systems.
CHAPTER 4 10/29/ RTS: Kernel Design and Cyclic Executives CE321-fall2013.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE /13/20151.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Embedded System Design and Development Introduction to Embedded System.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
CONCEPTS OF REAL-TIME OPERATING SYSTEM. OBJECTIVE  To Understand Why we need OS?  To identify Types of OS  To Define Real - Time Systems  To Classify.
1 OPERATING SYSTEMS. 2 CONTENTS 1.What is an Operating System? 2.OS Functions 3.OS Services 4.Structure of OS 5.Evolution of OS.
Input / Output Chapter 9.
Real-time Software Design
Applied Operating System Concepts
Chapter 1: Introduction
Introduction to Basic OS Concepts
Operating Systems Lecture 2.
Real time systems RTS Engineering.
RTS: Kernel Design and Cyclic Executives
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Real-time Software Design
Introduction to Realtime Systems (& Embedded Systems)
Chapter 1: Introduction
Hardware Considerations
RTS: Kernel Design and Cyclic Executives
CSE321: Realtime and Embedded Systems
CSE321: Realtime and Embedded Systems
Software Requirements Engineering
Operating Systems Bina Ramamurthy CSE421 11/27/2018 B.Ramamurthy.
RTS: Kernel Design 11/30/2018.
CSE321: Realtime and Embedded Systems
Operating System Concepts
Introduction to Hardware
CS 501: Software Engineering Fall 1999
Process Description and Control
Chapter 1: Introduction
Operating Systems Lecture 2.
BIC 10503: COMPUTER ARCHITECTURE
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design 1/2/2019.
Introduction to Operating Systems
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Threads Chapter 4.
Introduction to Operating Systems
RTS: Kernel Design and Cyclic Executives
Introduction to embedded systems and realtime systems
RTS: Kernel Design and Cyclic Executives
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Chapter 1: Introduction
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Operating System Concepts
Chapter 1: Introduction
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Realtime Embedded System Design B. Ramamurthy 4/7/2019

Example real-time and embedded systems Domain Application Avionics Navigation; displays Multimedia Games; simulators Medicine Robot surgery; remote surgery; medical imaging Industrial systems Robot assembly lines; automated inspection Civilian Elevator control Automotive system; Global positioning system (GPS) 4/7/2019

Lets discuss some realtime system (RTS) characteristics Realtime response 4/7/2019

Realtime Characteristics RTS have to respond to events in a certain pre-detemined amount of time. The time constraints have to be considered during planning, design, implementation and testing phases. Internal failures due to software and hardware fault have be handled satisfactorily. You cannot simply pop-up a dialog error box that says “send report” or “don’t send report”. Also external failures due to outside sources need to be handled. 4/7/2019

Realtime Characteristics (contd.) Typical interaction in an RTS is asynchronous. Thus an RTS should have features to handle asynchronous events such as interrupt handlers and dispatcher and associated resources. Potential for race condition: when state of resources are timing dependent race condition may occur. Periodic tasks are common. 4/7/2019

Embedded System Is a special purpose system designed to perform a few dedicated functions. Small foot prints (in memory) Highly optimized code Cell phones, mp3 players are examples. The components in an mp3 player are highly optimized for storage operations. (For example, no need to have a floating point operation on an mp3 player!) 4/7/2019

Real-time system concepts A system is a mapping of a set of input into a set of outputs. A digital camera is an example of a realtime system: set of input including sensors and imaging devices producing control signals and display information. Realtime system can be viewed as a sequence of job to be scheduled. Time between presentation of a set of inputs to a system and the realization of the required behavior, including availability of all associated outputs, is called the response time of the system. 4/7/2019

Real-time system concepts (contd.) Real-time system is the one in which logical correctness is based on both the correctness of the output as well as their timeliness. A soft real-time system is one in which performance is degraded by failure to meet response-time constraints. A hard real-time system is one in which failure to meet a single deadline may lead to complete and catastrophic failure. More examples: Automatic teller: soft Robot vacuum cleaner: firm Missile delivery system: hard Given a system you should be able to classify it. 4/7/2019

Embedded Systems 4/7/2019

Requirements-Engineering Process Deals with determining the goals, functions, and constraints of systems, and with representation of these aspects in forms amenable to modeling and analysis. 4/7/2019

Types of requirements Standard scheme for realtime systems is defined by IEEE standard IEEE830. It defines the following kind of requirements: Functional Non-functional External interfaces Performance Logical database Design constraints (ex: standards compliance) Software system attributes Reliability, availability, security, maintainability, portability 4/7/2019

Simple kernels Polled loop: Say a kernel needs to process packets that are transferred into the DMA and a flag is set after transfer: for(;;) { if (packet_here) { process_data(); packet_here=0; } Excellent for handling high-speed data channels, a processor is dedicated to handling the data channel. Disadvantage: cannot handle bursts 4/7/2019

Simple kernels: cyclic executives Illusion of simultaneity by taking advantage of relatively short processes in a continuous loop: for(;;) { process_1(); process_2(); process_3(); … process_n(); } Different rate structures can be achieved by repeating tasks in the list: 4/7/2019

Cyclic Executives: Example: Interactive games Space invaders: for(;;) { check_for_keypressed(); move_aliens(); check_collision(); update_screen(); } check_keypressed() checks for three button pressings: move tank left or right and fire missiles. If the schedule is carefully constructed we could achieve a very efficient game program with a simple kernel as shown above. 4/7/2019

Interrupt driven systems Main program is a simple loop. Various tasks in the system are schedules via software or hardware interrupts; Dispatching performed by interrupt handling routines. Hardware and software interrupts. Hardware: asynchronous Software: typically synchronous Executing process is suspended, state and context saved and control is transferred to ISR (interrupt service routine) 4/7/2019

Interrupt driven systems: code example void main() { init(); while(TRUE); } void int1(void){ save (context); task1(); retore (context);} restore (context);} Foreground/background systems is a variation of this where main does some useful task in the background; 4/7/2019

Design methods: Finite state machines Finite state automaton (FSA), finite state machine (FSM) or state transition diagram (STD) is a formal method used in the specification and design of wide range of embedded and realtime systems. The system in this case would be represented by a finite number of states. Lets design the avionics for a drone aircraft. 4/7/2019

Finite State Machine (FSM) M = five tuple  { S, i, T, Σ, δ } S = set of states i = initial state T = terminal state (s) Σ = events that bring about transitions δ = transitions Lets do this exercise for the avionics for fighter aircraft 4/7/2019

Drone aircraft avionics (simplified) else MA: Mission Assigned TD: Target Detected LO: Locked On EE: enemy Evaded ED: Enemy Destroyed MC: Mission Complete else TAK MA NAV TD else NAE MC TAK: Take off NAV: Navigate NAE: Navigate & Evade NAA: Navigate & Attack LAN: Land else LO NAA EE LAN ED 4/7/2019

State Transition table MA LO TD MC EE ED TAK NAV NAE LAN NAA 4/7/2019

Lets design a simple embedded/ realtime system Use the table to code a function with case/switch statement Or write a table-driven code Which is better and why? Lets implement this. I will show a demo later. 4/7/2019

Finite state automata and Co-routine based kernels void process_a(void){ for(;;) { switch (state_a) { case 1: phase_a1(); | case 2: phase_a2(); | …. case n: phase_an();}}} void process_b(void){ switch (state_b) { case 1: phase_b1(); | case 2: phase_b2(); | case n: phase_bn();}}} state_a and state_b are state counters; Communication between coroutines thru’ global variables; 4/7/2019

Summary We learned that realtime system requirements are quite different from that of regular systems. Discussed many approaches to designing realtime systems. Studied FSM based design of realtime systems Demo 4/7/2019