(slides are based on Peter Marwedel)

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

Peter Marwedel TU Dortmund, Informatik 12
Fakultät für informatik informatik 12 technische universität dortmund Optimizations - Compilation for Embedded Processors - Peter Marwedel TU Dortmund.
FSMs & message passing: SDL
1 Concurrency: Deadlock and Starvation Chapter 6.
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 Petri Nets Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Fakultät für informatik informatik 12 technische universität dortmund Petri Nets Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
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
1 Vorlesung Informatik 2 Algorithmen und Datenstrukturen (Parallel Algorithms) Robin Pomplun.
Embedded Systems & Parallel Programming P. Marwedel, Univ. Dortmund/Informatik 12 + ICD/ES, 2007 Universität Dortmund A view on embedded systems.
Chapter 7 System Models.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
Chapter 11: Models of Computation
Turing Machines.
Data Structures Using C++
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
CS 6143 COMPUTER ARCHITECTURE II SPRING 2014 ACM Principles and Practice of Parallel Programming, PPoPP, 2006 Panel Presentations Parallel Processing is.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
Kurt Jensen Lars M. Kristensen 1 Coloured Petri Nets Department of Computer Science Coloured Petri Nets Modelling and Validation of Concurrent Systems.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2003 Universität Dortmund Hardware/Software Codesign.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Copyright © 2013 by John Wiley & Sons. All rights reserved. HOW TO CREATE LINKED LISTS FROM SCRATCH CHAPTER Slides by Rick Giles 16 Only Linked List Part.
Chapter 3: Processes.
Executional Architecture
Fakultät für informatik informatik 12 technische universität dortmund Finite state machines + message passing: SDL Peter Marwedel TU Dortmund, Informatik.
Analyzing Genes and Genomes
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Essential Cell Biology
PSSA Preparation.
Essential Cell Biology
Mani Srivastava UCLA - EE Department Room: 6731-H Boelter Hall Tel: WWW: Copyright 2003.
Energy Generation in Mitochondria and Chlorplasts
Distributed Computing 9. Sorting - a lower bound on bit complexity Shmuel Zaks ©
Claus Brabrand, UFPE, Brazil Aug 11, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
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.
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,
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,
Modeling Main issues: What do we want to build How do we write this down.
User Defined Functions Lesson 1 CS1313 Fall User Defined Functions 1 Outline 1.User Defined Functions 1 Outline 2.Standard Library Not Enough #1.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Distributed Computing 5. Snapshot Shmuel Zaks ©
Chapter 9: Using Classes and Objects. Understanding Class Concepts Types of classes – Classes that are only application programs with a Main() method.
Technische universität dortmund fakultät für informatik informatik 12 Limits of von-Neumann (thread-based) computing Jian-Jia Chen (Slides are based on.
Fakultät für informatik informatik 12 technische universität dortmund Specifications - Session 5 - Peter Marwedel TU Dortmund Informatik 12 Germany Slides.
- 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.
Ch. 2. Specification and Modeling 2.1 Requirements Describe requirements and approaches for specifying and modeling embedded systems. Specification for.
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,
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
Technische universität dortmund fakultät für informatik informatik 12 Finite state machines & message passing: SDL Peter Marwedel TU Dortmund, Informatik.
2. Specification and Modeling
Embedded System Design Specifications and Modeling
Specifications and Modeling
Presentation transcript:

(slides are based on Peter Marwedel) SDL Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund, Informatik 12 © Springer, 2010 2014年 10 月 22 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

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 StateCharts SDL Data flow 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 model C, C++, Java C, C++, Java with libraries CSP, ADA | * Based on implementation of VHDL, Verilog..

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.

SDL-representation of FSMs/processes state input output

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

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.

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.

Timers Timers can be declared locally. Elapsed timers put signal into queue. RESET removes timer (also from FIFO-queue). Not necessarily processed immediately.

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

Application: description of network protocols

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

Data flow models Jian-Jia Chen (Slides are based on Peter Marwedel) TU Dortmund, Informatik 12 © Springer, 2010 2014年 10 月 22 日 These slides use Microsoft clip arts. Microsoft copyright restrictions apply.

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 StateCharts SDL Data flow 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 model C, C++, Java C, C++, Java with libraries CSP, ADA |

Data flow as a “natural” model of applications Example: Video on demand system www.ece.ubc.ca/~irenek/techpaps/vod/vod.html

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. http://en.wikipedia.org/wiki/Structured Systems Analysis and Design Methodology, 2010 (formatting added)].

Kahn process networks (KPN) Each component is modeled as a program/task/process Communication is by FIFOs Only one sender and one receiver per FIFO  no SDL-like conflicts at FIFOs No overflow considered  writes never have to wait,  reads wait if FIFO is empty.

© R. Gupta (UCSD), W. Wolf (Princeton), 2003 Example 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; } © R. Gupta (UCSD), W. Wolf (Princeton), 2003 levi animation

