Document routing between placed crossings and archive development records

This commit is contained in:
Jan Petykiewicz 2026-11-26 21:37:05 -08:00
commit 2c260e5e95
3 changed files with 161 additions and 102 deletions

View file

@ -35,9 +35,10 @@ Omitting `options` uses `RoutingOptions()`. To observe live congestion iteration
| --- | --- |
| `RoutingRunResult.results_by_net` | A mapping from net ID to `RoutingResult`. |
| `RoutingResult.is_valid` and `outcome` | Final validity and a status of `completed`, `colliding`, `partial`, or `unroutable`. |
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
| `RoutingResult.reached_target` and `report` | Arrival status, physical length, and collision details. |
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons for export or fixed obstacles, and the move sequence for reuse as a seed. |
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, the verified IDs, stage history, and any capacity or port-conflict bound. |
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |
See [how to read the result](tune-and-troubleshoot.md#read-the-result) for export checks and [developer diagnostics](../routing-diagnostics.md) for reports and traces.
@ -93,7 +94,7 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
| `base_penalty` | `100.0` | Initial penalty for overlapping other routes. |
| `multiplier` | `1.5` | Scale the penalty between unresolved iterations. |
| `use_tiered_strategy` | `True` | Allow a cheaper bend proxy in the first iteration when applicable. |
| `net_order` | `"user"` | Route in input order or use `"shortest"` or `"longest"`. |
| `net_order` | `"user"` | Start from input order or sort by terminal Manhattan distance with `"shortest"` or `"longest"`. |
| `warm_start_enabled` | `True` | Build greedy seeds before congestion iterations. |
| `shuffle_nets` | `False` | Shuffle routing order between iterations. |
| `seed` | `None` | Random seed for shuffled ordering. |

View file

@ -10,15 +10,60 @@ Start with the [first route](../../README.md#route-a-net), then replace the exam
4. **Add keepouts.** Supply Shapely polygons in `static_obstacles` and use `bounds` for the board rectangle. Leave enough access at the ports for the guide and its permitted bends. [Input fields](api-reference.md#layout-inputs)
5. **Run and check.** Call `route(problem, options=options)` and check each `result.is_valid`. Start with automatic mode for general layouts. [Read the result](tune-and-troubleshoot.md#read-the-result)
## Connect a preplaced crossing
<a id="connect-a-preplaced-crossing"></a>
- Place the device and reserve its keepout first.
- Leave openings in the keepout at the physical ports.
- Define the external legs as separate nets. The placed cell supplies the internal connections.
## Route between placed crossings
![Four routed legs stop at labeled ports in the notched keepout of a preplaced crossing. Dashed links inside the cell indicate connections supplied by the device.](../figures/placed-crossing.png)
1. **Place the crossing cells.** Keep each cell's physical footprint and internal connections in your layout. Get the port positions and headings in board coordinates after applying placement and rotation.
2. **Reserve routing keepouts around the cells.** Use the device's routing keepout if supplied. Otherwise, start from its footprint and make local openings at the ports you're connecting. Keep the full physical cell in the exported layout.
3. **Route the external connections.** Give Inire one net per connection between devices. The example connects A's east port to B's west port. B's arrival heading points east into the cell.
Each leg meets a port at the end of an access slot. The dashed links show the device's internal connections schematically. The four external paths come from Inire's `crossing-single` fixture. [Crossing fixtures](../benchmark-fixtures.md#preplaced-crossings)
![Two offset rectangular crossing cells with finite footprints. The solid external waveguide leaves A's east port and enters B's west port. Small cutouts in the shaded keepouts allow port access.](../figures/placed-crossing.png)
Dashed outlines show the complete device footprints. Shading shows the keepouts passed to Inire. The external route connects the two port markers. The arrow at each marker shows the heading.
Inire applies `clearance` around the supplied keepout polygons. A straight approach of width `w` between two keepout edges needs at least `w + 2 * clearance` of open width. Leave room for any turn near the port and check the opening after snapping the port to the grid.
```python
from shapely.geometry import box
from inire import (
NetSpec, Port, RoutingOptions,
RoutingProblem, SearchOptions,
route,
)
# Example footprints and access openings in board coordinates.
a = box(30, 50, 80, 100)
b = box(260, 90, 310, 140)
a_access = box(74, 69, 82, 81)
b_access = box(258, 109, 266, 121)
a_keepout = a.difference(a_access)
b_keepout = b.difference(b_access)
net_id = "A_east_to_B_west"
link = NetSpec(
net_id,
Port(80, 75, 0),
Port(260, 115, 0),
width=2,
)
problem = RoutingProblem(
bounds=(0, 0, 340, 180),
nets=(link,),
static_obstacles=(a_keepout, b_keepout),
clearance=4,
)
search = SearchOptions(
bend_radii=(25,), sbend_radii=(25,),
)
opts = RoutingOptions(search=search)
run = route(problem, options=opts)
result = run.results_by_net[net_id]
assert result.is_valid
```
Before export, check the port joins and clearance against the actual placed-cell geometry. Inire verifies the external route against the keepouts you supplied.
## Reuse an existing route

View file

@ -15,7 +15,7 @@ Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode,
## Why a net stopped short
1. **Check for a geometric bound.** If the automatic run reaches `max_routed` below the requested count, read `capacity_limit` or `port_conflicts`. Make more room at the reported cut or move conflicting ports.
1. **Check for a geometric bound.** In an automatic run, `max_routed` is an upper bound. If it is below the requested count, read `capacity_limit` or `port_conflicts` to see where to widen a passage or move a port. A result below the bound can still leave feasible nets unfinished.
2. **Check the port and turn geometry.** For static or self-collisions, inspect physical clearance and bend room. For dynamic collisions, inspect the routes that compete for the same space.
3. **Check the search budget.** If the verified count is below the bound and the geometry looks feasible, try raising a small `search.node_limit`. The limit is per search. A run can try the same net several times.
@ -33,6 +33,8 @@ Set `TopologyOptions(mode=...)` and pass it as `topology` in `RoutingOptions`.
- **`seed`.** Try to realize a verified starting path inside a corridor before the detailed search.
- **`bundle`.** Route supported ordered rectangular bundles. Use a circular radius enabled for both bends and S-bends. Unsupported layouts and invalid schedules raise `ValueError`.
### Mode requirements
- Guide and seed modes require constrained triangulation from Shapely 2.1 with GEOS 3.10 or newer. Caller-supplied seeds take precedence, and nets without a corridor can use ordinary lattice search.
- Enable `infer_terminal_headings` for point terminals with flexible headings. Preserve fixed headings when a device requires a specific arrival direction.
- In automatic mode, smaller initial budgets make the first attempts cheaper. If coverage remains below the bound, a lattice fallback can use your configured ceiling. Automatic also uses lattice for custom bend geometry or when constrained triangulation is unavailable. [Automatic stage order](../architecture.md#automatic-routing)