Docsity

Resource Sharing and Binding in Computer-Aided Logic Design - Prof. Susan Lysecky, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
ECE 474a/575a
Susan Lysecky
1of 25
ECE 474A/57A
Computer-Aided Logic Design
Lecture 14
Resource Sharing & Binding
ECE 474a/575a
Susan Lysecky
2of 25
Sharing vs. Binding
Resource Sharing
Assignment of a resource to more than one operation
Goal – reduce area by allowing multiple non-concurrent operations to share the same hardware
operator
Resource Binding
Explicit mapping between operations and resources
+
op1
+
op2
+
op3
+
adder1
+
adder2
+
op1
+
op2
+
op3
+
adder1
+
adder2
Resource Binding
Add op1 and op2 executes on adder unit 1
Add op3 executes on adder unit2
Resource Sharing
We have 3 add operations and 2 adder units
ECE 474a/575a
Susan Lysecky
3of 25
Resource Binding
Resource binding can be applied to scheduled or non-sche duled sequencing graphs
Scheduled sequencing graphs provides limitation on possible sharing
Requires 2 adders to meet the time constraint
(upper bound = 2)
NOP
NOP
+
1+
2+
3+
4
TIME 1
V0
Vn
NOP
NOP
+
1
+
2
+
3
+
4
TIME 1
V0
Vn
TIME 2
Requires 4 adders to meet the time constraint
(upper bound = 1)
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Resource Sharing and Binding in Computer-Aided Logic Design - Prof. Susan Lysecky and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 474a/575a Susan Lysecky 1 of 25

ECE 474A/57A

Computer-Aided Logic Design

Lecture 14

Resource Sharing & Binding

ECE 474a/575aSusan Lysecky 2 of 25

Sharing vs. Binding

ƒ Resource Sharing

ƒ Assignment of a resource to more than one operation

ƒ Goal – reduce area by allowing multiple non-concurrent operations to share the same hardware

operator

ƒ Resource Binding

ƒ Explicit mapping between operations and resources

op

op

op

adder

adder

op

op

op

adder

adder

Resource Binding

ƒ Add op1 and op2 executes on adder unit 1

ƒ Add op3 executes on adder unit

Resource Sharing

ƒ We have 3 add operations and 2 adder units

ECE 474a/575aSusan Lysecky 3 of 25

Resource Binding

ƒ Resource binding can be applied to scheduled or non-scheduled sequencing graphs

ƒ Scheduled sequencing graphs provides limitation on possible sharing

Requires 2 adders to meet the time constraint

(upper bound = 2)

NOP
NOP

TIME 1^1 +^2 +^3 +^4 +

V 0

Vn

NOP
NOP

TIME 1

V 0

Vn

TIME 2

Requires 4 adders to meet the time constraint

(upper bound = 1)

ECE 474a/575a Susan Lysecky 4 of 25

Resource Binding

ƒ Resource binding can be applied to scheduled or non-scheduled sequencing graphs

ƒ Scheduled sequencing graphs provides limitation on possible sharing

ƒ Non-scheduled sequencing graphs, the limitation of resource sharing effects the latency by

limiting the concurrency of operations (LIST_L scheduling)

At most 2 add operations can be executed in a

time slice, latency = 2

NOP
NOP

TIME 1

V 0

Vn

NOP
NOP

TIME 1

V 0

Vn

TIME 2

At most 1 add operation can be executed in a

time slice, latency = 4

Adders available = 1 Adders available = 2

TIME 2

TIME 3

TIME 4

ECE 474a/575aSusan Lysecky 5 of 25

Sharing and Binding for Resource Dominated Circuits

ƒ We are interested in the set of vertices of the sequencing graph (omit source/sink nodes)

ƒ How much sharing is possible?

ƒ Two or more operations can be bound to the same resource if the are compatible

ƒ Not concurrent

ƒ Can be implemented with the same resource type

a = b + c

e = a + 5

if ( a < b )

c = 5 + f

else

c = 5 + g

v7 and v10 are not

