0% found this document useful (0 votes)
54 views

Unfolding Basic Good One

Unfolding is a transformation technique that creates a new program describing multiple iterations of the original program by unfolding it by a factor J. This increases parallelism for implementation. The unfolded data flow graph (DFG) contains J times as many nodes and edges as the original DFG. Unfolding preserves the precedence constraints and number of delays between operations in the original DFG. The algorithm for unfolding a DFG draws J copies of each node and connects them with the same delays as the original edges.

Uploaded by

Sameer Nandagave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Unfolding Basic Good One

Unfolding is a transformation technique that creates a new program describing multiple iterations of the original program by unfolding it by a factor J. This increases parallelism for implementation. The unfolded data flow graph (DFG) contains J times as many nodes and edges as the original DFG. Unfolding preserves the precedence constraints and number of delays between operations in the original DFG. The algorithm for unfolding a DFG draws J copies of each node and connects them with the same delays as the original edges.

Uploaded by

Sameer Nandagave
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Unfolding basics

ArunachalamV
AP SG, SENSE
Unfolding - Basics
Transformationtechniquethat canbeappliedto DSP program
to createanewprogramdescribingmorethanoneiterationof
theoriginal program.
Unfolding is also referred to as loop unrolling, used in
compiler theory.
UnfoldingaDSPprogrambytheunfoldingfactor, J createsa
new program that describes J consecutive iterations of the
original program.
An Example
Consider
Replacing the index n with 2k
Replacing the index n with (2k+1)
Program (1) is described by (2) and (3) as two consecutive
iterations.
( ) ( ) ( ) ( ) 1 0 9 . = + = to n for n x n y a n y
( ) ( ) ( ) ( ) 2 0 2 9 2 . 2 = + = to k for k x k y a k y
( ) ( ) ( ) ( ) 3 0 1 2 8 2 . 1 2 = + + = + to k for k x k y a k y
J=2 unfolded version
(2) & (3) together describes a J=2 unfolded version of (1)
Why do graph based unfolding needed?
It canoftenbetedioustowritetheequationsfor theoriginal &
J-unfolded programs and then draw the corresponding
unfoldedDFG, especiallyfor larger valuesof J.
Therefore we describe a graph-based technique for directly
unfolding the DFG to createthe DFG of J-unfolded program
without explicitly writing equations describing theoriginal or
unfoldedprogram.
Applications of unfolding
Unfolding has applications in designing high speed and low
power VLSI architectures.
Unfold the program to reveal hidden concurrencies so that the program
can be scheduled to a smaller iteration period, thus increasing the
throughput of the implementation.
Design parallel architectures at the word level and bit level.
Some common notations used
Floor of x , largest integer less than or equal to x.
a % b : a mod b, remainder after dividing a by b ; also a & b
are integers.
Basic properties of unfolding
For each node U in the original DFG, there are J nodes with
same function as U in the J-unfolded DFG.
For each edge in the original DFG, there are J edges in the J-
unfolded DFG.
The J-unfolded DFG (program) contains J -times as many
nodes and edges as the original DFG (program).
Algorithm for unfolding a DFG by a factor J
1. For each node U in the original DFG, draw the J nodes U
0
,
U
1
, U
2
,, U
J-1
.
2. For each edge with w delays in the original DFG, draw J
edges with delays for i=0,1,2,3,, J-1.
V U
e

( ) J w i
e
i
V U
% +

+
J
w i
Example -1
( )
( )
( )
( ) 0 0 2 % 0 0 0
1 0 2 % 9 0 0
0 0 2 % 0 0 0
0 0 2 % 0 0 0
0
C D C D
D C D C
B C B C
C A C A
i




