Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2000 Morgan Kaufman Overheads for Computers as Components Introduction zWhat are embedded systems? zChallenges in embedded computing system design.

Similar presentations


Presentation on theme: "© 2000 Morgan Kaufman Overheads for Computers as Components Introduction zWhat are embedded systems? zChallenges in embedded computing system design."— Presentation transcript:

1

2 © 2000 Morgan Kaufman Overheads for Computers as Components Introduction zWhat are embedded systems? zChallenges in embedded computing system design. zDesign methodologies.

3 © 2000 Morgan Kaufman Overheads for Computers as Components Definition zEmbedded system: any device that includes a programmable computer but is not itself a general-purpose computer. zTake advantage of application characteristics to optimize the design: ydon’t need all the general-purpose bells and whistles.

4 © 2000 Morgan Kaufman Overheads for Computers as Components Embedding a computer CPU mem input output analog embedded computer

5 © 2000 Morgan Kaufman Overheads for Computers as Components Examples zPersonal digital assistant (PDA). zPrinter. zCell phone. zAutomobile: engine, brakes, dash, etc. zTelevision. zHousehold appliances. zPC keyboard (scans keys).

6 © 2000 Morgan Kaufman Overheads for Computers as Components Early history zLate 1940’s: MIT Whirlwind computer was designed for real-time operations. yOriginally designed to control an aircraft simulator. zFirst microprocessor was Intel 4004 in early 1970’s. zHP-35 calculator used several chips to implement a microprocessor in 1972.

7 © 2000 Morgan Kaufman Overheads for Computers as Components Early history, cont’d. zAutomobiles used microprocessor-based engine controllers starting in 1970’s. yControl fuel/air mixture, engine timing, etc. yMultiple modes of operation: warm-up, cruise, hill climbing, etc. yProvides lower emissions, better fuel efficiency.

8 © 2000 Morgan Kaufman Overheads for Computers as Components Microprocessor varieties zMicrocontroller: includes I/O devices, on- board memory. zDigital signal processor (DSP): microprocessor optimized for digital signal processing. zTypical embedded word sizes: 8-bit, 16- bit, 32-bit.

9 © 2000 Morgan Kaufman Overheads for Computers as Components Application examples zSimple control: front panel of microwave oven, etc. zCanon EOS 3 has three microprocessors. y32-bit RISC CPU runs autofocus and eye control systems. zAnalog TV: channel selection, etc. zDigital TV: programmable CPUs + hardwired logic.

10 © 2000 Morgan Kaufman Overheads for Computers as Components Automotive embedded systems zToday’s high-end automobile may have 100 microprocessors: y4-bit microcontroller checks seat belt; ymicrocontrollers run dashboard devices; y16/32-bit microprocessor controls engine.

11 © 2000 Morgan Kaufman Overheads for Computers as Components BMW 850i brake and stability control system zAnti-lock brake system (ABS): pumps brakes to reduce skidding. zAutomatic stability control (ASC+T): controls engine to improve stability. zABS and ASC+T communicate. yABS was introduced first---needed to interface to existing ABS module.

12 © 2000 Morgan Kaufman Overheads for Computers as Components BMW 850i, cont’d. brake sensor brake sensor brake sensor brake sensor ABS hydraulic pump

13 © 2000 Morgan Kaufman Overheads for Computers as Components Characteristics of embedded systems zSophisticated functionality. zReal-time operation. zLow manufacturing cost. zLow power. zDesigned to tight deadlines by small teams.

14 © 2000 Morgan Kaufman Overheads for Computers as Components Functional complexity zOften have to run sophisticated algorithms or multiple algorithms. yCell phone, laser printer. zOften provide sophisticated user interfaces.

15 © 2000 Morgan Kaufman Overheads for Computers as Components Real-time operation zMust finish operations by deadlines. yHard real time: missing deadline causes failure. ySoft real time: missing deadline results in degraded performance. zMany systems are multi-rate: must handle operations at widely varying rates.

16 © 2000 Morgan Kaufman Overheads for Computers as Components Non-functional requirements zMany embedded systems are mass- market items that must have low manufacturing costs. yLimited memory, microprocessor power, etc. zPower consumption is critical in battery- powered devices. yExcessive power consumption increases system cost even in wall-powered devices.

17 © 2000 Morgan Kaufman Overheads for Computers as Components Design teams zOften designed by a small team of designers. zOften must meet tight deadlines. y6 month market window is common. yCan’t miss back-to-school window for calculator.

