Report coincident terminals and unusable seeds per net, update custom bend handling and verification, and cover the revised behavior with regression tests. Shorten the user and developer guides around reader tasks and keep the illustrated routing walkthrough and reference links easy to find.
66 lines
4.7 KiB
Markdown
66 lines
4.7 KiB
Markdown
# Tune and troubleshoot a route
|
|
|
|
## Read the result
|
|
|
|
Get the route with `result = run.results_by_net[net_id]`.
|
|
|
|
| `result.outcome` | What to inspect |
|
|
| --- | --- |
|
|
| `completed` | The path reached its target and passed verification. Read its length in `report.total_length` and [save its placement recipe](route-a-layout.md#save-a-placement-recipe). |
|
|
| `colliding` | Reached the target and failed verification. Check `result.report` for collisions, invalid polygons, or a board boundary violation. |
|
|
| `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. |
|
|
|
|
Place the result when `result.is_valid` is true.
|
|
|
|
## Why a net stopped short
|
|
|
|
1. **Check the bound in automatic mode.** If `run.automatic.max_routed` is below the requested count, check `capacity_limit` for a bottleneck and `port_conflicts` for ports that are too close.
|
|
2. **Check room for the next turn.** For a [partial result](#read-the-result), start at `result.path[-1].end_port`. Compare the allowed radii and clearance with the room to reach the target heading.
|
|
3. **Try a larger search budget.** If the approach fits, increase `node_limit` in [`SearchOptions`](api-reference.md#searchoptions) and compare the endpoint and verified count. The limit is per search, and a run can search a net more than once.
|
|
|
|

|
|
|
|
Rerun the [best-effort example](../../examples/09_unroutable_best_effort.py) with `node_limit` raised from 3 to 500.
|
|
|
|
## Choose a routing mode
|
|
|
|
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.
|
|
- **`off`.** Run lattice search directly to measure what search can do without corridor suggestions.
|
|
- **`guide`.** Suggest a passage through free space. Search can leave it to make a turn.
|
|
- **`seed`.** Try to build a valid starting path inside the suggested passage before the detailed search.
|
|
- **`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
|
|
|
|
- Guide and seed modes need Shapely 2.1 or later with GEOS 3.10 or later when planning corridors. Nets that receive no corridor can use ordinary lattice search. A caller-supplied seed takes precedence over a generated one. Set `node_limit=0` to verify supplied seeds without planning corridors. [Constrained triangulation requirements](https://shapely.readthedocs.io/en/2.1.2/reference/shapely.constrained_delaunay_triangles.html)
|
|
- Use `infer_terminal_headings` with automatic or bundle mode if your ports may change direction and the layout supports bundle planning. Compare fixed and flexible headings in [complex-routing example 1](../../examples/advanced.md#complex-routing-example-1).
|
|
- Automatic starts with smaller budgets and can retry up to your ceiling. When corridor planning is unavailable, it can fall back to lattice search.
|
|
|
|
[Compare all five modes on one board](../complex-routing-example-1.md#compare-all-routing-modes)
|
|
|
|
## Choose the next setting
|
|
|
|
| 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). |
|
|
| 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). |
|
|
|
|
For a shorter refinement pass, derive the new settings from the `options` already used for the layout.
|
|
|
|
```python
|
|
from dataclasses import replace
|
|
from inire import route
|
|
|
|
short_pass = replace(
|
|
options.refinement,
|
|
max_windows_per_net=1,
|
|
)
|
|
faster_refinement = replace(
|
|
options, refinement=short_pass,
|
|
)
|
|
run = route(problem, options=faster_refinement)
|
|
```
|