Embedded Systems 8. Identifying, modeling and documenting how data moves around an information system. Dataflow modeling examines

Similar documents
Embedded Systems 7. Models of computation for embedded systems

Embedded Systems 7 BF - ES - 1 -

Dataflow Languages. Languages for Embedded Systems. Prof. Stephen A. Edwards. March Columbia University

fakultät für informatik informatik 12 technische universität dortmund Data flow models Peter Marwedel TU Dortmund, Informatik /10/08

Overview of Dataflow Languages. Waheed Ahmad

Hardware Software Codesign

Embedded Systems CS - ES

HW/SW Codesign. Exercise 2: Kahn Process Networks and Synchronous Data Flows

SDL. Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund, Informatik 年 10 月 18 日. technische universität dortmund

FSMs & message passing: SDL

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

Specifications Part 2

Fundamental Algorithms for System Modeling, Analysis, and Optimization

Lecture 4: Synchronous Data Flow Graphs - HJ94 goal: Skiing down a mountain

STATIC SCHEDULING FOR CYCLO STATIC DATA FLOW GRAPHS

Concurrent Models of Computation

EE382N.23: Embedded System Design and Modeling

EE213A - EE298-2 Lecture 8

Bounded Scheduling of Process Networks. Thomas M. Parks. B.S.E (Princeton University) in the

By: Chaitanya Settaluri Devendra Kalia

LabVIEW Based Embedded Design [First Report]

SDF Domain. 3.1 Purpose of the Domain. 3.2 Using SDF Deadlock. Steve Neuendorffer

EE249 Discussion Petri Nets: Properties, Analysis and Applications - T. Murata. Chang-Ching Wu 10/9/2007

A Deterministic Concurrent Language for Embedded Systems

Implementation of Process Networks in Java

Main application of SDF: DSP hardware modeling

From synchronous models to distributed, asynchronous architectures

PROF. TAJANA SIMUNIC ROSING. Final Exam. Problem Max. Points Points 1 25 T/F 2 10 Esterel 3 20 Petri net 4 20 SDF 5 20 EDF/RM 6 20 LS/power Total 115

A Deterministic Concurrent Language for Embedded Systems

Petri Nets ee249 Fall 2000

Compositionality in Synchronous Data Flow: Modular Code Generation from Hierarchical SDF Graphs

Applying Models of Computation to OpenCL Pipes for FPGA Computing. Nachiket Kapre + Hiren Patel

Distributed Deadlock Detection for. Distributed Process Networks

A Deterministic Concurrent Language for Embedded Systems

Concurrent Models of Computation

A Schedulability-Preserving Transformation Scheme from Boolean- Controlled Dataflow Networks to Petri Nets

Concurrency Abstractions in C#

Static Scheduling and Code Generation from Dynamic Dataflow Graphs With Integer- Valued Control Streams

EE382V: Embedded System Design and Modeling

Code Generation for TMS320C6x in Ptolemy

Parameterized Modeling and Scheduling for Dataflow Graphs 1

Outline. Petri nets. Introduction Examples Properties Analysis techniques. 1 EE249Fall04

Requirements on the Execution of Kahn Process Networks

Computational Process Networks a model and framework for high-throughput signal processing

Software Synthesis Trade-offs in Dataflow Representations of DSP Applications

Concurrency Abstractions in C#

Counting Interface Automata and their Application in Static Analysis of Actor Models

Hierarchical FSMs with Multiple CMs

Dynamic Response Time Optimization for SDF Graphs

Giotto Domain. 5.1 Introduction. 5.2 Using Giotto. Edward Lee Christoph Kirsch

Dynamic Dataflow. Seminar on embedded systems

LOOPED SCHEDULES FOR DATAFLOW DESCRIPTIONS OF MULTIRATE SIGNAL PROCESSING ALGORITHMS 1 ABSTRACT

Embedded Systems 7. Petri net plan coordination for robocup teams G. Kontes and M.G. Lagoudakis BF - ES BF - ES - 2 -

