1 csc 6001 vlsi cad (physical design) january 23 2006

34
1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

Post on 22-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

1

CSC 6001VLSI CAD (Physical Design)

January 23 2006

Page 2: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

2

“Graph Based Algorithms for Boolean Function Manipulation”, Randal E. Bryant, IEEE Transactions on Computers, Vol C-35, No. 8, 1986

Graph-based Representation of Boolean Functions

Page 3: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

3

Motivation

If you have 2 boolean functions:

f(x1, x2, …, xk) and g(x1, x2, …, xk)

How do you know if they represent the same function?

Page 4: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

4

Motivation

f(x1, x2, …, xk) g(x1, x2, …, xk)

Gf Gg

Then we can compare graph Gf and Gg.What properties should these graphs have foreasy comparison?

Page 5: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

5

Motivation

We want the graph representation to be:

– Unique for each boolean function.

– Can be operated on just like the boolean functions.

Page 6: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

6

Ordered BDD

• A data structure to represent boolean function.

• Directed acyclic graph (DAG)• Only one root node and two terminal nodes.• One terminal node labeled 0 and the other 1.• All non-terminal nodes are labeled with

variable names.

Page 7: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

7

Ordered BDD

a

cb

0 1

a=0a=1

b=1b=0

c=1c=0

This representsthe function:

f = ab + c

Page 8: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

8

Ordered BDD

• Every internal node has 2 successors.

• “Ordered” means that if x < y, then all nodes labeled x precede all nodes labeled y in the BDD.

• From now onwards, we will label the non-terminals with the orders of the variables only.

Page 9: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

9

Examples

1

1 0

01

1

2 2

1 0

0 1

3 3

011

0

•••

•••

What are these functions?

Page 10: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

10

Notations

1

32

0 1

01

1

0

10

index(v)

vnon-terminal

terminalvalue(u)

u

high(v)

low(v)

Page 11: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

11

BDD Boolean Function For each node v, the subgraph rooted at v

represents a function fv defined recursively as follow:– If v is a terminal node:

• If value(v) = 1, then fv = 1.

• If value(v) = 0, then fv = 0.

– Else, v is a non-terminal with index(v) = i: fv(x1, …, xn) = xi f low(v) (x1, …, xn) +

xi f high(v) (x1, …, xn)

Page 12: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

12

Example1

32

0 1

01

1

01

0 4

10

What boolean functiondoes it represent?

Page 13: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

13

Reduced BDD A BDD is reduced if it contains no:

– node v with low(v) = high(v), nor– distinct nodes v and v’ such that he subgraphs

rooted at v and v’ are identical.

1

3

2

0 1

3

2

0 1

1

11

10

0 0

How to reducethis BDD?

0

Page 14: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

14

Uniqueness of Reduced BDD

Theorem: For any boolean function f(x1, …, xn), there is a unique reduced BDD representing f with variable ordering x1< …< xn.

Page 15: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

15

Ordering Dependency1

32

4

5

6

0 1

1

1

1

1

1

10

0

00

0 What is this function?

What if we change the order to:1 3 5 2 4 6

Page 16: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

16

Ordering Dependency

Consider x1xn+1 + … + xnx2n

fb1,…bn(xn+1, …, x2n) = b1xn+1 + … + bnx2n

For all 2n possible combinations of the values b1, …, bn, each of these functions is distinct and they must be represented by distinct subgraphs in the BDD. Therefore, there exists at least 2n nodes in the reduced BDD.

Page 17: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

17

Inherently Complex Functions

Integer multiplier: Input: a1, …, an and b1, …, bn

Output: c1, …, c2n representing the integer ab.

Theorem: For any ordering of the inputs, at least one of the 2n functions for c1, …, c2n requires a graph containing at least 2n/8 nodes.

Page 18: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

18

Circuit Partitioning by Network Flow Approach

“Efficient Network Flow Based Min-Cut Balance Partitioning”, Yang and Wong, ICCAD, pp.50-55, 1994.

Page 19: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

19

k-Way Partitioning Problem Formulation:

Given a netlist of n cells V = {v1, v2, …, vn}, assign the cells to k clusters Pk = {C1, C2, …, Ck} satisfying some given constraints such that an objective function F(Pk) is optimized.

