CS321 Functional Programming 2 © JAS 2005 7-1 Implementation using the Data Flow Approach In a conventional control flow system a program is a set of operations.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

Parallel Processing & Parallel Algorithm May 8, 2003 B4 Yuuki Horita.
Intermediate Code Generation
Remote Procedure Call Design issues Implementation RPC programming
DATAFLOW ARHITEKTURE. Dataflow Processors - Motivation In basic processor pipelining hazards limit performance –Structural hazards –Data hazards due to.
Program Representations. Representing programs Goals.
DATAFLOW PROCESS NETWORKS Edward A. Lee Thomas M. Parks.
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
Execution of an instruction
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
CSCI 8150 Advanced Computer Architecture Hwang, Chapter 2 Program and Network Properties 2.3 Program Flow Mechanisms.
CS 536 Spring Code generation I Lecture 20.
Class canceled next Tuesday. Recap: Components of IR Control dependencies: sequencing of operations –evaluation of if & then –side-effects of statements.
RT-Level Custom Design. This Week in DIG II  Introduction  Combinational logic  Sequential logic  Custom single-purpose processor design  Review.
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Client Server Model and Software Design TCP/IP allows a programmer to establish communication between two application and to pass data back and forth.
Router Architectures An overview of router architectures.
Parallel Architectures
1Group 07 IPv6 2 1.ET/06/ ET/06/ ET/06/ EE/06/ EE/06/ EE/06/6473 Group 07 IPv6.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
CMPE 511 DATA FLOW MACHINES Mustafa Emre ERKOÇ 11/12/2003.
High Performance Architectures Dataflow Part 3. 2 Dataflow Processors Recall from Basic Processor Pipelining: Hazards limit performance  Structural hazards.
Computer Architecture Dataflow Machines. Data Flow Conventional programming models are control driven Instruction sequence is precisely specified Sequence.
Computer Architecture
Modeling Process CSCE 668Set 14: Simulations 2 May be several algorithms (processes) runs on each processor to simulate the desired communication system.
T. E. Potok - University of Tennessee Software Engineering Dr. Thomas E. Potok Adjunct Professor UT Research Staff Member ORNL.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Exploring an Open Source Automation Framework Implementation.
CHAPTER 12 INTRODUCTION TO PARALLEL PROCESSING CS 147 Guy Wong page
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
1 Multithreaded Architectures Lecture 3 of 4 Supercomputing ’93 Tutorial Friday, November 19, 1993 Portland, Oregon Rishiyur S. Nikhil Digital Equipment.
Multiplexing FDM & TDM. Multiplexing When two communicating nodes are connected through a media, it generally happens that bandwidth of media is several.
Computer Architecture And Organization UNIT-II General System Architecture.
Execution of an instruction
CS321 Functional Programming 2 © JAS The SECD Machine The SECD machine has become a classic way of implementing functional languages. It is based.
Different parallel processing architectures Module 2.
Chapter 7 Dataflow Architecture. 7.1 Dataflow Models  A dataflow program: the sequence of operations is not specified, but depends upon the need and.
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke Presented by: Xia Cheng.
CAP 4800/CAP 5805: Computer Simulation Concepts
1 Dr. Muhammed Al-Mulhem ICS Dataflow Programming.
Pipelined and Parallel Computing Partition for 1 Hongtao Du AICIP Research Nov 3, 2005.
4 Linking the Components Linking The Components A computer is a system with data and instructions flowing between its components in response to processor.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
SWE 4743 Abstraction Richard Gesick. CSE Abstraction the mechanism and practice of abstraction reduces and factors out details so that one can.
 Program Abstractions  Concepts  ACE Structure.
Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 519 Paradigms ICS Department KFUPM Feb. 1, 2005.
Sequencers SQO,SQC,SQL.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
CS 598 Scripting Languages Design and Implementation 9. Constant propagation and Type Inference.
Compilation of XSLT into Dataflow Graphs for Web Service Composition Peter Kelly Paul Coddington Andrew Wendelborn.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Autumn 2006CSE P548 - Dataflow Machines1 Von Neumann Execution Model Fetch: send PC to memory transfer instruction from memory to CPU increment PC Decode.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Dataflow Machines CMPE 511
Prof. Onur Mutlu Carnegie Mellon University
Closures and Streams cs784(Prasad) L11Clos
Stacks Chapter 4.
CS 31006: Computer Networks – The Routers
Chapter 6 Intermediate-Code Generation
Subprograms and Programmer Defined Data Type
Chapter 5: Computer Systems Organization
Computer Architecture
Functions Definition: A function from a set D to a set R is a rule that assigns to every element in D a unique element in R. Familiar Definition: For every.
A Trusted Safety Verifier for Process Controller Code
Samira Khan University of Virginia Jan 23, 2019
Advanced Computer Architecture Dataflow Processing
Prof. Onur Mutlu Carnegie Mellon University
Chapter 4 The Von Neumann Model
Presentation transcript:

