1 5-High-Performance Embedded Systems using Concurrent Process (cont.)

Slides:



Advertisements
Similar presentations
Embedded System, A Brief Introduction
Advertisements

2-Hardware Design of Embedded Processors (cont.) Advanced Approaches.
SpecC and SpecCharts Reviewed and Presented by Heemin Park and Eric Kwan EE202A - Fall 2001 Professor Mani Srivastava.
Finite state machines.
5-High-Performance Embedded Systems using Concurrent Process
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 8: State Machine and Concurrent Process Model.
© Katz, 2003 Formal Specifications of Complex Systems-- Real-time 1 Adding Real-time to Formal Specifications Formal Specifications of Complex Systems.
CS 425/625 Software Engineering System Models
1 “White box” or “glass box” tests “White Box” (or “Glass Box”) Tests.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
© Katz, 2007 Formal Specifications of Complex Systems-- Real-time 1 Adding Real-time to Formal Specifications Formal Specifications of Complex Systems.
Basic Register Typically, we store multi-bit items
1 © Wolfgang Pelz UML2 UML Part 3. 2 © Wolfgang Pelz UML2 Chapter Ten State Machine Diagrams.
Requirements Techniques, cont. Brief review Formal Requirements Techniques –Finite State Machines –Petri Nets.
Joshua GarrettUniversity of California, Berkeley SpecCharts: A VHDL Front-End for Embedded Systems.
Modeling the Processes and Logic
Advanced Behavioral Modeling
Ch.2 Part A: Requirements, State Charts EECE **** Embedded System Design.
CMP502 – Embedded Systems Models of Computation.
StateCAD FPGA Design Workshop. For Academic Use Only Presentation Name 2 Objectives After completing this module, you will be able to:  Describe how.
Chapter 10 State Machine Diagrams
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 8: State Machine and Concurrent Process Model.
Chapter 9 Finite-State Machines
1 5-High-Performance Embedded Systems using Concurrent Process (cont.)
1 5-High-Performance Embedded Systems using Concurrent Process (cont.)
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
CprE 588 Embedded Computer Systems Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #3 – Models of.
StateCharts Peter Marwedel Informatik 12 Univ. Dortmund Germany.
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 State Machine and Concurrent Process Model.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Elevator Example.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
CS244-Introduction to Embedded Systems and Ubiquitous Computing
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
1 5-High-Performance Embedded Systems using Concurrent Process (cont.)
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Modeling the Processes and Logic.
2-Hardware Design of Embedded Processors (cont.) Advanced Approaches.
Winter-Spring 2001Codesign of Embedded Systems1 Essential Issues in Codesign: Models Part of HW/SW Codesign of Embedded Systems Course (CE )
From requirements to specification Specification is a refinement of requirements Can be included together as Software Requirements Specifications (SRS)
Requirements Techniques, cont.
Dynamic Modeling of Banking System Case Study - I
2-Hardware Design of Embedded Processors (cont.)
5-High-Performance Embedded Systems using Concurrent Process
5-High-Performance Embedded Systems using Concurrent Process (cont.)
Chapter 8: State Machine and Concurrent Process Model
Programming Fundamentals
5-High-Performance Embedded Systems using Concurrent Process (cont.)
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
States.
“White box” or “glass box” tests
Introduction to Sequential Circuits
States.
Chapter 8: State Machine and Concurrent Process Model
UML Diagrams: StateCharts The Dynamic Analysis Model
Essential Issues in Codesign: Models
STATE MACHINE AND CONCURRENT PROCESS MODEL
State Machine and Concurrent Process Model
STATE MACHINE AND CONCURRENT
Presentation transcript:

1 5-High-Performance Embedded Systems using Concurrent Process (cont.)

2 Outline Models vs. Languages State Machine Model  FSM/FSMD  HCFSM and Statecharts Language  Program-State Machine (PSM) Model Altera Nios II concurrent processors Concurrent Process Model  Communication  Synchronization  Implementation Dataflow Model Real-Time Operating Systems

