Technische universität dortmund fakultät für informatik informatik 12 Finite state machines & message passing: SDL Peter Marwedel TU Dortmund, Informatik.

Slides:



Advertisements
Similar presentations
Technische universität dortmund fakultät für informatik informatik 12 Models of computation Peter Marwedel TU Dortmund Informatik 12 Graphics: © Alexandra.
Advertisements

Fakultät für informatik informatik 12 technische universität dortmund Optimizations - Compilation for Embedded Processors - Peter Marwedel TU Dortmund.
FSMs & message passing: SDL
Fakultät für informatik informatik 12 technische universität dortmund Imperative model of computation Peter Marwedel TU Dortmund, Informatik 12 Graphics:
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
Fakult ä t f ü r informatik informatik 12 technische universit ä t dortmund Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Fakultät für informatik informatik 12 technische universität dortmund Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
Fakultät für informatik informatik 12 technische universität dortmund SDL Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte, Gesine.
Technische universität dortmund fakultät für informatik informatik 12 Discrete Event Models Peter Marwedel TU Dortmund, Informatik 12 Germany
Communicating finite state machines
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik
Fakultät für informatik informatik 12 technische universität dortmund Finite state machines + message passing: SDL Peter Marwedel TU Dortmund, Informatik.
Petri Nets Jian-Jia Chen (slides are based on Peter Marwedel)
Technische universität dortmund fakultät für informatik informatik 12 Specifications, Modeling, and Model of Computation Jian-Jia Chen (slides are based.
(slides are based on Peter Marwedel)
Technische universität dortmund fakultät für informatik informatik 12 Discrete Event Models Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund,
Hardware/ Software Partitioning 2011 年 12 月 09 日 Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 These.
Electrical and Computer Department, North Dakota State University
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Timed Automata.
Fakultät für informatik informatik 12 technische universität dortmund Specifications - Session 5 - Peter Marwedel TU Dortmund Informatik 12 Germany Slides.
fakultät für informatik informatik 12 technische universität dortmund Early design phases Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra.
Network Protocols Dr. Eng Amr T. Abdel-Hamid NETW 703 Winter 2006 Finite State Machines (FSMs)
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Introduction to Data Flow Graphs and their Scheduling Sources: Gang Quan.
Requirements on the Execution of Kahn Process Networks Marc Geilen and Twan Basten 11 April 2003 /e.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Hardware/Software Codesign.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Synthesis of Embedded Software Using Free-Choice Petri Nets.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
Data Communication and Networks Lecture 2 ADTs in Protocol Design (Ring Buffer, Queue, FSM) September 16, 2004 Joseph Conron Computer Science Department.
A Schedulability-Preserving Transformation of BDF to Petri Nets Cong Liu EECS 290n Class Project December 10, 2004.
Dataflow Process Networks Lee & Parks Synchronous Dataflow Lee & Messerschmitt Abhijit Davare Nathan Kitchen.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
Models of Computation for Embedded System Design Alvise Bonivento.
A Denotational Semantics For Dataflow with Firing Edward A. Lee Jike Chong Wei Zheng Paper Discussion for.
Heterochronous Dataflow in Ptolemy II Brian K. Vogel EE249 Project Presentation, Dec. 4, 1999.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 11, 2009 Dataflow.
Mahapatra-A&M-Sprong'021 Co-design Finite State Machines Many slides of this lecture are borrowed from Margarida Jacome.
System-Level Types for Component-Based Design Paper by: Edward A. Lee and Yuhong Xiong Presentation by: Dan Patterson.
Introduction to Data Flow Graphs and their Scheduling Sources: Gang Quan.
Universität Dortmund  P. Marwedel, Univ. Dortmund, Informatik 12, 2003 Hardware/software partitioning  Functionality to be implemented in software.
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
Ch.2 Part A: Requirements, State Charts EECE **** Embedded System Design.
- 1 - Embedded Systems—State charts Specifications.
Course Outline DayContents Day 1 Introduction Motivation, definitions, properties of embedded systems, outline of the current course How to specify embedded.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2005/6 Universität Dortmund Specifications.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2005/6 Universität Dortmund Some general properties of languages 1. Synchronous vs. asynchronous languages.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
StateCharts Peter Marwedel Informatik 12 Univ. Dortmund Germany.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
C. André, J. Boucaron, A. Coadou, J. DeAntoni,
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Synchronization Methods in Message Passing Model.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
technische universität dortmund fakultät für informatik informatik 12 Early design phases Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund,
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
High Performance Embedded Computing © 2007 Elsevier Chapter 1, part 3: Embedded Computing High Performance Embedded Computing Wayne Wolf.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
1 An SDL Tutorial Two primary elements: –Structure –Identifies the various components of the system, and the communication paths among them. –Components:
1 Advanced Embedded Systems Lecture 3 Specification Languages.
2. Specification and Modeling
Event Relation Graphs and Extensions in Ptolemy II
Embedded System Design Specifications and Modeling
Spring CS 599. Instructor: Jyo Deshmukh
Specifications and Modeling
Presentation transcript:

technische universität dortmund fakultät für informatik informatik 12 Finite state machines & message passing: SDL Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte, Gesine Marwedel, 年 05 月 10 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

- 2 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Models of computation considered in this course Communication/ local computations Shared memory Message passing Synchronous | Asynchronous Undefined components Plain text, use cases | (Message) sequence charts Communicating finite state machines StateChartsSDL Data flow(Not useful)Kahn networks, SDF Petri nets C/E nets, P/T nets, … Discrete event (DE) model VHDL*, Verilog*, SystemC*, … Only experimental systems, e.g. distributed DE in Ptolemy Von Neumann modelC, C++, JavaC, C++, Java with libraries CSP, ADA | * Classification is based on implementation of VHDL, Verilog, SystemC with central queue

- 3 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 SDL  SDL used here as a (prominent) example of a model of computation based on asynchronous message passing communication.  SDL is appropriate also for distributed systems.  Just like StateCharts, it is based on the CFSM model of computation; each FSM is called a process.  Provides textual and graphical formats to please all users.

- 4 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 SDL-representation of FSMs/processes output input state

- 5 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Communication among SDL-FSMs Communication is based on message-passing of signals (=inputs+outputs), assuming a potentially indefinitely large FIFO-queue.  Each process fetches next signal from FIFO,  checks if signal enables transition,  if yes: transition takes place,  if no: signal is ignored (exception: SAVE- mechanism).  Implementation requires bound for the maximum length of FIFOs

- 6 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Determinate? Let signals be arriving at FIFO at the same time:  Order in which they are stored, is unknown: All orders are legal:  simulators can show different behaviors for the same input, all of which are correct.

- 7 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Operations on data Variables can be declared locally for processes. Their type can be predefined or defined in SDL itself. SDL supports abstract data types (ADTs). Examples:

- 8 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Process interaction diagrams Interaction between processes can be described in process interaction diagrams (special case of block diagrams). In addition to processes, these diagrams contain channels and declarations of local signals. Example:, B

- 9 - technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Hierarchy in SDL Process interaction diagrams can be included in blocks. The root block is called system. Processes cannot contain other processes, unlike in StateCharts.

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Timers Timers can be declared locally. Elapsed timers put signal into queue. RESET removes timer (also from FIFO-queue). Not necessarily processed immediately.

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Additional language elements SDL includes a number of additional language elements, like  procedures  creation and termination of processes  advanced description of data  More features added for SDL-2000

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Application: description of network protocols

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Larger example: vending machine Machine° selling pretzels, (potato) chips, cookies, and doughnuts: accepts nickels, dime, quarters, and half-dollar coins. Not a distributed application. ° [J.M. Bergé, O. Levia, J. Roullard: High-Level System Modeling, Kluwer Academic Publishers, 1995]

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Overall view of vending machine

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Decode Requests p

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 ChipHandler no yes no

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 History  Dates back to early 1970s,  Formal semantics defined in the late 1980s,  Defined by ITU (International Telecommunication Union): Z.100 recommendation in 1980 Updates in 1984, 1988, 1992, 1996 and 1999  SDL-2000 a significant update (not well accepted)  Becoming less popular

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Evaluation & summary  FSM model for the components,  Non-blocking message passing for communication,  Implementation requires bound for the maximum length of FIFOs; may be very difficult to compute,  Excellent for distributed applications (used for ISDN),  Commercial tools available (see  Not necessarily determinate  Timer concept adequate just for soft deadlines,  Limited way of using hierarchies,  Limited programming language support,  No description of non-functional properties,  Examples: small network + vending machine

technische universität dortmund fakultät für informatik informatik 12 Data flow models Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte, Gesine Marwedel, 年 05 月 10 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Models of computation considered in this course Communication/ local computations Shared memory Message passing Synchronous | Asynchronous Undefined components Plain text, use cases | (Message) sequence charts Communicating finite state machines StateChartsSDL Data flow(Not useful)Kahn networks, SDF Petri nets C/E nets, P/T nets, … Discrete event (DE) model VHDL, Verilog, SystemC, … Only experimental systems, e.g. distributed DE in Ptolemy Von Neumann modelC, C++, JavaC, C++, Java with libraries CSP, ADA |

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Data flow as a “natural” model of applications Example: Video on demand system

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Data flow modeling Definition: Data flow modeling is … “the process of identifying, modeling and documenting how data moves around an information system. Data flow modeling examines  processes (activities that transform data from one form to another),  data stores (the holding areas for data),  external entities (what sends data into a system or receives data from a system, and  data flows (routes by which data can flow)”. [Wikipedia: Structured systems analysis and design method. Systems Analysis and Design Methodology, 2010 (formatting added)].

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Kahn process networks (KPN)  Each component is modeled as a program/task/process, (underlying FSM is inconvenient: possibly many states)  Communication is by FIFOs; no overflow considered  writes never have to wait,  reads wait if FIFO is empty.  Only one sender and one receiver per FIFO  no SDL-like conflicts at FIFOs

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Example © R. Gupta (UCSD), W. Wolf (Princeton), 2003 levi animation Process f(in int u, in int v, out int w){ int i; bool b = true; for (;;) { i= b ? read(u) : read(v); //read returns next token in FIFO, waits if empty send (i,w); //writes a token into a FIFO w/o blocking b = !b; }

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Properties of Kahn process networks  Communication is only via channels (no shared variables)  Mapping from  1 input channel to  1 output channel possible;  Channels transmit information within an unpredictable but finite amount of time;  In general, execution times are unknown.

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Key beauty of KPNs (1)  A process cannot check for available data before attempting a read (wait).  A process cannot wait for data for >1 port at a time. if nonempty(p1) then read(p1) else if nonempty(p2) then read(p2); p1p2 read(p1|p2);  Processes have to commit to wait for data from a particular port;

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Key beauty of KPNs (2)  Therefore, the order of reads does not depend on the arrival time (but may depend on data).  Therefore, Kahn process networks are determinate (!); for a given input, the result will always the same, regardless of the speed of the nodes.  Many applications in embedded system design: Any combination of fast and slow simulation & hardware prototypes always gives the same result. p1p2

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Computational power and analyzability  It is a challenge to schedule KPNs without accumulating tokens  KPNs are Turing-complete (anything which can be computed can be computed by a KPN)  KPNs are computationally powerful, but difficult to analyze (e.g. what’s the maximum buffer size?)  Number of processes is static (cannot change)

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 More information about KPNs  levi/index.html: Animation   See also S. Edwards: ~sedwards/classes/2001/w /presentations/dataflow.ppt

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 SDF Less computationally powerful, but easier to analyze: Synchronous data flow (SDF).  Synchronous = global clock controlling “firing” of nodes  Again using asynchronous message passing = tasks do not have to wait until output is accepted.

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Homogeneous-) Synchronous data flow (SDF)  Nodes are called actors.  Actors are ready, if the necessary number of input tokens exists and if enough buffer space at the output exists  Ready actors can fire (be executed).  Execution takes a fixed, known time. Actually, this is a case of homogeneous synchronous data flow models (HSDF): # of tokens per firing the same.  1 1

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (1) In the general case, a number of tokens can be produced/ consumed per firing 2 A ready, can fire 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (2) In the general case, a number of tokens can be produced/ consumed per firing 2 B ready, can fire 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (3) In the general case, a number of tokens can be produced/ consumed per firing 2 A ready, can fire 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (4) In the general case, a number of tokens can be produced/ consumed per firing 2 B ready, can fire 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (5) In the general case, a number of tokens can be produced/ consumed per firing 2 B ready, can fire 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 (Non-homogeneous-) Synchronous data flow (SDF) (6) In the general case, a number of tokens can be produced/ consumed per firing 2 1 period complete, A ready, can fire Replace FIFO by back-edge 3

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Actual modeling of buffer capacity The capacity of buffers can be modeled easier: as a backward edge where (initial number of tokens = buffer capacity) Firing rate depends on # of tokens …

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Multi-rate models & balance equations (one for each channel) number of tokens consumed number of firings per “iteration” number of tokens produced Adopted from: ptolemy.eecs.berkeley.edu/presentations/03/streamingEAL.ppt Decidable:  buffer memory requirements  deadlock Schedulable statically fire B { … consume M … } fire A { … produce N … } channel N M FIFO

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Parallel Scheduling of SDF Models A C D B SequentialParallel SDF is suitable for automated mapping onto parallel processors and synthesis of parallel circuits. Many scheduling optimization problems can be formulated. Source: ptolemy.eecs.berkeley.edu/presentations/03/streamingEAL.ppt

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Expressiveness of data flow MoCs CSDF=Cyclo static data flow (rates vary in a cyclic way) Turing-complete Not Turing- complete [S. Stuijk, 2007]

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 The expressiveness/analyzability conflict [S. Stuijk, 2007]

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Similar MoC: Simulink - example - Semantics? “Simulink uses an idealized timing model for block execution and communication. Both happen infinitely fast at exact points in simulated time. Thereafter, simulated time is advanced by exact time steps. All values on edges are constant in between time steps.” [Nicolae Marian, Yue Ma] [mathworks]

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Code automatically generated © MathWorks, cmsimages/rt_forloop_code_ wl_7430.gif Starting point for “model-based design”

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Actor languages © E. Lee, Berkeley

technische universität dortmund fakultät für informatik  P.Marwedel, Informatik 12, 2012 Summary Data flow model of computation  Motivation, definition  Kahn process networks (KPNs)  (H/C)SDF  Visual programming languages Simulink, Real Time Workshop, LabVIEW