Sie sind auf Seite 1von 35

EE5903 Real-time Systems

Real-time System Design

Mandar Chitre

Course Outline
Introduction to real-time systems Real-time system design Inter-process communication Inter-process synchronization Implementation of concurrency Case studies Real-time operating systems Process scheduling Verication and validation
2010 Mr Cr

What to avoid!

2010 Mr Cr

Design Languages
Data Flow Diagrams (DFD)
Time Server

Context Diagram
Alarm Time Time

Unied Modeling Language (UML)

User

Time

Alarm Clock

Alarm

Stop Alarm

2010 Mr Cr

Data Flow Diagrams

Process

External Entity

Data Flow

Data Store

2010 Mr Cr

Layered DFDs
Context Diagram
External Entity

Process

Level 1 DFD
External Entity

Process 2

Process 1

Data Store

Level 2 DFD - Process 1


External Entity

Level 2 DFD - Process 2


Process 1

Process 1b

Process 2b

Process 1a
Process 2 Data Store

Process 2a

Data Store

2010 Mr Cr

Real-time Extensions
Pulse Generator
Sonar Pulse Transmit Trigger Sonar Pulse

Sonar Control System


Receive Enable

Sonar Transmitter Sonar Receiver


Sonar Return

Sonar Pulse
Sonar Pulse

Matched Filter

Detections

Targets

Target Tracker

Sonar Display

2010 Mr Cr

DFD Design Guidelines


Most process must have at least one input dataow (violators are called "magic" processes) Most process must have at least one output dataow (violators are called "black hole" processes) Every dataow must connect two elements one of them must be a process; the other can be a terminator, a data store or another process Each dataow diagram should contain no more than 6-7 processes and no more than 6-7 data stores, and all the processes should be conceptually at the same level of detail

2010 Mr Cr

Messy DFD!

Source http://www.astro.princeton.edu/PBOOK/datasys/dataproc.gif

2010 Mr Cr

DFD Design Guidelines


For every process, one of the following must eventually be true: The description label is so simple and unambiguous that every reader will understand it in exactly the same way It is expanded or decomposed into a separate lowerlevel dataow diagram that preserves exactly the same net inputs and outputs, but shows internal detail, such as data stores and internal processes It is rigorously described by a separate process specication (business rule, decision rule, function denition, algorithm, etc.)
2010 Mr Cr

Internet Alarm Clock


Time Server

Context Diagram
Alarm Time Time

User

Time

Alarm Clock

Alarm

Stop Alarm

2010 Mr Cr

Internet Alarm Clock


Level 1 Diagram : Alarm Clock
Time User Time Server Time

Alarm Time

Alarm Alarm Stop Alarm Tick Clock

Alarm Time

Current Time

Oscillator

2010 Mr Cr

Internet Alarm Clock


Level 2 Diagram : Clock
User Time Server Time Oscillator Tick

Time Sync Time Display Time Keep Time

Current Time

2010 Mr Cr

Internet Alarm Clock


Level 1 Diagram : Alarm Clock
Time User Time Server Time

Alarm Time

Alarm Alarm Stop Alarm Tick Clock

Alarm Time

Current Time

Oscillator

2010 Mr Cr

Internet Alarm Clock


Level 2 Diagram : Alarm
User

Alarm Time

Alarm Time

Alarm

Set Alarm Alarm Trigger Beeper

Compare Time

Stop Alarm

Current Time

2010 Mr Cr

Unied Modeling Language


Structure
Diagram

Object
Diagram

Deployment
Diagram

Diagram

Class

Component
Diagram

Activity
Diagram

Structural
Diagrams

Use Case
Diagram

Behavioral
Diagrams

UML
2.0

Functional
Diagrams

Statechart
Diagram

Interaction
Diagrams

Info Flow
Diagram

Sequence
Diagram

Timing
Diagram

Communication
Diagram

2010 Mr Cr

Use Case Diagrams

2010 Mr Cr

Activity Diagrams
Like owcharts, but more exible Denitions: An action has a "run to completion" semantics An activity is like an action, but it may be terminated by received events Token execution semantics

2010 Mr Cr

Activity Diagrams

2010 Mr Cr

Statechart Diagrams

2010 Mr Cr

Statechart Diagrams

2010 Mr Cr

Class Diagrams
Classname

Visibility: - Private # Protected + Public

Attribute denitions Method denitions

Method signature

2010 Mr Cr

Class Diagrams
Association the related classes have a link that allows them to invoke services from each other Aggregation () one or more of the "part" class is aggregated to form the "whole" class Composition () stronger aggregation relationship, with the "whole" class having the responsibility of creating and destroying the "part" objects Generalization () one class denes a set of features that are specialized or extended by another class Dependency (---) a relation between two classes that does not fall into one of the other types

2010 Mr Cr

Class Diagrams

2010 Mr Cr

Class Diagrams
An operation is an abstraction of a method without specifying the steps needed to provide the service An interface is a named collection of services The services provided by an interface are represented by operations A class is said to realize an interface, if it provides methods for each of the interface operations Interfaces are denoted in UML using stereotypes or the lollipop notation

2010 Mr Cr

Class Diagrams

2010 Mr Cr

Sequence Diagrams

2010 Mr Cr

Component Diagrams

2010 Mr Cr

Deployment Diagrams

2010 Mr Cr

Theres lots more to UML


Notes Stereotypes References Loops Options Parallel Execution Other diagrams Self study!

2010 Mr Cr

Process
System Design
URS HLD Detailed Design

Requirement Gathering

Reviews Test Plan

Implementation

Testing
Test Reports

Code

Code Docs

2010 Mr Cr

Waterfall Model

Source: Wikipedia

2010 Mr Cr

Spiral Model

Source: Wikipedia

2010 Mr Cr

V-Model

Source: Wikipedia

2010 Mr Cr

Summary
Data ow diagrams Layered data ow design UML Use case diagrams Activity diagrams Statechart diagrams Class diagrams Sequence diagrams Component diagrams Deployment diagrams Development processes
2010 Mr Cr

Das könnte Ihnen auch gefallen