Problemadvanced
Switchbox routing
Also called switch box routing.
Route nets in a rectangle with pins fixed on all four sides, which unlike a channel cannot grow, so a router may fail.
Switchbox routing is a form of detailed routing inside a rectangle whose four sides all carry fixed pins. The rectangle has a fixed number of columns and rows of tracks, and the router must connect the pins of every net inside it, with wires on two or more layers and vias between them. A switchbox appears where two channels meet, or where the cells around a region fix the pins on every side. In a channel, with pins on two sides only, the router can always add tracks until all nets fit. A switchbox cannot grow: its width and its height are fixed, so the question is whether a routing exists at all. That question is NP-complete. Switchbox routers are heuristics, and they are compared on a small set of benchmark switchboxes.
In plain words
Think of a small square room with doors on all four walls. Each door has a color, and doors of the same color must be joined by a rope laid on the floor. Ropes of different colors may not touch, but there are two floors: on the lower floor ropes run only east to west, and on the upper floor only north to south. A rope can go up or down through a hole in the floor.
In a long corridor with doors on two walls only, you can always make the corridor wider until the ropes fit. The room cannot be made larger, because the walls of the room are fixed by the rooms around it. So it can happen that no way to lay the ropes exists, even though no wall looks too crowded.
Definition
Input.
- A box of columns and rows. The grid points are with and .
- Two layers in the reserved-layer model: on layer H, wires join and ; on layer V, wires join and . A via joins the two layers at one grid point.
- Pins on the four sides. A top pin at column enters at on layer V, and a bottom pin at on layer V. A left pin at row enters at on layer H, and a right pin at on layer H. Each pin has a net label, or is empty.
Feasible solution. For each net, a connected set of grid points on the two layers, joined by wire edges and vias, that holds the entry point of each of its pins. No grid point on one layer belongs to two nets.
Objective. The decision version asks whether a feasible routing exists. The optimization version minimizes the total number of wire edges, and then the number of vias. The values and are part of the input and may not change.
Variants
- Unreserved layers. Each layer can hold wires in both directions. This allows more routings, and a net can turn without a via.
- More than two layers. The box has layers with alternating directions, as in a gcell of a modern router.
- Obstacles and pins inside the box. Some grid points are blocked, or some pins lie inside the box, as in the router of Hamachi and Ousterhout.
- Gridless switchboxes. Wires may have different widths and lie at any position that meets the spacing rules.
- Channels. A switchbox with no pins on its left and right sides and with free to grow is a channel.
Examples
One point. Take . There is one grid point and four pins: top T, bottom B, left L and right R.
- If T and B belong to net 1 and L and R to net 2, net 1 uses layer V and net 2 uses layer H at the point. The routing is feasible with no vias.
- If T and L belong to net 1 and B and R to net 2, then net 1 needs both layers at the point, because its pins enter on V and on H. Net 2 also needs both layers there. So no routing exists.
Two nets that swap rows. Take and any width . Net A has a left pin on row 0 and a right pin on row 1. Net B has a left pin on row 1 and a right pin on row 0. There are no top or bottom pins.
- Cuts. Each vertical cut between two columns is crossed by both nets and has horizontal tracks. The horizontal cut between the rows is crossed by both nets and has vertical tracks. So no cut is too crowded.
- No routing exists. A wire on layer H stays in its row, and the only way to change rows is a vertical edge on layer V in some column. With two rows, net A must use row 0 from column 0 to some column , a vertical edge in column , and row 1 from column to column . In the same way, net B uses row 1 from column 0 to some column , and row 0 from column to column . On row 1, the parts of A and of B are disjoint, so . On row 0, the parts of A and of B are disjoint, so . Both cannot hold.
- A larger box. With , the left and right pins still on rows 0 and 1 and row 2 free, a routing exists. A runs on row 0 from column 0 to column 1, up column 1 to row 1, and on row 1 to column 2. B goes up column 0 from row 1 to row 2, along row 2 to column 2, and down column 2 to row 0. This uses 8 wire edges and 6 vias, and an exhaustive search finds no routing with fewer wire edges. With and , the search finds no routing.
The second example shows that the cut conditions are necessary but not sufficient. A channel router facing the same conflict adds a track. A switchbox router cannot, so it fails.
Known algorithms
| Method | Idea | What is known |
|---|---|---|
| Exhaustive search, or integer programming and SAT formulations | try all routings, or encode them as constraints | exact; exponential worst-case time; used only for small boxes |
| Greedy switchbox router (Luk 1985) | extend the greedy channel router to pins on four sides | heuristic; measured on benchmark switchboxes |
| BEAVER (Cohoon and Heck 1988) | apply several simple routers in turn, then a maze router for the rest | heuristic; measured on benchmark switchboxes |
| Maze routing with rip-up and reroute | route the nets one at a time, then remove and reroute the nets that block others | heuristic; may fail on a routable box |
What is proved: the decision problem is NP-complete, and the cut conditions below are necessary. What is only measured: every practical switchbox router. Their papers report which benchmark switchboxes they complete and with how many vias and how much wire.
Bounds
Hardness. A channel with a given number of tracks and no pins on its ends is a switchbox with and no left or right pins. Deciding whether a channel can be routed in tracks is NP-complete in the two-layer reserved model with doglegs (Szymanski, 1985), and the switchbox model above allows doglegs, since a net may use any connected set of points. So the switchbox decision problem is NP-complete. See channel routing NP-completeness.
Cut conditions. Cut the box by a vertical line between two columns. Every net with pins on both sides of the line must cross it, and in the reserved model each crossing uses a horizontal track of its own. So the number of such nets is at most . In the same way, the number of nets crossing a horizontal cut is at most . This is the switchbox form of the channel density bound. The conditions are necessary for every routing, but the examples above show that they are not sufficient.
Wire length and vias. Each net needs at least the length of a shortest rectilinear tree on its pins inside the box. In the reserved model, a net with both a horizontal and a vertical part needs at least one via, since the two parts lie on different layers.
Reductions
- From channel routing. A channel instance with tracks is a switchbox instance with and empty left and right sides.
- To integer programming. A 0-1 variable for each net and each wire edge or via, with flow constraints for connectivity and one constraint per grid point and layer, gives an exact integer program.
- Inside detailed routing. A detailed router that cuts the area into channels and switchboxes routes the channels first, which fixes the pins on the sides of the switchboxes, and then routes each switchbox.
Applications
- Building-block and macro layouts. Where two routing channels meet, in an L or T shape, the region at the junction is a switchbox. Its pins are fixed by the channels that were already routed.
- Gcell routing. A gcell of a modern detailed router, with the global routes fixing where each net enters and leaves, is a small switchbox on several layers.
- FPGA switch boxes. The name is shared with the programmable switch boxes of FPGAs, where fixed wires on four sides meet. There the switches are fixed, and the routing problem is the choice of switch settings.
References
- 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 6, Section 6.4 Switchbox Routing (terminology and switchbox routing algorithms)
- Naveed A. Sherwani, Algorithms for VLSI Physical Design Automation, third edition, Kluwer, 1999, the chapter on detailed routing, the part on switchbox routing (general locator)
- James P. Cohoon and Patrick L. Heck, BEAVER, a computational-geometry-based tool for switchbox routing, IEEE Transactions on Computer-Aided Design 7(6), 684 to 697, 1988, the switchbox router that applies several simple routers in turn and its results on benchmark switchboxes (general locator)
- W. K. Luk, A greedy switch-box router, Integration, the VLSI Journal 3(2), 129 to 149, 1985, the extension of the greedy channel router to pins on four sides (general locator)
- Gordon T. Hamachi and John K. Ousterhout, A switchbox router with obstacle avoidance, Proceedings of the 21st Design Automation Conference, 173 to 179, 1984, switchbox routing around obstacles inside the box (general locator)
- Thomas G. Szymanski, Dogleg channel routing is NP-complete, IEEE Transactions on Computer-Aided Design 4(1), 1985, the NP-completeness of routing a channel in a given number of tracks, which is a switchbox with no pins on the left and right sides (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 7Q2FNA Edit this page History Report an error Markdown