Imperative model of computation

Concurrency Abstractions in C#

Modelling, Analysis and Scheduling with Dataflow Models

Actors and their composition. Jörn W. Janneck

Specifications Part 1

Computational Process Networks

UC Berkeley Mobies Technology Project

Specifications and Modeling

fakultät für informatik informatik 12 technische universität dortmund Specifications Peter Marwedel TU Dortmund, Informatik /11/15

ESE532: System-on-a-Chip Architecture. Today. Process. Message FIFO. Thread. Dataflow Process Model Motivation Issues Abstraction Recommended Approach

Specifications and Modeling

Computational Models for Concurrent Streaming Applications

DIGITAL VS. ANALOG SIGNAL PROCESSING Digital signal processing (DSP) characterized by: OUTLINE APPLICATIONS OF DIGITAL SIGNAL PROCESSING

Concurrent Component Patterns, Models of Computation, and Types

Process Networks in Ptolemy II

Deadlock Avoidance for Streaming Applications with Split-Join Structure: Two Case Studies

Lecture 2: Models of Computation

Node Prefetch Prediction in Dataflow Graphs

Symbolic Buffer Sizing for Throughput-Optimal Scheduling of Dataflow Graphs

Distributed Algorithms 6.046J, Spring, Nancy Lynch

Dynamic Dataflow Modeling in Ptolemy II. by Gang Zhou. Research Project

Building Synchronous DataFlow graphs with UML & MARTE/CCSL

Disciplined Concurrent Models of Computation for Parallel Software

CS420: Operating Systems. Interprocess Communication

Modeling Asynchronous Circuits in ACL2 Using the Link-Joint Interface

Tokens vs. Signals: On Conformance between Formal Models of Dataflow and Hardware

CSE237a Final Exam Winter Prof. Tajana Simunic Rosing. Problem Maximum points Points earned Total 100

Cover Page. The handle holds various files of this Leiden University dissertation

Chapter 2 Data Flow Modeling and Transformation 2.1 Introducing Data Flow Graphs

Software Synthesis and Code Generation for Signal Processing Systems

Model checking pushdown systems

Dynamic Scheduling Implementation to Synchronous Data Flow Graph in DSP Networks

Buffer Sizing to Reduce Interference and Increase Throughput of Real-Time Stream Processing Applications

Snapshot Protocols. Angel Alvarez. January 17, 2012

Orchestrating Safe Streaming Computations with Precise Control

Precedence Graphs Revisited (Again)

Distributed Systems. Rik Sarkar James Cheney Global State & Distributed Debugging February 3, 2014

Well, you need to capture the notions of atomicity, non-determinism, fairness etc. These concepts are not built into languages like JAVA, C++ etc!

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Programming Language Concepts, cs2104 Lecture 04 ( )

CS294-48: Hardware Design Patterns Berkeley Hardware Pattern Language Version 0.5. Krste Asanovic UC Berkeley Fall 2009

Software Synthesis from Dataflow Models for G and LabVIEW

MODERN automated manufacturing systems require. An Extended Event Graph With Negative Places and Tokens for Time Window Constraints

Compositionality in system design: interfaces everywhere! UC Berkeley

SCHEDULING DYNAMIC DATAFLOW GRAPHS WITH BOUNDED MEMORY USING THE TOKEN FLOW MODEL

CSL373: Lecture 5 Deadlocks (no process runnable) + Scheduling (> 1 process runnable)

Transcription:

Embedded Systems 8 - - Dataflow modeling Identifying, modeling and documenting how data moves around an information system. Dataflow 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). Dataflow modeling focuses on how things connect, (imperative programming: how things happen). Lee/Seshia Section 6.3 Marwedel Section 2.5 Scheduling responsibility of the system, not programmer - 2 -

