Está en la página 1de 18

Maze Router: Lee Algorithm

Lee, An algorithm for path connection and its application, IRE Trans. Electronic Computer, EC-10, 1961. Discussion mainly on single-layer routing Strengths Guarantee to nd connection between 2 terminals if it exists. Guarantee minimum path. Weaknesses Requires large memory for dense layout Slow

Applications: global routing, detailed routing

w w

. w

u t jn

r o w

. ld

m o c

Lee Algorithm
Find a path from S to T by wave propagation.

8 8 7 6 8

w w

8 7 6 5 6 7 8

T 7 6 5 4 5 6 7 8

7 6 5 4 3 4 5 6 7 8

8 7 6 5 4 3 2 3 4 5 6 7 8

n j .

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

8 7 6 5 4 3 2 1 s 1

8 7 6 5 4 3

8 7 6 5 4

w tu

8 7 6 5 6

8 7 8 6 7 8 7 8 8

or

. ld

m o c

8 8 7 6

8 7 6 5 6 7 8

T 7 6 5 4 5 6 7 8

7 8

7 6 5 4 3 4 5 6 7 8

8 7 6 5 4 3 2 3 4 5 6 7 8

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

8 7 6 5 4 3 2 1 s 1

8 7 6 5 4 3

8 7 6 5 4

8 7 6 5 6

8 7 8 6 7 8 7 8 8

5 7 8

Filing

Retrace

Time & space complexity for an M N grid: O(M N ) (huge!)

Reducing Memory Requirement


Akerss Observations (1967)
Adjacent labels for k are either k 1 or k + 1. Want a labeling scheme such that each label has its preceding label dierent from its succeeding label.

Way 1: coding sequence 1, 2, 3, 1, 2, 3, . . .; states: 1, 2, 3, empty, blocked (3 bits required) Way 2: coding sequence 1, 1, 2, 2, 1, 1, 2, 2, . . .; states: 1, 2, empty, blocked (need only 2 bits)

w w

2 2 1 3 2

2 1 3 2 3 1 2

T 1 3 2 1 2 3 1 2

j . w

1 3 2 1 3 1 2 3 1 2

2 1 3 2 1 3 2 3 1 2 3 1 2

2 1 3 2 1 3 2 1 2 3 1 2 2 3 1 1 2 2

2 1 3 2 1 3 2 1 s 1

2 1 3 2 1 3

2 1 3 2 1

u t n

r o w

. ld

m o c

2 1 2 3 1 2 2 3 1 2 2 2

2 2 2 1

2 2 1 1 1 2 2

T 2 1 1 2 1 1 2 2

2 1 1 2 2 2 1 1 2 2

2 2 1 1 2 2 1 2 2 1 1 2 2

2 2 1 1 2 2 1 1 1 2 2 1 1 2 2

2 2 1 1 2 2 1 1 s 1

2 2 1 1 2 2

2 2 1 1 2

2 2 1 1 1

2 2 2 1 2 2 2 2 2

2 2 2

Sequence: 1, 2, 3, 1, 2, 3, ...

Sequence: 1, 1, 2, 2, 1, 1, 2, 2, ...
3

Reducing Running Time


Starting point selection: Choose the point farthest from the center of the grid as the starting point. Double fan-out: Propagate waves from both the source and the target cells. Framing: Search inside a rectangle area 1020% larger than the bounding box containing the source and target. Need to enlarge the rectangle and redo if the search fails.
starting point selection
S T

w w
T

. w

u t jn
S

r o w

. ld
S

m o c

double fanout
T

framing
S T

Connecting Multi-Terminal Nets


Step 1: Propagate wave from the source s to the closet target. Step 2: Mark ALL cells on the path as s.

Step 3: Propagate wave from ALL s cells to the other cells. Step 4: Continue until all cells are reached.
D D

Step 5: Apply heuristics to further reduce the tree cost.

C B

w w
s

s s s

. w
C B

u t jn
E

r o w
C B A

. ld
D E

m o c
B

E A

Routing on a Weighted Grid


Motivation: nding more desirable paths weight(grid cell) = # of unblocked grid cell segments 1
x y z T S
more desirable path
occupied grid cell

w w

j . w

u t n
shortest path

r o w
blocked grid segments

. ld
2 2 2 1 1 2 1 3 3

m o c
2 2

weights

T 2

2 3 2 2 2 2 2 2 1 3 3 3 3 3 2 S 2 2 3 3 3 3 2 3 3 3 3 3 3 3 3 2 2 2

A Routing Example on a Weighted Grid


2 2 2 1 1 2 1 3 3 T 2 3 2 2 2 2 2 2 1 3 3 3 3 3 2 S 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2

initialize cell weights


15 13 11 9 6 5 3 1 4 5 2 S 2 8 5 2 5 11 8 5 8

wave propagation

12 11 9 7 15 14 11 8 15 16 14 11 19 17 14

first wave reaches the target

w w

j . w

u t n

r o w

3 1 4 5 2 S 2 5 2 5 5

. ld

m o c
12

11 9 7 5 15 14 11 8 5 T 16 14 11 8 17 14 11

13 11 9 6 3 1 4 2 S 2 5 2 5 8 5 8

12 11 9 13 14 11 15 16 14 16 15 17 19 17

17 15 13 11 9 6 7 5 3 1 4 8 5 2 S 2 11 8 5 2 5 14 11 8 5 8

13 15 19 16 13 19 17

19 17 15 13 11 9 6 11 9 7 5 3 1 4 14 11 8 5 2 S 2 16 14 11 8 5 2 5 19 17 14 11 8 5 8

finding other paths

mincost path found

