fakultät für informatik informatik 12 technische universität dortmund Data flow models Peter Marwedel Informatik 12 TU Dortmund Germany



Similar documents
Tutorial for Programming the LEGO MINDSTORMS NXT

LabVIEW Day 1 Basics. Vern Lindberg. 1 The Look of LabVIEW

Communication Protocol

The second goal is to provide a list of tips, tricks, and best known methods that have been discovered over the life span of the course.

Best Practises for LabVIEW FPGA Design Flow. uk.ni.com ireland.ni.com

How To Program An Nxt Mindstorms On A Computer Or Tablet Computer

Modeling Kahn Process Networks in the Dynamic Dataflow Formalism

Getting Started Manual

CONTENTS. What is ROBOTC? Section I: The Basics

GETTING STARTED WITH LABVIEW POINT-BY-POINT VIS

Discrete event modeling: VHDL

ROBOTICS AND AUTONOMOUS SYSTEMS

Programming LEGO NXT Robots using NXC

LEGO NXT-based Robotic Arm

Course Project Documentation

understanding sensors

Embedded & Real-time Operating Systems Communication Libraries

DSP Laboratory: Analog to Digital and Digital to Analog Conversion

Building Robots with NXT and LEJOS. Introduc<on. What is the NXT Robot Michael Wooldridge liv.ac.uk)

First Bytes Programming Lab 2

Advanced Programming with LEGO NXT MindStorms

Importance of Home Alarm System Based on LABVIEW Software

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

Exercise 10: Basic LabVIEW Programming

Software Synthesis from Dataflow Models for G and LabVIEW

Additional Guides. TETRIX Getting Started Guide NXT Brick Guide

Next Gen Platform: Team & Mentor Guide

Quick Start Guide to computer control and robotics using LEGO MINDSTORMS for Schools

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Aperiodic Task Scheduling

Throughput constraint for Synchronous Data Flow Graphs

Introduction to LabVIEW Design Patterns

Lab 3: Introduction to Data Acquisition Cards

EET 310 Programming Tools

EVALUATION. WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration COPY. Developer

Load balancing Static Load Balancing

EasyC. Programming Tips

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Reminder: Complexity (1) Parallel Complexity Theory. Reminder: Complexity (2) Complexity-new

Real-Time Component Software. slide credits: H. Kopetz, P. Puschner

LabVIEW Advanced Programming Techniques

Distance-Learning Remote Laboratories using LabVIEW

SIMATIC. WinCC V7.0. Getting started. Getting started. Welcome 2. Icons 3. Creating a project 4. Configure communication 5

Lego Robot Tutorials Touch Sensors

FRC WPI Robotics Library Overview

siemens.com/mobility Traffic data analysis in Sitraffic Scala/Concert The expert system for visualization, quality management and statistics

Digital Systems Design! Lecture 1 - Introduction!!

Modeling and Simulation Firewall Using Colored Petri Net

Software Engineering for LabVIEW Applications. Elijah Kerry LabVIEW Product Manager

SIMERO Software System Design and Implementation

Kirsten Sinclair SyntheSys Systems Engineers

Load Balancing and Termination Detection

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

DS1104 R&D Controller Board

OPC COMMUNICATION IN REAL TIME

Can Traffic Accidents be eliminated by Robots?

Regular Expressions and Automata using Haskell

estatistik.core: COLLECTING RAW DATA FROM ERP SYSTEMS

Model Engineering using Multimodeling

Introduction WELCOME TO LEGO MINDSTORMS EDUCATION

EV3 Programming. Overview for FLL Coaches. A very big high five to Tony Ayad

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

Background: Experimental Manufacturing Cell

Candle Plant process automation based on ABB 800xA Distributed Control Systems

MECE 102 Mechatronics Engineering Orientation

How To Get A Computer Engineering Degree

Real-time Process Network Sonar Beamformer

Introduction WELCOME TO LEGO MINDSTORMS EDUCATION

iridium for Weinzierl KNX IP BAOS

iridium for KNX/EIB Fast Start: Connection Setting Manual for KNX/EIB equipment

Introduction to Simulink & Stateflow. Coorous Mohtadi

SOFTWARE ENGINEERING IT 0301 Semester V B.Nithya,G.Lakshmi Priya Asst Professor SRM University, Kattankulathur. School of Computing, Department of IT

Data Acquisition in LabVIEW

Real Time Programming: Concepts

Designing Real-Time and Embedded Systems with the COMET/UML method

Final Project Report. Trading Platform Server

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

North Texas FLL Coaches' Clinics. Beginning Programming October Patrick R. Michaud republicofpi.org

How To Test Automatically

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Measuring the Performance of an Agent

Programmable Logic Controllers Definition. Programmable Logic Controllers History

Applications. Network Application Performance Analysis. Laboratory. Objective. Overview

