Techniquecore
Pattern routing
Also called L-shaped and Z-shaped routing.
Routes each two-pin connection only by L-shaped or Z-shaped patterns with one or two bends, which is fast and leaves maze routing for hard nets.
Pattern routing is a technique of global routing that routes each two-pin connection by one of a few fixed shapes: an L with one bend or a Z with two bends, inside the bounding box of the two pins. A connection whose pins differ by columns and rows, both at least 1, has exactly such routes, against shortest routes in all. The router picks the cheapest pattern under the current congestion costs. It is much faster than maze routing, and the routes are short and have few bends. Connections for which no pattern is good are left to a maze router in a later rip-up and reroute step.
In plain words
A wire from one corner of a box to the opposite corner can go many ways. Most of them zigzag. Pattern routing tries only the simple ones: go along one side and then up the other side, which is an L, or go part of the way, turn, cross, and turn back, which is a Z.
There are only a few such shapes, so the router can try them all and take the one that passes through the least crowded places. Each shape is as short as any route between the two points, and it has at most two turns, so it needs few vias.
The price is that the router does not look at other shapes. If every simple shape passes through a crowded spot, the router must try again with a slower search that can follow any path.
When it applies
- The routing graph is a grid, and each net is split into two-pin connections, for example along a rectilinear minimum spanning tree or a Steiner tree from FLUTE.
- A short route with few bends is wanted. A pattern always has the least length , so it adds no wirelength over the half-perimeter wirelength of the connection.
- Speed is more important than the quality of each single route: the first routing of a full netlist, a congestion estimate during placement, or a router that must run on millions of connections.
- The congestion is moderate. On a very crowded grid, the best pattern often crosses a full edge, and the router must fall back to a search over all paths.
The template
Let a connection go from to , with and . Each grid edge has a cost that grows with its usage, for example a large penalty when the edge is full.
- Build the candidate set.
- If or , the only pattern is the straight segment.
- Else the two L-shapes: horizontal then vertical, through the corner , and vertical then horizontal, through .
- The Z-shapes with a vertical middle segment: horizontal from to column , vertical to row , horizontal to , for each column strictly between and . There are of them.
- The Z-shapes with a horizontal middle segment, for each row strictly between and . There are of them.
- Price each candidate. Its cost is the sum of the edge costs along its 2 or 3 straight segments, plus a cost per bend if bends or vias count.
- Commit the cheapest candidate: add 1 to the usage of each edge on it, and update the costs.
- Hand the rest on. Mark connections whose chosen pattern crosses a full edge. A later step rips them up and routes them by maze search.
Why there are patterns. A shortest route is a sequence of horizontal and vertical steps. A route with one bend has all horizontal steps before all vertical steps or the other way round: 2 routes. A route with exactly two bends is with , or with : routes. The total is .
Cost of the evaluation. Keep a prefix sum of the edge costs along each row and each column. A straight segment then costs to price, so all patterns are priced in time. A maze search with Dijkstra's algorithm inside the bounding box looks at up to gcells and takes time.
Classic examples
A Z-shape beats both L-shapes. Take a grid of 4 columns and 3 rows, with and , so and . A free edge costs 1 and a full edge costs 4. The full edges are on the bottom row and on the top row. There are patterns, each with 5 edges.
| pattern | gcells | cost |
|---|---|---|
| L, horizontal first | (0,0) (1,0) (2,0) (3,0) (3,1) (3,2) | 8 |
| L, vertical first | (0,0) (0,1) (0,2) (1,2) (2,2) (3,2) | 8 |
| Z, middle column 1 | (0,0) (1,0) (1,1) (1,2) (2,2) (3,2) | 8 |
| Z, middle column 2 | (0,0) (1,0) (2,0) (2,1) (2,2) (3,2) | 8 |
| Z, middle row 1 | (0,0) (0,1) (1,1) (2,1) (3,1) (3,2) | 5 |
The Z-shape through the middle row avoids both full edges and wins with cost 5.
All patterns fail, a staircase succeeds. Make the edge full as well. Now the last Z-shape also costs 8, so every pattern crosses a full edge. But the route , , , , , has cost 5 and no full edge. It is a shortest route with 4 bends, one of the shortest routes, and a maze search finds it. This connection is the kind that pattern routing leaves to the next stage.
Straight connections. If and lie in the same row, the straight segment is the only pattern. When one of its edges is full, any legal route must leave the row, and it is longer than .
Variations
- L-shapes only. The fastest form, with 2 candidates per connection. The experiments of Kastner, Bozorgzadeh and Sarrafzadeh use L-shapes.
- U-shapes. Routes with two bends that leave the bounding box on one side and come back. They are longer than , but they can go around a crowded box.
- Monotone routing. Allow every shortest route, not only those with two bends. A dynamic program over the gcells of the bounding box finds the cheapest one in time, since each gcell is reached from its left or its lower neighbor (for and ).
- Patterns with layers. In a three-dimensional grid, each straight segment is put on one layer of the right direction and each bend becomes a via. A small dynamic program over the segments chooses the layers, which joins pattern routing with layer assignment.
- Patterns inside other routers. A router can use patterns for the first routing and then negotiated congestion routing or rip-up and reroute with maze search for the connections that still overflow.
Pitfalls
- Counting a net twice on one edge. When a multi-pin net is split into two-pin connections, two connections of the same net can share an edge. The usage of that edge goes up by 1 for the net, not by 2.
- Order of the connections. Each committed pattern changes the costs for the next connections. The result depends on the order, as in every sequential router. Routers often route short or critical connections first.
- The bounding box is a hard limit. A pattern never leaves the bounding box. If a cut across the box is full, no pattern is legal, and only a detour can help.
- Bends cost vias. In a grid with one direction per layer, each bend is at least one via. A Z-shape has two bends, so its cost must include them when vias matter.
- Mixing up the pattern count. The number of Z-shapes is , not . The extreme columns and give the L-shapes, so they are not counted twice.
- Claims of quality. Pattern routing gives no bound on the overflow of the whole routing. Its quality is measured on benchmarks, and a router that uses it needs a stronger stage after it.
Exercises
- Prove that a connection with has shortest routes, of which exactly have at most two bends. For , compute both numbers (answer: 70 and 8).
- Show how to price all patterns in time with prefix sums. How much time does an update of the prefix sums take after a route is committed?
- Give the dynamic program for the cheapest monotone route in a bounding box, and prove that it runs in time.
- Build a grid and a connection for which every pattern crosses a full edge, every shortest route crosses a full edge, and a longer route has no full edge.
- Two connections of one net share a segment. Show that a router that counts the usage of each connection on its own can report overflow where there is none.
References
- Ryan Kastner, Elaheh Bozorgzadeh and Majid Sarrafzadeh, Pattern routing, use and theory for increasing predictability and avoiding coupling, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 21(7), 777 to 790, 2002, the definition of L-shaped and Z-shaped patterns for two-pin connections and the experiments that route with L-shapes (general locator)
- Ryan Kastner, Elaheh Bozorgzadeh and Majid Sarrafzadeh, Predictable routing, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design (ICCAD), 110 to 114, 2000, the conference version of pattern routing (general locator)
- Andrew B. Kahng, Jens Lienig, Igor L. Markov and Jin Hu, VLSI Physical Design, From Graph Partitioning to Timing Closure, second edition, Springer, 2022, Chapter 5, Global Routing (single-net routing and modern global routing; general locator)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag D2CZPG Edit this page History Report an error Markdown