inire/docs/user/fabrication.md
Jan Petykiewicz eac083a37d Refine routing geometry checks and streamline documentation
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.
2026-11-29 23:12:28 -08:00

85 lines
4.3 KiB
Markdown

# Route with process constraints
Keep the layer and process rules with each [placement recipe](route-a-layout.md#save-a-placement-recipe). Check physical joins in the assembled layout.
## Check placed optical ports
`PlacedPort.connect` checks that the placed devices have matching port widths.
```python
from inire import Port
from inire.layout import PlacedPort
source = PlacedPort(Port(10000, 10000, 0), width=500)
taper_input = PlacedPort(Port(70000, 10000, 0), width=500)
net = source.connect("source_to_taper", taper_input)
```
Place the 40 µm [EBeam taper](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) with the 500 nm face at `taper_input` and the 3,000 nm face at the target. Leave access for the route in the device keepouts.
## Preserve length-sensitive paths
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.
placement = original_placement
if preserves_length(replacement, authored_length, length_tolerance):
placement = (replacement.effective_net, replacement.as_seed(), options.search)
```
In the [Raymond MZI layout](https://github.com/SiEPIC/openEBL-2025-02/blob/a887476a301db2a014be007717cd1821e111f58e/submissions/EBeam_hannahraymond_MZIv21.gds), a 127.208 µm route fits in place of a 286.770 µm path. The circuit tolerance decides whether to keep it. Use the same [custom bend lengths](api-reference.md#searchoptions) for search and replay.
## Keep layers and process profiles with the nets
Use one `RoutingProblem` per collision plane. Keep the layer and datatype with the placement. Project keepouts from other layers when the process requires cross-layer spacing.
```python
from inire import RoutingProblem, route
from inire.layout import partition_layers
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],
)
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
```
On one layer, `route_profiles` routes each group with its own options and reserves verified geometry in group order. The [QFoundry profiles](https://github.com/tii-qfoundry/PDK_QFoundry/blob/9c31db1d6879c96bd98460ee134181a865481d75/qfoundry/tech/waveguides.xml#L21-L64) allow a 15 µm flux-line bend but require 50 µm for the feedline.
```python
from inire import RoutingProblem
from inire.layout import route_profiles
cpw_plane = RoutingProblem(
bounds, (flux_net, feed_net), static_obstacles=cpw_keepouts, clearance=ground_strip_width,
)
profiles = [
((flux_net.net_id,), flux_options),
((feed_net.net_id,), feed_options),
]
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)
```
## Route a coplanar waveguide envelope
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.
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.