3 HCFSM and the Statecharts language Hierarchical/concurrent state machine model (HCFSM)  Extension to state machine model to support hierarchy and concurrency  States can be decomposed into another state machine With hierarchy has identical functionality as Without hierarchy, but has one less transition (z) Known as OR-decomposition  States can execute concurrently Known as AND-decomposition Statecharts  Graphical language to capture HCFSM  timeout: transition with time limit as condition  history: remember last substate OR-decomposed state A was in before transitioning to another state B Return to saved substate of A when returning from B instead of initial state A1 z B A2 z x y w Without hierarchy A1 z B A2 x y A w With hierarchy C1 C2 x y C B D1 D2 u v D Concurrency

4 UnitControl with FireMode FireMode  When fire is true, move elevator to 1 st floor and open door Without hierarchy Idle GoingUp req>floor req<floor !(req>floor) timeout(10) req<floor DoorOpen GoingDn req>floor u,d,o = 1,0,0 u,d,o = 0,0,1 u,d,o = 0,1,0 req==floor !(req<floor) fire FireGoingDn floor>1 u,d,o = 0,1,0 u,d,o = 0,0,1 !fire FireDrOpen floor==1 fire u,d,o = 0,0,1 UnitControl fire !fire FireGoingDn floor>1 u,d,o = 0,1,0 FireDrOpen floor==1 fire FireMode u,d,o = 0,0,1 With hierarchy Idle GoingUp req>floor req<floor !(req>floor) timeout(10) req<floor DoorOpen GoingDn req>floor u,d,o = 1,0,0 u,d,o = 0,0,1 u,d,o = 0,1,0 req==floor !(req>floor) u,d,o = 0,0,1 NormalMode UnitControl NormalMode FireMode fire!fire UnitControl ElevatorController RequestResolver... With concurrent RequestResolver –w/o hierarchy: Getting messy! –w/ hierarchy: Simple!

5 Program-state machine model (PSM): HCFSM plus sequential program model Program-state’s actions can be FSM or sequential program  Designer can choose most appropriate Stricter hierarchy than HCFSM used in Statecharts  transition between sibling states only, single entry  Program-state may “complete” Reaches end of sequential program code, OR FSM transition to special complete substate PSM has 2 types of transitions Transition-immediately (TI): taken regardless of source program-state Transition-on-completion (TOC): taken only if condition is true AND source program-state is complete  SpecCharts: extension of VHDL to capture PSM model  SpecC: extension of C to capture PSM model up = down = 0; open = 1; while (1) { while (req == floor); open = 0; if (req > floor) { up = 1;} else {down = 1;} while (req != floor); open = 1; delay(10); } NormalMode FireMode up = 0; down = 1; open = 0; while (floor > 1); up = 0; down = 0; open = 1; fire!fire UnitControl ElevatorController RequestResolver... req = int req; NormalMode and FireMode described as sequential programs Black square originating within FireMode indicates !fire is a TOC transition –Transition from FireMode to NormalMode only after FireMode completed

6 Role of appropriate model and language Finding appropriate model to capture embedded system is an important step  Model shapes the way we think of the system Originally thought of sequence of actions, wrote sequential program First wait for requested floor to differ from target floor Then, we close the door Then, we move up or down to the desired floor Then, we open the door Then, we repeat this sequence To create state machine, we thought in terms of states and transitions among states When system must react to changing inputs, state machine might be best model  HCFSM described FireMode easily, clearly Language should capture model easily  Ideally should have features that directly capture constructs of model  FireMode would be very complex in sequential program Checks inserted throughout code  Other factors may force choice of different model Structured techniques can be used instead E.g., Template for state machine capture in sequential program language

7 Concurrent process model Describes functionality of system in terms of two or more concurrently executing subtasks Many systems easier to describe with concurrent process model because inherently multitasking E.g., simple example:  Read two numbers X and Y  Display “Hello world.” every X seconds  Display “How are you?” every Y seconds More effort would be required with sequential program or state machine model Subroutine execution over time time ReadXReadY PrintHelloWorld PrintHowAreYou Simple concurrent process example ConcurrentProcessExample() { x = ReadX() y = ReadY() Call concurrently: PrintHelloWorld(x) and PrintHowAreYou(y) } PrintHelloWorld(x) { while( 1 ) { print "Hello world." delay(x); } PrintHowAreYou(x) { while( 1 ) { print "How are you?" delay(y); } Sample input and output Enter X: 1 Enter Y: 2 Hello world. (Time = 1 s) Hello world. (Time = 2 s) How are you? (Time = 2 s) Hello world. (Time = 3 s) How are you? (Time = 4 s) Hello world. (Time = 4 s)...