Data flow modeling Registering for courses Video on demand system http://www.agilemodeling.com/artifacts/dataflowdiagram.htm www.ece.ubc.ca/~irenek/techpaps/vod/vod.html - 3 - Dataflow models Actor A FIFO buffer Actor B Buffered communication between concurrent components (actors). An actor can fire whenever it has enough data (tokens) in its input buffers. It then produces some data on its output buffers. In principle, buffers are unbounded. But for implementation on a computer, we want them bounded (and as small as possible). - 4-2

Process networks Many applications can be specified in the form of a set of communicating processes. Example: system with two sensors: temperature sensor mux humidity sensor Alternating read loop read_temp; read_humidity until false; of the two sensors not the right approach. FIFO - 5 - Reference model for dynamic data flow: Kahn process networks (974) Describe computations to be performed and their dependence but not the order in which they must be performed communication via infinitely large FIFOs - 6-3

Properties of Kahn process networks () Each node corresponds to one program/task; Communication is only via channels; Channels include FIFOs as large as needed; Channels transmit information within an unpredictable but finite amount of time; Mapping from input sequence to output sequence; In general, execution times are unknown; Send operations are non-blocking, reads are blocking. One producer and one consumer; i.e. there is only one sender per channel; - 7 - Properties of Kahn process networks (2) There is only one sender per channel. A process cannot check whether data is available before attempting a read. A process cannot wait for data for more than one port at a time. Therefore, the order of reads depends only on data, not on the arrival time. Therefore, Kahn process networks are deterministic (!); for a given input, the result will always the same, regardless of the speed of the nodes. - 8-4

A Kahn Process process f(in int u, in int v, out int w) { int i; bool b = true; u for (;;) { i = b? wait(u) : wait(w); f printf("%i\n", i); send(i, w); v b =!b; } Process alternately reads } from u and v, prints the data value, and writes it to w w Source: Gilles Kahn, The Semantics of a Simple Language for Parallel Programming (974) - 9 - A Kahn Process process f(in int u, in int v, out int w) { int i; bool b = true; for (;;) { i = b? wait(u) : wait(w); printf("%i\n", i); send(i, w); b =!b; } } wait() returns the next token in an input FIFO, blocking if it s empty send() writes a data value on an output FIFO Source: Gilles Kahn, The Semantics of a Simple Language for Parallel Programming (974) - 0-5

A Kahn Process process g(in int u, out int v, out int w) { v int i; bool b = true; for(;;) { u g i = wait(u); w if (b) send(i, v); else send(i, w); b =!b; } } Process reads from u and alternately copies it to v and w - - A Kahn System Prints an alternating sequence of 0 s and s Emits a then copies input to output h g f h Emits a 0 then copies input to output - 2-6

Definition: Kahn networks A Kahn process network is a directed graph (V,E), where V is a set of processes, E V V is a set of edges, associated with each edge e is a domain D e D : finite or countably infinite sequences over D D is a complete partial order where X Y iff X is an initial segment of Y - 3 - Definition: Kahn networks e e e p v e q associated with each process v V with incoming edges e,, e p and outgoing edges e,,e q is a continuous function f v : D e D ep D e D eq (A function f: A B is continuous if f(lim A a) = lim B f(a) ) - 4-7

Semantics: Kahn networks A process network defines for each edge e E a unique sequence X e. X e is the least fixed point of the equations (X e,, X eq ) = f v (X e,, X eq ) for all v V. Result is independent of scheduling! - 5 - Scheduling Kahn Networks A (always produces token) C (only consumes from A) B (always produces token) D (always consumes token) Problem: run processes with finite buffer - 6-8

Scheduling may be impossible A (Two a s for every b ) a b B (Alternates between receiving a and b) - 7 - Parks Scheduling Algorithm (995) Set a capacity on each channel Block a write if the channel is full Repeat Run until deadlock occurs If there are no blocking writes terminate Among the channels that block writes, select the channel with least capacity and increase capacity until producer can fire. - 8-9