18 © 2000 Morgan Kaufman Overheads for Computers as Components Why use microprocessors? zAlternatives: field-programmable gate arrays (FPGAs), custom logic, etc. zMicroprocessors are often very efficient: can use same logic to perform many different functions. zMicroprocessors simplify the design of families of products.

19 © 2000 Morgan Kaufman Overheads for Computers as Components The performance paradox zMicroprocessors use much more logic to implement a function than does custom logic. zBut microprocessors are often at least as fast: yheavily pipelined; ylarge design teams; yaggressive VLSI technology.

20 © 2000 Morgan Kaufman Overheads for Computers as Components Power zCustom logic is a clear winner for low power devices. zModern microprocessors offer features to help control power consumption. zSoftware design techniques can help reduce power consumption.

21 © 2000 Morgan Kaufman Overheads for Computers as Components Challenges in embedded system design zHow much hardware do we need? yHow big is the CPU? Memory? zHow do we meet our deadlines? yFaster hardware or cleverer software? zHow do we minimize power? yTurn off unnecessary logic? Reduce memory accesses?

22 © 2000 Morgan Kaufman Overheads for Computers as Components Challenges, etc. zDoes it really work? yIs the specification correct? yDoes the implementation meet the spec? yHow do we test for real-time characteristics? yHow do we test on real data? zHow do we work on the system? yObservability, controllability? yWhat is our development platform?

23 © 2000 Morgan Kaufman Overheads for Computers as Components Design methodologies zA procedure for designing a system. zUnderstanding your methodology helps you ensure you didn’t skip anything. zCompilers, software engineering tools, computer-aided design (CAD) tools, etc., can be used to: yhelp automate methodology steps; ykeep track of the methodology itself.

24 © 2000 Morgan Kaufman Overheads for Computers as Components Design goals zPerformance. yOverall speed, deadlines. zFunctionality and user interface. zManufacturing cost. zPower consumption. zOther requirements (physical size, etc.)

25 © 2000 Morgan Kaufman Overheads for Computers as Components Levels of abstraction requirements specification architecture component design system integration

26 © 2000 Morgan Kaufman Overheads for Computers as Components Top-down vs. bottom-up zTop-down design: ystart from most abstract description; ywork to most detailed. zBottom-up design: ywork from small components to big system. zReal design uses both techniques.

27 © 2000 Morgan Kaufman Overheads for Computers as Components Stepwise refinement zAt each level of abstraction, we must: yanalyze the design to determine characteristics of the current state of the design; yrefine the design to add detail.

28 © 2000 Morgan Kaufman Overheads for Computers as Components Requirements zPlain language description of what the user wants and expects to get. zMay be developed in several ways: ytalking directly to customers; ytalking to marketing representatives; yproviding prototypes to users for comment.

29 © 2000 Morgan Kaufman Overheads for Computers as Components Functional vs. non- functional requirements zFunctional requirements: youtput as a function of input. zNon-functional requirements: ytime required to compute output; ysize, weight, etc.; ypower consumption; yreliability; yetc.

30 © 2000 Morgan Kaufman Overheads for Computers as Components Our requirements form

31 © 2000 Morgan Kaufman Overheads for Computers as Components Example: GPS moving map requirements zMoving map obtains position from GPS, paints map from local database. lat: 40 13 lon: 32 19 I-78 Scotch Road

32 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map needs zFunctionality: For automotive use. Show major roads and landmarks. zUser interface: At least 400 x 600 pixel screen. Three buttons max. Pop-up menu. zPerformance: Map should scroll smoothly. No more than 1 sec power-up. Lock onto GPS within 15 seconds. zCost: $500 street price = approx. $100 cost of goods sold.

33 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map needs, cont’d. zPhysical size/weight: Should fit in hand. zPower consumption: Should run for 8 hours on four AA batteries.

34 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map requirements form

35 © 2000 Morgan Kaufman Overheads for Computers as Components Specification zA more precise description of the system: yshould not imply a particular architecture; yprovides input to the architecture design process. zMay include functional and non-functional elements. zMay be executable or may be in mathematical form for proofs.

36 © 2000 Morgan Kaufman Overheads for Computers as Components GPS specification zShould include: yWhat is received from GPS; ymap data; yuser interface; yoperations required to satisfy user requests; ybackground operations needed to keep the system running.

37 © 2000 Morgan Kaufman Overheads for Computers as Components Architecture design zWhat major components go satisfying the specification? zHardware components: yCPUs, peripherals, etc. zSoftware components: ymajor programs and their operations. zMust take into account functional and non-functional specifications.

38 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map block diagram GPS receiver search engine renderer user interface database display

39 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map hardware architecture GPS receiver CPU panel I/O display frame buffer memory

