5.6 KiB
5.6 KiB
Tune and troubleshoot a route
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
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. |
colliding |
The path reached its target and failed verification. Check result.report for keepout clearance, conflicts with another route, self-overlap, invalid geometry, a bad join, or geometry outside the board. |
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. |
Check is_valid before exporting. Every routing mode checks that the physical polygons fit within the board.
Why a net stopped short
- 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_limitcan identify a cut with too few tracks andport_conflictscan identify pairs of nets whose ports are too close. If the count falls below the bound, check the approaches and search limits as well. - 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.
- Compare two search limits. If the geometry looks feasible, rerun with a larger
search.node_limitand 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 inSearchOptions.
At three nodes per search the dashed path ends before the first keepout. At 500 the solid path clears the obstacles and reaches the target with the required westbound heading. To reproduce the comparison, change node_limit from 3 to 500 in a copy of the best-effort example.
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. The smallest 90-degree bend radius must be a positive integer and must also appear insbend_radii. Unsupported layouts and invalid schedules raiseValueError.
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=0to verify supplied seeds without planning corridors. Constrained triangulation requirements - 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 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. With no triangulation available, it tries the constructive planners before falling back to lattice search. Example with all five 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. |
| 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)