Partitioning: k is small O(1) Clustering: k is large O(n) Technology Mapping: Constraints on the clusters.

Page 20: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

20

Network Flow Technique

s t

a b

c d

16

13

10 4 9 7

12

20

4

11

s t

a b

c d

11/16

12/13

10 1/4 9 7/7

12/12

19/20

4/4

11/11

min-cut = max-flow

Page 21: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

21

Network Flow Technique

• The network flow technique can find the min-cut bipartition optimally, but not necessarily balanced.

• Apply the algorithm repeatedly to obtain a balanced bipartition.

Page 22: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

22

Network Flow Technique

• The network flow technique is very useful in different research areas.

• Many sophisticated improvements have been made to the original algorithm.

• Edmonds-Karp: O(|V||E|2)

• Ford & Fulkerson: O(|E||f|) where |f| is the size of the total flow. Note that for unit capacity, |f| |E|, so O(|E|2) time.

Page 23: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

23

Circuit Partitioning

• We can apply the network flow algorithm in partitioning circuits.

• The biggest problem is that the two partitions may not be balanced.

• The problem of obtaining two balanced partitions with minimum cut is NP-complete.

• However we can apply some heuristics to balance the two partitions.

Page 24: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

24

Flow-Balanced-Bipartition (FBB)

1 Find a min-cut C = (X,Y) in the network N.2 If (1-)W/2 w(X) (1+)W/2, stop and

return C.3 If w(X) < (1-)W/2 then

– Collapse all nodes in X to s.– Collapse to s a node vY incident on a net in C.– Goto to step 1.

4 If w(X) > (1+)W/2 … (similarly) ...

Why do we needthis step?

Page 25: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

25

Circuit Representation

Another problem in applying the network flow technique in circuit partitioning is how to represent a circuit correctly by a graph.

A B C D

How to represent this netlist by a simple graph?

Page 26: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

26

Hypergraph

A B C D

H(V,E) whereV = {A, B, C, D}E = {n1, n2, n3}n1 = {A, B, C, D}n2 = {A, B}n3 = {C, D}

In hypergraph, an edge is a set of vertices.

Circuits can be represented by hypergraphs, but the net-work flow method can only be used in simple graphs.

Page 27: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

27

Circuit Representation

Use a clique to model a net:

A B C D

What should be the edge weights?

Page 28: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

28

Circuit Representation

A B C D

1/4

1/4 1/4

1/41/41/4

1/2 1/2

Cut size = 4*1/4 = 1 (Actual cut size = 1)

Cut size = 3*1/4+1/2 = 5/4 (Actual cut size = 2)

edge weight =

n(k) = no. of cells in net k

)(

1

in

Page 29: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

29

Circuit Representation

A B C D

1/3

1/3 1/3

1/31/31/3

1 1

Cut size = 4*1/3 = 4/3 (Actual cut size = 1)

Cut size = 3*1/3+1 = 2 (Actual cut size = 2)

edge weight = 1)(

1in

Page 30: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

30

Circuit Representation

• It is proved that exact modeling of a hyper-graph by a graph with positive weights is impossible. [Ihler, Wagner & Wager, 1993]

• However, we can model a hypergraph H by a simple graph G such that when we apply the network flow algorithm, the min-cut in G is equal to the min-cut in H.

Page 31: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

31

Circuit Representation

A

B

C

A

B

C

1

What will happen when we apply the max-flow min-cutalgorithm to the graph G?

Original circuit C: G:

Page 32: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

32

Circuit Representation

A B C D

1

1

1

Page 33: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

33

Modeling a Circuit

d

ab

c

e

f

g

d

s

b

c

e

f

t

C: G:

Page 34: 1 CSC 6001 VLSI CAD (Physical Design) January 23 2006

34

Modeling a Circuit

Lemma: If C has a cut (X,Y) of size K, G has a cut (X’,Y’) of size K. If G has a cut (X’,Y’) of size K, C has a cut (X,Y) of size less than or equal to K.

Corollary: If (X’,Y’) is the min-cut of G of size K, the corresponding cut (X,Y) in C is also a min-cut of C of size K.