Hadlocks Algorithm
Hadlock, A shortest path algorithm for grid graphs, Networks, 1977. Uses detour number (instead of labeling wavefront in Lees router) Detour number, d(P ): # of grid cells directed away from its target on path P . M D(S, T ): the Manhattan distance between S and T . Path length of P , l(P ): l(P ) = M D(S, T ) + 2d(P ). M D(S, T ) xed! Minimize d(P ) to nd the shortest path. For any cell labeled i, label its adjacent unblocked cells away from T i + 1; label i otherwise. Time and space complexities: O(M N ), but substantially reduces the # of searched cells. Finds the shortest path between S and T .

w w

. w

u t jn

r o w

. ld

m o c

Hadlocks Algorithm (contd)


d(P ): # of grid cells directed away from its target on path P . M D(S, T ): the Manhattan distance between S and T . Path length of P , l(P ): l(P ) = M D(S, T ) + 2d(P ). M D(S, T ) xed! Minimize d(P ) to nd the shortest path. For any cell labeled i, label its adjacent unblocked cells away from T i + 1; label i otherwise.

w w

. w

u t jn
3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 3

3 2 1 1 1 1 1 1 1 S 0 0 2 1 1 1 3 2 2 2 3 3 3

3 2 1 1 1 1 1

3 3 3 3 2 3 3 3 T 1 1 1 1 1

r o w

. ld

m o c

Soukups Algorithm
Soukup, Fast maze router, DAC-78. Combined breadth-rst and depth-rst search.

Depth-rst (line) search is rst directed toward target T until an obstacle or T is reached. Breadth-rst (Lee-type) search is used to bubble around an obstacle if an obstacle is reached.

Time and space complexities: O(M N ), but 1050 times faster than Lees algorithm. Find a path between S and T , but may not be the shortest!

w w

. w

u t jn
S

r o w
T

. ld

m o c

10

Features of Line-Search Algorithms


works on line segment

lines generated by "escape" points

source

every point is an escape point

one escape point per line segment

MikamiTabuchi

Time and space complexities: O(L), where L is the # of line segments generated.

w w

j . w

Hightower

u t n

r o w

generate lines

set A

. ld

m o c
target set B

generate lines

some line from A intersect

some line from B

path is found

11

Mikami-Tabuchis Algorithm
Mikami & Tabuchi, A computer program for optimal routing of printed circuit connectors, IFIP, H47, 1968. Every grid point is an escape point.
1 1 11 0 1 1 1 1 0 1 1 1 1 1 1 2 2 2 2

w w

. w

u t jn

r o w

. ld

m o c
Base point

Trial lines from source Trial lines from target

Point of intersection 1

1 1 1 0 1 1

12

Hightowers Algorithm
Hightower, A solution to line-routing problem on the continuous plane, DAC-69. A single escape point on each line segment.

If a line parallels to the blocked cells, the escape point is placed just past the endpoint of the segment.
0 1 d 0 y

w w

. w
x 0

u t jn
z P

r o w
v T r w a 0

. ld
2

m o c
1

b 2

13

Comparison of Algorithms
Lee O (M N ) O (M N ) yes yes grid Maze routing Soukup Hadlock O (M N ) O (M N ) O (M N ) O (M N ) yes yes no yes grid grid

Time Space Finds path if one exists? Is the path shortest? Works on grids or lines?

Soukup, Mikami, and Hightower all adopt some sort of line-search operations cannot guarantee shortest paths.

w w

. w

u t jn

r o w

. ld

m o c

Line search Mikami Hightower O(L) O(L) O(L) O(L) yes no no no line line

14

Multi-layer Routing
3-D grid:
T 4 4 3 4 4 3 2 3 4 3 2 1 2 3 4 2 1 S 1 2 3 4

Two planner arrays:

Neglect the weight for inter-layer connection through via. Pins are accessible from both layers.

w w

3 2 3 4 5 6 7

2 1 2 3 4 5 6

1 S 1 2 3 4 5

2 1 2 3 4 5 6

3 2 3 4 5 6 7

. w
4 3 4 5 6 7 8

1 3 S 2 3 4 3 2 5 4 3

u t jn
2 3 4 1 2 3 3 4 5 4 5 6

r o w
S

. ld

m o c
Layer1 Layer2 Via or cut

9 8 7 8 9 T

7 6 5 6 7 8 8 7 6 7 8 9 9 8 7 8 9 T

1st layer

2nd layer

a path
15

Net Ordering
Net ordering greatly aects routing solutions. In the example, we should route net b before net a.
a
b
b
a

w w
a
b

j . w
b

u t n
a

route net a before net b

r o w
a

. ld
a

m o c
b
a

b
b

a
16

route net b before net a

Net Ordering (contd)


Order the nets in the ascending order of the # of pins within their bounding boxes. Order the nets in the ascending (or descending??) order of their lengths. Order the nets based on their timing criticality.
c b d b

A mutually intervening case:


a

w w

routing ordering: a (0) > b (1) > d (2) > c (6)


a b a a b a a b

j . w
d

u t n
b

r o w
a d c

. ld

m o c
c d a

a prevents routing of b

b prevents routing of a

a feasible routing

17

Rip-Up and Re-routing


Rip-up and re-routing is required if a global or detailed router fails in routing all nets. Approaches: the manual approach? the automatic procedure? Two steps in rip-up and re-routing

1. Identify bottleneck regions, rip o some already routed nets. 2. Route the blocked connections, and re-route the ripped-up connections. Repeat the above steps until all connections are routed or a time limit is exceeded.

w w

. w

u t jn

r o w

. ld

m o c

18

También podría gustarte