concurrent

Two operations are NOT concurrent if

ƒ Either one starts after the other has

finished

ƒ Alternative choices (mutually

exclusive) of a branching decision

v1 and v3 are not

concurrent

ECE 474a/575aSusan Lysecky 6 of 25

Resource Compatibility Graph

ƒ Graph whose set of vertices is a one-to-one correspondence with operations in the

sequencing graph and whose edges denotes the compatible operations pairs

NOP

NOP

TIME 1
TIME 2
TIME 3
TIME 4
V 0

Vn

3, 1 – Same op, 3 starts after 1 3, 2 – Same op, 3 starts after 2 3, 4 – Different ops 3, 5 – Different ops 3, 6 – Same op, BUT neither starts after the other and not alternative choices of branch 3, 7 – Same op, 3 starts in Time 2 and 7 starts in Time 3 3, 8 – Same op, 3 starts in Time 2 and 8 starts in Time 3 3, 9 – Different ops 3, 10 – Different ops 3, 11 – Different ops

Repeat for each node

ECE 474a/575a Susan Lysecky 10 of 25

Clique Partitioning

Example 1

Is G empty? No.

Find max clique

C = 4 // vertex with largest degree, anything with 4 will do U = {5, 9, 10, 11} // these vertices are connected to 4 V = 5 C = {4} U {5} = {4, 5} U = {10, 11} // these vertices are connected to 1 and 3 C = {4, 5} U {10} = {4, 5, 10}

U = { Φ } // no others vertices connect to 1, 3, and 7

Return {4, 5, 10, 11}

Vertices Degree

Remove {4, 5, 10, 11} from G

U = {11} // these vertices are connected to 1and 3 C = {4, 5, 10} U {11} = {4, 5, 10, 11}

ECE 474a/575aSusan Lysecky 11 of 25

Clique Partitioning

Example 1

Π = {1, 3, 7}, {4, 5, 10, 11}^9

Is G empty? No.

Find max clique

C = 2 // vertex with largest degree, anything with 2 will do U = {6, 8} // these vertices are connected to 4 V = 6 C = {2} U {6} = {2, 6} U = {8} // these vertices are connected to 1and 3 C = {2, 6} U {8} = {2, 6, 8} U = { Φ } // no others vertices connect to 1, 3, and 7

Return {2, 6, 8}

Vertices Degree

Remove {2, 6, 8} from G

ECE 474a/575aSusan Lysecky 12 of 25

Clique Partitioning

Example 1

Π = {1, 3, 7}, {4, 5, 10, 11}, {2, 6, 8}^9

Is G empty? No.

Find max clique

C = 9
U = {9}

U = { Φ } // no others vertices connect to 1, 3, and 7

Return {9}

Vertices Degree 9 0

Remove {9} from G

ECE 474a/575a Susan Lysecky 13 of 25

Clique Partitioning

Example 1

Is G empty? Yes!

ƒ What does clique partition tell us?

ƒ {1, 3, 7} – multiplier

ƒ {4, 5, 10, 11} – alu

ƒ {2, 6, 8} – multiplier

ƒ {9} – alu

ƒ We know how much sharing AND binding

ECE 474a/575aSusan Lysecky 14 of 25

Clique Partitioning

Example 2

NOP

NOP

TIME 1^3
TIME 2
TIME 3
TIME 4
V 0

Vn

Is G empty? No. Find max clique C = 4 U = {1, 2, 3, 5, 6} V = 1 C = {4} U {1} = {1, 4} U = {5, 6} C = {1, 4} U {5} = {1, 4, 5}

U = { Φ }

Return {1, 4, 5, 6} Π = {1, 4, 5, 6} Remove {1, 4, 5, 6} from G

Vertices Degree

U = {6}
C = {1, 4, 5} U {6} = {1, 4, 5, 6}

ECE 474a/575aSusan Lysecky 15 of 25

Clique Partitioning

Example 2

Is G empty? No. Find max clique C = 2 U = {Φ} Return {2} Π = {1, 4, 5, 6}, {2} Remove {2} from G