=
+
+
+
+
) 1 2 ( , 0 ; 2 = = i J
( )
( )
( )
( ) 1 1 2 % 0 1 1
0 1 2 % 9 1 1
1 1 2 % 0 1 1
1 1 2 % 0 1 1
1
C D C D
D C D C
B C B C
C A C A
i




=
+
+
+
+
( )
delays with
D C D C
i
5
2
9 1
1
0 1 2 % 9 1 1
=
(

+

=
+
( )
delays with
D C D C
i
4
2
9 0
0
1 0 2 % 9 0 0
=
(

+

=
+
w > J
Example -2
3 , 2 , 1 , 0 ; 4 = = i J
( )
delays with
V U V U
i
9
4
37 0
0
1 0 4 % 37 0 0
=
(

+

=
+
( )
delays with
V U V U
i
9
4
37 1
1
2 1 4 % 37 1 1
=
(

+

=
+
( )
delays with
V U V U
i
9
4
37 2
2
3 2 4 % 37 2 2
=
(

+

=
+
( )
delays with
V U V U
i
10
4
37 3
3
0 3 4 % 37 3 3
=
(

+

=
+
w > J
Example -3
InUV, w < J
In such cases J -w edges with
nodelayandwedgeswithone
delayeach.
2 , 1 , 0 ; 3 = = i J
Unfolding preserves precedence constraints
Unfoldingpreservesprecedenceconstraintsof aDSPprogram.
The e edges in the original DFG explicitly show the
precedence constraints for 1iterationof theoriginal program,
and Je edges in the J-unfolded DFG explicitly show the
precedenceconstraintsfor J iterationsof theprogram.
Proof
The edge with delays in the unfolded DFG
corresponds to the edge with w delays in the original
DFG.
k
th
iteration of the node U
i
in the J-unfolded DFG executes the
(Jk+i)
th
iteration of the node U in the original DFG.
Due to the delays on the edge , the output of the
k
th
iteration of the node U
i
is consumed by the -th
iteration of the node in the unfolded DFG.
V U
e

( ) J w i
e
i
V U
% +

+
J
w i
(

+
J
w i
( ) J w i
e
i
V U
% +

|
|
.
|

\
|
(

+
+
J
w i
k
( ) J w i
V
% +
Proof
k
th
iteration of the node U
i
corresponds to the (Jk+i)
th
iteration
of the node U, and the -th iteration of
corresponds to -th iteration of node
V.
Therefore in the original DFG, the output of the (Jk+i)
th
iteration of the node U is consumed by the
-th iteration of node V.
|
|
.
|

\
|
(

+
+
J
w i
k ( ) J w i
V
% +
( ) | |
|
|
.
|

\
|
+ +
(

|
|
.
|

\
|
(

+
+ J w i
J
w i
k J %
( ) | |
|
|
.
|

\
|
+ +
(

|
|
.
|

\
|
(

+
+ J w i
J
w i
k J %
k
th
iteration
Unfolded DFG Original DFG
k
th
iteration of U
i
node (Jk+i)
th
iteration of U node
- thiteration by
node
- th
iteration by node V
On edge
(unfolded)
On UV edge
(original)
Output of U
i
is consumed in
- thiteration by
node .
Output of U is consumed in
- th
iteration by node V
|
|
.
|

\
|
(

+
+
J
w i
k
( ) J w i
V
% +
( ) | |
|
|
.
|

\
|
+ +
(

|
|
.
|

\
|
(

+
+ J w i
J
w i
k J %
( ) J w i
e
i
V U
% +

|
|
.
|

\
|
(

+
+
J
w i
k
( ) J w i
V
% +
( ) | |
|
|
.
|

\
|
+ +
(

|
|
.
|

\
|
(

+
+ J w i
J
w i
k J %
U V
w
U
i
( ) J w i
V
% +
(

+
J
w i
( ) | | ( ) i Jk J w i
J
w i
k J +
|
|
.
|

\
|
+ +
(

|
|
.
|

\
|
(

+
+ %
( ) | | i J w i
J
w i
J + +
(

+
%
( ) | | i J w i
J
w i
J =
|
|
.
|

\
|
+ +
(

+
%
So the number of delays on the edge UV is (i+w)-i = w
Unfolding preserves the number of delays in a DFG
( ) | | i Jk J w i
J
w i
J Jk + +
(

+
+ %
k
J
w i
k
(

|
|
.
|

\
|
(

+
+
k
J
w i
k
(

+
+
(

J
w i
Original
Unfolded
PROPERTIES OF UNFOLDING
Next Class

You might also like