jason cong 1 - university of california, los...

79
Jason Cong 1

Upload: others

Post on 10-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 1

Page 2: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 2

❁ Channel Routing

❁ Maze Routing and Its Variations

❁ Hierarchical Routing

Page 3: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 3

Channel Routing ProblemInput: Pins on the lower and upper edge

Output: Connection of each net

Constraints (Assumption)(i) grid structure(ii) two routing layers. One for horizontal

wires, the other for vertical wires(iii) vias for connecting wires in two layers

Minimize:(i) # tracks (channel height)(ii) total wire length(iii) # vias

Page 4: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 4

Channel Routing Problem(Cont’d)

1 2 43 4662 2

12 43 4 56 235

t1

t2

t3

t4

t5

t6

Page 5: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 5

Channel Density❁ Local density at column C

ld(C) = # nets split by column C❁ Channel Density

d = max ld( C )all C

❁ Each net spans over an interval❁ Horizontal Constraint Graph(HCG)

node : netedge: two intervals intersect

❁ Size of max clique in HCG= channel density❁ A lower bound:

# tracks ≥≥≥≥ channel density

a aa

c

a

bd

ef

ld(x)

e

a

dc

b

f

Page 6: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 6

Thm: If the density of a set of intervals is d, then they can be packed into d tracks.Proof: I1=(a,b) I2=(c,d)Define: I1<I2 iff b<c or I1=I2

❁ reflective: I1<I1❁ anti-symmetric: I1<I2, I2<I1 I1=I2❁ transitive: I1<I2, I2<I3 I1<I3

❁ The interval set with binary relation < forms a partially ordered set (POSET)!!Intervals in a track⇔⇔⇔⇔ they form a chainIntervals intersecting a common column antichain

Dilworth’s theorem (1950): If the max antichain of a POSET is d, then the POSET can be partitioned into d chains

Interval PackingI6

ca b d

I4I3I1 I2

I5

I1

I5 I2

I3

I4I6

Page 7: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 7

Left-Edge Algorithm for Interval PackingRepeat

create a new track tRepeat

put leftmost feasible interval to tuntil no move feasible interval

until no move interval

Interval are sorted according to their left endpoints

O(nlogn) time algorithm. Greedy algorithm works!

I6I4

I3I1 I2

I5I6

I4I3I1

I2I5

Page 8: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 8

Vertical Constraint Graph (VCG)❁ Node: represent a net

❁ edge (a1→→→→a2): if at some column, net a1 has a terminal on upper edgenet a2 has a terminal on lower edgea1→→→→a2 means that net a1 has to be above a2

❁ Another lower bound:# tracks ≥≥≥≥ longest path in VCG

❁ VCG may have cycle !

What shall we do??

a b

bba

c ca

c

b

b

ba

a

b

a

Page 9: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 9

Doglegs in Channel Routing❁ Doglegs may reduce the longest path in VCG

❁ Doglegs break cycles in VCG

a b c d d

a a b c

abc

d

abc-1

c-2

d

a b

b a

a b

b ab-1

b-2

a

b

b-1

b-2

a?

a b c d d

a b c

c-1

c-2

Page 10: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 10

Doglegs in Channel Routing(Cont’d)

❁ Restricted Dogleg vs unrestricted dogleg

a

a a

a

a

Page 11: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Characterizing Channel Routing Problem

1

3

5

8

9

2

6

7

104 1

3

5 4

8

910

7

6

2

Vertical constraint graph GvHorizontal constraint graph

The channel routing problem is completely characterized by the vertical constraint graph and the horizontal constraint graph.

0 1 4 5 1 6 7 0 4 9 10 10

2 3 5 3 5 2 6 8 9 8 7 9

2

1

5

4

3

67

8

9

10

Page 12: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 12

Channel/Switch Box Routing Algorihm

❁ Graph theory based algorithmYoshimura and Kuh

❁ Greedy algorithmRivest and Fiduccia

❁ Maze routing and its variationsLee, Robin, Soukup, Ohtsuki

❁ Hierarchical wire routingBurstein and Pelavin

Channel routing

Channel / switchbox and general area routing

Page 13: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 13

Yoshimura and Kuh’s Method

Source:“Efficient Algorithms for Channel Routing”

by T. Yoshimura and E. Kuh

IEEE Trans. On Computer-Aided Design of Integrated Circuits and Systems.

Vol. CAD-1, pp25-35, Jan 1982

Page 14: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 14

Zone Representation of Horizontal Segments