40 © 2000 Morgan Kaufman Overheads for Computers as Components GPS moving map software architecture position database search renderer timer user interface pixels

41 © 2000 Morgan Kaufman Overheads for Computers as Components Designing hardware and software components zMust spend time architecting the system before you start coding. zSome components are ready-made, some can be modified from existing designs, others must be designed from scratch.

42 © 2000 Morgan Kaufman Overheads for Computers as Components System integration zPut together the components. yMany bugs appear only at this stage. zHave a plan for integrating components to uncover bugs quickly, test as much functionality as early as possible.

43 © 2000 Morgan Kaufman Overheads for Computers as Components Summary zEmbedded computers are all around us. yMany systems have complex embedded hardware and software. zEmbedded systems pose many design challenges: design time, deadlines, power, etc. zDesign methodologies help us manage the design process.

44 © 2000 Morgan Kaufman Overheads for Computers as Components Introduction zObject-oriented design. zUnified Modeling Language (UML).

45 © 2000 Morgan Kaufman Overheads for Computers as Components System modeling zNeed languages to describe systems: yuseful across several levels of abstraction; yunderstandable within and between organizations. zBlock diagrams are a start, but don’t cover everything.

46 © 2000 Morgan Kaufman Overheads for Computers as Components Object-oriented design zObject-oriented (OO) design: A generalization of object-oriented programming. zObject = state + methods. yState provides each object with its own identity. yMethods provide an abstract interface to the object.

47 © 2000 Morgan Kaufman Overheads for Computers as Components Objects and classes zClass: object type. zClass defines the object’s state elements but state values may change over time. zClass defines the methods used to interact with all objects of that type. yEach object has its own state.

48 © 2000 Morgan Kaufman Overheads for Computers as Components OO design principles zSome objects will closely correspond to real-world objects. ySome objects may be useful only for description or implementation. zObjects provide interfaces to read/write state, hiding the object’s implementation from the rest of the system.

49 © 2000 Morgan Kaufman Overheads for Computers as Components UML zDeveloped by Booch et al. zGoals: yobject-oriented; yvisual; yuseful at many levels of abstraction; yusable for all aspects of design.

50 © 2000 Morgan Kaufman Overheads for Computers as Components UML object d1: Display pixels: array[] of pixels elements menu_items pixels is a 2-D array comment object name class name attributes

51 © 2000 Morgan Kaufman Overheads for Computers as Components UML class Display pixels elements menu_items mouse_click() draw_box operationsclass name

52 © 2000 Morgan Kaufman Overheads for Computers as Components The class interface zThe operations provide the abstract interface between the class’s implementation and other classes. zOperations may have arguments, return values. zAn operation can examine and/or modify the object’s state.

53 © 2000 Morgan Kaufman Overheads for Computers as Components Choose your interface properly zIf the interface is too small/specialized: yobject is hard to use for even one application; yeven harder to reuse. zIf the interface is too large: yclass becomes too cumbersome for designers to understand; yimplementation may be too slow; yspec and implementation are probably buggy.

54 © 2000 Morgan Kaufman Overheads for Computers as Components Relationships between objects and classes zAssociation: objects communicate but one does not own the other. zAggregation: a complex object is made of several smaller objects. zComposition: aggregation in which owner does not allow access to its components. zGeneralization: define one class in terms of another.

55 © 2000 Morgan Kaufman Overheads for Computers as Components Class derivation zMay want to define one class in terms of another. yDerived class inherits attributes, operations of base class. Derived_class Base_class UML generalization

56 © 2000 Morgan Kaufman Overheads for Computers as Components Class derivation example Display pixels elements menu_items pixel() set_pixel() mouse_click() draw_box BW_displayColor_map_display base class derived class

57 © 2000 Morgan Kaufman Overheads for Computers as Components Multiple inheritance SpeakerDisplay Multimedia_display base classes derived class

58 © 2000 Morgan Kaufman Overheads for Computers as Components Links and associations zLink: describes relationships between objects. zAssociation: describes relationship between classes.

59 © 2000 Morgan Kaufman Overheads for Computers as Components Link example zLink defines the contains relationship: message msg = msg1 length = 1102 message msg = msg2 length = 2114 message set count = 2

60 © 2000 Morgan Kaufman Overheads for Computers as Components Association example message msg: ADPCM_stream length : integer message set count : integer 0..*1 contains # contained messages # containing message sets

61 © 2000 Morgan Kaufman Overheads for Computers as Components Stereotypes zStereotype: recurring combination of elements in an object or class. zExample: y >

