3 KiB
3 KiB
Route a layout
Start with the first route, then replace the example ports and add your layout's constraints.
Define the inputs
- Choose a coordinate unit. Inire snaps port coordinates to an integer grid. Choose a unit fine enough to preserve narrow gaps, and use it for widths, radii, clearance, and bounds too.
- Set source and target headings. Heading 0 points east and 90 points north. The source heading points along the launch. The target heading points along the arrival. If your device library labels the target port with its outward heading, reverse it by 180 degrees.
- Add a net for each connection. Give each
NetSpeca unique ID and the guide width. Set your process limits throughSearchOptionsand choose the required clearance onRoutingProblem. - Add keepouts. Supply Shapely polygons in
static_obstaclesand useboundsfor the board rectangle. Leave enough access at the ports for the guide and its permitted bends. Input fields - Run and check. Call
route(problem, options=options)and check eachresult.is_valid. Start with automatic mode for general layouts. Read the result
Connect a preplaced crossing
- Place the device and reserve its keepout first.
- Leave openings in the keepout at the physical ports.
- Define the external legs as separate nets. The placed cell supplies the internal connections.
Each leg meets a port at the end of an access slot. The dashed links show the device's internal connections schematically. The four external paths come from Inire's crossing-single fixture. Crossing fixtures
Reuse an existing route
- Give the router a route it can move. Put
result.as_seed()ininitial_pathsunder the net's ID. A seed uses the current start port, width, and geometry settings. A partial seed can suggest an approach. - Hold a route fixed. Add
result.locked_geometrytostatic_obstacleswhile routing other nets. The next run applies its own clearance.
To reuse the verified routes from a first problem as fixed obstacles, add them to a second problem that contains the remaining nets.
from dataclasses import replace
from inire import route
first = route(first_problem)
locked = tuple(
polygon
for result in first.results_by_net.values()
if result.is_valid
for polygon in result.locked_geometry
)
obstacles = (
next_problem.static_obstacles
+ locked
)
second = route(replace(
next_problem,
static_obstacles=obstacles,
))
See the locked-path example for the resulting detour and the seed reference for building a hint by hand.