Vertices Degree

Is G empty? No. Find max clique C = 3 U = {Φ} Return {3} Π = {1, 4, 5, 6}, {2}, {3} Remove {3} from G

Vertices Degree

ECE 474a/575a Susan Lysecky 19 of 25

Building Resource Conflict Graph

ƒ Conflict graph is the complement of the compatibility graph

ƒ In conflict graph, looking for set of mutually compatible operations

ƒ Subset of vertices that are NOT connected by edges

ƒ Also called independent set of G

resource compatibility graph resource conflict graph

ECE 474a/575aSusan Lysecky 20 of 25

Graph Coloring

VERTEX_COLOR ( G(v, e) ){

for( i=1 to | V | ){

C = 1 // use number to represent color

while( there exists a vertex adjacent to vi with color c) do{

C = C + 1

label vi with C

ƒ Use graph coloring to find independent sets

ƒ Each color represents a resource instance (two adders will be represented by two different

colors)

ƒ Optimal resource sharing corresponds to vertex coloring with minimal amount of

colors

ECE 474a/575aSusan Lysecky 21 of 25

Graph Coloring Example 1

i = 1C = c1 // represents first color // look at vertex 1 9

Is there any adjacent vertices with color = 1? No. v 1 = c

c

i = 2 // look at vertex 2

C = c Is there any adjacent vertices with color = 1? Yes. C = c Is there any adjacent vertices with color = 2? No. v 2 = c

c

i = 3 // look at vertex 3

C = c1 // represents first color Is there any adjacent vertices with color = 1? No. v 3 = c

c

ECE 474a/575a Susan Lysecky 22 of 25

Graph Coloring Example 1

i = 4 // look at vertex 4

c

c

c1 c

c1 c

c

c

c

c

Similarly repeat for remaining

C = c1 // represents first color Is there any adjacent vertices with color = 1? Yes – rememberconflict is implied across different resource types.

v 4 = c

C = c Is there any adjacent vertices with color = 2? Yes. C = c Is there any adjacent vertices with color = 3? No.

c

ƒ Four colors required – need four resources

ƒ c1 is used for multiply

ƒ c2 is used for multiply

ƒ c3 is used for alu

ƒ c4 is used for alu

ECE 474a/575aSusan Lysecky 23 of 25

Graph Coloring Example 2

c1 c

i = 1

C = c Adjacent vertices with color = 1? No. v 1 = c

ƒ Four colors required – need

four resources

ƒ c1 for node 1, 3 op ƒ c2 for node 2, 4 op ƒ c3 for node 5 op ƒ c4 for node 6 op

c3 c

c

c

i = 2

C = c Adjacent vertices with color = 2? No.

C = c Adjacent vertices with color = 1? Yes.

v 2 = c

i = 3

C = c Adjacent vertices with color = 1? No. v 3 = c

i = 4

C = c Adjacent vertices with color = 2? No.

C = c Adjacent vertices with color = 1? Yes.

v 4 = c

i = 5

Adjacent vertices with color = 2? Yes.

C = c Adjacent vertices with color = 1? Yes.

v 5 = c

C = c

Adjacent vertices with color = 3? No. C = c

i = 6

Adjacent vertices with color = 2? Yes.

C = c Adjacent vertices with color = 1? Yes.

v 6 = c

C = c

Adjacent vertices with color = 3? Yes. C = c

Adjacent vertices with color = 4? No.

C = c

ECE 474a/575aSusan Lysecky 24 of 25

Graph Coloring

ƒ VERTEX_COLOR algorithm sensitive to ordering of vertices explored - variety of

modifications available

ƒ Switching pair assignment of colors

ƒ Backtracking to switching larger number of vertices

c

c1 c2 c

c

ƒ Node ordering 1, 2, 3, 4, 5

ƒ Requires 2 colors

c

c1 c2 c

c

ƒ Node ordering 1, 5, 2, 3, 4

ƒ Requires 3 colors