A Comparison of Task Pools for Dynamic Load Balancing of Irregular Algorithms

DATA ACQUISITION FROM IN VITRO TESTING OF AN OCCLUDING MEDICAL DEVICE

Getting Started with the LabVIEW Mobile Module Version 2009

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Programming Logic controllers

Software Engineering Best Practices. Christian Hartshorne Field Engineer Daniel Thomas Internal Sales Engineer

Capacitive Touch Lab. Renesas Capacitive Touch Lab R8C/36T-A Family

dspace DSP DS-1104 based State Observer Design for Position Control of DC Servo Motor

LabVIEW DSP Test Integration Toolkit for TI DSP

Transcription:

12 Data flow models Peter Marwedel Informatik 12 TU Dortmund Germany

Models of computation considered in this course Communication/ local computations Communicating finite state machines Data flow model Von Neumann model Discrete event (DE) model Shared memory StateCharts Not useful C, C++, Java VHDL, Verilog, SystemC (Simulink, LabView) Message passing Synchronous Asynchronous SDL Kahn process networks, SDF C, C++, Java with libraries CSP, ADA Only experimental systems, e.g. distributed DE in Ptolemy - 2 -

Data flow as a natural model of applications Registering for courses Examples Video on demand system http://www.agilemodeling.com/artifacts/dataflowdiagram.htm www.ece.ubc.ca/~irenek/techpaps/vod/vod.html - 3 -

Data flow modeling Def.: 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). http://www.webopedia.com/term/d/data_flow_modeling.html See also S. Edwards: http://www.cs.columbia.edu/ ~sedwards/classes/2001/w4995-02/presentations/dataflow.ppt - 4 -

Reference model for data flow: Kahn process networks For asynchronous message passing: communication between tasks is buffered Special case: Kahn process networks: executable task graphs; Communication via infinitely large FIFOs - 5 -

Properties of Kahn process networks (1) 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 1 input seq. to 1 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; - 6 -

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. SDL-like conflicts at FIFOs do not exist. This is the key beauty of KPNs! - 7 -

Example R. Gupta (UCSD), W. Wolf (Princeton), 2003 Model of parallel computations used in practice (e.g. at Philips/NXP). It is a challenge to schedule KPNs without accumulating tokens http://en.wikipedia.org/wiki/kahn_process_networks http://ls12-www.cs.tu-.de/edu/es/levikpn.zip: Animation levi animation - 8 -

Asynchronous message passing: Synchronous data flow (SDF) 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. - 9 -

Synchronous Dataflow (SDF) Fixed Production/Consumption Rates Balance equations (one for each channel): f A N = Schedulable statically Decidable: buffer memory requirements deadlock f B M number of tokens consumed number of firings per iteration number of tokens produced fire A { produce N } N channel M fire B { consume M } Source: ptolemy.eecs.berkeley.edu/presentations/03/streamingeal.ppt - 10 -

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

Similar MoC: Simulink - example - 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] From www.mathworks.co.uk/acc ess/helpdesk/help/toolbox/ fuzzy/fuzzyt25.shtml - 12 -

12 Data flow programming of LEGO mindstorms robots Peter Marwedel Informatik 12 TU Dortmund Germany

Lego Mindstorm components motor 3 output ports (A, B, C) 1 USB port for software upload 4 input ports (1, 2, 3, 4) for connecting sensors Lego NXT control unit collision sensor Ultra sonic Sensor light sensor - 14 -

Basic robot for lab 1 ultra sonic sensor 2 indepently controlled wheels The basic robot will be extended by additional sensors and actuators during the labs - 15 -

Data flow programming using LabVIEW LabVIEW programs = graphs Specification of operations and dependences can be executed in arbitrary sequence as long as data dependences are met we don t care about the precise sequential code needed for each of the nodes. Example: - 16 -

Virtual instruments VI = virtual instrument VIs represented in 2 windows: Front panel: user interface Block diagram: functionality of the system - 17 -

LabVIEW NXT tool kit Front panel irrelevant, since robots have no user interface Mindstorm programming: functions menu contains all required features as addons Use only these addons! The other features are not available for the mindstorms Introduction of most relevant NXT features - 18 -

Input (1) Menu: NXTToolkit => NXT Library => Input => Touch Sensor / Sound Sensor Touch sensor reads in sensor from designated input port Mode: pressed/released Output: yes/no Sound sensor reads in sensor from designated input port Output: volume - 19 -

Input (2) Menu: NXTToolkit => NXT Library => Input => Light Sensor / Ultrasonic Sensor Light sensor reads in sensor from designated input port sensor must be switched on (Generate Light => True ) Output: intensity Ultra sonic sensor: reads sensor from designated input port Output: distance - 20 -

Comparison Menu: NXTToolkit => Comparison Essentially self-explaining Result: Boolean Exception: Select 2 1 Mux - 21 -