0 1 4 5 1 6 7 0 4 9 10 10

2 3 5 3 5 2 6 8 9 8 7 9

2

1

5

4

3

67

89

10

2 1 1 1 1 2 4 4 4 7 7 92 2 2 2 4 6 7 7 8 9 103 3 3 4 6 7 8 8 9 10

4 4 5 9 5 5

Zone: 1 2 3 4 5

Page 15: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 15

Zone Representation of Horizontal Segments(Cont’d)

Zone representation

S(i): set of nets intersect column i❁ we only need to consider those s(i)s

which are maximal

❁ Zone ↔↔↔↔ maximal clique in the horizontal constraint graph

Page 16: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 16

Dogleg Considerationor or

❁ New vertical constraint graph and zone rep.

1b2a 2b 2c

34a 4b

1234

1 3

4

2

No doleg

With dolog

1b2b34a

1a2a 2c

4b

1a

2a

2b

4a

1b 3

4b

2c

❁ Break net into subnets❁ Restricted dogleg

Zone rep VCG

1ae.g.

Page 17: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 17

Merging of Nets1

3

5

8

9

2

6

7

104 12345 6

789

10

net 6 and net 9 can be merged

1

3

5

8

6,9

2

7

10

4 12345 6,9

78

10

Updated graph and zone repNet i and net j can be merged if (a) there is no directed path connecting them in VCG; (b) the two nets do not overlap

Page 18: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 18

1010

Change of VCGs

(a) (b) (c)

1

3

5

8

9

2

6

7

4

5,6

1

3 8

9

2

7410

5,6

1,7

3 8

9

2

4

10

(d)

5,6,9

1,7

2 3,8

4

4,10

(d)

5,6,9

1,7

2 3,8

track 1

track 2

track 3

track 5(or 4)

track 4 (or 5)

How to choose two feasible nets to merge? Determine the quality of the solutions

Page 19: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 19

10

3

Process the Zones Sequentially12

45 6

789

1234

5,6

78

910

1,7234

5,6

89

10

LEFT={1,3,5}

RIGHT={6)

LEFT={2,3,5.6}

RIGHT={8,9)

LEFT={1,2,3}

RIGHT={7)

Page 20: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 20

Process the Zones Sequentially(Cont’d)

1,7

23,8

45,6,9

10

LEFT={2,3.8,4}

RIGHT={10)

1,72

3,8

4,105,6,9

LEFT={1.7, 2, 3.8, 4.10, 5.6.9}

RIGHT= φφφφ

Page 21: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 21

First Approach❁ Merge LEFT and RIGHT so as to minimize the increase

of the longest path length in the VCG

❁ Heuristic rule to select nets to merge sequentially

2

3

4

s

15

8

69

107

t

d(2)=3

u(2)=2d(10)=1

u(10)=3

Longest lower path

Longest upper path

s

vu

t

s

u.v

t

u(u)

d(v)d(u)

u(v)

d(u.v)= max(d(u),d(v))

u(u.v)= max(u(u),u(v))

Page 22: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 22

Criteria for Selecting Nets for Merge❁ Select x∈∈∈∈ LEFT which lies on a longest path from s→→→→t

❁ Select y ∈∈∈∈ RIGHT to minimize the increase in longest path after merging x and y

s

yx

t

s

X y

s

Increase in longest path = h(x,y)

= max(d(x),d(y)) + max(u(x),u(y)) - max(u(x)+d(x),u(y)+d(y))

Page 23: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 23

