• 沒有找到結果。

GPS receiver

在文檔中 Scotch Road (頁 44-80)

search

engine renderer

user interface database

display

Embedded System Design - NTHU EOS Lab 45 Module-1 Embedded Computing

Step-3: GPS moving map Hardware Architecture (2/3)

GPS receiver CPU

panel I/O display frame

buffer

memory

Embedded System Design - NTHU EOS Lab 46 Module-1 Embedded Computing

Step-3: GPS moving map Software Architecture (3/3)

position

database

search renderer

timer user

interface

pixels

Embedded System Design - NTHU EOS Lab 47 Module-1 Embedded Computing

Step-3: Architecture Design (cont)

 Functional block diagram first  SW/HW architecture

 SW  HW module mapping

 Make sure both functional and non-functional requirements are satisfied

 Otherwise, redo Step-3 again

 How to make sure non-functional requirements are satisfied?

 Experience

 Modeling

 Simulation

Embedded System Design - NTHU EOS Lab 48 Module-1 Embedded Computing

Step-4: Designing Hardware and Software Components

 Must spend time architecting the system before you start coding

 Some components are ready-made (e.g.,

CPU, topographic databases), some can

be modified from existing designs, others

must be designed from scratch

Embedded System Design - NTHU EOS Lab 49 Module-1 Embedded Computing

Step-5: System Integration

 Put together the components

 Many bugs appear only at this stage 

 Have a plan for integrating components

to uncover bugs quickly, test as much

functionality as early as possible

Embedded System Design - NTHU EOS Lab 50 Module-1 Embedded Computing

Summary

 Embedded computers are all around us

 Many systems have complex embedded hardware and software

 Embedded systems pose many design challenges: design time, deadlines, power, etc.

 Design methodologies help us manage the

design process

Embedded System Design - NTHU EOS Lab 51 Module-1 Embedded Computing

Review Slides (3)

 Common design goals?

 Performance, functionality, user interface, cost, power, size, weight

 5-step design process?

 Requirements? Requirement form?

 Specification?

 Architecture design?

 Component design?

 System integration?

Embedded System Design - NTHU EOS Lab 52 Module-1 Embedded Computing

Embedded System Introduction

Embedded Systems Characteristics Embedded System Design Process

Object

Object - - Oriented Design Oriented Design

Unified Modeling Language (UML) Unified Modeling Language (UML)

Design Example: Model Train Controller

Design Example: Model Train Controller

Embedded System Design - NTHU EOS Lab 53 Module-1 Embedded Computing

System Modeling

 Need languages to describe systems:

 useful across several levels of abstraction;

 understandable within and between organizations

 Block diagrams are a start, but don’t

cover everything

Embedded System Design - NTHU EOS Lab 54 Module-1 Embedded Computing

Object-Oriented Design

 Object-oriented (OO) design: A generalization of object-oriented programming

 OO design is different from OO programming

 Object = state + methods

 State provides each object with its own identity

 Methods provide an abstract interface to the

object

Embedded System Design - NTHU EOS Lab 55 Module-1 Embedded Computing

OO implementation in C++

class display {

pixels : pixeltype[IMAX,JMAX];

public:

display() { } // constructor

pixeltype pixel(int i, int j) { return pixels[i,j]; } void set_pixel(pixeltype val, int i, int j)

{ pixels[i,j] = val; }

}

Embedded System Design - NTHU EOS Lab 56 Module-1 Embedded Computing

Objects and Classes

 Class: object type

 Class defines the object’s state elements

 Class defines the methods used to interact with all objects of that type

 Each object has its own state (memory)

Embedded System Design - NTHU EOS Lab 57 Module-1 Embedded Computing

OO Design Principles

 Some objects will closely correspond to real-world objects

 Some objects may be useful only for description or implementation

 Not every object is executable

 Objects provide interfaces to read/write

state, hiding the object’s implementation

from the rest of the system

Embedded System Design - NTHU EOS Lab 58 Module-1 Embedded Computing

Embedded System Introduction

Embedded Systems Characteristics Embedded System Design Process Object-Oriented Design

Unified Modeling Language (UML) Unified Modeling Language (UML)

Design Example: Model Train Controller

Design Example: Model Train Controller

Embedded System Design - NTHU EOS Lab 59 Module-1 Embedded Computing

UML

 Developed by Booch et al.

 Goals:

 object-oriented

 visual

 useful at many levels of abstraction

 usable for all aspects of design

Embedded System Design - NTHU EOS Lab 60 Module-1 Embedded Computing