Case-dependent data flow Menu: NXTToolkit => Structures => Case Structure Move from Functions-Palette into editing area using drag & drop Consists of several sub diagrams, only one of which can be active Click on the arrows next to the case label to display a particular sub diagram. The case selector serves as the input to the case structure; Possible data types: Bool, String, Integer. Action to be performed designated by additional elements within the case structure Right click opens context menu Case selector Case label - 22 -

Data flow loops Menu: NXTToolkit => Structures => While Loop Sub diagram will be repeated until Boolean condition is true Condition is represented by conditional terminal Right allows selecting whether iterations will stop or continue if condition is true The iteration terminal includes the number of the actually executed iteration Iteration terminal Conditional terminal - 23 -

Output (1) Menu: NXTToolkit => NXT Library => Output => Motor Unlimited / Sync Unlimited Motor control (unlimited) controlling one motor Designate output port Direction (true = forward) Velocity controlling both motors Designate output ports Direction Velocity Relative speed (direction): -100 (left) 100 (right) - 24 -

Output (2) Menu: NXTToolkit => NXT Library => Output => Motor Distance / Motor Time Motor control (distance) controlling one motor Designate output port Direction Velocity Distance in degrees Follow-up action (braking, free running) Motor control (time) controlling one motor Distance indicated via time Otherwise, same as above - 25 -

Output (3) Menu: NXTToolkit => NXT Library => Output => Stop Motor / Legacy Lamp Motor control (stop) controlling one motor Designate port Stop motor thrust there is a variant controlling both motors Lamp Designate output port indicate intensity switch on explicitly - 26 -

Display Menu: NXTToolkit => NXT Library => Display => Display Text Display display line of text on robot s display displays only strings numbers must be converted into strings: NXTToolkit => String => String/Number Conversion => Number to Decimal - 27 -

Downloading software Menu: Tools => NXT Module => NXT Terminal Download either via USB or Bluetooth Terminal window Find robot compile + download upper window: files on PC lower window: files on robot - 28 -

Small example Goal: robot moves forward until collision sensor detects a collision Terminate loop if sensor returns true - 29 -

From data flow to task graphs Lunatics (S. Edwards) tried to build general purpose data flow computers, but failed However, modern computers contain subsystems build on the data flow paradigm (scoreboard, Tomasulo s algorithm) Pure data flow frequently too restrictive: lack of modeling control, resources etc. Data flow graphs are a special case of the somewhat more general task graphs. - 30 -

Task graphs 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_humi until false; of the two sensors no the right approach. FIFO - 31 -

The case for multi-process modeling MODULE main; TYPE some_channel = (temperature, humidity); some_sample : RECORD value : integer; line : some_channel END; PROCESS get_temperature; VAR sample : some_sample; BEGIN LOOP sample.value := new_temperature; IF sample.value > 30 THEN... sample.line := temperature; to_fifo(sample); END END get_temperature; PROCESS get_humidity; VAR sample : some_sample; BEGIN LOOP sample.value := new_humidity; sample.line := humidity; to_fifo(sample); END END get_humidity; BEGIN get_temperature; get_humidity; END; Blocking calls new_temperature, new_humidity Structure clearer than alternating checks for new values in a single process How to model dependencies between tasks/processes? - 32 -

Dependences between processes/tasks Get_temperature main FIFO Get_ humidity General discussion of process networks - 33 -

Task graphs Sequence constraint Nodes are assumed to be a program described in some programming language, e.g. C or Java. Def.: A dependence graph is a directed graph G=(V,E) in which E V V is a partial order. If (v1, v2) E, then v1 is called an immediate predecessor of v2 and v2 is called an immediate successor of v1. Suppose E* is the transitive closure of E. If (v1, v2) E*, then v1 is called a predecessor of v2 and v2 is called a successor of v1. - 34 -

Task graphs 1. Timing information - Task graphs may contain additional information, for example: Timing information Arrival time deadline ] - 35 -

Task graphs 2. I/O-information - 36 -

Task graphs 3. Shared resources - 37 -

Task graphs 4. Periodic schedules.. infinite task graphs Each instance called a job - 38 -

Task graphs 5. Hierarchical task graphs - - 39 -

Multi-thread graphs (IMEC) Def.: A multi-thread graph M is defined as an 11-tuple (O, E, V, D, ϑ, ι, Λ, E lat, E resp, i, av ) with: O: set of operation nodes, E: set of control edges, V, D : refer to the access of variables, ι: is the set of input/output nodes, Λ: associates execution latency intervals with all threads, E lat, E resp, i, av are timing constraints. - 40 -

MTG graphs: graphical notation - 41 -

Multi-thread graph (Example) - 42 -

Summary Data flow model of computation Motivation Kahn process networks SDF Visual programming languages Simulink Labview programming of mindstorm NXT robots Task graphs Multi thread graph (IMEC) - 43 -