inire/examples/advanced.md

112 lines
6.8 KiB
Markdown
Raw Permalink Normal View History

# Advanced routing examples
Route stress-test boards with shared openings, tight turns, and placed crossings.
- [Competing passages](#competing-passages)
- [Bend and return room](#bend-and-return-room)
- [Placed crossings](#placed-crossings)
- [Complex-routing example 1](#complex-routing-example-1)
## Run a layout
Select a case by its name below. Repeat `--case` to draw several layouts, or omit it to draw all twelve.
```sh
python examples/advanced_layouts.py \
--case stress-crossings-shared-outside-detour \
--case complex-routing-example-1 \
--output-dir /tmp/inire-advanced-routes
```
The [layout data](advanced-layouts.json) describes keepouts as WKT and ports as `[x, y, heading_in_degrees]`. The [runner](advanced_layouts.py) loads each case into a `RoutingProblem` and uses automatic routing.
In the figures, gray shapes are keepouts. Open circles mark sources and filled squares mark targets. Arrows indicate the direction of travel at those ports. The result panel draws the physical waveguides and reports the number of nets that passed verification.
## Competing passages
### Mixed widths at a slit
In `stress-passage-width-key`, the 2-unit-wide guide fits through the 14-unit lower slit with the required clearance of 5 on each side. The upper opening carries the other five routes, some eastbound and some westbound.
![Six verified routes through a wall. One thin route uses a low slit while five routes share the upper opening.](../docs/figures/example-stress-passage-width-key.png)
### Staggered openings and one shared passage
In `stress-passage-split-merge`, three routes use each of the first wall's two openings. Their turns between the walls bring all six routes into one opening in the second wall, with clearance between the guides.
![Six ports on each side of two staggered walls. Three routes use each first opening, then all six pass through the second opening.](../docs/figures/example-stress-passage-split-merge.png)
## Bend and return room
### Alternating doglegs
In `stress-refine-alternating-doglegs`, three eastbound nets pass above a wall rising from the bottom and then below a wall hanging from the top. The staggered turns preserve clearance for three different guide widths.
![Three nested waveguides turn above the first wall and below the second wall.](../docs/figures/example-stress-refine-alternating-doglegs.png)
### Folded return near a shelf
In `stress-refine-return-shelf`, the folded return starts and finishes heading east, even though its target lies west of its source. It loops below two nearby routes before turning east to enter its target.
![Four verified routes. The folded return heads east at both ports and loops below the neighboring routes to reach a target west of its source.](../docs/figures/example-stress-refine-return-shelf.png)
### Trunk that detours around branches
In `stress-retry-straight-decoy`, a straight route between the trunk's ports would cross both vertical branches. The routed trunk passes below the lower end of each branch and above the bottom route.
![Two vertical branches route across the direct line between the trunk ports. A four-turn trunk detour leaves both branches room.](../docs/figures/example-stress-retry-straight-decoy.png)
### Short shifts on separate rows
In `stress-retry-compact-shift-bank`, walls divide the board into four rows. The lowest net has only 66 units of forward travel for an 85-unit lateral shift. Its turns fit beside the keepout on that row.
![Four verified routes on separate rows. The lowest net shifts up sharply over a small forward span.](../docs/figures/example-stress-retry-compact-shift-bank.png)
### Mixed port bank
In `stress-retry-mixed-port-bank`, the two short routes connect offset ports on opposite sides of the board. One launches east and the other west. The route starting near the bottom turns from northbound to eastbound, and the top route runs straight west.
![Five verified routes, including a straight westbound path at the top, a 90-degree turn near the bottom, and short lateral shifts at the sides.](../docs/figures/example-stress-retry-mixed-port-bank.png)
## Placed crossings
The cells are already placed. Slots in their keepouts give the external routes access to each port.
- [Placed crossing setup](../docs/user/route-a-layout.md#route-between-placed-crossings)
### Opposed S-bends beside a crossing
In `stress-sbend-competing-slots`, the two left-hand routes each shift sideways by 20 units. The eastbound route bends past the right end of the small keepout, and the westbound route bends past its left end. Two other routes connect to the north and south ports of the crossing.
![Two opposed S-bends share the left half of the board. Two more waveguides access a preplaced crossing on the right.](../docs/figures/example-stress-sbend-competing-slots.png)
### Odd offset and a short launch pocket
In `stress-crossing-off-lattice-slot`, the west approach shifts 17 units north with two 90-degree bends and still arrives heading east. The route leaving the crossing's north port bends around the keepout above it.
![Four routes connect to a crossing. The west link steps up near its launch, and the north link turns around an adjacent keepout.](../docs/figures/example-stress-crossing-off-lattice-slot.png)
### Two crossings with an outside detour
In `stress-crossings-shared-outside-detour`, a straight external waveguide joins the two crossing cells. The long eastbound route detours below the horizontal keepout and the two short links to the south ports.
![Nine verified paths around two crossings. A straight route joins the devices, and a long lower detour passes beneath both approaches.](../docs/figures/example-stress-crossings-shared-outside-detour.png)
## Complex-routing example 1
Nine source ports feed routes around seven keepouts. Both variants use width 2, clearance 6, and bend radius 50.
- [Lane assignment, turnaround, and refinement](../docs/complex-routing-example-1.md)
- [Benchmark fixture](../docs/benchmark-fixtures.md#complex-routing-example-1)
### Fixed eastbound headings
In `complex-routing-example-1`, all routes must leave and arrive heading east. Follow `net_08` from the bottommost source around the board. Near the top edge, it turns back to approach its target from the west.
![All nine fixed-heading nets verified. The outer return comes back around and makes an eastbound approach to its top target.](../docs/figures/example-complex-routing-example-1.png)
### Point terminals
In `complex-routing-example-1-point-terminals`, `infer_terminal_headings=True` lets the planner choose directions at the same port coordinates. In the result, `net_08` enters its target from the east and avoids the final turnaround.
![The setup shows the port positions without arrows. All nine routes verify, and the outer return arrives westbound.](../docs/figures/example-complex-routing-example-1-point-terminals.png)