62 © 2000 Morgan Kaufman Overheads for Computers as Components Behavioral description zSeveral ways to describe behavior: yinternal view; yexternal view.

63 © 2000 Morgan Kaufman Overheads for Computers as Components State machines ab state state name transition

64 © 2000 Morgan Kaufman Overheads for Computers as Components Event-driven state machines zBehavioral descriptions are written as event-driven state machines. yMachine changes state when receiving an input. zAn event may come from inside or outside of the system.

65 © 2000 Morgan Kaufman Overheads for Computers as Components Types of events zSignal: asynchronous event. zCall: synchronized communication. zTimer: activated by time.

66 © 2000 Morgan Kaufman Overheads for Computers as Components Signal event > mouse_click leftorright: button x, y: position declaration a b mouse_click(x,y,button) event description

67 © 2000 Morgan Kaufman Overheads for Computers as Components Call event cd draw_box(10,5,3,2,blue)

68 © 2000 Morgan Kaufman Overheads for Computers as Components Timer event ef tm(time-value)

69 © 2000 Morgan Kaufman Overheads for Computers as Components Example state machine region found got menu item called menu item found 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)

70 © 2000 Morgan Kaufman Overheads for Computers as Components Sequence diagram zShows sequence of operations over time. zRelates behaviors of multiple objects.

71 © 2000 Morgan Kaufman Overheads for Computers as Components Sequence diagram example m: Moused1: Displayu: Menu mouse_click(x,y,button) which_menu(x,y,i) call_menu(i) time

72 © 2000 Morgan Kaufman Overheads for Computers as Components Summary zObject-oriented design helps us organize a design. zUML is a transportable system design language. yProvides structural and behavioral description primitives.

73 © 2000 Morgan Kaufman Overheads for Computers as Components Introduction zExample: model train controller.

74 © 2000 Morgan Kaufman Overheads for Computers as Components Purposes of example zFollow a design through several levels of abstraction. zGain experience with UML.

75 © 2000 Morgan Kaufman Overheads for Computers as Components Model train setup console power supply rcvrmotor ECCaddressheadercommand

76 © 2000 Morgan Kaufman Overheads for Computers as Components Requirements zConsole can control 8 trains on 1 track. zThrottle has at least 63 levels. zInertia control adjusts responsiveness with at least 8 levels. zEmergency stop button. zError detection scheme on messages.

77 © 2000 Morgan Kaufman Overheads for Computers as Components Requirements form

78 © 2000 Morgan Kaufman Overheads for Computers as Components Conceptual specification zBefore we create a detailed specification, we will make an initial, simplified specification. yGives us practice in specification and UML. yGood idea in general to identify potential problems before investing too much effort in detail.

79 © 2000 Morgan Kaufman Overheads for Computers as Components Basic system commands

80 © 2000 Morgan Kaufman Overheads for Computers as Components Typical control sequence :console:train_rcvr set-inertia set-speed estop

81 © 2000 Morgan Kaufman Overheads for Computers as Components Message classes command set-inertia value: unsigned- integer set-speed value: integer estop

82 © 2000 Morgan Kaufman Overheads for Computers as Components Roles of message classes zImplemented message classes derived from message class. yAttributes and operations will be filled in for detailed specification. zImplemented message classes specify message type by their class. yMay have to add type as parameter to data structure in implementation.

83 © 2000 Morgan Kaufman Overheads for Computers as Components Subsystem collaboration diagram Shows relationship between console and receiver (ignores role of track): :console:receiver 1..n: command

84 © 2000 Morgan Kaufman Overheads for Computers as Components System structure modeling zSome classes define non-computer components. yDenote by *name. zChoose important systems at this point to show basic relationships.

85 © 2000 Morgan Kaufman Overheads for Computers as Components Major subsystem roles zConsole: yread state of front panel; yformat messages; ytransmit messages. zTrain: yreceive message; yinterpret message; ycontrol the train.

86 © 2000 Morgan Kaufman Overheads for Computers as Components Console system classes console panelformattertransmitter receiver*sender* 1 1 1 1 1 1 1 1 1 1

87 © 2000 Morgan Kaufman Overheads for Computers as Components Console class roles zpanel: describes analog knobs and interface hardware. zformatter: turns knob settings into bit streams. ztransmitter: sends data on track.

88 © 2000 Morgan Kaufman Overheads for Computers as Components Train system classes train set train receiver controller motor interface detector*pulser* 1 1..t 1 1 1 1 1 1 1 1 1 1

89 © 2000 Morgan Kaufman Overheads for Computers as Components Train class roles zreceiver: digitizes signal from track. zcontroller: interprets received commands and makes control decisions. zmotor interface: generates signals required by motor.