Example A (always produces token) C (only consumes from A) B (always produces token) D (always consumes token) - 9 - Parks Scheduling Algorithm Whether a Kahn network can execute in bounded memory is undecidable Parks algorithm does not violate this It will run in bounded memory if possible, and use unbounded memory if necessary Disadvantages: Requires dynamic memory allocation Does not guarantee minimum memory usage Scheduling choices may affect memory usage Data-dependent decisions may affect memory usage Relatively costly scheduling technique Detecting deadlock may be difficult - 20-0

Synchronous data flow With digital signal processors, data flows at fixed rate - 2 - Synchronous data flow (SDF) Restriction of Kahn networks (Berkeley, Ptolemy system) Asynchronous message passing= tasks do not have to wait until output is accepted. Synchronous data flow = all tokens are consumed at the same time. SDF model allows static scheduling of token production and consumption. In the general case, buffers may be needed at edges. - 22 -

SDF: restriction of Kahn networks An SDF graph is a tuple (V, E, cons, prod, d) where V is a set of nodes (activities) E is a set of edges (buffers) cons: E N number of tokens consumed prod: E N number of tokens produced d: E N number of initial tokens d: delay (sample offset between input and output) - 23 - CD-to-DAT rate converter Converts a 44. khz sampling rate to 48 khz 2 3 2 7 8 7 5 Upsampler Downsampler - 24-2

Scheduling SDF models - 25 - SDF example static schedule: - 26-3

SDF Scheduling Algorithm Lee/Messerschmitt 987. Establish relative execution rates Generate balance equations Solve for smallest positive integer vector c 2. Determine periodic schedule Form an arbitrarily ordered list of all nodes in the system Repeat: For each node in the list, schedule it if it is runnable, trying each node once If each node has been scheduled c n times, stop. If no node can be scheduled, indicate deadlock. Source: Lee/Messerschmitt, Synchronous Data Flow (987) - 27 - Balance equations Number of produced tokens must equal number of consumed tokens on every edge Firing vector v S of schedule S: number of firings of each actor in S v S (A) n p = v S (B) n c must be satisfied on each edge - 28-4

Balance equations - 29 - Rank of a matrix The rank of a matrix is the number of linearly independent rows or columns. The equation q 0 forms a linear combination of the columns of. Such a linear combination can only yield the zero vector if the columns are linearly dependent. If has a columns and b rows, the rank cannot exceed min(a, b). - 30-5

Balance equations Non-full rank Infinite number of solutions exist: any multiple of 2 2 T satisfies the balance equations ABCBC and ABBCC are valid schedules - 3 - Static SDF scheduling SDF scheduling theorem (Lee 86) A connected SDF graph with n actors has a periodic schedule iff its topology matrix M has rank n- If M has rank n- then there exsts a unique smallest integer solution v S to M v S = 0 Rank must be at least n- because we need at least n- edges (connectedness), each providing a linearly independent row Rank is at most n because there are n actors Admissibility is not guaranteed, depends on initial tokens on cycles - 32-6

Admissibility - 33 - An inconsistent system A 2 B 3 C a - c = 0 a 2b = 0 3b c = 0 3a 2c = 0 No way to execute without an unbounded accumulation of tokens Only consistent solution is do nothing - 34-7

PASS example: ) firing rates B 4 3 2 3 C D 2 3 A 2 d(ab)=6 Smallest solution: a=2; b=3; d=4; c= - 35 - PASS example: 2) Simulation B 4 Smallest solution: a=2; b=3; d=4; c= 3 2 3 2 C 3 A 2 D Possible schedules: BBBCDDDDAA BDBDBCADDA BBDDBDDCAA (and many more) d(ab)=6 BC... not valid - 36-8

Completeness theorem Given an SDF graph with topology matrix M and a positive integer vector v s.t. M v = 0, a PASS of period p = T q exists iff a pass of period N p exists for any integer N. (proof on blackboard) - 37-9