Implementation(Procedure to select x and y to be merged)

)})()(),()(max{)}(),(max{)}(),(max{),(

})()()()({),(),(

,)2()1()}(),(max{)}()({)(

)1(

mdmundnumdndmunumnh

mdndnumdmnRCm nng

LEFTmRIGHTforCmdmumdmuCmf

LEFTmfor

++++++++++++====

∗∗∗∗++++∗∗∗∗−−−−∗∗∗∗====

∈∈∈∈∈∈∈∈>>>>>>>>++++++++∗∗∗∗====

∈∈∈∈

∞∞∞∞∞∞∞∞

**),(maximizes*)(*)(maximizes*)(

nymngwhichRIGHTnFindiimxmfwhichLEFTmFindi

====∈∈∈∈====∈∈∈∈

n

====

Page 24: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 24

Implementation(cont’d)

}*)(*)(*)(*)({*)*,(*)*,(

)}(),(max{*)}(*)({*)(

ndmdnumumnhCmng

mdmumdmuCmf

++++++++++++−−−−====

++++++++====

∞∞∞∞

∞∞∞∞

Lies on a longest path Farthest away from s and t

Minimum increase in longest path length

*)(

*)(

*)(

*)()2(

max*) ≅≅≅≅(*)()1(

nd

nu

md

mu

imumndnu

≅≅≅≅

++++

∗∗∗∗

∗∗∗∗

Page 25: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 25

Second Approach

❁ Global merging of nets using algorithm for maximum cardinality matching

❁ Delay net merging❁ Re-pair two nets if necessary

❁ merge when it is safe

Page 26: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 26

Shortcomings of the First ApproachObservation: Merging of two nodes may block subsequent merging

Net f cannot be merged with either c or g. But, if we merged a with d, c with e then f can be merged with net b

abcg

h4

de

kf

321

a.db.ecg

h4

kf

321

a

gc

eb

k

h

fd

a.d

gc

b.e

k

hf

Page 27: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 27

Processing Zoneabcg

hde

kf

a

gc

eb

k

h

fdProcessing Zone 1

Bipartite graph

LEFT={a,b,c}

RIGHT={d,e}

a

b

c

d

eDelay merging!!(Both d and e do not terminate at zone 2

Processing Zone 2a

b

c

d

e

fg

a

b

c

d

e

fg

Modify matching

Cyclic conflict!!

Merge a&d, b&f, delay merging c&e

LEFT={a.d, b.f,c,g}

RIGHT={h,k,e}

Merge two nets when both of them terminate!

Page 28: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 28

Simultaneous MergingCan Produce Cyclic Conflicts

a b

c d

a.d

b.c

a

b

d

c

a

b

c

d

How to modify a matching with cyclic conflicts to get a feasible matching?

Page 29: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 29

Bipartite graph Gh=(N, Eh)

Gh Ex= set of edges in Gh.

Theorem The merging corresponding to any matching on Gh is feasible⇔⇔⇔⇔Ex=φφφφ

Corollary The merging corresponding to any matching on Gr=( N , Eh-Ex) is feasible.

Algorithm A

Cycle Avoidance

“bad edges”

Page 30: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 30

Algorithm A for Cycle AvoidanceGh=( N, E h ) bipartite graph ( for matching)

Gv=( N, E v ) VCG

begin:Ex:=0while N is not empty do

N0:=nodes in Gv with no incoming edgesremoves E0={(i,j) | i ∈∈∈∈ N0, j∈∈∈∈ N0} from Gh

if some node in Gh has zero degree, let it be velse choose v ∈∈∈∈ N0 with the smallest degree in Gh

Ex:=Ex+Ev (Ev is the set of edges adjacent to v)Remove v and its incident edges from Gh and Gv.

end-whileend-Algorithm

Page 31: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 31

Illustration of Algorithm A

Bipartite Graph Gh=(N, Eh)

Gh Ex=a set of edges in GhAlgorithm A

a

b

c

g

h

id

a

b

c

g

h

i

a

b

c

g

h

idGh

g

bc

h

i

dag

b c h

iag

bc

h

i

da

Isolated vertex

Gv

N0=set of nodes with in-degree zero

Page 32: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 32

Illustration of Algorithm A(Cont’d)

a

b

c

g

h

i

g

b c h

iaN0

a

b

c

g

h

i

g

b c h

ia

b

c

g

h

i

g

b h

ic

N0

b

ch

i

b

h

ic

b

ch

b hc

a∈∈∈∈ N0 and a has minimum degree here

Put edge(a,h) into Ex

Graph become empty! Ex={(a,h)}

Page 33: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 33

Illustration of the Corollary

Gr=(N, Eh-Ex)

Merging corresponding to any matching on Gr is feasible

a

b

c

g

h

i

d

d.g

b.h

a.h

c

Arbitrary matching

No cycles

Page 34: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 34

Procedure to get a feasible matching

① Find a matching in Gh

② Apply algorithm to the graph Gm=(N, M) (M= the set of edges in the matching)

③ If Ex=φφφφ then the matching is feasible!④ Else apply algorithm to Gh and obtain Ex’,

calculate a new matching in (N, Eh-Ex’)

N.B. this new matching is feasible

Page 35: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 35

Comments① Avoid unnecessary introduction of dogleg, use a

process “merging of subnets”subnet i and subnet j can be merged⇔⇔⇔⇔ merging subnet i and subnet j will not increase the longest path length passing through H

② Reduce CPU time by:# of edges/nodes in the bipartite graph is limited by a parameter(e.g. =3 in the program)

③ Need not start at zone 1In general, can obtain better results by starting at the max density zone

Max density zone

Page 36: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 36

Routing Examples by Y-K’s Algorithm

number of tracks=18maximum density =18

number of tracks=17

maximum density =17

Example 3c

Example 4b

Page 37: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 37

Routing Examples by Y-K’s Algorithm (Cont’d)

number of tracks=20

maximum density =20

number of tracks=28

maximum density =19

Example 5

Deutsch’s Difficult example without dogleg

Page 38: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 38

Deutsch’s Difficult Example# columns =174, # nets=72

density=19

Deutsch’s difficult example with doglegsnumber of tracks=20maximum density=19

Page 39: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 39

Summary of Yoshimura and Kuh’s Algorithm

❁ Split multi-terminal nets into 2-terminal subnets

❁ Merging subnets to share tracks

❁ Consider both HCG and VCG

❁ Global matching and delayed merging help

Shortcomings

❁ Cannot produce unrestricted doglegs

❁ VCG cannot have cycle

Page 40: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 40

Greedy Channel Router

R.L. Rivest and C.M. Fiduccia “ A Greedy Channel Router”, 19th DAC, 1982 P418-424

❁ A simple linear time algorithm

❁ Guarantee the completion of all the nets (may extend to right-hand side of the channel)

❁ Produce both restricted doglegs and unrestricted doglegs

Page 41: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 41

Left-to-right, Column-by-column scanc:=0;while (not done) do

beginc:=c+1;complete wiring at column c;

end;

In general, a net may be(1) empty (net 5)(2) unsplit (nets 1,4)(3) split (net 3)(4) completed (net2)

Overview of Greedy Router

1 3 1 2 1 5

2 1 2 3 4 5 4 4

1 3 4 3

Page 42: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 42

Operations at Each ColumnAt each column, the greedy router tries to maximize the utility of the wiring produced:

A: Make minimal feasible top/bottom connections;B: Collapse split nets;C: Move split nets closer to one another;D: Raise rising nets/lower falling nets;E: Widen channel when necessary;F: Extend to next column;

1 3 1 2 1 5

2 1 2 3 4 5 4 4

Page 43: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 43

(A) Make Minimal Feasible Top/Bottom Connections

234

234

4 4

1 1

231

231

0 0

1 1

A A* B B*

21

23

2 2

1 1

C C*

1234

5

0

D D*

1234

5

0

1234

5

5

F F*

1234

5

5

3214

3

2

E E*

3214

3

2

Page 44: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 44

( B ) Collapse Split Nets

0

2

13

2

0

2

13

2

G G*0

0

13414

0 H H*

0

13414

0

1

212343

I I*0

1

212343

0

0

1

212

0

1

212

J J*

0

Page 45: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 45

( C ) Move Split Nets Closer

0

0

121

2

k k*0

0

121

2

Page 46: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 46

( D ) Rising/Falling

L L*0

1

34

falling

fallingrising

0

1

34

falling

fallingrising

Page 47: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 47

M M*7

0

151

6

( E ) Insert New Track

7

0

1516

Page 48: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 48

7

0

151

6

( F ) Extend to Next Column

7

N

Page 49: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 49

Comments on Greedy Router (Rivest&Fiduccia 1982)

❁ Always succeed (even if cyclic conflict is present);

❁ Allows unrestricted dogleg;

❁ Allows a net to occupy more than 1 track at a given column;

❁ May use a few columns off the edge;

1 3 1 2 1 5

2 1 3 3 4 5 4 4

A column off the edge

Unrestricted dogleg

Net 1 occupies two tracks at this

column; it also “ wraps-around

Page 50: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 50

Parameters to Greedy Router

❁ Initial-channel-width icw

❁ Minimum-jog-length mjl

❁ Steady-net-constant snc

❁ Usually start icw as d. the density

❁ Mjl controls the number of vias, use a large mjl for fewer vias

❁ Snc also controls # of vias, typical value=10

Page 51: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 51

Experimental Results

❁ Runs very fast

❁ 20-track solution to the Deutsch’s Difficult Example

Page 52: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 52

❁ Channel Routing

❁ Maze Routing and Its Variations

❁ Hierarchical Routing

Page 53: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 53

Maze RoutingBasic idea -- wave propagation method(Lee, 1961)

❁ Breadth-first search❁ backtracking after finding

the shortest path❁ guarantee to find the

shortest path

4 3 2 3 4 5 6 7 8 9 10 11

3 2 1 2 3 4 5 6 7 8 9 10

2 1 A 1 5 6 7 8 3 2 1 2 6 7 8 9 10 11 12

4 3 2 3 12 13

5 4 3 2 14 B 13 14

6 5 13 14 14

7 6 7 11 12 13 14

8 7 8 9 10 11 12 13 14

9 8 9 10 11 12 13 14

Page 54: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 54

❁ Connect one terminal at a time❁ Use the entire connected paths as

source to expand.❁ Improve the quality of the solution

(remove a segment and re-connect)

4

AD

C

B

E

AD

C

B

E

12

3

Page 55: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 55

Problems with Maze Routing❁ Slow: for each net, we have to search a N××××N grid.Improvements

❁ Simple speed-up❁ Line search (Mikami & Tabuchi, 1968;

Hightower, 1969)❁ Minimum detour algorithm ( Hadlock, 1977)❁ Fast maze algorithm (Soukup, 1978)

❁ Net ordering: we have to route net by net, but it is difficult to determine the best net ordering!

Improvement ❁ Use other routers

channel/switchbox routershierarchical routers

❁ Rip-up and re-route

Page 56: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 56

x

Simple Speed-up of Maze RoutersAkers, S.B. “ A modification of Lee’s path connection algorithm”, IEEE Trans. On Electronic Computers 1967

starting point selection

xy

xy

xy y

double fan-out Framing

Page 57: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 57

Line Searching AlgorithmsMikami&Tabuchi IFIPS Proc, Vol H47, pp 1475-1478, 1968Hightower, IFIP Proc. 6th Design Automation Conf. pp 1-24, 1969

Mikami+Tabuchi’s algorithm❁ Generate search lines from both the source and the

target (level-0 lines)❁ From every point on the level-i search lines, generate

perpendicular level-(i+1) search lines❁ Stop until a search line from the source meet a search

line from the target❁ Guarantee to find the shortest path

Page 58: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 58

Difference: generate level-(i+1) searchlines which are extendable beyondthe obstacle.

Faster, but not guarantee a connection

Page 59: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 59

Minimum Detour AlgorithmHadlock, F.O. “A shortest path algorithm for grid graphs” Networks, vol 7, 1977

Let P be a path connecting A and Bdist(A,B)=Manhattan distance between A and Bdetour(p): # points away from the targest (detour number)

Then length(p): dist(A, B)+2x detour(p)

Page 60: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 60

x x xooA

B

obstacle

Detour point

Minimum Detour Algorithm(cont’d)

Algorithmeach cell stores the detour number so far from the source expand the cell with the least detour number

Result❁ guarantee to find a shortest path❁ expand fewer points in general(similar to the A* search algorithm)

Page 61: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 61

Soukup’s Fast Maze AlgorithmSoukup, J.m “Fast maze router” , Proc 15th Design Automation

Conf. pp 100-102, 178

Basic Idea:

❁ Combination of breadth-first search and depth-first search

❁ Extend a line from the source to target

❁ When search lines are blocked, use wave propagation algorithm to search around the obstacle

❁ Once a cell approaching the target is found, extend a search line to the target (see example)

❁ Fast (10-15 times faster than Lee’s algorithm).

❁ Guarantee to find a path, but may not be the shortest one.

Page 62: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 62

Cells Searched Before Target is Reached

(a) original Lee algorithm

(b) minimum detour algorithm

(c) fast maze algorithm

Page 63: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 63

Hierarchical Wire Routing

Burstein, M. & R. Pelavin, “ Hierarchical Channel Router” Integration, the VLSI journal , pp 21-28, 1983

Burstein, M. & R. Pelavin, “Hierarchical Wire Routing”, IEEE Trans. CAD pp223-234 1983

❁ Top-down refinement

❁ Can be used for both global routing and detailed routing

Page 64: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 64

The Basic ApproachUse 2x2 routing

Use 2xN routing

Page 65: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 65

2x2 Routing❁ Given capacity constraints

❁ Via constraints (if detailed routing)

❁ Each net is one of the following 11 types

❁ Determine routing for all the nets

h1

h2

v1 v2

Page 66: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 66

Types of 2-terminal nets

TYPE 1 TYPE 2 TYPE 3 TYPE 6TYPE 5TYPE 4

TYPE11

Types of 3-terminal nets

TYPE 7 TYPE 8 TYPE 9 TYPE 10

4

3=4

4

2=6

1Types of 4-terminal nets

2x2 Routing(cont’d)

solution method: integer Linear programming

Page 67: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 67

Routing Configuration of Each Type of Nets

x(1,1), x(1,2)

x(2,1), x(2,2)

Page 68: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 68

Routing Configuration of Each Type of Nets(Cont’d)

X(7,1), x(7,2), x(7,3)

x(11,1), x(11,2), x(11,3), x(11,4)

Page 69: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Integer Linear Programming for 2x2 Routingk(i): # nets of type i. 1≤≤≤≤ i≤≤≤≤ 11h1,h2,v1,v2: capacity constraints.x(i): # unconnected nets of type i: 1≤≤≤≤ i ≤≤≤≤11x(i,j): # nets of type i connected using the j-th possibility

∈∈∈∈

∈∈∈∈

∈∈∈∈

∈∈∈∈

====

≤≤≤≤

≤≤≤≤

≤≤≤≤

≤≤≤≤

≤≤≤≤≤≤≤≤====++++≥≥≥≥

≥≥≥≥

2

1

2

1

),(2

),(1

),(2

),(1

11

1

),(

),(

),(

),(

111)(),()(0),(

0)(

)(min

hji

hji

vji

vji

j

r

hjix

hjix

vjix

vjix

iikjixixjix

ix

ix

Page 70: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 70

Integer Linear Programming for 2x2 Routing(Cont’d)

V1={(i,j)| P(i,j) crosses left horizontal boundary}

={(1,1), (2, 2), (3, 2), (4, 2), (5, 2), (6, 1), (7, 2), (7, 3), (8, 1), (8, 3), (9, 2), (9, 3), (10, 2), (10, 3), (11, 1), (11,3), (11, 4)}

V2, H1, H2 defined similarly

Page 71: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 71

ILP Approach for 2x2 Routing (Cont’d)

❁ 39 variables

❁ 15 linear equation

11 x(i)

28 x(i,j)= k(i) 11

≤≤≤≤ h1, h2, v1, v2 4

(19 equations, if we consider via constraints since we have 4 more equations for each super cell)

❁ Can be solved efficiently

❁ Map a net to a routing configuration using heuristic ( we only know the number of nets for each configuration)

Page 72: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 72

2xN Routing by 2x2 RoutingInitial terminal cells of a net

Our net is the factorized (2x2) problem

Route taken by the net in the (2x2) wiring

Reduction by he net in the (2x2) wiring

Factorized (2x2) subproblem for these (2x4) problem

Page 73: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 73

2xN Routing by 2x2 Routing(Cont’d)

Routes taken by the pieces of the net at this level

Each of the (2x4) problems reduced to (2x2)

Routes chosen

Resulting routing in the original (2x8) problem

Page 74: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 74

2xN Routing❁ 2xN routing can be computed by a series of 2x2 routing

❁ 2xN routing can be computed using dynamic programming approach

For 2xN grid, We can compute a minimum Steiner tree efficiently

Aho, Garey, Huang: “Rectilinear Steiner trees: efficient special case algorithms”, Networks, vol. 7, 1977

T1

T3

T2

T4

Page 75: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 75

Results of Hierarchical Routing#circuit Array size Overflow count Wire length

HGWMaze Runner

100 10x13 15

618656

HGWMaze Runner

150 11x16 511

824890

HGWMaze Runner

200 13x17 04

11241196

HGWMaze Runner

250 15x20 1123

13561396

HGWMaze Runner

300 17x22 24

19562188

HGWMaze Runner

350 18x24 314

22452378

Page 76: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 76

Burstein’s Difficult Example

Page 77: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 77

19-Track Solution of Deutsch’s Difficulty Example

Page 78: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 78

19-Track Solution of Deutsch’s Difficulty Example(Cont’d)

Page 79: Jason Cong 1 - University of California, Los Angelescadlab.cs.ucla.edu/~cong/CS258F/chap7_new.pdf · Jason Cong 7 Left-Edge Algorithm for Interval Packing Repeat create a new track

Jason Cong 79

Channel vs Switchbox

❁ Channel may have exits at left and right sides, but exit positions are not fixed

❁ We may map exits to either lower or upper edge of a channel

❁ One dimensional problem

❁ Terminal positions on all four sides of a switchbox are fixed

❁ Two dimensional problem

Switchbox routing is more difficult!

1

1 1 3 2 4 4

4

43 322

3

3

3

1

1

1

2

22