CS321 Functional Programming 2 © JAS Implementation using the Data Flow Approach In a conventional control flow system a program is a set of operations that are performed in an order specified by the programmer (a control path). In a data flow system a program is a set of operations performed in an order determined by the data dependencies (and the availability of resources). This latter approach is clearly more appropriate to a functional style of programming than the conventional approach.

CS321 Functional Programming 2 © JAS Data Flow programs may be represented graphically op …………… It can be shown that a maximum of two inputs and two outputs Are required

CS321 Functional Programming 2 © JAS The basic idea is that data values (tokens) flow along the arcs in a graph built up from nodes. Whenever a node has all (necessary) inputs present it is said to be enabled. It then fires by absorbing its inputs and generating output values on its output arcs. Nodes can fire in parallel

CS321 Functional Programming 2 © JAS x Constant generator Copy + Typical operators =

CS321 Functional Programming 2 © JAS Switch control T F T F Merge Gates F control T

CS321 Functional Programming 2 © JAS A conditional expression control T F T F predicate then path else path

CS321 Functional Programming 2 © JAS Applying functions fac APPLY argument definition of function result or closure APPLY (2nd)argument

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY F F F F F

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY 1

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY T T T T T 1 1

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY F F 2 2 2

CS321 Functional Programming 2 © JAS Encoding the graph Each node can have A name (ID) An operation A list of inputs A list of outputs id op inputs outputs a+b1c1d2 -

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY (a,1,-,-,b1,-) a b (b,>=,a1,c1,d1,-) c (c,copy,inp,-,b2,e2) d e f g h i j k m n o p q (d,copy,b1,-,j1,e1) (e,F-gate,d2,c2,f1,-) (f,copy,f1,-,m1,i1) (g,1,-,-,i2,-) (h,fac,-,-,k1,-) (i,-,f2,g1,k2,-) (j,copy,d1,-,o1,p1) (k,apply,h1,i1,m2,-) (m,1,-,-,o2,-) (n,*,f1,k1,p2,-) (o,T-gate,j1,m1,q1,-) (p,F-gate,j2,n1,q2,-) (q,join,o1,p1,out,-)

CS321 Functional Programming 2 © JAS Note that naming both the inputs and the outputs is unnecessary – the node generating the values can determine which node needs them, but the node needs to know how many inputs it needs Also note that in all the examples given we never had 2 inputs and 2 outputs It is therefore possible that the size of these instruction packets could be reduced

CS321 Functional Programming 2 © JAS Execution Cycle (Data-Driven) FOR any instruction DO IF instruction has all its required inputs THEN execute the instruction

CS321 Functional Programming 2 © JAS Executing the apply node IF the first input is a single parameter function THEN generate a copy of the function create a new copy of each instr in the fn assign unique id's and modify output list FOR each output instr in the fn DO set output list to appropriate values from output list of apply node place 2 nd input value into input record of 1 st instr in function ELSE IF 1 st input is closure requiring 1 parameter THEN generate copy of function pass 2 nd input and closure to appropriate input records ELSE generate new closure with 2 nd input value

CS321 Functional Programming 2 © JAS A machine architecture to implement this execution cycle pool of packets processors

CS321 Functional Programming 2 © JAS Processing units Communication network Instruction selection mechanism Program store instructions Executable instructions Values/closures

CS321 Functional Programming 2 © JAS The Manchester Architecture instruction store processing units result queue switch matching store tasks results operand pairs input output interface to real world and other layers route for inputs to single operand instructions memory/control unit

CS321 Functional Programming 2 © JAS The Alice Architecture processors Network – originally slotted ring

CS321 Functional Programming 2 © JAS As well as this data-driven approach it is possible to envisage a demand-driven approach Instead of the arrival of data driving the execution we imagine a request for output being received at the bottom of the graph

CS321 Functional Programming 2 © JAS A factorial function 1 >= F 1 fac - 1 T * F APPLY

CS321 Functional Programming 2 © JAS Execution Cycle (Demand-Driven ) FOR any instruction whose output has been requested DO IF instruction has all required inputs THEN execute instruction ELSE CASE type of instr OF primitive, copy switch: send request to all instrs in source list gate: IF control input is present THEN IF control matches gate THEN send request to 2 nd instr ELSE no action ELSE request 1 st instr in source list apply: send request to 1 st instr in source list

CS321 Functional Programming 2 © JAS Executing the apply node IF the first input is a single parameter fn THEN generate copy of fn adjusting input and output lists ELSE IF first input is closure requiring 1 parameter THEN generate copy of fn ELSE generate closure, remembering id of 2 nd instr

CS321 Functional Programming 2 © JAS Data Flow as implementation of a functional language Every node represents a function output = node (input1, input2) Functional expressions can be represented by networks of nodes Basic property of data flow is no variables – single assignment – or zero assignment This is mirrored in functional languages Demand-driven = Lazy; Data-Driven = Eager/Applicative Order

CS321 Functional Programming 2 © JAS Data Flow Languages ManchesterLapse MITVAL IrivineId JapanValid ( ) Lawrence LivermoreSISAL