Keep route placement at the layout writer boundary
Use the effective net, seed, and search settings as the placement recipe. Remove the export-grid, whole-layer, and CPW mask assembly helpers and cover replay from resolved ports.
This commit is contained in:
parent
07f1c47e26
commit
42e1de9884
4 changed files with 148 additions and 718 deletions
|
|
@ -43,14 +43,15 @@ The fields below appear in constructor order. Use one layout unit for coordinate
|
|||
| `RoutingRunResult.results_by_net` | A read-only mapping from net ID to `RoutingResult`. Use `dict(run.results_by_net)` to make an editable copy. |
|
||||
| `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.requested_net` and `effective_net` | The net as supplied and the net used by the worker, including resolved headings. |
|
||||
| `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. Each component carries its move specification and placed start and end ports. An unroutable result has an empty path. |
|
||||
| `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` flags geometry outside the board. `discontinuous` flags missing or point-only joins, including at terminal faces. `invalid_geometry` flags invalid or empty physical polygons. `seed_error` identifies a supplied bend that cannot carry the net's width or cannot be safely materialized. `terminal_error` identifies an inaccessible start or target face. |
|
||||
| `RoutingResult.locked_geometry` and `as_seed()` | Physical polygons and the sequence of moves, respectively. Check validity before exporting polygons or [reserving a completed net](route-a-layout.md#reuse-an-existing-route). |
|
||||
| `RoutingResult.as_seed()` | The ordered moves for [saving a placement recipe](route-a-layout.md#save-a-placement-recipe) or replaying a path. |
|
||||
| `RoutingResult.locked_geometry` | Physical polygons checked during routing. Use these to inspect the route or [reserve a completed net](route-a-layout.md#reuse-an-existing-route). |
|
||||
| `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. |
|
||||
|
||||
To read a route's polygons and write them to a test file, follow the [geometry export steps](route-a-layout.md#export-verified-geometry). For saved route provenance and full-layer checks, see [Check a complete layer before writing](fabrication.md#check-a-complete-layer-before-writing).
|
||||
Check `is_valid` and keep the effective net and geometry settings with each placement recipe. [Placement workflow](route-a-layout.md#save-a-placement-recipe)
|
||||
|
||||
## Options and defaults
|
||||
|
||||
|
|
@ -86,7 +87,7 @@ To read a route's polygons and write them to a test file, follow the [geometry e
|
|||
| `bend_physical_length` | `None` | Optional authored centerline length for the shared custom 90-degree template, including tangent extensions. Search, refinement, and reports use it when supplied. |
|
||||
| `distance_heuristic_weight` | `1.0` | Finite, nonnegative multiplier for the remaining-distance term only. Increase it to favor progress toward the target relative to estimated turn penalties. The routed path's objective stays the same. |
|
||||
|
||||
A custom S-bend outline uses local coordinates. Its input face is centered at `(0, 0)`, its output face at `(span, offset)`, and both ports face east. Use the same grid span as `SBendSeed(offset, radius)`, including any tangent extension to reach the output face. For example, an offset of `40` with radius `50` has its output at `(80, 40)`. The router rotates and translates the entire outline and uses it for collision checks and export. Supply a separate outline to customize the opposite offset. Width matching allows a relative difference of `1e-12` to account for floating-point conversions. An ambiguous match raises an error. Unmatched moves use the circular S-bend. Set `SBendOutline.length` to use a process-specific centerline length for scoring, refinement, and reporting. The default is the nominal circular length. Automatic mode uses lattice search when a registered outline matches a net width. Bundle mode requires circular bends for its nets.
|
||||
A custom S-bend outline uses local coordinates. Its input face is centered at `(0, 0)`, its output face at `(span, offset)`, and both ports face east. Use the same grid span as `SBendSeed(offset, radius)`, including any tangent extension to reach the output face. For example, an offset of `40` with radius `50` has its output at `(80, 40)`. The router rotates and translates the entire outline and uses it for collision checks and seed replay. Supply a separate outline to customize the opposite offset. Width matching allows a relative difference of `1e-12` to account for floating-point conversions. An ambiguous match raises an error. Unmatched moves use the circular S-bend. Set `SBendOutline.length` to use a process-specific centerline length for scoring, refinement, and reporting. The default is the nominal circular length. Automatic mode uses lattice search when a registered outline matches a net width. Bundle mode requires circular bends for its nets.
|
||||
|
||||
When migrating a half-arc template, supply the complete outline through `sbend_outlines` and keep `bend_physical_geometry` for custom 90-degree bends. Both terminal faces of each custom polygon must be centered on their ports and match the routed width. A custom 90-degree template is shared across nets, so it can only be used by nets whose width matches its faces. Replay an `SBendSeed` with the same outlines and bend settings to recover its physical geometry.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Check routed geometry before fabrication
|
||||
# Route with process constraints
|
||||
|
||||
Inire checks continuity, board containment, and clearance for the shapes and constraints in the routing problem. The placed-cell and process data determine port compatibility, layer assignment, length tolerances, and conductor connectivity. Keep those values with the layout through verification and export.
|
||||
Inire checks routed-path continuity, board containment, and clearance for the geometry in the routing problem. Use the placed-cell and process data for port compatibility, layer assignment, and length tolerances. Keep that context with each [placement recipe](route-a-layout.md#save-a-placement-recipe) when assembling the layout.
|
||||
|
||||
## Check placed optical ports
|
||||
|
||||
|
|
@ -15,114 +15,71 @@ taper_input = PlacedPort(Port(70000, 10000, 0), width=500)
|
|||
net = source.connect("source_to_taper", taper_input)
|
||||
```
|
||||
|
||||
For a 3,000 nm target, place the 40 µm taper with its 500 nm face at `taper_input` and its 3,000 nm face abutting the target. Include the placed taper in the cell geometry and open only the intentional join in the routing keepouts. Check the two actual joins in the assembled layer after writing the file. [EBeam taper cell](https://github.com/SiEPIC/SiEPIC_EBeam_PDK/blob/363fbb52eefa8669100499ab531d3fe7befc4867/klayout/EBeam/gds/EBeam/ebeam_routing_taper_te1550_w%3D500nm_to_w%3D3000nm_L%3D40um.gds)
|
||||
For a 3,000 nm target, place the 40 µm taper with its 500 nm face at `taper_input` and its 3,000 nm face abutting the target. Use routing keepouts with local openings for the terminal leads. When you assemble the layout, place the verified route against the device ports and check the physical joins. [EBeam taper cell](https://github.com/SiEPIC/SiEPIC_EBeam_PDK/blob/363fbb52eefa8669100499ab531d3fe7befc4867/klayout/EBeam/gds/EBeam/ebeam_routing_taper_te1550_w%3D500nm_to_w%3D3000nm_L%3D40um.gds)
|
||||
|
||||
## Preserve length-sensitive paths
|
||||
|
||||
Keep the original polygons and authored length when rerouting one arm of an interferometer. Compare the replacement to the tolerance supplied by the circuit designer. For a matched pair, compare the signed difference between the two arm lengths before and after the replacement.
|
||||
Keep the original placement and authored length when rerouting one arm of an interferometer. Compare the replacement to the tolerance supplied by the circuit designer. For a matched pair, compare the signed difference between the two arm lengths before and after the replacement.
|
||||
|
||||
```python
|
||||
from inire.layout import preserves_length
|
||||
|
||||
# Lengths are in the same units as the routing layout.
|
||||
geometry = replacement.locked_geometry if preserves_length(replacement, authored_length, length_tolerance) else original_geometry
|
||||
placement = original_placement
|
||||
if preserves_length(replacement, authored_length, length_tolerance):
|
||||
placement = (replacement.effective_net, replacement.as_seed(), options.search)
|
||||
```
|
||||
|
||||
An authored 286.770 µm path in the Raymond MZI array can be replaced geometrically by a 127.208 µm route. If the circuit uses process-specific Bézier bends, supply the measured centerline length with the custom bend template and use the same setting for search and replay. Use the geometry comparison above to retain the original path when the replacement falls outside the circuit tolerance. [Raymond MZI layout](https://github.com/SiEPIC/openEBL-2025-02/blob/a887476a301db2a014be007717cd1821e111f58e/submissions/EBeam_hannahraymond_MZIv21.gds) · [Custom bend lengths](api-reference.md#searchoptions)
|
||||
|
||||
## Check the export grid
|
||||
|
||||
Use the layout writer's rounding grid in routing units. `verify_export_grid` rounds route vertices while holding the supplied keepouts fixed. Supply the keepout geometry as it will appear in the file and pass all intended routes on the layer in one call so they are checked against each other. The function requires each result to match the net’s width and terminal contract and to have passed routing verification. For fixed routes, supply their final layout polygons as described in the [route reuse workflow](route-a-layout.md#reuse-an-existing-route). Recheck the assembled cell after writing when the writer performs further operations such as path merging or coordinate transforms.
|
||||
|
||||
```python
|
||||
from inire.layout import verify_export_grid
|
||||
|
||||
results = {net.net_id: run.results_by_net[net.net_id] for net in problem.nets}
|
||||
export = verify_export_grid(problem, results, grid=1.0)
|
||||
if not export.is_valid:
|
||||
raise ValueError(export.reports_by_net)
|
||||
geometry_by_net = export.geometry_by_net
|
||||
```
|
||||
|
||||
For example, two concentric bends with approximately 70.02 nm floating-point clearance can fall below 70 nm on a 1 nm grid. Use an allowed finer database unit or increase the route's margin, then recheck the rounded geometry and run the process deck. [Pinned EBeam spacing deck](https://github.com/SiEPIC/SiEPIC_EBeam_PDK/blob/363fbb52eefa8669100499ab531d3fe7befc4867/klayout/EBeam/drc/SiEPIC_EBeam.drc)
|
||||
An authored 286.770 µm path in the Raymond MZI array can be replaced geometrically by a 127.208 µm route. If the circuit uses process-specific Bézier bends, supply the measured centerline length with the custom bend template and use the same setting for search and replay. The length check retains the original placement when the replacement falls outside the circuit tolerance. [Raymond MZI layout](https://github.com/SiEPIC/openEBL-2025-02/blob/a887476a301db2a014be007717cd1821e111f58e/submissions/EBeam_hannahraymond_MZIv21.gds) · [Custom bend lengths](api-reference.md#searchoptions)
|
||||
|
||||
## Keep layers and process profiles with the nets
|
||||
|
||||
Each `RoutingProblem` represents one collision plane. Group independent layers by the layer and datatype used by the writer, then keep that pair on the output. Add projected keepouts from other layers when the process requires cross-layer spacing. Keep intentional transitions between layers as placed circuit devices.
|
||||
Each `RoutingProblem` represents one collision plane. Group independent layers by layer and datatype and keep that pair with the placement recipes. Add projected keepouts from other layers when the process requires cross-layer spacing. Keep intentional transitions between layers as placed circuit devices.
|
||||
|
||||
```python
|
||||
from inire import RoutingProblem, route
|
||||
from inire.layout import partition_layers, verify_export_grid
|
||||
from inire.layout import partition_layers
|
||||
|
||||
geometry_by_layer = {}
|
||||
placements_by_layer = {}
|
||||
for layer, nets in partition_layers([((1, 0), silicon_net), ((4, 0), nitride_net)]).items():
|
||||
plane = RoutingProblem(bounds, nets, static_obstacles=keepouts_by_layer[layer], clearance=clearance_by_layer[layer])
|
||||
run = route(plane, options=options_by_layer[layer])
|
||||
export = verify_export_grid(plane, run.results_by_net, grid=1.0)
|
||||
if not export.is_valid:
|
||||
raise ValueError(export.reports_by_net)
|
||||
geometry_by_layer[layer] = export.geometry_by_net
|
||||
plane = RoutingProblem(
|
||||
bounds, nets, static_obstacles=keepouts_by_layer[layer], clearance=clearance_by_layer[layer],
|
||||
)
|
||||
options = options_by_layer[layer]
|
||||
run = route(plane, options=options)
|
||||
placements = {}
|
||||
for net_id, result in run.results_by_net.items():
|
||||
if not result.is_valid:
|
||||
raise ValueError(f"Route {net_id!r} ended with outcome {result.outcome!r}")
|
||||
placements[net_id] = (result.effective_net, result.as_seed(), options.search)
|
||||
placements_by_layer[layer] = placements
|
||||
```
|
||||
|
||||
For different bend rules on the same layer, supply each group's allowed radii in `SearchOptions`. `route_profiles` applies those options to search, seed replay, and refinement, and reserves the verified groups in the order supplied. In the QFoundry example, the flux line can use 15 µm radius while the feedline requires at least 50 µm although both have a 15.5 µm signal width and 7 µm gaps. [QFoundry process profiles](https://github.com/tii-qfoundry/PDK_QFoundry/blob/9c31db1d6879c96bd98460ee134181a865481d75/qfoundry/tech/waveguides.xml#L21-L64)
|
||||
|
||||
```python
|
||||
from inire import RoutingProblem
|
||||
from inire.layout import route_profiles, verify_export_grid
|
||||
from inire.layout import route_profiles
|
||||
|
||||
cpw_plane = RoutingProblem(
|
||||
bounds, (flux_net, feed_net), static_obstacles=cpw_keepouts, clearance=ground_strip_width,
|
||||
)
|
||||
results = route_profiles(cpw_plane, [
|
||||
profiles = [
|
||||
((flux_net.net_id,), flux_options),
|
||||
((feed_net.net_id,), feed_options),
|
||||
])
|
||||
export = verify_export_grid(cpw_plane, results, grid=1.0)
|
||||
if not export.is_valid:
|
||||
raise ValueError(export.reports_by_net)
|
||||
]
|
||||
results = route_profiles(cpw_plane, profiles)
|
||||
placements = {}
|
||||
for net_ids, options in profiles:
|
||||
for net_id in net_ids:
|
||||
result = results[net_id]
|
||||
if not result.is_valid:
|
||||
raise ValueError(f"Route {net_id!r} ended with outcome {result.outcome!r}")
|
||||
placements[net_id] = (result.effective_net, result.as_seed(), options.search)
|
||||
```
|
||||
|
||||
## Check a complete layer before writing
|
||||
## Route a coplanar waveguide envelope
|
||||
|
||||
For a saved layout, keep each route with its source layer, coordinate scale, and revision. Use `SavedRoute` with the verified result from the original run. Supply the current profile for every active net when exporting. The layer check replays each saved move sequence with the current profile and checks its authored length and geometry on the writer’s grid.
|
||||
For a 15.5 µm signal with a 7 µm gap on each side, route with a width of 29.5 µm. Use the required ground-strip width as the clearance between envelopes. Save the verified placement recipe for your component library. To verify the same path at the signal width, replay its seed with a 15.5 µm net using the same effective ports and bend rules.
|
||||
|
||||
```python
|
||||
from inire.layout import SavedRoute, verify_layer_export
|
||||
|
||||
layer = (1, 0)
|
||||
meters_per_unit = 1e-9
|
||||
saved_routes = {
|
||||
net_id: SavedRoute(
|
||||
result, layer=layer, meters_per_unit=meters_per_unit, profile_revision=source_revision,
|
||||
)
|
||||
for net_id, result in original_run.results_by_net.items()
|
||||
}
|
||||
profiles_by_net = {
|
||||
net.net_id: (current_revision, current_options_by_net[net.net_id].search)
|
||||
for net in plane.nets
|
||||
}
|
||||
export = verify_layer_export(
|
||||
plane, saved_routes, grid=1.0, layer=layer,
|
||||
meters_per_unit=meters_per_unit, profiles_by_net=profiles_by_net,
|
||||
)
|
||||
if not export.is_valid:
|
||||
raise ValueError({net_id: check for net_id, check in export.checks_by_net.items() if not check.is_valid})
|
||||
geometry_to_write = export.geometry_by_net
|
||||
```
|
||||
|
||||
Use `export.checks_by_net` to inspect the recorded revision for active nets and the geometric checks for imported fixed routes. Fixed polygons must be in final layer coordinates and on the writer’s grid. The layer check checks their clearance against other fixed owners, keepouts, and the newly routed polygons. `geometry_to_write` contains the new polygons. The imported polygons are already present in the layout. Verification records and their projected mappings are read-only snapshots.
|
||||
|
||||
## Verify a coplanar waveguide cross-section
|
||||
|
||||
For a 15.5 µm signal with a 7 µm gap on each side, route the 29.5 µm envelope. Use the required ground-strip width as the clearance between envelopes. Replay the verified seed with a 15.5 µm net using the same ports and bend rules. The conductor and envelope together define the negative gap mask. `coplanar_geometry` checks for side contact and allows the gap to end at the terminal faces. Check the process minimum gap in the assembled layout. A separate wider ground exclusion can be buffered locally from the envelope. This fills the inside of turns where a constant-width circular strip wider than the bend diameter would collapse.
|
||||
|
||||
```python
|
||||
from inire.layout import coplanar_geometry
|
||||
|
||||
cpw = coplanar_geometry(verified_signal, verified_envelope, ground_margin=10000)
|
||||
signal = cpw.conductor
|
||||
negative_gap_mask = cpw.gaps
|
||||
ground_exclusion = cpw.ground_exclusion
|
||||
```
|
||||
|
||||
On the 1 nm grid, a 3 µm minimum ground strip rejects the 28 µm and 32 µm pitches. A 36 µm pitch leaves a 6.5 µm strip. After applying the negative mask in the layout tool, check that the expected ground regions are connected and that separate signal conductors remain separate. For a coupling capacitor, route one connection on either side of the intentional conductor break and keep its etch mask in the layout. Removing that mask can short the two sections even when a width check passes. [QFoundry DRC](https://github.com/tii-qfoundry/PDK_QFoundry/blob/9c31db1d6879c96bd98460ee134181a865481d75/qfoundry/tech/drc/drc.lydrc) · [CPW chip with coupling capacitor](https://github.com/paulggin/klayout-cpw-design/blob/a38dc34cf6785ba0af41b27f43b6137fd2b69cc7/layouts/cpw_full_layout.gds)
|
||||
A 3 µm minimum ground strip rejects parallel tracks at 28 µm and 32 µm pitches. A 36 µm pitch leaves a 6.5 µm strip between their envelopes.
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ To get a result you can experiment with, run the [single-net quick start](../../
|
|||
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).
|
||||
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)`. Automatic mode is the default. 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 using a placement recipe, [check the net's result](tune-and-troubleshoot.md#read-the-result).
|
||||
|
||||
<a id="connect-a-preplaced-crossing"></a>
|
||||
|
||||
## Route between placed crossings
|
||||
|
||||
1. **Place the crossing cells.** Keep each cell's physical footprint and internal connections in your layout. Get the port positions and headings in board coordinates after applying placement and rotation.
|
||||
2. **Reserve routing keepouts around the cells.** Use the device's routing keepout if supplied. Otherwise, start from its footprint and make local openings at the ports you're connecting. Keep the full physical cell in the exported layout.
|
||||
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 your 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.
|
||||
|
||||

|
||||
|
|
@ -63,36 +63,33 @@ result = run.results_by_net[net_id]
|
|||
assert result.is_valid
|
||||
```
|
||||
|
||||
Before export, check the port joins and clearance against the actual placed-cell geometry. Inire verifies the external route against the keepouts you supplied.
|
||||
When assembling the layout, check the port joins and clearance against the actual placed-cell geometry. Inire verifies the external route against the keepouts you supplied.
|
||||
|
||||
For declared port widths and transition cells, see [Check placed optical ports](fabrication.md#check-placed-optical-ports).
|
||||
|
||||
## Export verified geometry
|
||||
## Save a placement recipe
|
||||
|
||||
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.
|
||||
|
||||
Port positions snap to integers. Arc vertices can remain fractional. If the writer uses an integer database grid, [verify the coordinates that will be written](fabrication.md#check-the-export-grid).
|
||||
After checking `result.is_valid`, use `result.as_seed()` to get the ordered moves. Keep the effective net, the component settings, and your coordinate unit with the recipe. The effective net records the resolved terminal positions and headings and the route width.
|
||||
|
||||
```python
|
||||
from pathlib import Path
|
||||
|
||||
from shapely.geometry import GeometryCollection
|
||||
|
||||
if not result.is_valid:
|
||||
raise ValueError(f"{result.net_id}: {result.outcome}")
|
||||
raise ValueError(f"Route {result.net_id!r} ended with outcome {result.outcome!r}")
|
||||
|
||||
geometry = GeometryCollection(result.locked_geometry)
|
||||
Path("route.wkt").write_text(geometry.wkt + "\n", encoding="utf-8")
|
||||
placement = (result.effective_net, result.as_seed(), options.search)
|
||||
```
|
||||
|
||||
For a multi-net layout, apply the validity check to every net you intend to export. If a route is short or colliding, use its outcome to choose the [next troubleshooting check](tune-and-troubleshoot.md#read-the-result).
|
||||
The example uses the `options` from the crossing example. If you called `route(problem)`, use `RoutingOptions().search`.
|
||||
|
||||
Place the first move at the effective start port and each subsequent move at the previous move's end port. For explicit placements, read the `move_spec`, `start_port`, and `end_port` of each component in `result.path`. Use the same width, radii, tangent extensions, and custom outlines that the router checked.
|
||||
|
||||
Your layout tool realizes the components and writes the layout. Choose widths and clearance with enough margin for any downstream rounding. Inire's verification describes the supplied geometry in routing units. Use `result.locked_geometry` to inspect the polygons it checked or reserve them in a later routing run.
|
||||
|
||||
## 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. Search can follow a partial seed from the first iteration and can leave it to find another approach. To build a hint from turns and straights, see the [path seed reference](api-reference.md#path-seeds).
|
||||
- **Hold a route fixed.** Check `result.is_valid`, then use `FixedRoute.from_result(result)` and pass it in `fixed_routes` alongside the remaining nets. The next run respects it as a distinct net, including at zero clearance. Verify the groups together before [exporting the layer](fabrication.md#check-the-export-grid).
|
||||
- **Hold a route fixed.** Check `result.is_valid`, then use `FixedRoute.from_result(result)` and pass it in `fixed_routes` alongside the remaining nets. The next run respects it as a distinct net, including at zero clearance.
|
||||
|
||||
When terminal headings are inferred, store the two selected ports alongside the seed, width, and geometry options. Use those exact ports to replay the route and export the same polygons.
|
||||
When terminal headings are inferred, use the effective net with the saved moves to replay the same placement.
|
||||
|
||||
```python
|
||||
from dataclasses import replace
|
||||
|
|
@ -105,7 +102,7 @@ seeds = {}
|
|||
for net in problem.nets:
|
||||
result = chosen.results_by_net[net.net_id]
|
||||
if result.is_valid:
|
||||
verified_nets.append(replace(net, start=result.path[0].start_port, target=result.path[-1].end_port))
|
||||
verified_nets.append(result.effective_net)
|
||||
seeds[net.net_id] = result.as_seed()
|
||||
|
||||
replay = route(
|
||||
|
|
@ -129,7 +126,6 @@ Route a straight net, then reserve it while routing another net on the same laye
|
|||
from dataclasses import replace
|
||||
|
||||
from inire import FixedRoute, NetSpec, Port, RoutingOptions, RoutingProblem, SearchOptions, route
|
||||
from inire.layout import verify_export_grid
|
||||
|
||||
bounds = (0, -50, 100, 50)
|
||||
options = RoutingOptions(search=SearchOptions(bend_radii=(10,)))
|
||||
|
|
@ -139,12 +135,11 @@ problem = RoutingProblem(bounds=bounds, nets=(fixed_net, detour_net), clearance=
|
|||
fixed = route(replace(problem, nets=(fixed_net,)), options=options).results_by_net["fixed"]
|
||||
|
||||
remaining = replace(problem, nets=(detour_net,), fixed_routes=(FixedRoute.from_result(fixed),))
|
||||
run = route(remaining, options=options)
|
||||
export = verify_export_grid(remaining, run.results_by_net, grid=1.0)
|
||||
if not export.is_valid:
|
||||
raise ValueError(export.reports_by_net)
|
||||
detour = route(remaining, options=options).results_by_net["detour"]
|
||||
assert detour.is_valid
|
||||
detour_placement = (detour.effective_net, detour.as_seed(), options.search)
|
||||
```
|
||||
|
||||
For imported metal or waveguide polygons, use `FixedRoute("existing_net", imported_polygons)`. Supply fixed polygons in their final layer coordinates. Export checks new routes against them and returns the new polygons.
|
||||
For imported metal or waveguide polygons that belong to an existing net, use `FixedRoute("existing_net", imported_polygons)`. Supply polygons in board coordinates. For other artwork that blocks routing, use `static_obstacles`.
|
||||
|
||||
To compare the two paths on a plot, see the [fixed-route example](../../examples/README.md#route-around-fixed-geometry).
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ Start with `run.results_by_net[net_id].outcome`. It distinguishes a path that st
|
|||
|
||||
| `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 [save its placement recipe](route-a-layout.md#save-a-placement-recipe). |
|
||||
| `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.
|
||||
Check `is_valid` before placing a result. Every routing mode checks that the physical polygons fit within the board.
|
||||
|
||||
## Why a net stopped short
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue