Introduction to Data Flow Graphs and their Scheduling
- Slides: 35
Introduction to Data Flow Graphs and their Scheduling Sources: Gang Quan
Computational Models l What: – A conceptual notion for expressing the function of a system l DFG (Design Flow Graph) l FSM, l Petri net, l Turing machine, l etc. l Computational Models & Languages – Models express the behavior, languages capture models – Models are conceptual, languages are concrete l What is in a computational model – A set of objects – Rules – Semantics Should be “big” (powerful) enough to precisely express the function of the system with unambiguity, should be “small” enough to have synthesis and verification tools to support it.
Data Flow Graph (DFG) l A modem communications system – Each box is a single function or sub systems – The activity of each block in the chain depends on the input of the previous block – Data driven l l Each functional block may have to wait until it receives a "certain amount" of information before it begins processing Some place to output the results
Data Flow Graph l Definition – A directed graph that shows the data dependencies between a number of functions – G = (V, E) l l Nodes (V): each node having input/output data ports Arces (E): connections between the output ports and input ports – Semantics l l l Fire when input data are ready Consume data from input ports and produce data to its output ports There may be many nodes that are ready to fire at a given time
Data Flow Graph Construction
b -1 4 c a x ** 2 x Constant x Multiplication Square root sqrt Division Nodes of DFG can be any operators, also very complex operators + / X 1 / X 2
Data flow graph construction original code: x a + b; y a * c; z x + d; x y - d; x x + c; c b a + d * + x + - z yx x
Data flow graph construction original code: x a + b; y a * c; z x + d; x y - d; x x + c; single-assignment form: x 1 a + b; y a * c; z x 1 + d; x 2 y - d; x 3 x 2 + c;
Data flow graph construction single-assignment form: x 1 a + b; y a * c; z x 1 + d; x 2 y - d; x 3 x 2 + c; c b a + d * - + y x 1 + z x 2 x 3
Design Issues for DFGs Allocating operator nodes to resources (blocks, functional units) Mapping to blocks Schedule in time Memory management Construction and usage of the queues and other special memory resources useful in data flows 1. 2. 3. 4. 5. – stacks?
What are the goals of these design processes? l Guarantee correct behavior l Utilize hardware efficiently. l Obtain acceptable performance.
Allocation l Decide the numbers and types of different functional units – E. g. register allocation …. x <= a + b; y <= a + c; x <= x - c; …. …. x … …. y…. three registers …. x <= a + b; y <= a + c; x <= x - c; …. …. x … …. y….
Mapping l Distributing nodes to different functional units on which they will fire – Functional units may provide different functions l Adder or ALU, MUX or buses, etc – Functional units may have different delay l Ripple adder or look ahead adder – Determines area, cycle time.
A Mapping Example Subject to: b a c + d + + e f 1. Two adders 2. Four registers 3. b and e cannot be assigned to the same register We assume two adders and four registers and next do synthesis for this assumption. But how do we know how many to assume?
A Mapping Example b a c + d + + e f Subject to: 1. Two adders 2. Three registers 3. a and e cannot be assigned to the same register R 1 R 2 R 3 Adder 2 Adder 1 R 1: a R 2: b, c, e R 3: d, f Mapping may not be unique !
Scheduling of DFG l Schedule – Creating the sequence in which nodes fire – Determines number of clock cycles required l Two simple schedules: – – As-soon-as-possible (ASAP) schedule puts every operation as early in time as possible As-late-as-possible (ALAP) schedule puts every operation as late in schedule as possible
ASAP scheduling for DFG Start from t=0 / + ** t=0 -1 t=1 - t=2 -1 * + t=3 t=4 / + ** * + Nodes fire whenever the input data are available.
ALAP Scheduling for DFG / + ** t=0 / t=1 -1 + - t=2 * t=3 t=4 + -1 ** * + Nodes fire when absolutely necessary. Start from the terminal values of t
More about ASAP and ALAP l Unlimited resources – No limit for the number of registers, adders, etc l Longest path through data flow determines minimum schedule length l Mobility – t. L – t. S • Difference between schedule in ALAP and schedule in ASAP. • The higher it is the more solutions we can find in optimization process
/ + Mobility ** -1 u here is the mobility list * + u = t. L - t. S l t=0 -1 t=1 ASAP t=2 * t=3 + t=4 / t=0 ALAP t=1 t=2 -1 t=3 + t=4 / - + + * ** ** u + 0 / 0 - 0 ** 1 * 0 -1 2 + 0 We will use this list in next scheduling method The node mobility represents its flexibility in the fire sequence.
Restrained Scheduling l / + * + – Time is given, minimize the resource ** l Resource constraints -1 Time constraints l NP problem
Time Constraints b -1 4 c a x ** 2 x x sqrt + - / X 1 How many units of time the graph needs to complete (we assume it) / X 2 T 6 7 8 +/*// 2 2 1 1 ** sqrt 1 1 1 -1 1 This shows how many various blocks we need if 6 fires. This shows how many various blocks we need if 8 fires.
Resource Constraints Resource is given, minimize the long time l List based scheduling l – Maintain a priority based ready list l The priority can be decided by mobility for example / – Fire the nodes according to their + - priorities until all the resource are used in that stage -1 * + **
List Based Scheduling priority based ready list The priority can be decided by mobility for example Fire the nodes according to their priorities until all the resource are used in that stage / + + - u / + + - * + + 0 0 1 0 0 t=0 / + * t=1 t=2 + Such that there is one +/-, one *// t=3 t=4 t=5 + + * + + 2 0
List Based Scheduling A general ASAP l Priority based ready list l / + - -1 * + **
Control/Data Flow Graph (CDFG) x <= a + b; if ( x > 100) y <= a * c; else y <= a + c; endif
Control/Data Flow Graph l Definition – A directed graph that represents the control dependencies among the functions l l branch fall-through – G=(V, E) l Nodes (V) – Encapsulated DFG – Decision l Arces (E) – flow of the controls l Very similar to FSMD – Operation rectangles (instructions) can be vary complicated – Diamonds for predicates can be very complicated and require many clock pulses to complete.
CDFG Example fun 0(); if (cond 1) fun 1(); else fun 2(); fun 3(); switch(test 1) { case 1: fun 4(); break; case 2: fun 5(); break; case 3: fun 6(); break; } fun 7(); fun 0 fun 1 Y cond 1 N fun 2 fun 3 test 1 fun 4 fun 5 fun 7 fun 6
CDFG Example fun 0(); while(cond 1) { fun 1(); } fun 2(); cond 1 N Y fun 2 fun 3
Design Issues for CDFG l Code optimization – Loop optimization, dead code detection l Register allocation
Summary l Data Flow Graph (DFG) – models data dependencies. – Does not require that nodes be fired in a particular order. – Models operations in the functional model—no conditionals. – Allocation and Mapping – Scheduling – ASAP, ALAP, List-based scheduling l Control/Data Flow Graph – Represents control dependencies
To remember l Now we know the most important concepts: – Data Flow Graph (DFG) – Control/Data Flow Graph – FSM table – Transition Graph – Combinational Graph (netlist) l These concepts alone are sufficient to complete all projects in this class. l However we will introduce more concepts and algorithms so you will be able to find: – Better solutions – In shorter time
Homework 3 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Find an example of some computation that is repeated many times on the same or on different data Draw DFG for this computation Possibly optimize this DFG using laws of arithmetic Schedule this DFG ASAP. Allocate to resources and find cost of hardware and time of processing. Schedule this DFG ALAP. Allocate to resources and find cost of hardware and time of processing. Schedule this DFG according any other method or heuristically using your common sense. Allocate to resources and find cost of hardware and time of processing. Make a table comparing all your results – you can have more than three. Select one design and give reason for this. Realize this design as a complete circuit. You can use ready adders, multipliers, etc blocks from internet. If you want (option) you may simulate this design with Verilog or VHDL or any graphic simulator. This is not mandatory part of the homework.
Review for Exams (1) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. What is in a computational model? Give examples Why computational models are important? We can describe every system as a Mealy Machine? Why other? What is DFG? Give few applications of DFGs Give example of a DFG of some hypothetical computer that would be worthy to build, for instance Hough Transform processor for a robot What is Allocating? What is Mapping? What is Scheduling? Explain ASAP Scheduling for a practical DFG on example. Do the same example again using ALAP scheduling. Compare the ASAP and ALAP Scheduling. What is Constraint Satisfaction Problem (question asked again but now you know more) What is NP, NP complete and NP hard problem. Give examples. Why the concept of NP problems is important?
Review for Exams (2) 1. 2. 3. 4. What is mobility and fire sequence. Give an example. Formulate the scheduling, allocation and similar problems as constraints satisfaction problems with constraints and costs as energy to be minimized. Give example of List Scheduling What is CDFG and what are associated synthesis and optimization problems?
- Cdfg graph
- Hedera: dynamic flow scheduling for data center networks
- Sjn scheduling
- State graphs in software testing
- Graphs that enlighten and graphs that deceive
- Speed and velocity
- Polynomial function form
- Control flow and data flow computers
- Unit 3 lesson 3 rational functions and their graphs
- Quadratic functions and their graphs
- 8-3 rational functions and their graphs
- 9-1 quadratic graphs and their properties
- Expander graphs and their applications
- Chapter 1 functions and their graphs
- Lesson 3-1 inequalities and their solutions
- Sketch the graph of the following rational function
- Common functions and their graphs
- Polynomial functions and their graphs
- Inequalities and their graphs 3-1
- 3-1 inequalities and their graphs answer key
- Polynomial functions and their graphs
- Analyzing graphs of polynomial functions calculator
- Exponential functions and their graphs
- Chapter 2 functions and their graphs answers
- 3-1 inequalities and their graphs
- How to find vertical asymptotes of a function
- Lesson 3 rational functions and their graphs
- Data flow vs control flow
- Matching graph theory
- Practice a investigating graphs of polynomial functions
- Investigating graphs of functions for their properties
- Markov factorization
- Signal flow graph examples
- Interpreting graphs science
- Data tables and graphs
- Introduction to data warehousing and data mining