UML object

d1: Display

pixels: array[] of pixels elements

menu_items pixels is a

2-D array

comment

object name

class name

attributes

Embedded System Design - NTHU EOS Lab 61 Module-1 Embedded Computing

UML class

Display pixels elements menu_items

mouse_click()

draw_box() operations

class name

Embedded System Design - NTHU EOS Lab 62 Module-1 Embedded Computing

The class interface

 The operations provide the abstract interface between the class’s

implementation and other classes

 Operations may have arguments, return values

 An operation can examine and/or modify

the object’s state

Embedded System Design - NTHU EOS Lab 63 Module-1 Embedded Computing

Class Derivation

 May want to define one class in terms of another

 Derived class inherits attributes, operations of base class

Derived_class

Base_class

UML

generalization

Embedded System Design - NTHU EOS Lab 64 Module-1 Embedded Computing

Class Derivation Example

Display pixels elements menu_items pixel()

set_pixel()

mouse_click() draw_box

BW_display Color_map_display

base class

derived class

Embedded System Design - NTHU EOS Lab 65 Module-1 Embedded Computing

Multiple Inheritance

Speaker Display

Multimedia_display base classes

derived class

Embedded System Design - NTHU EOS Lab 66 Module-1 Embedded Computing

Links and Associations

 Link: describes relationships between objects

 Association: describes relationship

between classes

Embedded System Design - NTHU EOS Lab 67 Module-1 Embedded Computing

Association Example

message

msg: ADPCM_stream length : integer

message set count : integer

0..* 1

contains

# contained messages # containing message sets

0 or more messages

Embedded System Design - NTHU EOS Lab 68 Module-1 Embedded Computing

Link Example

 Link defines the contains relationship:

m1:message msg = msg1 length = 1102 m2:message msg = msg2 length = 2114

ms1:message set

count = 2

Embedded System Design - NTHU EOS Lab 69 Module-1 Embedded Computing

State Machines

a b

state state name

transition

Embedded System Design - NTHU EOS Lab 70 Module-1 Embedded Computing

Event-Driven State Machines

 Behavioral descriptions are written as event-driven state machines

 Machine changes state when receiving an input

 An event may come from inside or

outside of the system

Embedded System Design - NTHU EOS Lab 71 Module-1 Embedded Computing

Event Type

 Signal: asynchronous event

 Call: synchronized communication

 Timer: activated by time

Embedded System Design - NTHU EOS Lab 72 Module-1 Embedded Computing

Signal Event

<<signal>>

mouse_click

leftorright: button x, y: position

declaration

a

b mouse_click(x,y,button)

event description

Embedded System Design - NTHU EOS Lab 73 Module-1 Embedded Computing

Call Event (Procedural Call)

c d

draw_box(10,5,3,2,blue)

Embedded System Design - NTHU EOS Lab 74 Module-1 Embedded Computing

Timer Event

e f

tm(time-value)

• State change after a certain amount of time

• time-value = amount of time to expire

Embedded System Design - NTHU EOS Lab 75 Module-1 Embedded Computing

Example State Diagram

region found

got menu item

called menu item

found object

object highlighted start

finish

mouse_click(x,y,button)/

find_region(region)

input/output

region = menu/

which_menu(i) call_menu(i)

region = drawing/

find_object(objid) highlight(objid)

Embedded System Design - NTHU EOS Lab 76 Module-1 Embedded Computing

Sequence Diagram

 Shows sequence of operations over time

 Relates behaviors of multiple objects

Embedded System Design - NTHU EOS Lab 77 Module-1 Embedded Computing

Sequence Diagram Example

m: Mouse d1: Display u: Menu

mouse_click(x,y,button)

which_menu(x,y,i)

call_menu(i)

time

lifeline

Embedded System Design - NTHU EOS Lab 78 Module-1 Embedded Computing

Summary

 Object-oriented design helps us organize a design

 UML is a transportable system design language

 Provides structural and behavioral

description primitives

Embedded System Design - NTHU EOS Lab 79 Module-1 Embedded Computing

Embedded System Introduction

Embedded Systems Characteristics Embedded System Design Process Object-Oriented Design

Unified Modeling Language (UML)

Design Example: Model Train Controller

Design Example: Model Train Controller

Embedded System Design - NTHU EOS Lab 80 Module-1 Embedded Computing

Model train setup

console

power supply

rcvr motor

ECC

在文檔中 Scotch Road (頁 44-80)

相關文件