Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13Slide 1 Chapter 13 Real-time Software Design.
Advertisements

1 Note content copyright © 2004 Ian Sommerville. NU-specific content copyright © 2004 M. E. Kabay. All rights reserved. Real-time Software Design IS301.
Real-time Software Design
Real-time software Sommerville, Hfst. 13. Sommerville, Ch. 132 Real-time systems A real-time system is a software system where the correct functioning.
Chapter 20- Embedded Systems
Chapter 2 Real-time software design
Chapter 20- Embedded Systems Lecture 1. Topics covered  Embedded systems design  Architectural patterns  Timing analysis  Real-time operating systems.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Real-time Software Design
1 / 32 CS 425/625 Software Engineering Real-Time Software Design Based on Chapter 15 of the textbook [SE-8] Ian Sommerville, Software Engineering, 8 th.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Chapter 11 Operating Systems
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 Organization of Programming Languages-Cheng (Fall 2004) Concurrency u A PROCESS or THREAD:is a potentially-active execution context. Classic von Neumann.
CprE 458/558: Real-Time Systems
EMBEDDED SOFTWARE Team victorious Team Victorious.
Chapter 19: Real-Time Systems Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 19: Real-Time Systems System Characteristics Features of Real-Time.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
1 Reference architectures u Reference models are derived from a study of the application domain rather than from existing systems u May be used as a basis.
1 Embedded Systems Development. 2 Topics covered  Embedded systems design  Architectural patterns  Timing analysis  Real-time operating systems.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
 Dr. Syed Noman Hasany 1.  Review of known methodologies  Analysis of software requirements  Real-time software  Software cost, quality, testing.
EMBEDDED SYSTEMS 9 April 2013 William W. McMillan.
1 CS 501 Spring 2003 CS 501: Software Engineering Lecture 16 System Architecture and Design II.
1 소프트웨어공학 강좌 Chap 11. Real-time software Design - Designing embedded software systems whose behaviour is subject to time constraints -
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
EEL Software development for real-time engineering systems.
Multiprocessor and Real-Time Scheduling Chapter 10.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Chapter 5 System Modeling (2/2) Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Slide 1 Chapter 11 Real –time Software Designs. Slide 2 Real-time systems l Systems which monitor and control their environment l Inevitably associated.
EKT 424 Real Time System 1.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 / 30 CS 425/625 Software Engineering Real-Time Software Design Based on Chapter 13 of the textbook [SOMM00] Ian Sommerville, Software Engineering, 6.
©Ian Sommerville, Robin Abraham 2004CS 361, Summer 2004 Slide 1 Real-time Software Design.
Real-time Software Design King Saud University College of Computer and Information Sciences Department of Computer Science Dr. S. HAMMAMI.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Chapter 21– Real-time Software Engineering 04/12/2014Chapter 21. Real-time Software Engineering1.
19.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 19: Real-Time Systems.
Real-time Software Design Chapter 15 of Ian Sommerville’s Book on Software Engineering.
Chapter 19: Real-Time Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 19: Real-Time Systems System Characteristics.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Software Engineering for Embedded Systems Lecture 12.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Software Design.
Real-time System Definition A real-time system is a software system where the correct functioning of the system depends on the results produced by the.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Embedded software / Real-time Software Engineering 1.
Real-time Software Design. Objectives l To explain the concept of a real-time system and why these systems are usually implemented as concurrent processes.
Real-time Software Design
Real-time Software Design
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Chapter 19: Real-Time Systems
Real-time Software Design
Real-time Software Design
Real-time & distributed Software Design
Real-time Software Design
CS 501: Software Engineering Fall 1999
Multiprocessor and Real-Time Scheduling
Real-time & distributed Software Design
Chapter 19: Real-Time Systems
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:

Real-Time Software Design Yonsei University 2 nd Semester, 2014 Sanghyun Park

Topics Covered  System design  Real-time executives  Monitoring and control systems  Data acquisition systems

Real-Time Systems  A real-time system is a software system where the correct functioning of the system depends on the results produced by the system and the time at which these results are produced  Soft real-time system  Hard real-time system  Time is critical. Real-time systems MUST respond within specified times

