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

Slides:



Advertisements
Similar presentations
Embedded System, A Brief Introduction
Advertisements

Architecture-dependent optimizations Functional units, delay slots and dependency analysis.
2-Hardware Design of Embedded Processors (cont.) Advanced Approaches.
Give qualifications of instructors: DAP
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
SpecC and SpecCharts Reviewed and Presented by Heemin Park and Eric Kwan EE202A - Fall 2001 Professor Mani Srivastava.
Remote Procedure Call (RPC)
5-High-Performance Embedded Systems using Concurrent Process
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Synthesis of Embedded Software Using Free-Choice Petri Nets.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 8: State Machine and Concurrent Process Model.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Scheduling for Embedded Real-Time Systems Amit Mahajan and Haibo.
1 “White box” or “glass box” tests “White Box” (or “Glass Box”) Tests.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
Models of Computation for Embedded System Design Alvise Bonivento.
Joshua GarrettUniversity of California, Berkeley SpecCharts: A VHDL Front-End for Embedded Systems.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
Modeling the Processes and Logic
Advanced Behavioral Modeling
Precision Going back to constant prop, in what cases would we lose precision?
Ch.2 Part A: Requirements, State Charts EECE **** Embedded System Design.
CMP502 – Embedded Systems Models of Computation.
Chapter 10 State Machine Diagrams
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 8: State Machine and Concurrent Process Model.
1 5-High-Performance Embedded Systems using Concurrent Process (cont.)
Extreme Makeover for EDA Industry
- 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.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 State Machine and Concurrent Process Model.
States.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
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.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
UML Activity Diagrams.
High Performance Embedded Computing © 2007 Elsevier Lecture 10: Code Generation Embedded Computing Systems Michael Schulte Based on slides and textbook.
From Natural Language to LTL: Difficulties Capturing Natural Language Specification in Formal Languages for Automatic Analysis Elsa L Gunter NJIT.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
Chapter – 8 Software Tools.
CS244-Introduction to Embedded Systems and Ubiquitous Computing
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
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.
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.
1 5-High-Performance Embedded Systems using Concurrent Process (cont.)
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)
2-Hardware Design of Embedded Processors (cont.)
5-High-Performance Embedded Systems using Concurrent Process
Chapter 8: State Machine and Concurrent Process Model
White-Box Testing.
5-High-Performance Embedded Systems using Concurrent Process (cont.)
States.
“White box” or “glass box” tests
White-Box Testing.
States.
Chapter 8: State Machine and Concurrent Process Model
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
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)...

8 Dataflow model Derivative of concurrent process model Nodes represent transformations  May execute concurrently Edges represent flow of tokens (data) from one node to another  May or may not have token at any given time When all of node’s input edges have at least one token, node may fire When node fires, it consumes input tokens processes transformation and generates output token Nodes may fire simultaneously Several commercial tools support graphical languages for capture of dataflow model  Can automatically translate to concurrent process model for implementation  Each node becomes a process modulateconvolve transform ABCD Z Nodes with more complex transformations t1t2 +– * ABCD Z Nodes with arithmetic transformations t1t2 Z = (A + B) * (C - D)

9 Synchronous dataflow With digital signal-processors (DSPs), data flows at fixed rate Multiple tokens consumed and produced per firing Synchronous dataflow model takes advantage of this  Each edge labeled with number of tokens consumed/produced each firing  Can statically schedule nodes, so can easily use sequential program model Don’t need real-time operating system and its overhead How would you map this model to a sequential programming language? Try it... Algorithms developed for scheduling nodes into “single-appearance” schedules  Only one statement needed to call each node’s associated procedure Allows procedure inlining without code explosion, thus reducing overhead even more modulateconvolve transform ABCD Z Synchronous dataflow mt1ct2 mAmBmCmD tZ tt1tt2 t1t2