Lecture18 GR
Lecture18 GR
Minsik Cho
[email protected]
10/22/08 1
Global Routing Approaches
2
Sequential Approach
Algorithm:
1. Graph modeling of the routing regions
2. For each net k:
We can use different
2.1 Find a route r for net k on the graph.
methods to do this.
2.2 For each edge e in r:
2.2.1 capacity(e) = capacity(e) - 1
2.2.2 if capacity(e) < 0 then cost(e) = α × cost(e)
3
Maze Routing for Multi-Terminal Nets
4
Maze Routing on Weighted Graph
5
Example of Weighted Graph
6
Mikami & Tabuchi’s Algorithm
7
Line Probing
• Keep two lists of line segments, slist and tlist, for the
source and the target respectively.
• If a line segment from slist intersects with one from tlist, a
route is found; else, new line segments are generated
from the escape points.
S
Intersection
slist T
tlist 8
Line Probing
• We can use all the grid vertices on the line segments as
escape points:
1 0 1
1
1 Escape point
S
0 Iteration number
1 1
T 0
1
1 1
1 1
1 0 1
• Always find a path but may not be optimal.
9
Hightower’s Algorithm
10
Line Probing
• We can pick just one escape point from each line
segment.
0 1
0 S
Iteration number
T 0
1 Escape point
1 0
• May fail to find a path even if one exists.
11
12
Comparison of Algorithms
13
BFS based Maze Routing (A*)
• Need to search whole space?
– Guide the search to the goal explicitly
• A* search is faster if you need “good path”, not “perfect
path”
– Use priority queue
– C(n) = F(n)+H(n)
• F(n) is a computed cost from source to current location.
• H(n) is a predicted cost from current location to target.
• If H(n)=0, it becomes maze routing!
– Optimal (shortest path) when H(n) <= H’(n) (no overestimation)
• H’(n) is the exact cost
• H(n)=0 never overestimates!
14
Maze vs A* routing (I)
15
Maze vs A* routing (II)
16
Shortest Path Based Algorithms
• For 2-terminal nets only.
• Use Dijkstra’s algorithm to find the shortest path
between the source s and the sink t of a net.
• Different from Maze Routing:
– The graph need not be a rectangular grid.
– The edges need not be of unit length.
17
Dijkstra’s Shortest Path Algorithm
• Initially,
– P = Empty Set.
– Label of S = 0, Label of all other vertices = infinity.
• While (T is not in P) do
– Pick the vertex v with the min. label among all vertices not in P.
– Add v to P.
– Update the label for all neighbours of v.
18
Dijkstra’s Algorithm: Example
P (Permanently Labeled) Min. Label Vertex
B 1 T B 1 T B 1 T
10 8 14
8
8
10 10 10
2 3 94 6 2 3 94 6 2 3 94 6
0 0 0
S 5 7 S 5 7 S 5 7
5 2 5 2 7
8
8
2
A C A C A C
B 1 T B 1 T B 1 T
10
8 9 10
8 9 10
8 13
2 3 94 6 2 3 94 6 2 3 94 6
0 0 0
S 5 7 S 5 7 S 5 7
5 2 7 5 2 7 5 2 7
A C A C A C
19
Steiner Tree Based Algorithms
• For multi-terminal nets.
• Find Steiner tree instead of shortest path.
• Construct a Steiner tree from the minimum spanning
trees (MST)
20
Net Ordering
• In sequential approach, we need some net ordering.
• A bad net ordering will increase the total wire length,
and may even prevent com-pletion of routing for some
circuits which are indeed routable.
A B A B
B B
B first A A first
A (Good order) (Bad order)
21
Criteria for Net Ordering
A
B Which one should be routed first
B and why? (Note that this rule of
A thumb is not always applicable.)
B is in A’s BR
22
Net Ordering (cont’d)
23
Rip-Up and Re-route
• It is impossible to get the optimal net ordering.
• If some nets are failed to be routed, the rip-up and re-
route technique can be applied:
A A A A A A
B B B B B B
C C C C C C
24
Concurrent Approach
• Consider all the nets simultaneously.
• Formulate as an integer program.
• Given:
: :
: :
net n Tn1, Tn2, ... , Tnkn
25
Integer Program Formulation
n ki
Min. ∑∑ L × x
i =1 j =1
ij ij
∑
ki
s.t. j =1
xij
= 1 for all i = 1, , n
∑ i , j s.t. e∈Tij
xij ≤ Ce for all edge e
xij = 0 or 1 ∀i, j
26
Concurrent Approach: Example
b Possible trees:
1 1 1,2 1,3
2 3 net 1: 2 3 3
3 1 a d
2 2 2,3 1,2 net 2: 2 3 3
c
Ca= Cb= Cc= Cd= 2 net 3: 2 2
Solution Min. 2 x11 + 3 x12 + 3 x13 + 2 x21 + 3 x22 + 3 x23 + 2 x31 + 2 x32
28
Hierarchical Approach to Speed Up Integer
Programming Formulation
For Global Routing
10/22/08 29
Hierarchical Approach
• Large Integer Programs are difficult to solve.
• Hierarchical Approach reduces global routing to routing
problems on a 2x2 grid.
• Decompose recursively in a top-down fashion.
• Those 2x2 routing problems can be solved optimally by
integer programming formulation.
30
Hierachical Approach: Example
• Solving a 2xn routing problem hierarchically.
Level 1
Level 2
Level 3
Solution:
31
Types of 2x2 Routing Problems
Type 1 Type 7
Type 2 Type 8
Type 3 Type 9
Type 4 Type 10
Type 5 Type 11
Type 6
32
Objective Function of 2x2 Routing
Possible Routing Trees:
T11, T12, T21, T22,....., T11,1,..., T11,4
# of nets of each type: n1, ..., n11
Determine xij: # of type-i nets using Tij for routing.
yi: # of type-i nets that fails to route.
yi + ∑ j xij = ni i = 1, ,11
Want to minimize ∑i =1 yi .
11
33
Constraints of 2x2 Routing
Constraints on Edge Capacity:
Cb
Bab Bbc ∑i, j s.t. a∈T ij
xij ≤ Ca
Ca a
b
c Cc
∑i, j s.t. b∈T ij
xij ≤ Cb
d ∑i, j s.t. c∈T ij
xij ≤ Cc
Bda
Cd
Bcd
∑i, j s.t. d∈T ij
xij ≤ Cd
Want to minimize ∑i =1 yi .
11
Type 11
35
ILP Formulation of 2x2 Routing
Min. ∑i =1 yi
11
36