ESII: Spec & Modeling 1 Design and Architectures for Embedded Systems Prof. Dr. J. Henkel Prof. Dr. J. Henkel CES CES - - Chair for Embedded Systems Chair for Embedded Systems University of Karlsruhe, Germany University of Karlsruhe, Germany University of Karlsruhe, Germany University of Karlsruhe, Germany Today: Specification and Modeling Today: Specification and Modeling http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling 2 Where are we ? - models of computation System specification -Spec languages Design space exploration Optimization -low power refine -low power -Performance -performance -Area -Area, … - … Estimation&Simulation -low power -low power System System -performance partitioning -Area, … embedded IP: Emb. Software Middleware, Embedded Hardware -PEs Optimization for: RTOS Processor Design -Memories -low power -Scheduling Design - synthesis -Communication -Performance - extens. Instruction -Peripherals -Area, … - Parameterization - … - … IC technology Integration Prototyping Tape out http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling 3 Outline � Categorization of systems Categorization of systems � Models vs. Languages Models vs. Languages � State Machine Model State Machine Model � FSM/FSMD FSM/FSMD � HCFSM and Statecharts Language � HCFSM and Statecharts Language HCFSM and Statecharts Language HCFSM and Statecharts Language � Program Program- -State Machine (PSM) Model State Machine (PSM) Model � Concurrent Process Model Concurrent Process Model � Communication Communication � Synchronization Synchronization � Implementation Implementation � Dataflow Model Dataflow Model � Concurrent Processes Concurrent Processes http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling 4 Categorization of Systems � Transformational Transformational � Operate on inputs; produce outputs and stop Operate on inputs; produce outputs and stop � Interactive Interactive � Do not typically terminate Do not typically terminate � Continuous interaction with environment � Continuous interaction with environment Continuous interaction with environment Continuous interaction with environment � Interactive system act at their own speed Interactive system act at their own speed � Example: OS Example: OS � Reactive Reactive � Like interactive systems Like interactive systems � But: the pace is imposed by the environment But: the pace is imposed by the environment ⇒ Embedded Systems belong to this group Embedded Systems belong to this group http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling 5 Example: elevator control Example specification in plain English If the elevator is on the floor 1 and the floor If the elevator is on the floor 1 and the floor requested is the floor 1, then the elevator requested is the floor 1, then the elevator remains on the floor 1. remains on the floor 1. If the elevator is on the floor 1 and the floor If the elevator is on the floor 1 and the floor requested is the floor 2, then the elevator is requested is the floor 2, then the elevator is raised up 1 floor. raised up 1 floor. Elevator If the elevator is on the floor 1 and the floor If the elevator is on the floor 1 and the floor requested is the floor 3, then the elevator is requested is the floor 3, then the elevator is raised up 2 floors. raised up 2 floors. If the elevator is on the floor 2 and the floor If the elevator is on the floor 2 and the floor If the elevator is on the floor 2 and the floor If the elevator is on the floor 2 and the floor requested is the floor 1, then the elevator is requested is the floor 1, then the elevator is lowered down 1 floor. lowered down 1 floor. If the elevator is on the floor 2 and the floor If the elevator is on the floor 2 and the floor requested is the floor 2, then the elevator requested is the floor 2, then the elevator remains on the floor 2. remains on the floor 2. If the elevator is on the floor 2 and the floor If the elevator is on the floor 2 and the floor requested is the floor 3, then the elevator is requested is the floor 3, then the elevator is raised up 1 floor. raised up 1 floor. If the elevator is on the floor 3 and the floor If the elevator is on the floor 3 and the floor requested is the floor 1, then the elevator is requested is the floor 1, then the elevator is lowered down 2 floors. lowered down 2 floors. If the elevator is on the floor 3 and the floor If the elevator is on the floor 3 and the floor requested is the floor 2, then the elevator is requested is the floor 2, then the elevator is lowered down 1 floor. lowered down 1 floor. If the elevator is on the floor 3 and the floor If the elevator is on the floor 3 and the floor requested is the floor 3, then the elevator requested is the floor 3, then the elevator remains on the floor 3 remains on the floor 3 (source: B. Lee, Berkeley) http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling 6 Example: elevator (cont’d) while (1) { as a C program switch (cur) { req_1 as an FSM case 1: if (req_1) { u_1=0; d_1=0; u_2=0; d_2=0; cur=1; } else if (req_2) { u_1=1; d_1=0; u_2=0; d_2=0; cur=2; } else if (req_3) { 1 u_1=0; d_1=0; u_2=1; d_2=0; cur=3; } break; case 2: if (req_1) { if (req_1) { u_1=0; d_1=1; u_2=0; d_2=0; cur=1; } else if (req_2) { u_1=0; d_1=0; u_2=0; d_2=0; cur=2; } else if (req_3) { u_1=1; d_1=0; u_2=0; d_2=0; cur=3; } req_3 / u_1 break; 2 3 case 3: if (req_1) { req_2 / d_1 u_1=0; d_1=0; u_2=0; d_2=1; cur=1; } else if (req==2) { u_1=0; d_1=1; u_2=0; d_2=0; cur=2; } else if (req==3) { u_1=0; d_1=0; u_2=0; d_2=0; cur=3; } req_3 break; req_2 } } (source: B. Lee, Berkeley) http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling ESII: Spec & Modeling 7 Introduction • Describing embedded system’s processing behavior – Can be extremely difficult • Complexity increasing with increasing IC capacity – Past: washing machines, small games, etc. • Hundreds of lines of code – Today: TV set-top boxes, Cell phone, etc. • Hundreds of thousands of lines of code • Hundreds of thousands of lines of code • Desired behavior often not fully understood in beginning – Many implementation bugs due to description mistakes/omissions – English (or other natural language) common starting point • Precise description difficult to impossible • Example: Motor Vehicle Code – thousands of pages long... Embedded Systems Design: A Unified 3 Hardware/Software Introduction, (c) 2000 Vahid/Givargis http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling ESII: Spec & Modeling 8 An example of trying to be precise in English • California Vehicle Code – Right-of-way of crosswalks • 21950. (a) The driver of a vehicle shall yield the right-of-way to a pedestrian crossing the roadway within any marked crosswalk or within any unmarked crosswalk at an intersection, except as otherwise provided in this chapter. • (b) The provisions of this section shall not relieve a pedestrian from the duty of using due care for his or her safety. No pedestrian shall suddenly leave a curb or other place due care for his or her safety. No pedestrian shall suddenly leave a curb or other place of safety and walk or run into the path of a vehicle which is so close as to constitute an immediate hazard. No pedestrian shall unnecessarily stop or delay traffic while in a marked or unmarked crosswalk. • (c) The provisions of subdivision (b) shall not relieve a driver of a vehicle from the duty of exercising due care for the safety of any pedestrian within any marked crosswalk or within any unmarked crosswalk at an intersection. – All that just for crossing the street (and there’s much more)! Embedded Systems Design: A Unified 4 Hardware/Software Introduction, (c) 2000 Vahid/Givargis http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
ESII: Spec & Modeling ESII: Spec & Modeling 9 Models and languages • How can we (precisely) capture behavior? – We may think of languages (C, C++), but computation model is the key • Common computation models: – Sequential program model • Statements, rules for composing statements, semantics for executing them – Communicating process model • Multiple sequential programs running concurrently • Multiple sequential programs running concurrently – State machine model • For control dominated systems, monitors control inputs, sets control outputs – Dataflow model • For data dominated systems, transforms input data streams into output streams – Object-oriented model • For breaking complex software into simpler, well-defined pieces Embedded Systems Design: A Unified 5 Hardware/Software Introduction, (c) 2000 Vahid/Givargis http://ces.univ-karlsruhe.de J. Henkel, Univ. of Karlsruhe, WS0708
Recommend
More recommend