Stimulus/Response Systems  One way of looking at a real-time system is as a stimulus / response system  Given a stimulus, the system must produce a response within a specified time  Periodic stimuli  Stimuli which occur at predictable time intervals (A temperature sensor may be polled 10 times per second)  Aperiodic stimuli  Stimuli which occur at unpredictable times (A system power failure may trigger an interrupt which must be processed by the system)

Architectural Considerations  A real-time system has to respond to stimuli that occur at different times  Control should be transferred to the appropriate handler for that stimulus as soon as it is received  This is impractical in sequential programs  Real-time systems are usually designed as a set of concurrent, cooperating processes with a real-time executive controlling these processes

A Real-Time System Model

Sensor/Actuator Control Processes

System Elements  Sensor control  Collect information from sensors. May buffer information collected from a sensor  Data processor  Carry out processing of collected information and compute the system response  Actuator control  Manage actuator operation

Real-Time System Design Process 1.Identify stimuli and associated responses 2.Define the timing constraints associated with each stimulus and response 3.Aggregate the stimulus and response processing to concurrent processes 4.For each stimulus and response, design algorithms to carry out the required computations 5.Design a scheduling system which will ensure that processes are started in time to meet their deadlines 6.Integrate the system under the control of a real-time executive

Real-Time System Modeling  The effect of a stimulus in a real-time system may trigger a transition from one state to another  Finite state model is a good, language-independent way of representing the design of a real-time system  The UML includes notations for defining state machine models

State Machine Model Of A Microwave Oven

Real-Time Programming  Hard real-time systems may have to be programmed in assembly language to ensure that deadlines are met  System-level languages such as C allow efficient programs to be written but do not have constructs to support concurrency or shared resource management  Ada as a language designed to support real-time system design includes a general purpose concurrency mechanism

Java As A Real-Time Language  Java supports lightweight concurrency (threads and synchronized methods) and can be used for some soft real-time systems  Java is not suitable for hard real-time programming or programming where precise control of timing is required  Not possible to specify thread execution time  Uncontrollable garbage collection  Not possible to discover queue sizes for shared resources  Variable virtual machine implementation  Not allow for detailed run-time space or processor analysis

Real-Time Executives  Real-time executives are analogous to an operating system in a general-purpose computer  Responsible for process management and resource (processor and memory) allocation  Components  Real-time clock (timer)  Interrupt handler: manages aperiodic requests for service  Scheduler: chooses the next process to be run  Resource manager: allocates memory and processor resources  Dispatcher: starts process execution

Components Of A Real-Time Executives

Starting A Process

Stimuli Priority  The executive has to be able to manage at least two priority levels for the system processes  Interrupt level priority: highest priority which is allocated to processes requiring a very fast response  Clock level priority: allocated to periodic processes

Scheduling Strategies  Non pre-emptive scheduling  Once a process has been scheduled for execution, it runs to completion or until it is blocked for some reason (e.g., waiting for input)  Pre-emptive scheduling  The execution of an executing process may be stopped if a higher priority process requires service  Scheduling algorithms  Round-robin  Rate monotonic  Shortest deadline

Monitoring and Control Systems  Important standard/generic real-time system class  Continuously check sensors and take actions depending on sensor values  Monitoring systems take an action when some exceptional sensor value is detected  Control systems continuously control hardware actuators depending on the value of associated sensors

Burglar Alarm System  A system is required to monitor sensors on doors and windows to detect the presence of intruders in a building  When a sensor indicates a break-in, the system switches on lights around the area and calls police automatically  The system should include provision for operation without a main power supply

Control Systems  The burglar alarm system is a monitoring system rather than a control system as it does not include actuators which are directly affected by sensor values  Control systems are similar but, in response to sensor values, the system sends control signals to actuators  An example of a control system is a building heating control system which monitors temperatures and switches heaters on and off

Data Acquisition System  Collect data from sensors for subsequent processing and analysis  Data collection processes and processing processes may have different periods and deadlines  Data collection may be faster than processing  Circular or ring buffers are a mechanism for smoothing speed differences

A Ring Buffer For Data Acquisition

Mutual Exclusion  Producer processes collect data and add it to the buffer. Consumer processes take data from the buffer and make elements available  Producer and consumer processes must be mutually excluded from accessing the same element  The buffer must stop producer processes from adding information to a full buffer and consumer processes from trying to take information from an empty buffer