Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

20
Designing Realtime Designing Realtime Systems & Embedded Systems & Embedded Systems Systems B. Ramamurthy CSE 321 06/17/22 1

Transcript of Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Page 1: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Designing Realtime Designing Realtime Systems & Embedded Systems & Embedded SystemsSystemsB. RamamurthyCSE 321

04/21/23 1

Page 2: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

The course will enable you The course will enable you to:to:Understand and design embedded

systems and real-time systemsFor real-time systems:

◦Identify the unique characteristics of real-time systems

◦Explain the general structure of a real-time system

◦Define the design problems and challenges of real-time systems

◦Apply real-time systems design techniques to various software programs.

04/21/23 2

Page 3: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Course overviewCourse overview

For embedded systems it will enable you to :◦Understand the basics of an

embedded system◦Program an embedded system◦Design, implement and test an

embedded system.◦Ex: realtime + embedded : heart

pacemaker◦Ex: realtime: online video games

04/21/23 3

Page 4: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Global Embedded Systems Global Embedded Systems MarketMarket

Global Embedded Systems Market, 2003-2009($ Millions):

Source BBC Inc.

http://www.the-infoshop.com/study/bc31319-embedded-systems.html

04/21/23 4

Page 5: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Example real-time and embedded Example real-time and embedded systemssystems

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)

04/21/23 5

Page 6: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Lets discuss some realtime Lets discuss some realtime system (RTS) characteristicssystem (RTS) characteristics

04/21/23 6

Page 7: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Realtime CharacteristicsRealtime CharacteristicsRTS 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.

04/21/23 7

Page 8: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Realtime Characteristics Realtime Characteristics (contd.)(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.

04/21/23 8

Page 9: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Embedded SystemEmbedded SystemIs a special purpose system designed to

perform a few dedicated functions.Small foot prints (in memory)Highly optimized codeCell 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!)

04/21/23 9

Page 10: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Real-time system Real-time system conceptsconceptsA 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.

04/21/23 10

Page 11: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Real-time system concepts Real-time system concepts (contd.)(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.

04/21/23 11

Page 12: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Embedded SystemsEmbedded Systems

04/21/23 12

Page 13: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Requirements-Engineering Requirements-Engineering ProcessProcessDeals with determining the goals,

functions, and constraints of systems, and with representation of these aspects in forms amenable to modeling and analysis.

04/21/23 13

Page 14: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Types of requirementsTypes of requirements Standard scheme for realtime

systems is defined by IEEE standard IEEE830.

It defines the following kind of requirements:

I. FunctionalII. Non-functional

1. External interfaces2. Performance3. Logical database4. Design constraints (ex: standards

compliance)5. Software system attributes

Reliability, availability, security, maintainability, portability

04/21/23 14

Page 15: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Design methods: Finite state Design methods: Finite state machinesmachinesFinite 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.

04/21/23 15

Page 16: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Drone aircraft avionics Drone aircraft avionics (simplified)(simplified)

TAK

LANNAA

NAE

NAV

else

MA else

TDelse

LOelse

EE

ED

MC

MA: Mission AssignedTD: Target DetectedLO: Locked OnEE: enemy EvadedED: Enemy DestroyedMC: Mission Complete

TAK: Take offNAV: NavigateNAE: Navigate & EvadeNAA: Navigate & AttackLAN: Land

04/21/23 16

Page 17: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Finite State Machine (FSM)Finite State Machine (FSM)M = five tuple { S, i, T, Σ, δ }S = set of statesi = initial stateT = terminal state (s)Σ = events that bring about transitionsδ = transitionsLets do this exercise for the avionics

for fighter aircraft

04/21/23 17

Page 18: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

State Transition table State Transition table

MA LO TD MC EE ED

TAK NAV

NAV NAE LAN

NAE NAA

NAA NAE NAV

LAN

04/21/23 18

Page 19: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

Lets design a simple Lets design a simple embedded/ realtime systemembedded/ realtime systemUse the table-cell to code a

function / use with switch statement

Or write a table-driven codeWhich is better and why?

04/21/23 19

Page 20: Designing Realtime Systems & Embedded Systems B. Ramamurthy CSE 321 12/13/20151.

SummarySummaryWe examined the course

objectives for embedded and realtime systems

We looked at sample systemsFSM are common approach to

design RTS/EMBBrush up your programming

language skills

04/21/23 20