Clarify routing documentation and refresh example figures
4
DOCS.md
|
|
@ -21,7 +21,7 @@ If you're new to Inire, start with the [single-net quick start](README.md#route-
|
||||||
|
|
||||||
## Check and improve a route
|
## Check and improve a route
|
||||||
|
|
||||||
- [Check the result](docs/user/tune-and-troubleshoot.md#read-the-result) to see whether each net reached its port and cleared obstacles.
|
- [Check the result](docs/user/tune-and-troubleshoot.md#read-the-result) to see whether each net reached its target port and passed verification.
|
||||||
- [Export verified geometry](docs/user/route-a-layout.md#export-verified-geometry) to use the physical polygons in your layout.
|
- [Export verified geometry](docs/user/route-a-layout.md#export-verified-geometry) to use the physical polygons in your layout.
|
||||||
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) to decide whether to change the layout or spend more search time.
|
- [Diagnose an unfinished net](docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) to decide whether to change the layout or spend more search time.
|
||||||
- [Choose a routing mode](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) when your layout calls for a specific planner.
|
- [Choose a routing mode](docs/user/tune-and-troubleshoot.md#choose-a-routing-mode) when your layout calls for a specific planner.
|
||||||
|
|
@ -43,5 +43,5 @@ If you're new to Inire, start with the [single-net quick start](README.md#route-
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- See how bends, locks, and congestion affect individual routes in the [basic examples](examples/README.md).
|
- See how port headings, fixed routes, and competing connections affect the result in the [basic examples](examples/README.md).
|
||||||
- Compare the boards, ports, and verified results for multi-net layouts in the [advanced examples](examples/advanced.md).
|
- Compare the boards, ports, and verified results for multi-net layouts in the [advanced examples](examples/advanced.md).
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# inire
|
# inire
|
||||||
|
|
||||||
Use Inire to connect fixed ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply the device placement, keepouts, and allowed bend radii. The router checks the finished geometry for clearance and returns partial paths to help you diagnose unfinished nets.
|
Use Inire to connect ports on a photonic or RF layout with straight segments, 90-degree bends, and S-bends. Supply each connection's port coordinates and travel directions, along with the board bounds, keepouts, and allowed bend radii. Each result reports whether the route reached its target and passed verification. A search that stops early can return a partial path.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ Use these records to recover the rationale for a routing decision or compare a f
|
||||||
|
|
||||||
- For the original coverage target and retry priorities, read the [routing policy goal](routing-policy-goal.md).
|
- For the original coverage target and retry priorities, read the [routing policy goal](routing-policy-goal.md).
|
||||||
- For the reason a responsibility lives in a particular module, consult the [routing refactor plan](routing-refactor-plan.md).
|
- For the reason a responsibility lives in a particular module, consult the [routing refactor plan](routing-refactor-plan.md).
|
||||||
|
- For the work removed by the routing cleanups and the prototypes that changed search behavior, read the [simplification results](simplification-results.md).
|
||||||
- For the original audience and page split, see the [first documentation reorganization plan](documentation-improvement-plan.md).
|
- For the original audience and page split, see the [first documentation reorganization plan](documentation-improvement-plan.md).
|
||||||
|
|
||||||
## Reproduce probe and retry experiments
|
## Reproduce probe and retry experiments
|
||||||
|
|
@ -26,4 +27,4 @@ Use these records to recover the rationale for a routing decision or compare a f
|
||||||
| Sampled prune reasons near remaining overlaps | [Frontier trace](frontier_trace.md). |
|
| Sampled prune reasons near remaining overlaps | [Frontier trace](frontier_trace.md). |
|
||||||
| Reroute order and work immediately before repair | [Pre-pair frontier trace](pre_pair_frontier_trace.md). |
|
| Reroute order and work immediately before repair | [Pre-pair frontier trace](pre_pair_frontier_trace.md). |
|
||||||
|
|
||||||
Each trace report has a companion JSON file with the same basename. The baseline comparison tool reads `performance_baseline.json` from this directory by default. Capture tools also write here by default and replace files with the same name. To preserve an earlier record while running a fresh capture, follow the [scratch output commands](../../docs/routing-diagnostics.md#reproduce-and-compare).
|
Each trace report has a companion JSON file with the same basename. The baseline comparison tool reads `performance_baseline.json` from this directory by default. For a fresh trace, set `--output-dir` to keep the capture separate from the archived record. See the [fan-out capture command](../../docs/routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair).
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
# Router architecture
|
# Router architecture
|
||||||
|
|
||||||
An explicit routing mode runs one worker. Automatic routing can run several and compare their results. To follow how the worker gets its obstacles, locks, and seed hints, start at [`route_once()`](../inire/router/_stack.py#L71).
|
An explicit routing mode runs one worker with that mode's settings. Automatic routing can run several workers with different obstacles, locks, or starting paths, then select a result. To see what a single worker receives and returns, start at [`route_once()`](../inire/router/_stack.py#L71).
|
||||||
|
|
||||||
## Automatic routing
|
## Automatic routing
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Follow the left column down while the run is below its coverage target. Move right to selection when a verified candidate reaches that target or the attempts run out. Custom physical bends, polygonal proxies, and layouts routed without constrained triangulation take a lattice-only path.
|
Follow the left column down while the number of verified nets is below the target. The router selects a layout when an attempt reaches that target or the attempts run out. It uses lattice search directly for custom physical bends, polygonal proxies, or a run without constrained triangulation.
|
||||||
|
|
||||||
1. **Set the coverage target.** Each disjoint pair of incompatible fixed ports rules out one route. At supported rectangular cuts, compute how many paths of the narrowest width can fit through the openings. To change which cuts can establish an upper bound, start with [`cut_capacity()`](../inire/router/_capacity.py#L27).
|
1. **Set the coverage target.** A pair of nets with fixed ports that are too close can supply at most one route. Count such pairs using each net at most once. For rectangular keepouts, also bound the number of paths that can cross a vertical cut by packing tracks at the narrowest requested width. To see how the openings are counted, start with [`cut_capacity()`](../inire/router/_capacity.py#L27).
|
||||||
2. **Try constructive planners.** Bundles assign ordered tracks through barriers. Column schedules place turns between openings. Compact planners fit short connections between constrained ports. Each produces seeds whose physical geometry the worker checks.
|
2. **Try constructive planners.** Bundles assign ordered tracks through barriers. Column schedules place turns between openings. Compact planners fit short connections between constrained ports. Each produces seeds whose physical geometry the worker checks.
|
||||||
3. **Start with a small search budget.** Lock verified straight links and search for the remaining nets. A different lock order or a small unlocked probe can free room for a turn. Promising guide and column attempts can run first.
|
3. **Start with a small search budget.** Lock verified straight links and search for the remaining nets. A different lock order or a small unlocked probe can free room for a turn. Promising guide and column attempts can run first.
|
||||||
4. **Decide what to keep fixed.** If the remaining ports are connected, route around the locked geometry. If the locks disconnect them, pass the incumbents as movable seeds. A joint retry can assign different lanes through a shared portal. If recovery stalls, seed and lattice attempts can search the whole layout, with a final lattice retry up to the caller's ceiling.
|
4. **Decide what to keep fixed.** If the remaining ports are connected, route around the locked geometry. If the locks disconnect them, pass the previously verified paths as seeds that can move. A joint retry can assign different lanes through a shared opening. If recovery stalls, seed and lattice attempts can search the whole layout. The final lattice retry can use the caller's full node limit.
|
||||||
5. **Select a verified layout.** Prefer greater coverage and compare cost on identical verified net sets. A complete locked layout or an improving joint retry must pass its whole-layout check before selection. To see how a refined candidate must preserve the verified net set, follow [the refinement handoff](../inire/router/_automatic.py#L581).
|
5. **Select a verified layout.** Prefer more verified nets and compare cost when the verified net IDs match. A completed `incumbent-residual` trial or an improving `joint-portal-lanes` trial must pass another check with the original keepouts before it can win. Refinement can replace the selected layout only if it preserves the verified net IDs. See [the refinement handoff](../inire/router/_automatic.py#L581).
|
||||||
|
|
||||||
The near-port attempt uses up to 100 nodes per search and two congestion iterations with the arc proxy. Alternate proxies use the configured iteration limit because a later shallow iteration can find a cheaper path. Wider lookahead uses up to 500 nodes per search and the configured iteration limit. Follow the caps and early exits in [the initial search trials](../inire/router/_automatic.py#L480).
|
The near-port attempt uses up to 100 nodes per search and two congestion iterations with the arc proxy. Alternate proxies use the configured iteration limit because a later shallow iteration can find a cheaper path. Wider lookahead uses up to 500 nodes per search and the configured iteration limit. Follow the caps and early exits in [the initial search trials](../inire/router/_automatic.py#L480).
|
||||||
|
|
||||||
### Example of a poor lock
|
### Example of a poor lock
|
||||||
|
|
||||||
1. A straight trunk in `stress-retry-straight-decoy` fits on its own. Once locked, it divides the board and blocks two perpendicular nets.
|
1. The straight trunk in `stress-retry-straight-decoy` fits on its own. Fixing it in place would block both vertical routes.
|
||||||
2. The probe can keep the branches and lower rail. A four-turn dogleg completes the trunk around them before wider search.
|
2. The early search can keep the vertical routes and the lower rail. A four-turn detour connects the trunk before the router tries a larger search budget. See where it bends in the [layout and route figure](../examples/advanced.md#trunk-that-detours-around-branches).
|
||||||
3. If you change lock ordering or acceptance, run the [single-case benchmark command](benchmarks.md#run-a-benchmark) with `--case stress-retry-straight-decoy`. Check that all four nets still verify and compare which stage finishes the trunk.
|
3. If you change lock ordering or acceptance, run the [single-case benchmark command](benchmarks.md#run-a-benchmark) with `--case stress-retry-straight-decoy`. Check that all four nets still verify and compare which stage finishes the trunk.
|
||||||
|
|
||||||
## Detailed search and congestion
|
## Detailed search and congestion
|
||||||
|
|
@ -28,15 +28,17 @@ The near-port attempt uses up to 100 nodes per search and two congestion iterati
|
||||||
|
|
||||||
- **Recheck the installed set.** The driver raises the overlap penalty when successive routes collide. After an iteration it verifies the installed paths, since a later route can collide with one completed earlier. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. To see when it reroutes just the conflicting nets, read [`next_reroute_net_ids()`](../inire/router/_congestion_policy.py#L93).
|
- **Recheck the installed set.** The driver raises the overlap penalty when successive routes collide. After an iteration it verifies the installed paths, since a later route can collide with one completed earlier. It ranks snapshots by completed nets, then by conflicts and dynamic collisions. To see when it reroutes just the conflicting nets, read [`next_reroute_net_ids()`](../inire/router/_congestion_policy.py#L93).
|
||||||
|
|
||||||
- **Repair a small conflict set.** The driver restores its best iteration and verifies it once for diagnostics and target selection. Pair-local search keeps the geometry outside an eligible pair fixed and can try either routing order. The driver checks replacements in the live world. To compare the restored set with the repaired paths, [follow a late conflict](routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair).
|
- **Repair a small conflict set.** The driver returns to the best iteration and can reuse its verification when those paths are still installed and restored-stage traces are disabled. If the conflicts form separate pairs, the router can try repairing up to two of them. It holds the other paths fixed, tries both routing orders as needed, and checks proposed replacements against the installed layout. For a worked trace, [follow a late conflict](routing-diagnostics.md#follow-a-late-conflict-into-pair-local-repair).
|
||||||
|
|
||||||
## Geometry and refinement
|
## Geometry and refinement
|
||||||
|
|
||||||
Search proxies help reject candidates cheaply. Final verification checks physical clearance, self-collisions, and automatic board containment. A mitred buffer can flag a candidate near a corner even when physical distance meets clearance. The exact distance check resolves those cases. To test changes to the broad phase, use the boundary-touching and custom-shape cases in the [collision tests](../inire/tests/test_collision.py).
|
Search proxies approximate the shape of a move for collision checks. Verification uses physical polygons for static keepout checks and self-collisions. For conflicts between nets, it compares the checked path's clearance-expanded physical polygons with the other routes' installed, clearance-expanded proxies. Automatic and bundle modes also check that the physical polygons fit within the board.
|
||||||
|
|
||||||
|
At a keepout corner, a mitred clearance buffer can reach farther than the specified clearance. Verification checks the actual distance before counting these hits as collisions. For an example with a corner close to the required clearance, see the [mitred-corner test](../inire/tests/test_collision.py#L146).
|
||||||
|
|
||||||
When expansion counts are similar but routing time rises, inspect ray casts for repeated visibility queries and exact pair checks for an overly broad dynamic lookup. The [metrics guide](routing-diagnostics.md#route-metrics) maps those questions to counters.
|
When expansion counts are similar but routing time rises, inspect ray casts for repeated visibility queries and exact pair checks for an overly broad dynamic lookup. The [metrics guide](routing-diagnostics.md#route-metrics) maps those questions to counters.
|
||||||
|
|
||||||
Refinement scores replacement windows before constructing their polygons. Finite budgets above one window prioritize bend-ended windows to give expensive turns an early chance to be replaced. One-window and unlimited runs try the longest windows first. Local checks rely on the rest of the route and the other installed paths being valid. Final verification checks the installed result.
|
Refinement tries replacing sections of routes with at least four 90-degree bends. It scores proposed detours before constructing their polygons. With a finite budget above one, it tries sections with bends at both ends first. With a budget of one or no window limit, it starts with the longest section by component count. It can check just the replacement when the original route is valid against the installed geometry. Final verification checks the entire updated route.
|
||||||
|
|
||||||
## Validate a change
|
## Validate a change
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ Start with a board that exercises the behavior you want to measure. Use the [cas
|
||||||
|
|
||||||
## Automatic nine-net Terminal-Bench routing
|
## Automatic nine-net Terminal-Bench routing
|
||||||
|
|
||||||
Use `terminal-bench-point-terminals` to test heading inference and ordered tracks through shared openings. The bundle planner reserves room for the outer return and bend tangencies. Use `terminal-bench` to test automatic routing with fixed headings.
|
Use `terminal-bench-point-terminals` to test heading inference and ordered tracks through shared openings. Use `terminal-bench` to test automatic routing with eastbound arrival at every target. The [nine-net example figures](../examples/advanced.md#nine-net-terminal-bench-board) show how that requirement changes the route to the target near the top edge.
|
||||||
|
|
||||||
To measure the bundle planner on the unseeded point-terminal input, export its routes.
|
To run the bundle planner from point terminals and export its verified waypoints, use the following command.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m scripts.route_terminal_bench --output /tmp/inire-terminal-bench.json
|
python -m scripts.route_terminal_bench --output /tmp/inire-terminal-bench.json
|
||||||
|
|
@ -26,7 +26,7 @@ Use unseeded runs to evaluate routing policy. For a separate check of geometry a
|
||||||
|
|
||||||
## Imported fixtures
|
## Imported fixtures
|
||||||
|
|
||||||
The importer converts placed device outlines to keepouts with port openings and snaps optical ports to a 0.1 µm grid. The six converted layouts exercise routing between fixed devices. To inspect their ports and keepouts, open the [checked-in fixture data](../inire/tests/data/external_routing_benchmarks.json).
|
The importer cuts port openings into device keepouts and snaps optical ports to a 0.1 µm grid. Each layout unit in the converted files represents 0.1 µm. Inspect the six layouts' port locations and keepouts in the [checked-in fixture data](../inire/tests/data/external_routing_benchmarks.json).
|
||||||
|
|
||||||
| Cases | Pinned source | License |
|
| Cases | Pinned source | License |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ Use these measurements when changing the automatic probe budget or retry order.
|
||||||
|
|
||||||
The November 26, 2026 comparison used the regression corpus and retry holdouts under the `public-defaults` and `corpus-regression` profiles. Against the full configured probe budget, a two-iteration cap reduced public-default corpus expansions by 23%. Verified paths and costs matched on both board sets. Check these individual cases before changing the cap again.
|
The November 26, 2026 comparison used the regression corpus and retry holdouts under the `public-defaults` and `corpus-regression` profiles. Against the full configured probe budget, a two-iteration cap reduced public-default corpus expansions by 23%. Verified paths and costs matched on both board sets. Check these individual cases before changing the cap again.
|
||||||
|
|
||||||
- The splitter tree benefited from fewer repeated shallow searches.
|
- The splitter tree still verified all six nets and used fewer expansions after shortening the probe.
|
||||||
- The mixed port bank did more work because the shorter probe passed its last net to the wider retry.
|
- The mixed port bank used more expansions because the last net moved from the short probe to the larger retry.
|
||||||
- A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the original probe budget to find its cheaper route, so the current cap applies to the arc proxy. See the [automatic stage sequence](architecture.md#automatic-routing).
|
- A one-iteration cap increased the cost of a crossing approach. The clipped-proxy case needed the full probe to find its cheaper route. The two-iteration cap applies to the arc proxy in the [automatic stage sequence](architecture.md#automatic-routing).
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
python -m scripts.benchmark_retry_order --case corpus --case retry-holdout \
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ python -m scripts.compare_topological_routing \
|
||||||
--mode automatic
|
--mode automatic
|
||||||
```
|
```
|
||||||
|
|
||||||
Expect `3/4 valid` and a report of three tracks for four nets crossing the cut. The run reached the geometric bound. When trying another setting, check the bound and verified IDs before comparing cost. For a case whose bound comes from fixed ports, use `--case lidar-clements-8x8`.
|
Expect `3/4 valid`. All four nets need to cross a vertical cut where the openings have room for three tracks. Run the same command with `--case lidar-clements-8x8` to see `3/6 valid` with a bound set by port spacing.
|
||||||
|
|
||||||
## Choose a case
|
## Choose a case
|
||||||
|
|
||||||
| If you are changing | Use `--case` |
|
| If you are changing | Use `--case` |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Overall coverage | `corpus` runs the regression suite. |
|
| Overall coverage | `corpus` runs the regression suite. |
|
||||||
| Ordered tracks, shared gates, and barrier layouts | `all` exercises the original layouts, including fixed-heading Terminal-Bench. |
|
| Ordered tracks, shared gates, and barrier layouts | `all` selects the original comparison set, including fixed-heading Terminal-Bench. Use `corpus` for the full regression suite. |
|
||||||
| Seeds, custom bend geometry, and fallback behavior | `broad` includes caller seeds, custom bends, imported layouts, and held-out boards. |
|
| Seeds, custom bend geometry, and fallback behavior | `broad` includes caller seeds, custom bends, imported layouts, and held-out boards. |
|
||||||
| Ports on placed devices | `crossings` exercises external legs to preplaced crossing cells. |
|
| Ports on placed devices | `crossings` exercises external legs to preplaced crossing cells. |
|
||||||
| Lock ordering, tight turns, and competing passages | `stress` runs known-feasible folded returns, competing locks, and shared passages. |
|
| Lock ordering, tight turns, and competing passages | `stress` runs known-feasible folded returns, competing locks, and shared passages. |
|
||||||
|
|
@ -31,10 +31,10 @@ Run `python -m scripts.compare_topological_routing --list` to find individual ca
|
||||||
| Profile | Use it to |
|
| Profile | Use it to |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `public-defaults` | Measure the public policy and objective on the fixture geometry. |
|
| `public-defaults` | Measure the public policy and objective on the fixture geometry. |
|
||||||
| `corpus-regression` | Reproduce the routing regression settings. The profile retains fixture options and sets 500 search nodes, 500 seed nodes, and three configured congestion iterations. |
|
| `corpus-regression` | Reproduce the routing regression settings. The profile sets a 500-node search limit, a 500-node seed budget per net, and up to three congestion iterations per attempt. |
|
||||||
| `matched-budget` | Compare modes at shared configured budgets. It defaults to 500 search nodes and two configured iterations. Use CLI overrides to test a smaller budget. |
|
| `matched-budget` | Compare modes with the same configured search and iteration limits. Defaults to 500 nodes per search and up to two congestion iterations per attempt. |
|
||||||
|
|
||||||
The two budget profiles use benchmark weights for automatic candidate selection. Stages can use smaller budgets. Match the profile, options, and worker count when measuring a change.
|
Both budget profiles use benchmark weights when selecting an automatic candidate. A stage can use a smaller budget, and a net can be searched more than once. Match the profile, options, and worker count when measuring a change.
|
||||||
|
|
||||||
### Run the full regression corpus
|
### Run the full regression corpus
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ python -m scripts.compare_topological_routing \
|
||||||
--json /tmp/inire-modes.json
|
--json /tmp/inire-modes.json
|
||||||
```
|
```
|
||||||
|
|
||||||
At 100 nodes per search, `off` stops short. Guide and seed both finish the same net at the same cost. Guide takes 4 expansions. Seed takes 37, all in seed search. If seed work increases after a change, inspect how the [corridor is realized as a path](topological-routing.md#corridor-planning-and-realization).
|
At 100 nodes per search, `off` verifies zero routes. Guide and seed both verify the single requested net at the same cost. Guide uses 4 search expansions and seed uses 37, all spent building its starting path. If this work changes, check how the [corridor becomes a path](topological-routing.md#corridor-planning-and-realization).
|
||||||
|
|
||||||
### Test a retry on holdouts
|
### Test a retry on holdouts
|
||||||
|
|
||||||
|
|
@ -76,6 +76,6 @@ Check which holdouts gained a verified net, then compare previously verified pat
|
||||||
|
|
||||||
## Compare the results
|
## Compare the results
|
||||||
|
|
||||||
1. **Coverage and bounds.** Check verified IDs, requested nets, and any bound. The overloaded gate exercises passage capacity. The imported LiDAR Clements layout exercises fixed-port conflicts. Verify any feasibility witness separately from the timed run.
|
1. **Coverage and bounds.** Check which nets verified and whether their count reached the reported bound. A reference path shows that its exact route is feasible. Check it separately from an unseeded timing run.
|
||||||
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective. Compare costs on identical verified IDs, and report coverage changes separately.
|
2. **Cost on matching net sets.** Benchmark-weighted length weights physical straights, 90-degree bends, and S-bends by 1, 4, and 13. Native objective cost uses the run's configured objective. Compare costs on identical verified IDs, and report coverage changes separately.
|
||||||
3. **Search and time.** Compare expansions and repeated wall times at the same settings. Constructive stages can spend time planning and verifying even with zero expansions. To locate work that moved to a different stage, use the [automatic reports](routing-diagnostics.md#automatic-reports).
|
3. **Search and time.** Compare expansions and repeated wall times at the same settings. Constructive stages can spend time planning and verifying even with zero expansions. To locate work that moved to a different stage, use the [automatic reports](routing-diagnostics.md#automatic-reports).
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
### Check a documentation figure
|
### Check a documentation figure
|
||||||
|
|
||||||
Run `python -m scripts.render_documentation_figures --output-dir /tmp/inire-figures` to preview changes. Compare the port labels, keepouts, path, and caption against the published example. Run the script without `--output-dir` to regenerate the figures in `docs/figures`.
|
Run `python -m scripts.render_documentation_figures --output-dir /tmp/inire-figures` to preview the guides' figures. Check the port directions, keepouts, and route against the runnable example before writing its caption. Omit `--output-dir` to write the guide figures to `docs/figures`. The basic example scripts save their own plots in `examples/`.
|
||||||
|
|
||||||
### Refresh the advanced example gallery
|
### Refresh the advanced example gallery
|
||||||
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
|
@ -6,9 +6,9 @@ Use these reports to investigate a change in planner selection, coverage, or run
|
||||||
|
|
||||||
- **A net is missing.** Compare the verified count with `max_routed`. If the count falls short of the bound, read `stages` for skipped or locked nets and look for the attempt where coverage stopped increasing. To see a run that reaches its bound of three routes out of four, try the [overloaded-gate benchmark](benchmarks.md#run-a-benchmark).
|
- **A net is missing.** Compare the verified count with `max_routed`. If the count falls short of the bound, read `stages` for skipped or locked nets and look for the attempt where coverage stopped increasing. To see a run that reaches its bound of three routes out of four, try the [overloaded-gate benchmark](benchmarks.md#run-a-benchmark).
|
||||||
|
|
||||||
- **The chosen route changed.** Start at `stages[selected_stage]`. The `planner` identifies the source of the proposal and `mode` identifies the worker, so a bundle seed can be checked by an `off` worker. Use `planner_rejections` for constructive candidates that never reached selection.
|
- **The chosen route changed.** Start at `stages[selected_stage]`. Read `planner` to identify how the candidate was created. Read `mode` to identify the worker that searched or verified it. A bundle candidate, for example, can be checked by a worker in `off` mode. Use `planner_rejections` to see why certain planners failed to produce a usable layout.
|
||||||
|
|
||||||
- **The run slowed down.** Group exclusive `timings` by policy and operation, including failed attempts. `duration_s` also includes orchestration. Use `run.metrics` and stage data for work across attempts. Detailed traces, corridor reports, and expanded states describe the selected attempt when present.
|
- **The run slowed down.** Group `timings` by policy and operation to see where the time went, including failed attempts. Each duration excludes time recorded by nested operations. `duration_s` is the total automatic run time. Use `run.metrics` and stage data to compare work across attempts. The returned traces, corridor report, and expanded states come from the selected attempt when available.
|
||||||
|
|
||||||
## Route metrics
|
## Route metrics
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@ Pair each counter with a question about the work. Use a repeated wall-time compa
|
||||||
| Similar expansions, more search time | Check `ray_cast_calls*` and `ray_cast_exact_geometry_checks` for visibility work. Compare dynamic `congestion_candidate_ids` with `congestion_exact_pair_checks` to see how much candidate geometry reaches exact tests. |
|
| Similar expansions, more search time | Check `ray_cast_calls*` and `ray_cast_exact_geometry_checks` for visibility work. Compare dynamic `congestion_candidate_ids` with `congestion_exact_pair_checks` to see how much candidate geometry reaches exact tests. |
|
||||||
| Verification dominates | Compare `verify_path_report_calls` with `verify_static_buffer_ops` and `verify_dynamic_exact_pair_checks`. This can distinguish repeated path checks from expensive checks of the same paths. |
|
| Verification dominates | Compare `verify_path_report_calls` with `verify_static_buffer_ops` and `verify_dynamic_exact_pair_checks`. This can distinguish repeated path checks from expensive checks of the same paths. |
|
||||||
| Refinement takes longer | Compare `refinement_windows_considered`, `refinement_candidates_verified`, and `refinement_candidates_accepted`. Check whether the added windows buy a better path before enlarging the default budget. |
|
| Refinement takes longer | Compare `refinement_windows_considered`, `refinement_candidates_verified`, and `refinement_candidates_accepted`. Check whether the added windows buy a better path before enlarging the default budget. |
|
||||||
| Attempts reach targets while verified coverage stays flat | Compare `iteration_conflict_edges` and `nets_carried_forward`. Inspect pair-local attempts and accepts after congestion stops. `pair_local_search_nodes_expanded` counts searches that returned a locally valid pair, so consult the attempt count to see failed searches. |
|
| Attempts reach targets while verified coverage stays flat | Compare `iteration_conflict_edges` and `nets_carried_forward`. After congestion iterations finish, check how many pair repairs were tried and how many were installed. `pair_local_search_nodes_expanded` counts expansions from searches that produced a locally valid pair. Use `pair_local_search_attempts` to count every try. |
|
||||||
|
|
||||||
`nets_routed` and `nets_reached_target` count attempts. Use `result.is_valid` or `verified_net_ids` to count final successes. Duration counters ending in `_total_ns` can vary between identical runs. For the full field list, see the [`RouteMetrics` definition](../inire/results.py).
|
`nets_routed` and `nets_reached_target` count attempts. Use `result.is_valid` or `verified_net_ids` to count final successes. Duration counters ending in `_total_ns` can vary between identical runs. For the full field list, see the [`RouteMetrics` definition](../inire/results.py).
|
||||||
|
|
||||||
|
|
@ -31,18 +31,20 @@ Enable the `DiagnosticsOptions` flag for the question you want to answer.
|
||||||
| Question | Flag and result |
|
| Question | Flag and result |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Which net consumed an iteration's budget? | `capture_iteration_trace` records `iteration_trace`. Inspect per-net `net_attempts` for expansions, pruning, congestion calls, and seed usage. |
|
| Which net consumed an iteration's budget? | `capture_iteration_trace` records `iteration_trace`. Inspect per-net `net_attempts` for expansions, pruning, congestion calls, and seed usage. |
|
||||||
| Which two routes overlap after re-verification? | `capture_conflict_trace` records the conflicting net IDs and the indices of their overlapping path components. |
|
| Which routes have a clearance conflict? | `capture_conflict_trace` records the conflicting net IDs and the component indices in `conflict_trace`. |
|
||||||
| What pruning occurred near the final overlap? | `capture_frontier_trace` records `frontier_trace` for reached-but-colliding nets. Inspect the states and prune reasons sampled in that area. The diagnostic replay leaves the selected route fixed. |
|
| Which candidate moves were pruned near the conflict? | `capture_frontier_trace` records `frontier_trace` for routes that reached their targets and still conflict with other nets. The trace samples moves and their prune reasons during a replay. |
|
||||||
| What did the last unresolved iteration hand to pair-local repair? | `capture_pre_pair_frontier_trace` records `pre_pair_frontier_trace`. Check reroute order, conflict edges, and per-net attempt work immediately before repair. |
|
| What did the last unresolved iteration hand to pair-local repair? | `capture_pre_pair_frontier_trace` records `pre_pair_frontier_trace`. Check reroute order, conflict edges, and per-net attempt work immediately before repair. |
|
||||||
| Where did the router explore? | `capture_expanded` records `expanded_nodes` for plotting. See the [fan-out example](../examples/07_large_scale_routing.py). |
|
| Where did detailed search explore? | `capture_expanded` records positions and headings from the detailed routing iterations in `expanded_nodes`. Use `plot_expanded_nodes()` as in the [fan-out script](../examples/07_large_scale_routing.py). |
|
||||||
|
|
||||||
### Find overlapping components
|
<a id="find-overlapping-components"></a>
|
||||||
|
|
||||||
1. Enable `capture_conflict_trace` in the run's `DiagnosticsOptions`. In the returned `run.conflict_trace`, use the entry whose `stage` is `"final"` to inspect the paths the run returned.
|
### Find components in conflict
|
||||||
|
|
||||||
|
1. Enable `capture_conflict_trace` in `DiagnosticsOptions`. In `run.conflict_trace`, choose the entry with `stage="final"` to inspect the returned paths.
|
||||||
2. Find the two net IDs in `conflict_edges`. In the matching `nets` entry, read `component_conflicts` for `self_component_index`, `other_net_id`, and `other_component_index`.
|
2. Find the two net IDs in `conflict_edges`. In the matching `nets` entry, read `component_conflicts` for `self_component_index`, `other_net_id`, and `other_component_index`.
|
||||||
3. Index each net's `path` in `run.results_by_net` using those zero-based indices. Plot the components' `physical_geometry` on the board and check their spacing against the required clearance. See whether both components compete for the same opening.
|
3. Use those zero-based indices to look up components in each net's `path` in `run.results_by_net`. Plot their physical shapes to see where they approach each other. If their physical spacing looks sufficient, compare the installed proxy used by the [dynamic clearance check](architecture.md#geometry-and-refinement).
|
||||||
|
|
||||||
For an earlier stage such as `restored_best`, read the net and component indices from that entry. The final paths may have changed during repair.
|
An earlier entry such as `restored_best` indexes the paths at that stage. Use the paths from the same stage for a geometry comparison. If verification failed with an empty conflict edge list, check the net's report for a keepout conflict, self-collision, or board boundary violation.
|
||||||
|
|
||||||
### Follow a late conflict into pair-local repair
|
### Follow a late conflict into pair-local repair
|
||||||
|
|
||||||
|
|
@ -54,8 +56,8 @@ python -m scripts.record_conflict_trace \
|
||||||
--output-dir /tmp/inire-trace
|
--output-dir /tmp/inire-trace
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Open `conflict_trace.json` and find `restored_best`. Six nets are complete and the conflict edges are `net_02` with `net_03` and `net_06` with `net_07`. For example, the entry for `net_02` reports that its component 1 overlaps component 1 of `net_03`. See the stage summary in the [recorded conflict trace](../archive/routing/conflict_trace.md#example_07_large_scale_routing_no_warm_start).
|
1. Open `conflict_trace.json` and find `restored_best`. Six nets pass verification. The conflicting pairs are `net_02` with `net_03` and `net_06` with `net_07`. For example, component 1 of `net_02` conflicts with component 1 of `net_03`. Compare the counts with the [recorded conflict trace](../archive/routing/conflict_trace.md#example_07_large_scale_routing_no_warm_start).
|
||||||
2. Compare with `final`. All ten nets verified and the conflict edges are empty. The staged trace shows that repair resolved conflicts remaining after the congestion iterations.
|
2. Compare with `final`. All ten nets pass verification after repair, and the list of conflict edges is empty.
|
||||||
3. To compare expansions and congestion work in the iterations leading up to repair, substitute `scripts.record_iteration_trace` in the command. If you need the reroute order and per-net work immediately before repair, substitute `scripts.record_pre_pair_frontier_trace` and compare with the [recorded pre-pair trace](../archive/routing/pre_pair_frontier_trace.md).
|
3. To compare expansions and congestion work in the iterations leading up to repair, substitute `scripts.record_iteration_trace` in the command. If you need the reroute order and per-net work immediately before repair, substitute `scripts.record_pre_pair_frontier_trace` and compare with the [recorded pre-pair trace](../archive/routing/pre_pair_frontier_trace.md).
|
||||||
|
|
||||||
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).
|
Use the returned result to count final successes. For live progress during routing, pass an [`iteration_callback`](user/api-reference.md#route-a-problem).
|
||||||
|
|
@ -67,8 +69,9 @@ Use the returned result to count final successes. For live progress during routi
|
||||||
3. If the run gets slower without more expansions, check the operation timings and use the counters above to pick a narrower trace or profile.
|
3. If the run gets slower without more expansions, check the operation timings and use the counters above to pick a narrower trace or profile.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# Run this from the baseline checkout.
|
||||||
python -m scripts.routing_benchmark_parity capture /tmp/routing-before.json --case stress
|
python -m scripts.routing_benchmark_parity capture /tmp/routing-before.json --case stress
|
||||||
# Use the same options on the changed revision.
|
# Run these from the changed checkout.
|
||||||
python -m scripts.routing_benchmark_parity capture /tmp/routing-after.json --case stress
|
python -m scripts.routing_benchmark_parity capture /tmp/routing-after.json --case stress
|
||||||
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
|
python -m scripts.routing_benchmark_parity compare /tmp/routing-before.json /tmp/routing-after.json
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,21 @@
|
||||||
|
|
||||||
# Topological routing
|
# Topological routing
|
||||||
|
|
||||||
Guide mode helps detailed search choose a passage through free space. Seed mode also tries to build a physical path through the passage before detailed search starts.
|
Guide mode suggests where a path can pass through free space and lets detailed search choose the actual turns. Seed mode tries to build a valid starting path through that passage before detailed search starts.
|
||||||
|
|
||||||
## Corridor planning and realization
|
## Corridor planning and realization
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
In offset gates, a route must change height between two openings. Read the panels from top to bottom. The highlighted triangle edges show the chosen portals, the dashed line joins the suggested crossing points, and the solid S-bend shows where detailed search fits a physical turn.
|
In the offset-gates example, the two openings are at different heights. The top panel highlights the proposed sequence of triangle edges to cross. In the middle panel, the dashed line joins suggested crossing points. In the bottom panel, the solid route uses an S-bend to change height between the openings.
|
||||||
|
|
||||||
1. **Find connected space for centerlines.** Inset the board by half the widest net's width and expand obstacles by that half-width plus clearance. A short lead tries to attach each terminal to the constrained Delaunay mesh along its heading. The common padding can exclude passages that a narrower net can still use in lattice search.
|
1. **Find connected space for centerlines.** Inset the board by half the widest guide's width and expand obstacles by that half-width plus clearance. To connect a port to the mesh, try a short straight along its departure or arrival heading, or use the port position itself. The common padding can exclude openings that a narrower net can still use in lattice search.
|
||||||
|
|
||||||
<a id="design-background"></a>
|
<a id="design-background"></a>
|
||||||
|
|
||||||
A portal is an edge shared by adjacent free-space triangles. For an earlier representation of a route by its crossings of triangle edges, see Section III-A and Figure 1 of [Hama and Etoh's curvilinear detailed-routing paper](https://www.cecs.uci.edu/~papers/compendium94-03/papers/1998/aspdac98/pdffiles/06c_3.pdf).
|
A portal is an edge shared by adjacent free-space triangles. For an earlier representation of a route by its crossings of triangle edges, see Section III-A and Figure 1 of [Hama and Etoh's curvilinear detailed-routing paper](https://www.cecs.uci.edu/~papers/compendium94-03/papers/1998/aspdac98/pdffiles/06c_3.pdf).
|
||||||
|
|
||||||
2. **Choose a passage and a lane.** Rank portal sequences by distance, occupancy, and estimated overflow. Along each chosen portal, sample crossing points and rank them by turn room and access reserved for other nets. A joint retry can move nets to different lanes through the same opening to make room for a turn. To change how candidate points are ranked, inspect [`assign_lanes()`](../inire/router/_topology.py#L214).
|
2. **Choose a passage and a lane.** Rank a sequence of portals by distance and how many other nets want to use the same edges. A lane is a suggested position along an edge where a net can cross into the next triangle. Rank those positions by turn room and the lanes reserved for other nets. A joint retry can change the lane positions for several nets at the same opening. To see how the positions are scored, inspect [`assign_lanes()`](../inire/router/_topology.py#L214).
|
||||||
|
|
||||||
3. **Turn the sketch into a path.** Guide mode uses the corridor to suggest moves and add a soft cost, so search can leave it to make a turn. Seed mode first searches inside a corridor and checks any seed against obstacles and earlier seeds. With alternatives, the first corridor gets at least half the per-net seed budget. Later detailed iterations can move an incumbent or use another guide. Final verification checks the installed geometry.
|
3. **Turn the sketch into a path.** Guide mode uses the corridor to suggest moves and add a soft cost, so search can leave it to make a turn. Seed mode first searches inside a corridor and checks any seed against obstacles and earlier seeds. With alternatives, the first corridor gets at least half the per-net seed budget. Later detailed iterations can move an incumbent or use another guide. Final verification checks the installed geometry.
|
||||||
|
|
||||||
|
|
@ -26,11 +26,11 @@ In offset gates, a route must change height between two openings. Read the panel
|
||||||
|
|
||||||
## Diagnose a missing or colliding route
|
## Diagnose a missing or colliding route
|
||||||
|
|
||||||
In an explicit guide or seed run, check `run.topology.corridor_counts` and `seeded_net_ids` when the worker returns a topology report.
|
In an explicit guide or seed run, `run.topology.corridor_counts` shows how many passages the planner found per net. In seed mode, `run.topology.seeded_net_ids` shows which nets received a generated starting path.
|
||||||
|
|
||||||
- **No corridor is reported for the net.** Check that the snapped port can launch into free space along its heading. Inspect the keepouts and the padding at the suspected opening to see whether that passage is connected in the mesh.
|
- **No corridor is reported for the net.** Check that the snapped port can launch into free space along its heading. Inspect the keepouts and the padding at the suspected opening to see whether that passage is connected in the mesh.
|
||||||
- **A corridor exists and the path stops short.** Look at the next turn from the end of the partial path. Compare the available space with the allowed radii and arrival heading. If the geometry fits, vary the [per-net seed budget](user/api-reference.md#topologyoptions) and compare whether seed mode reaches the target.
|
- **A corridor exists and the path stops short.** Look at the next turn from the end of the partial path. Compare the available space with the allowed radii and arrival heading. If the geometry fits, vary the [per-net seed budget](user/api-reference.md#topologyoptions) and compare whether seed mode reaches the target.
|
||||||
- **The paths reach their ports and overlap.** Use the [conflict trace](routing-diagnostics.md#find-overlapping-components) to identify the nets and the overlapping components. Locate those components on the board. If both nets compete for the same opening, inspect their lane order and available turn room before increasing the seed budget.
|
- **The paths reach their ports and fail clearance checks.** Use the [conflict trace](routing-diagnostics.md#find-components-in-conflict) to identify the pair and locate the components. If they share an opening, check which lanes the routes used and where they turned. A turn inside the opening may leave too little room for the neighboring route.
|
||||||
|
|
||||||
<a id="moved-benchmark-sections"></a>
|
<a id="moved-benchmark-sections"></a>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@ Import these types from `inire`. To see how the inputs fit together in a runnabl
|
||||||
route(problem, *, options=None, iteration_callback=None) -> RoutingRunResult
|
route(problem, *, options=None, iteration_callback=None) -> RoutingRunResult
|
||||||
```
|
```
|
||||||
|
|
||||||
Omitting `options` uses `RoutingOptions()`. To observe live congestion iterations, pass a callable accepting `(index, results_by_net)`. The index increases across automatic attempts. Each callback sees the nets in its current attempt. Use the returned result for final coverage.
|
Omitting `options` uses `RoutingOptions()`. To observe progress, pass a callable accepting `(index, results_by_net)`. Each call reports one completed congestion iteration on the nets in that attempt. Automatic mode keeps increasing the index across attempts. Check the returned result for final coverage, including on runs that finish without a callback.
|
||||||
|
|
||||||
## Layout inputs
|
## Layout inputs
|
||||||
|
|
||||||
### Ports and nets
|
### Ports and nets
|
||||||
|
|
||||||
- `Port(x, y, r)` snaps coordinates to the integer grid and normalizes the heading `r` in degrees. Heading 0 points east and 90 points north. The heading must be a multiple of 90 after rounding.
|
- `Port(x, y, r)` rounds coordinates to integers. The heading `r` is in degrees, with 0 east, 90 north, 180 west, and 270 south. The rounded angle must be a multiple of 90 and is wrapped to the range 0–359.
|
||||||
- `NetSpec(net_id, start, target, width=2.0)` uses a unique ID and two ports. The target heading is the direction of arrival.
|
- `NetSpec(net_id, start, target, width=2.0)` uses a unique ID and two ports. Set the start heading to the direction of departure and the target heading to the direction of arrival.
|
||||||
|
|
||||||
### RoutingProblem
|
### RoutingProblem
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ The fields below appear in constructor order. Use one layout unit for coordinate
|
||||||
| `static_obstacles` | `()` | Shapely polygons that define keepouts. |
|
| `static_obstacles` | `()` | Shapely polygons that define keepouts. |
|
||||||
| `initial_paths` | Empty mapping | Net IDs mapped to `PathSeed` objects. |
|
| `initial_paths` | Empty mapping | Net IDs mapped to `PathSeed` objects. |
|
||||||
| `clearance` | `2.0` | Required spacing between physical shapes. |
|
| `clearance` | `2.0` | Required spacing between physical shapes. |
|
||||||
| `safety_zone_radius` | `0.0021` | Tolerance for very small obstacle intersections at ports during search. |
|
| `safety_zone_radius` | `0.0021` | Tolerance for small obstacle intersections at a move's endpoints during search. |
|
||||||
|
|
||||||
## Path seeds
|
## Path seeds
|
||||||
|
|
||||||
|
|
@ -39,11 +39,11 @@ The fields below appear in constructor order. Use one layout unit for coordinate
|
||||||
| Value | Read it for |
|
| Value | Read it for |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `RoutingRunResult.results_by_net` | A mapping from net ID to `RoutingResult`. |
|
| `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.is_valid` and `outcome` | `is_valid` is true when the outcome is `completed`. Read `outcome` to distinguish success, a failed geometry check (`colliding`), a path that stopped short (`partial`), or an empty path (`unroutable`). |
|
||||||
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
|
| `RoutingResult.path` | Ordered path components from the source to the last reached state. An unroutable result has an empty path. |
|
||||||
| `RoutingResult.reached_target` | Whether the path reached the target port with its required heading. |
|
| `RoutingResult.reached_target` | Whether the path reached the target position and heading. With heading inference, the check uses the chosen heading. Read `is_valid` for the result of geometry verification. |
|
||||||
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` records a board containment failure when checked. |
|
| `RoutingResult.report` | `total_length` in layout units plus static, dynamic, and self-collision counts. `out_of_bounds` records a board containment failure when checked. |
|
||||||
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons for export or fixed obstacles, and the move sequence for reuse as a seed. |
|
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons and the sequence of moves, respectively. Check validity before exporting polygons or using them as keepouts. |
|
||||||
| `RoutingRunResult.automatic` | In automatic mode, the selected planner, verified IDs, stage history, and any capacity or port-conflict bound. `None` for explicit modes. |
|
| `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. |
|
| `RoutingRunResult.topology` and `metrics` | Corridor counts and seed work when reported by the selected worker, plus work counters across the run. |
|
||||||
|
|
||||||
|
|
@ -67,9 +67,9 @@ To read a route's polygons and write them to a test file, follow the [geometry e
|
||||||
| Field | Default | Effect |
|
| Field | Default | Effect |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `node_limit` | `1_000_000` | Per-search expansion ceiling. Automatic uses smaller budgets for its initial stages. |
|
| `node_limit` | `1_000_000` | Per-search expansion ceiling. Automatic uses smaller budgets for its initial stages. |
|
||||||
| `min_straight_length` | `5.0` | Minimum single straight length. |
|
| `min_straight_length` | `5.0` | Minimum length for regular forward moves in lattice search. |
|
||||||
| `max_straight_length` | `2000.0` | Maximum single straight length. |
|
| `max_straight_length` | `2000.0` | Maximum distance the forward scan uses to propose straight moves in lattice search. |
|
||||||
| `greedy_h_weight` | `1.5` | Weight for the A* heuristic. Lower values give the path cost more influence. |
|
| `greedy_h_weight` | `1.5` | Weight on the estimated cost still needed to reach the target. Lower values give more influence to the cost of the path so far. |
|
||||||
| `bend_radii` | `(50.0, 100.0)` | Permitted radii for 90-degree bends. |
|
| `bend_radii` | `(50.0, 100.0)` | Permitted radii for 90-degree bends. |
|
||||||
| `sbend_radii` | `(10.0,)` | Permitted S-bend radii. |
|
| `sbend_radii` | `(10.0,)` | Permitted S-bend radii. |
|
||||||
| `sbend_offsets` | `None` | Set permitted lateral offsets explicitly, or let search suggest offsets. A compact S-bend needs a nonzero offset with magnitude less than twice its radius. |
|
| `sbend_offsets` | `None` | Set permitted lateral offsets explicitly, or let search suggest offsets. A compact S-bend needs a nonzero offset with magnitude less than twice its radius. |
|
||||||
|
|
@ -86,7 +86,7 @@ The search objective scores path length, components, and proximity. Increasing a
|
||||||
| Field | Default | Effect |
|
| Field | Default | Effect |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `unit_length_cost` | `1.0` | Cost per unit of path length. |
|
| `unit_length_cost` | `1.0` | Cost per unit of path length. |
|
||||||
| `bend_penalty` | `250.0` | Additional cost of a 90-degree bend, scaled by radius. |
|
| `bend_penalty` | `250.0` | Additional cost of a 90-degree bend. Smaller radii incur a larger surcharge when this penalty is positive. |
|
||||||
| `sbend_penalty` | `500.0` | Additional cost of an S-bend. |
|
| `sbend_penalty` | `500.0` | Additional cost of an S-bend. |
|
||||||
| `danger_weight` | `1.0` | Weight of the obstacle proximity cost. |
|
| `danger_weight` | `1.0` | Weight of the obstacle proximity cost. |
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
|
||||||
| `base_penalty` | `100.0` | Initial penalty for overlapping other routes. |
|
| `base_penalty` | `100.0` | Initial penalty for overlapping other routes. |
|
||||||
| `multiplier` | `1.5` | Scale the penalty between unresolved iterations. |
|
| `multiplier` | `1.5` | Scale the penalty between unresolved iterations. |
|
||||||
| `use_tiered_strategy` | `True` | Allow a cheaper bend proxy in the first iteration when applicable. |
|
| `use_tiered_strategy` | `True` | Allow a cheaper bend proxy in the first iteration when applicable. |
|
||||||
| `net_order` | `"user"` | Start from input order or sort by terminal Manhattan distance with `"shortest"` or `"longest"`. |
|
| `net_order` | `"user"` | Start from input order or sort by the sum of the horizontal and vertical distances between ports with `"shortest"` or `"longest"`. |
|
||||||
| `warm_start_enabled` | `True` | Build greedy seeds before congestion iterations. |
|
| `warm_start_enabled` | `True` | Build greedy seeds before congestion iterations. |
|
||||||
| `shuffle_nets` | `False` | Shuffle routing order between iterations. |
|
| `shuffle_nets` | `False` | Shuffle routing order between iterations. |
|
||||||
| `seed` | `None` | Random seed for shuffled ordering. |
|
| `seed` | `None` | Random seed for shuffled ordering. |
|
||||||
|
|
@ -111,7 +111,7 @@ Increase the iteration limit when later reroutes might resolve conflicts. Adjust
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `enabled` | `True` | Try geometric improvements after routing. |
|
| `enabled` | `True` | Try geometric improvements after routing. |
|
||||||
| `objective` | `None` | Use another `ObjectiveWeights` value for refinement, or reuse the search objective. |
|
| `objective` | `None` | Use another `ObjectiveWeights` value for refinement, or reuse the search objective. |
|
||||||
| `max_windows_per_net` | `4` | Maximum candidate windows per net across improvement rounds. Use `1` for a shorter pass or `None` for unlimited windows. |
|
| `max_windows_per_net` | `4` | Maximum number of path sections to try replacing per net across improvement rounds. Use `1` for a shorter pass or `None` to remove this limit. |
|
||||||
|
|
||||||
### TopologyOptions
|
### TopologyOptions
|
||||||
|
|
||||||
|
|
@ -120,11 +120,11 @@ For a layout that repeatedly stops short at an opening, `guide` can suggest a pa
|
||||||
| Field | Default | Effect |
|
| Field | Default | Effect |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `mode` | `"automatic"` | Select a [routing mode](tune-and-troubleshoot.md#choose-a-routing-mode). |
|
| `mode` | `"automatic"` | Select a [routing mode](tune-and-troubleshoot.md#choose-a-routing-mode). |
|
||||||
| `max_corridors` | `3` | Limit alternative corridors per net. |
|
| `max_corridors` | `3` | Maximum proposed passages per net. |
|
||||||
| `guide_strength` | `0.75` | Maximum added guidance cost per unit length. Zero keeps the suggested moves without adding cost. |
|
| `guide_strength` | `0.75` | Maximum added guidance cost per unit length. Zero keeps the suggested moves without adding cost. |
|
||||||
| `seed_node_limit` | `600` | Total seed-search expansions per net, capped by the active search limit. |
|
| `seed_node_limit` | `600` | Total seed-search expansions per net, capped by the active search limit. |
|
||||||
| `infer_terminal_headings` | `False` | Allow heading inference for bundle-style point terminals. Automatic preserves caller headings when initial paths are supplied. |
|
| `infer_terminal_headings` | `False` | Let automatic or bundle mode choose headings for supported layouts with flexible port directions. Automatic preserves caller headings when initial paths are supplied. |
|
||||||
| `automatic_cost` | `"selective"` | Re-score column layouts when they chain short S-bends. Use `"always"` for both passes or `"never"` for span scoring alone. |
|
| `automatic_cost` | `"selective"` | Try a second column-planning pass based on route cost when the first pass chains short S-bends. Use `"always"` to try both passes or `"never"` to plan by span alone. |
|
||||||
| `automatic_length_weights` | `None` | Optional straight, 90-degree bend, and S-bend length multipliers for automatic candidate selection. The default uses the search objective. |
|
| `automatic_length_weights` | `None` | Optional straight, 90-degree bend, and S-bend length multipliers for automatic candidate selection. The default uses the search objective. |
|
||||||
|
|
||||||
### DiagnosticsOptions
|
### DiagnosticsOptions
|
||||||
|
|
@ -135,8 +135,8 @@ The flags default to `False`.
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `capture_expanded` | Plot the states explored by search. |
|
| `capture_expanded` | Plot the states explored by search. |
|
||||||
| `capture_iteration_trace` | Attribute search work to individual nets and iterations. |
|
| `capture_iteration_trace` | Attribute search work to individual nets and iterations. |
|
||||||
| `capture_conflict_trace` | Find overlapping pairs of routes. |
|
| `capture_conflict_trace` | Find pairs of routes with clearance conflicts. |
|
||||||
| `capture_frontier_trace` | Examine pruning near a final overlap. |
|
| `capture_frontier_trace` | See why search pruned moves near a final route conflict. |
|
||||||
| `capture_pre_pair_frontier_trace` | Inspect the routing state before pair-local repair. |
|
| `capture_pre_pair_frontier_trace` | Inspect the routing state before pair-local repair. |
|
||||||
|
|
||||||
For the corresponding result fields and a worked trace, see the [developer diagnostics](../routing-diagnostics.md#traces).
|
For the corresponding result fields and a worked trace, see the [developer diagnostics](../routing-diagnostics.md#traces).
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ To get a result you can experiment with, run the [single-net quick start](../../
|
||||||
## Define the inputs
|
## Define the inputs
|
||||||
|
|
||||||
1. **Choose a coordinate unit.** Inire snaps port coordinates to an integer grid. Choose a unit fine enough to preserve narrow gaps, and use it for widths, radii, clearance, and bounds too.
|
1. **Choose a coordinate unit.** Inire snaps port coordinates to an integer grid. Choose a unit fine enough to preserve narrow gaps, and use it for widths, radii, clearance, and bounds too.
|
||||||
2. **Set source and target headings.** Heading 0 points east and 90 points north. The source heading points along the launch. The target heading points along the arrival. If your device library labels the target port with its outward heading, reverse it by 180 degrees.
|
2. **Set source and target headings.** A heading is the direction the waveguide travels as it leaves its source or enters its target. Heading 0 points east and 90 points north. If a device labels a target port by the direction it faces outward, reverse that heading by 180 degrees. For example, a waveguide entering a west-facing port travels east, so its target heading is 0.
|
||||||
3. **Add a net for each connection.** Give each `NetSpec` a unique ID and the guide width. Use your process's allowed bend radii in [`SearchOptions`](api-reference.md#searchoptions).
|
3. **Add a net for each connection.** Give each `NetSpec` a unique ID and the guide width. Use your process's allowed bend radii in [`SearchOptions`](api-reference.md#searchoptions).
|
||||||
4. **Set the board and keepouts.** Pass the board rectangle as `bounds`, Shapely polygons as `static_obstacles`, and the required physical spacing as `clearance`. For the defaults and accepted inputs, see [`RoutingProblem`](api-reference.md#routingproblem).
|
4. **Set the board and keepouts.** Pass the board rectangle as `bounds`, Shapely polygons as `static_obstacles`, and the required physical spacing as `clearance`. For the defaults and accepted inputs, see [`RoutingProblem`](api-reference.md#routingproblem).
|
||||||
5. **Route and check.** Call `route(problem, options=options)` with automatic mode for a general layout. Before exporting, [check each net's result](tune-and-troubleshoot.md#read-the-result).
|
5. **Route and check.** Call `route(problem, options=options)`. Automatic mode is the default. Before exporting, [check each net's result](tune-and-troubleshoot.md#read-the-result).
|
||||||
|
|
||||||
<a id="connect-a-preplaced-crossing"></a>
|
<a id="connect-a-preplaced-crossing"></a>
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ To get a result you can experiment with, run the [single-net quick start](../../
|
||||||
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.
|
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.
|
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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The dashed outlines show the full footprints of crossings A and B. The shaded keepouts leave a port opening on each facing edge. The external waveguide leaves A at `(80, 75)` and enters B at `(260, 115)`. Both arrows point east.
|
The dashed outlines show the full footprints of crossings A and B. The shaded keepouts leave a port opening on each facing edge. The external waveguide leaves A at `(80, 75)` and enters B at `(260, 115)`. Both arrows point east.
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ Before export, check the port joins and clearance against the actual placed-cell
|
||||||
|
|
||||||
## Export verified geometry
|
## Export verified geometry
|
||||||
|
|
||||||
Use `result.locked_geometry` to pass a verified net's physical polygons to a layout writer. For a test file, continue from the quick start or the crossing example and write the polygons as WKT in the layout's coordinate unit.
|
Use `result.locked_geometry` to pass a verified net's physical polygons to a layout writer. To inspect the coordinates in a text file, continue from the quick start or the crossing example and write the polygons as well-known text (WKT). Keep track of your coordinate unit when importing the file into another tool.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -86,7 +86,7 @@ For a multi-net layout, apply the validity check to every net you intend to expo
|
||||||
## Reuse an existing route
|
## Reuse an existing route
|
||||||
|
|
||||||
- **Give the router a route it can move.** Put `result.as_seed()` in `initial_paths` under the net's ID. A seed uses the current start port, width, and geometry settings. A partial seed can suggest an approach. To build a hint from turns and straights, see the [path seed reference](api-reference.md#path-seeds).
|
- **Give the router a route it can move.** Put `result.as_seed()` in `initial_paths` under the net's ID. A seed uses the current start port, width, and geometry settings. A partial seed can suggest an approach. To build a hint from turns and straights, see the [path seed reference](api-reference.md#path-seeds).
|
||||||
- **Hold a route fixed.** Add `result.locked_geometry` to `static_obstacles` while routing other nets. The next run applies its own clearance.
|
- **Hold a route fixed.** Check `result.is_valid`, then add `result.locked_geometry` to `static_obstacles` while routing other nets. The next run applies its own clearance to those polygons.
|
||||||
|
|
||||||
Route a straight net, then use its polygons as keepouts in a second routing problem. The second net has to detour around one end of the fixed route.
|
Route a straight net, then use its polygons as keepouts in a second routing problem. The second net has to detour around one end of the fixed route.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
# Tune and troubleshoot a route
|
# Tune and troubleshoot a route
|
||||||
|
|
||||||
Start with the net's outcome. It tells you whether to examine the port approach, an overlap, or the search budget.
|
Start with `run.results_by_net[net_id].outcome`. It distinguishes a path that stopped short from one that reached its target and failed a geometry check.
|
||||||
|
|
||||||
## Read the result
|
## Read the result
|
||||||
|
|
||||||
| `result.outcome` | What to inspect |
|
| `result.outcome` | What to inspect |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `completed` | The path reached its target and passed verification. Read its length in `report.total_length` and follow the [geometry export steps](route-a-layout.md#export-verified-geometry). |
|
| `completed` | The path reached its target and passed verification. Read its length in `report.total_length` and follow the [geometry export steps](route-a-layout.md#export-verified-geometry). |
|
||||||
| `colliding` | The path reached its target. Check the collision counts in `result.report` to see whether it overlaps a keepout, another route, or itself. For automatic routing, also check `report.out_of_bounds`. |
|
| `colliding` | The path reached its target and failed verification. Check `result.report` for keepout clearance, conflicts with another route, or self-overlap. In automatic mode, also check `report.out_of_bounds`. |
|
||||||
| `partial` | Locate `result.path[-1].end_port` on the board and check the next turn and radius. If that approach fits, compare search limits. |
|
| `partial` | Read the position and heading of `result.path[-1].end_port`. Check room for the path to continue from that heading. If the next turn fits, compare search limits. |
|
||||||
| `unroutable` | The path is empty. Check the launch heading and room for the first straight or bend. |
|
| `unroutable` | The path is empty. Check the launch heading and room for the first straight or bend. |
|
||||||
|
|
||||||
Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode, also check that the physical polygons fit the board if your export requires containment. Automatic mode includes that check in candidate verification.
|
Check `is_valid` before exporting. With explicit `off`, `guide`, or `seed` mode, also check that the physical polygons fit the board if your export requires containment. Automatic mode includes that check in candidate verification.
|
||||||
|
|
||||||
## Why a net stopped short
|
## Why a net stopped short
|
||||||
|
|
||||||
1. **Check whether automatic routing hit a bound.** Compare the verified count with `run.automatic.max_routed`. If the count reaches a bound below the requested total, use `capacity_limit` to locate the passage to widen or `port_conflicts` to find the ports to move.
|
1. **Check the coverage bound in automatic mode.** Compare the verified count with `run.automatic.max_routed`. If the bound is below the requested total, `capacity_limit` can identify a cut with too few tracks and `port_conflicts` can identify pairs of nets whose ports are too close. If the count falls below the bound, check the approaches and search limits as well.
|
||||||
2. **Check the next approach.** Follow a partial route from its endpoint toward the target. Check the width, clearance, allowed turns, and final heading against the physical layout. When none of the allowed bends fits, change the port approach or the available space.
|
2. **Check the next approach.** Follow a partial route from its last heading toward the target heading. Check whether the allowed turns fit with the guide width and clearance. If the approach requires a turn larger than the available space, reposition the port or give the turn more room.
|
||||||
3. **Compare two search limits.** If the geometry looks feasible, rerun with a larger `search.node_limit` and compare the path endpoint and verified count. The limit applies per search. One run can search the same net several times. Look up the default and related fields in [`SearchOptions`](api-reference.md#searchoptions).
|
3. **Compare two search limits.** If the geometry looks feasible, rerun with a larger `search.node_limit` and compare the path endpoint and verified count. The limit applies per search. One run can search the same net several times. Look up the default and related fields in [`SearchOptions`](api-reference.md#searchoptions).
|
||||||
|
|
||||||

|

|
||||||
|
|
@ -28,23 +28,23 @@ At three nodes per search the dashed path ends before the first keepout. At 500
|
||||||
Set `TopologyOptions(mode=...)` and pass it as `topology` in `RoutingOptions`.
|
Set `TopologyOptions(mode=...)` and pass it as `topology` in `RoutingOptions`.
|
||||||
|
|
||||||
- **`automatic`.** Start here. Inire chooses from constructive planners and search stages and keeps the best verified coverage it finds.
|
- **`automatic`.** Start here. Inire chooses from constructive planners and search stages and keeps the best verified coverage it finds.
|
||||||
- **`off`.** Isolate lattice search or work with custom physical bend geometry.
|
- **`off`.** Run lattice search directly to measure what search can do without corridor suggestions.
|
||||||
- **`guide`.** Use suggested corridors when a detour looks promising and the router needs freedom to leave the corridor to turn.
|
- **`guide`.** Suggest a passage through free space. Search can leave it to make a turn.
|
||||||
- **`seed`.** Try to realize a verified starting path inside a corridor before the detailed search.
|
- **`seed`.** Try to build a valid starting path inside the suggested passage 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`.
|
- **`bundle`.** Route supported ordered rectangular bundles with an empty `initial_paths` mapping. Use circular physical bends. The smallest 90-degree bend radius must be a positive integer and must also appear in `sbend_radii`. Unsupported layouts and invalid schedules raise `ValueError`.
|
||||||
|
|
||||||
### Mode requirements
|
### 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.
|
- In guide and seed modes, nets without a corridor can use ordinary lattice search. A caller-supplied seed takes precedence over a generated one. These modes require Shapely 2.1 or later with GEOS 3.10 or later for [constrained triangulation](https://shapely.readthedocs.io/en/2.1.2/reference/shapely.constrained_delaunay_triangles.html).
|
||||||
- Enable `infer_terminal_headings` for point terminals with flexible headings. Preserve fixed headings when a device requires a specific arrival direction.
|
- Use `infer_terminal_headings` with automatic or bundle mode if your ports may change direction and the layout supports bundle planning. For the same board with fixed and flexible headings, see the [nine-net example](../../examples/advanced.md#nine-net-terminal-bench-board).
|
||||||
- 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 mode starts with smaller budgets and can retry with your configured ceiling if coverage remains below the bound. It runs lattice search directly for custom physical bends or polygonal search proxies, or when constrained triangulation is unavailable.
|
||||||
|
|
||||||
## Choose the next setting
|
## Choose the next setting
|
||||||
|
|
||||||
| Observation | Next comparison |
|
| Observation | Next comparison |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| Multiple routes reach their ports and collide with one another | Change `net_order` or `max_iterations` one at a time. Compare which nets remain unresolved. See the accepted values in [`CongestionOptions`](api-reference.md#congestionoptions). |
|
| Multiple routes reach their ports and collide with one another | Change `net_order` or `max_iterations` one at a time. Compare which nets remain unresolved. See the accepted values in [`CongestionOptions`](api-reference.md#congestionoptions). |
|
||||||
| Valid routes use too many small bends | Increase `bend_penalty`. Compare bend counts and physical lengths to see whether a straighter path needs a longer detour. See [`ObjectiveWeights`](api-reference.md#objectiveweights). |
|
| Valid routes use too many turns | Increase `bend_penalty` for 90-degree turns or `sbend_penalty` for S-bends. Compare the number of each type and the resulting path length. See [`ObjectiveWeights`](api-reference.md#objectiveweights). |
|
||||||
| Refinement dominates runtime | Try `max_windows_per_net=1`. Compare runtime, cost, and verified paths before adopting the smaller limit. See [`RefinementOptions`](api-reference.md#refinementoptions). |
|
| Refinement dominates runtime | Try `max_windows_per_net=1`. Compare runtime, cost, and verified paths before adopting the smaller limit. See [`RefinementOptions`](api-reference.md#refinementoptions). |
|
||||||
|
|
||||||
For a shorter refinement pass, derive the new settings from the `options` already used for the layout.
|
For a shorter refinement pass, derive the new settings from the `options` already used for the layout.
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 88 KiB |
|
|
@ -3,13 +3,13 @@ from inire.utils.visualization import plot_routing_results
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
print("Running Example 05: Orientation Stress Test...")
|
print("Running Example 05: Port Headings...")
|
||||||
|
|
||||||
bounds = (0, 0, 200, 200)
|
bounds = (0, 0, 200, 200)
|
||||||
netlist = {
|
netlist = {
|
||||||
"u_turn": (Port(50, 50, 0), Port(50, 70, 180)),
|
"east_to_west": (Port(50, 50, 0), Port(50, 70, 180)),
|
||||||
"loop": (Port(100, 100, 90), Port(100, 80, 270)),
|
"north_to_south": (Port(100, 100, 90), Port(100, 80, 270)),
|
||||||
"zig_zag": (Port(20, 150, 0), Port(180, 150, 0)),
|
"straight": (Port(20, 150, 0), Port(180, 150, 0)),
|
||||||
}
|
}
|
||||||
problem = RoutingProblem(
|
problem = RoutingProblem(
|
||||||
bounds=bounds,
|
bounds=bounds,
|
||||||
|
|
@ -20,7 +20,7 @@ def main() -> None:
|
||||||
objective=ObjectiveWeights(bend_penalty=50.0),
|
objective=ObjectiveWeights(bend_penalty=50.0),
|
||||||
)
|
)
|
||||||
|
|
||||||
print("Routing complex orientation nets...")
|
print("Routing two heading reversals and one straight connection...")
|
||||||
run = route(problem, options=options)
|
run = route(problem, options=options)
|
||||||
for net_id, result in run.results_by_net.items():
|
for net_id, result in run.results_by_net.items():
|
||||||
status = "Success" if result.is_valid else "Failed"
|
status = "Success" if result.is_valid else "Failed"
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 53 KiB |
|
|
@ -1,6 +1,6 @@
|
||||||
# Routing examples
|
# Routing examples
|
||||||
|
|
||||||
After [installing Inire](../README.md#install), run the scripts from the repository root. They save PNGs in the examples directory by default.
|
After [installing Inire](../README.md#install), run the scripts from the repository root. They save PNGs in `examples/` by default. Arrows at ports show the direction the route leaves its source or enters its target.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python examples/01_simple_route.py
|
python examples/01_simple_route.py
|
||||||
|
|
@ -10,36 +10,37 @@ python examples/01_simple_route.py
|
||||||
|
|
||||||
| Script | What to look for | Preview |
|
| Script | What to look for | Preview |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| [Simple route](01_simple_route.py) | One path leaves and enters its ports travelling east. | [Quick-start figure](../README.md#route-a-net) |
|
| [Simple route](01_simple_route.py) | A straight waveguide connects two eastbound ports 80 units apart. | [Straight connection](01_simple_route.png) |
|
||||||
| [Port orientations](05_orientation_stress.py) | Perpendicular and opposing headings require different approaches, even for nearby ports. | [Port approaches](05_orientation_stress.png) |
|
| [Port headings](05_orientation_stress.py) | Two routes connect ports just 20 units apart. The lower route departs east and arrives west. The middle route departs north and arrives south. Both need room to turn. | [Two heading reversals and a straight route](05_orientation_stress.png) |
|
||||||
|
|
||||||
## Route around fixed geometry
|
## Route around fixed geometry
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The second route loops around the left end of the fixed straight. To reproduce the detour, run [`03_locked_paths.py`](03_locked_paths.py). To supply your own fixed polygons, follow the [route reuse workflow](../docs/user/route-a-layout.md#reuse-an-existing-route).
|
The first call routes a straight waveguide. The second uses its polygons as keepouts, so the new northbound connection passes to the left of the fixed route. Run [`03_locked_paths.py`](03_locked_paths.py) to reproduce the detour. To hold a route fixed in your own design, follow the [route reuse workflow](../docs/user/route-a-layout.md#reuse-an-existing-route).
|
||||||
|
|
||||||
## Fit bends to available room
|
## Fit bends to available room
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Follow the short offset to see a single S-bend. The larger shift has room for a pair of right-angle bends.
|
Run [`04_sbends_and_radii.py`](04_sbends_and_radii.py) to compare a 5-unit shift made with an S-bend and an 80-unit shift made with two 90-degree bends. Both routes leave and arrive heading east. The two 90-degree turns use radius 10 from the allowed radii of 10 and 30.
|
||||||
|
|
||||||
| Script | What to look for | Preview |
|
| Script | What to look for | Preview |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| [S-bends and radii](04_sbends_and_radii.py) | The shapes used for a short offset and for a larger shift. | Compare the two paths in the figure above. |
|
| [Bend proxies](06_bend_collision_models.py) | Compare three separate runs. The middle route has round physical bends and uses rectangles to check for collisions during search. The bottom route uses a right-angle polygon for both. | [Arc, box proxy, and custom bend](06_bend_collision_models.png) |
|
||||||
| [Bend proxies](06_bend_collision_models.py) | How an arc, a box proxy for an arc, and a custom physical bend affect the route. | [Bend model comparison](06_bend_collision_models.png) |
|
| [Custom bends](08_custom_bend_geometry.py) | Two runs connect the same ports. Compare the standard arc with the custom right-angle bend. The shaded box at the turn shows the custom bend's search proxy. | [Two bends at the same corner](08_custom_bend_geometry.png) |
|
||||||
| [Custom bends](08_custom_bend_geometry.py) | A route whose search proxy and physical bend use different polygons. | [Custom bend overlay](08_custom_bend_geometry.png) |
|
|
||||||
|
The dashed outlines show the shapes used for collision checks during search. The solid outlines show the physical waveguides.
|
||||||
|
|
||||||
## Diagnose congestion or an incomplete route
|
## Diagnose congestion or an incomplete route
|
||||||
|
|
||||||
| Script | What to look for | Preview |
|
| Script | What to look for | Preview |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| [Congestion resolution](02_congestion_resolution.py) | How rerouting separates nets competing for the same space. | [Separated routes](02_congestion_resolution.png) |
|
| [Congestion resolution](02_congestion_resolution.py) | The eastbound route bends around the lower ends of two straight vertical routes. | [Detour around vertical routes](02_congestion_resolution.png) |
|
||||||
| [Best-effort result](09_unroutable_best_effort.py) | Where a path stops with a small node budget. Try `node_limit=500` to complete it. | [Budget comparison](../docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) |
|
| [Best-effort result](09_unroutable_best_effort.py) | At `node_limit=3`, the route stops after its first turn with outcome `partial`. At 500 it reaches the target heading west. | [Three versus 500 nodes](../docs/user/tune-and-troubleshoot.md#why-a-net-stopped-short) |
|
||||||
| [Fan-out](07_large_scale_routing.py) | How search states cluster around a bottleneck. The example adjusts the heuristic between iterations through the internal worker. | [Fan-out search overlay](07_large_scale_routing.png) |
|
| [Fan-out](07_large_scale_routing.py) | Ten routes pass through one opening in a wall and spread out to widely spaced targets on the right. | [Ten routes through one opening](07_large_scale_routing.png) |
|
||||||
|
|
||||||
In the bend overlays, the dashed outline shows what search uses to screen candidate moves. The solid outline shows the physical bend you can measure for clearance. To interpret an incomplete or colliding path, read `result.outcome` using the [result guide](../docs/user/tune-and-troubleshoot.md#read-the-result).
|
The fan-out script includes a callback that can adjust the search weight for later iterations. With these settings, the automatically generated starting paths already pass verification. For a multi-net example built on the public API, try the [two-crossing layout](advanced.md#two-crossings-with-an-outside-detour).
|
||||||
|
|
||||||
## Route a challenging layout
|
## Route a challenging layout
|
||||||
|
|
||||||
|
|
|
||||||