Properties of Kahn process networks Communication is only via channels (no shared variables) Mapping from 1 input channel to 1 output channel possible;.

Key Property of Kahn process networks Processes have to commit to wait for data from a particular port; A process cannot check for available data before attempting a read (wait). p1 p2 if nonempty(p1) then read(p1) else if nonempty(p2) then read(p2); A process cannot wait for data for >1 port at a time. read(p1|p2);

Key beauty of KPNs 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 be 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. p1 p2

Computational power and analyzability KPNs are Turing-complete We can implement a Turing machine as a KPN However, the difficulty of Turing machines is also inherited Analyzing the maximum FIFO size is “undecidable” Analyzing whether it terminates is “undecidable” Deadlock may be possible Timing is not specified Number of processes is static (cannot change)

More information about KPNs http://ls12-www.cs.tu-dortmund.de/teaching/download/ levi/index.html: Animation See also S. Edwards: http://www.cs.columbia.edu/ ~sedwards/classes/2001/w4995-02/presentations/dataflow.ppt

Synchronous data flow (SDF). Less computationally powerful, but easier to analyze: Synchronous data flow (SDF). Synchronous all the tokens are consumed synchronously one way to implement is to have a global clock controlling “firing” of nodes Again using asynchronous message passing = tasks do not have to wait until output is accepted.

(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). 1 1 Execution takes a fixed, known time. Actually, this is a case of homogeneous synchronous data flow models (HSDF): # of tokens per firing the same. 

(Non-homogeneous-) Synchronous data flow (SDF) (1) In the general case, a number of tokens can be produced/ consumed per firing 2 3 A ready, can fire (does not have to)

(Non-homogeneous-) Synchronous data flow (SDF) (2) In the general case, a number of tokens can be produced/ consumed per firing 2 3 B ready, can fire

(Non-homogeneous-) Synchronous data flow (SDF) (3) In the general case, a number of tokens can be produced/ consumed per firing 2 3 A ready, can fire

(Non-homogeneous-) Synchronous data flow (SDF) (4) In the general case, a number of tokens can be produced/ consumed per firing 2 3 B ready, can fire

(Non-homogeneous-) Synchronous data flow (SDF) (5) In the general case, a number of tokens can be produced/ consumed per firing 2 3 B ready, can fire

(Non-homogeneous-) Synchronous data flow (SDF) (6) In the general case, a number of tokens can be produced/ consumed per firing 2 3 A ready, can fire Replace FIFO by back-edge

Actual modeling of buffer capacity The capacity of buffers can be modeled easier: as a backward edge where (initial number of tokens = buffer capacity). 3 2 3 Firing rate depends on # of tokens …

Multi-rate models & balance equations (one for each channel) fire B { … consume M } fire A { produce N channel N M FIFO number of tokens consumed number of firings per “iteration” number of tokens produced Determinate Decidable: buffer memory requirements deadlock Schedulable statically Adopted from: ptolemy.eecs.berkeley.edu/presentations/03/streamingEAL.ppt

On-site Exercise: Deadlock in SDF Is it possible to have deadlocks (all the actors are waiting to fire?) in SDF?

Parallel Scheduling of SDF Models SDF is suitable for automated mapping onto parallel processors and synthesis of parallel circuits. Many scheduling optimization problems can be formulated. A C B D Sequential Parallel Source: ptolemy.eecs.berkeley.edu/presentations/03/streamingEAL.ppt

Expressiveness of data flow MoCs Turing-complete Not Turing-complete CSDF=Cyclo static data flow (rates vary in a cyclic way) [S. Stuijk, 2007]

The expressiveness/analyzability conflict [S. Stuijk, 2007]

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]

Starting point for “model-based design” Code automatically generated © MathWorks, http://www.mathworks.de/ cmsimages/rt_forloop_code_wl_7430.gif

Actor languages © E. Lee, Berkeley

Summary Data flow model of computation Motivation, definition Kahn process networks (KPNs) (H/C)SDF Visual programming languages Simulink, Real Time Workshop, LabVIEW