Check physical keepout clearance, retain useful partial paths, and account for all pair repair searches. Verify complete seeds early and recover narrower corridors when shared guides are blocked. Keep frontier diagnostics outside routing decisions and bound their work by the worker deadline. Correct benchmark scaling and scenario validation, and update the guides and release metadata.
4.9 KiB
4.9 KiB
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. |
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
- Check the bound in automatic mode. If
run.automatic.max_routedis below the requested count, checkcapacity_limitfor a bottleneck andport_conflictsfor ports that are too close. - Check room for the next turn. For a partial result, start at
result.path[-1].end_port. Compare the allowed radii and clearance with the room to reach the target heading. - Try a larger search budget. If the approach fits, increase
node_limitinSearchOptionsand 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 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 emptyinitial_pathsmapping. Use circular physical bends and configure a usable positive integer radius in bothbend_radiiandsbend_radii. Unsupported layouts and invalid schedules raiseValueErrorwhen routing iterations are enabled.
Mode requirements
- Inire requires Shapely 2.1 or newer with GEOS 3.10 or newer. In guide and seed modes, nets that receive no corridor can use ordinary lattice search. Set
node_limit=0to verify supplied seeds without planning corridors. Constrained triangulation requirements - Seed mode gives complete caller-supplied paths priority when they can be reserved without collisions. Partial paths are hints. Seed mode may replace them with complete paths generated from a corridor before the main search.
- Use
infer_terminal_headingswith 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. - Automatic starts with smaller budgets and can retry up to your ceiling. It can try lattice search after constructive planning and corridor-guided search leave unresolved nets.
Compare all five modes on one board
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. |
| 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. |
| Refinement dominates runtime | Try max_windows_per_net=1. Compare runtime, cost, and verified paths before adopting the smaller limit. See RefinementOptions. |
For a shorter refinement pass, derive the new settings from the options already used for the layout.
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)