90 © 2000 Morgan Kaufman Overheads for Computers as Components Detailed specification zWe can now fill in the details of the conceptual specification: ymore classes; ybehaviors. zSketching out the spec first helps us understand the basic relationships in the system.

91 © 2000 Morgan Kaufman Overheads for Computers as Components Train speed control zMotor controlled by pulse width modulation: V + - duty cycle

92 © 2000 Morgan Kaufman Overheads for Computers as Components Console physical object classes knobs* train-knob: integer speed-knob: integer inertia-knob: unsigned- integer emergency-stop: boolean pulser* pulse-width: unsigned- integer direction: boolean sender* send-bit() detector* read-bit() : integer

93 © 2000 Morgan Kaufman Overheads for Computers as Components Panel and motor interface classes panel train-number() : integer speed() : integer inertia() : integer estop() : boolean new-settings() motor-interface speed: integer

94 © 2000 Morgan Kaufman Overheads for Computers as Components Class descriptions zpanel class defines the controls. ynew-settings() behavior reads the controls. zmotor-interface class defines the motor speed held as state.

95 © 2000 Morgan Kaufman Overheads for Computers as Components Transmitter and receiver classes transmitter send-speed(adrs: integer, speed: integer) send-inertia(adrs: integer, val: integer) set-estop(adrs: integer) receiver current: command new: boolean read-cmd() new-cmd() : boolean rcv-type(msg-type: command) rcv-speed(val: integer) rcv-inertia(val:integer)

96 © 2000 Morgan Kaufman Overheads for Computers as Components Class descriptions ztransmitter class has one behavior for each type of message sent. zreceiver function provides methods to: ydetect a new message; ydetermine its type; yread its parameters (estop has no parameters).

97 © 2000 Morgan Kaufman Overheads for Computers as Components Formatter class formatter current-train: integer current-speed[ntrains]: integer current-inertia[ntrains]: unsigned-integer current-estop[ntrains]: boolean send-command() panel-active() : boolean operate()

98 © 2000 Morgan Kaufman Overheads for Computers as Components Formatter class description zFormatter class holds state for each train, setting for current train. zThe operate() operation performs the basic formatting task.

99 © 2000 Morgan Kaufman Overheads for Computers as Components Control input cases zUse a soft panel to show current panel settings for each train. zChanging train number: ymust change soft panel settings to reflect current train’s speed, etc. zControlling throttle/inertia/estop: yread panel, check for changes, perform command.

100 © 2000 Morgan Kaufman Overheads for Computers as Components Control input sequence diagram :knobs:panel:formatter:transmitter change in speed/ inertia/estop change in train number change in control settings read panel panel settings panel-active send-command send-speed, send-inertia. send-estop read panel panel settings read panel panel settings change in train number set-knobs new-settings

101 © 2000 Morgan Kaufman Overheads for Computers as Components Formatter operate behavior idle update-panel() send-command() panel-active()new train number other

102 © 2000 Morgan Kaufman Overheads for Computers as Components Panel-active behavior panel*:read-train() current-train = train-knob update-screen changed = true T panel*:read-speed() current-speed = throttle changed = true T F... F

103 © 2000 Morgan Kaufman Overheads for Computers as Components Controller class controller current-train: integer current-speed[ntrains]: integer current-direction[ntrains]: boolean current-inertia[ntrains]: unsigned-integer operate() issue-command()

104 © 2000 Morgan Kaufman Overheads for Computers as Components Setting the speed zDon’t want to change speed instantaneously. zController should change speed gradually by sending several commands.

105 © 2000 Morgan Kaufman Overheads for Computers as Components Sequence diagram for set- speed command :receiver:controller:motor-interface:pulser* new-cmd cmd-type rcv-speed set-speed set-pulse

106 © 2000 Morgan Kaufman Overheads for Computers as Components Controller operate behavior issue-command() receive-command() wait for a command from receiver

107 © 2000 Morgan Kaufman Overheads for Computers as Components Refined command classes command type: 3-bits address: 3-bits parity: 1-bit set-inertia type=001 value: 3-bits set-speed type=010 value: 7-bits estop type=000

108 © 2000 Morgan Kaufman Overheads for Computers as Components Summary zSeparate specification and programming. ySmall mistakes are easier to fix in the spec. yBig mistakes in programming cost a lot of time. zYou can’t completely separate specification and architecture. yMake a few tasteful assumptions.


Download ppt "© 2000 Morgan Kaufman Overheads for Computers as Components Introduction zWhat are embedded systems? zChallenges in embedded computing system design."

Similar presentations


Ads by Google