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
1 changed files with 148 additions and 718 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue