1 / 35

# Introduction to Data Flow Graphs and their Scheduling - PowerPoint PPT Presentation

Introduction to Data Flow Graphs and their Scheduling . Sources: Gang Quan. Computational Models. What: A conceptual notion for expressing the function of a system DFG (Design Flow Graph) FSM, Petri net, Turing machine, etc. Computational Models & Languages

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'Introduction to Data Flow Graphs and their Scheduling' - liluye

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Sources: Gang Quan

• What:

• A conceptual notion for expressing the function of a system

• DFG (Design Flow Graph)

• FSM,

• Petri net,

• Turing machine,

• etc.

• Computational Models & Languages

• Models express the behavior, languages capture models

• Models are conceptual, languages are concrete

• What is in a computational model

• A set of objects

• Rules

• Semantics

Should be “big” (powerful) enough enough to precisely express the function of the system with unambiguity, should be “small” enough to have synthesis and verification tools to support it.

• 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

• 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

• Definition

• A directed graph that shows the data dependencies between a number of functions

• G = (V,E)

• Nodes (V): each node having input/output data ports

• Arces (E): connections between the output ports and input ports

• Semantics

• 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

4

c

a

2

x

x

-1

**

x

-

sqrt

+

-

/

/

X2

X1

Constant

Multiplication

Square root

Division

Nodes of DFG can be any operators, also very complex operators

x  a + b;

y  a * c;

z  x + d;

x  y - d;

x  x + c;

Data flow graph construction

c

d

b

a

+

*

+

+

-

x

y

z

x

x

x  a + b;

y  a * c;

z  x + d;

x  y - d;

x  x + c;

single-assignment form:

x1 a + b;

y  a * c;

z x1 + d;

x2 y - d;

x3 x2 + c;

Data flow graph construction

x1  a + b;

y  a * c;

z  x1 + d;

x2  y - d;

x3  x2 + c;

c

d

b

a

+

*

-

+

y

x1

+

z

x2

x3

Data flow graph construction

• 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

• stacks?

• Guarantee correct behavior

• Utilize hardware efficiently.

• Obtain acceptable performance.

• Decide the numbers and types of different functional units

• E.g. register allocation

….

x <= a + b;

y <= a + c;

x <= x - c;

….

….x …

….y….

….

x <= a + b;

y <= a + c;

x <= x - c;

….

….x …

….y….

three registers

• Distributing nodes to different functional units on which they will fire

• Functional units may provide different functions

• Adder or ALU, MUX or buses, etc

• Functional units may have different delay

• Determines area, cycle time.

a

+

c

d

+

+

f

e

A Mapping Example

• Subject to:

• Four registers

• 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?

b

a

+

c

R1

R2

R3

d

+

+

f

e

R1: a

R2: b, c, e

R3: d, f

• Subject to:

• Three registers

• a and e cannot be assigned to the same register

Mapping may not be unique !

• Schedule

• Creating the sequence in which nodes fire

• Determines number of clock cycles required

• 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

/

+

**

-1

/

+

**

t=1

-

-

t=2

*

t=3

-1

*

+

t=4

+

ASAP scheduling for DFG

Start from t=0

Nodes fire whenever the input data are available.

/

+

t=1

-

**

t=2

-1

*

t=3

+

t=4

ALAP Scheduling for DFG

/

+

**

-

-1

*

+

Nodes fire when absolutely necessary.

Start from the terminal values of t

• Unlimited resources

• No limit for the number of registers, adders, etc

• Longest path through data flow determines minimum schedule length

• Mobility

• tL – tS

• Difference between schedule in ALAP and schedule in ASAP.

• The higher it is the more solutions we can find in optimization process

t=0

/

+

**

-1

/

/

+

+

**

t=1

t=1

-

-

-

**

t=2

t=2

-1

*

*

t=3

t=3

-1

*

+

+

t=4

t=4

+

Mobility

u here is the mobility list

u

We will use

this list

in next

scheduling

method

• u = tL - tS

0

+

0

/

ASAP

0

-

1

**

0

*

ALAP

2

-1

0

+

The node mobility represents its flexibility in the fire sequence.

+

**

-

-1

*

+

Restrained Scheduling

• Time constraints

• Time is given, minimize the resource

• Resource constraints

• NP problem

4

c

a

2

x

x

-1

**

x

-

sqrt

+

-

/

/

X2

X1

Time Constraints

How many units of time the graph needs to complete (we assume it)

T

6

7

8

2

1

1

+/-

*//

2

2

1

1

1

1

**

sqrt

1

1

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.

+

**

-

-1

*

+

Resource Constraints

• Resource is given, minimize the long time

• List based scheduling

• Maintain a 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

+

+

-

*

+

+

0 0 1 0 0 2 0

u

List Based Scheduling

• 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

/

+

+

-

t=0

/

+

t=1

+

*

-

t=2

+

+

t=3

*

+

Such that there is

one +/-,

one *//

t=4

+

t=5

+

**

-

-1

*

+

List Based Scheduling

• A general ASAP

x <= a + b;

if ( x > 100)

y <= a * c;

else

y <= a + c;

endif

• Definition

• A directed graph that represents the control dependencies among the functions

• branch

• fall-through

• G=(V,E)

• Nodes (V)

• Encapsulated DFG

• Decision

• Arces (E)

• flow of the controls

• 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.

Y

N

fun1

cond1

fun2

fun3

test1

fun4

fun5

fun6

fun7

CDFG Example

fun0();

if (cond1) fun1();

else fun2();

fun3();

switch(test1) {

case 1: fun4(); break;

case 2: fun5(); break;

case 3: fun6(); break;

}

fun7();

fun0

N

fun0();

while(cond1) {

fun1();

}

fun2();

cond1

Y

fun2

fun3

• Code optimization

• Loop optimization, dead code detection

• Register allocation

• 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

• Control/Data Flow Graph

• Represents control dependencies

• Now we know the most important concepts:

• Data Flow Graph (DFG)

• Control/Data Flow Graph

• FSM table

• Transition Graph

• Combinational Graph (netlist)

• These concepts alone are sufficient to complete all projects in this class.

• However we will introduce more concepts and algorithms so you will be able to find:

• Better solutions

• In shorter time

• 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.

• 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?

• 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?