Routes
Routes
Preferred routing APIs in cicpy:
addConnectivityRoute(...)addOrthogonalConnectivityRoute(...)
These are the APIs the examples below use. addDirectedRoute(...) still exists, but it is a lower-level escape hatch and is not the default path for normal layout generation.
The examples below are generated from:
tests/routes/route_examples.spitests/routes/build_route_examples.py
Flow used by the examples:
- parse a tiny SPICE file with one subckt per route demo
- build a
LayoutCellfrom each subckt - call
place()so the instances create a realnodeGraph - route by net name with
addConnectivityRoute(...)oraddOrthogonalConnectivityRoute(...) - render the result with
SvgPrinter
The transistor used in every example is the real NCHDL cell from the SVG regression data. Routes land on actual G, S, or D terminals.
Preferred APIs
addConnectivityRoute(...)
layout.addConnectivityRoute(layer, regex, routeType, options, cuts, excludeInstances, includeInstances)
Arguments:
layer: routing layer used by the route objectregex: regular expression matched againstnodeGraphListnet namesrouteType: one of the route strings documented belowoptions: comma-separated route optionscuts: accepted by the API but currently not consumed directly byRoute; cut count is instead parsed fromoptionsexcludeInstances: regex used to drop instance names from the candidate rectangle setincludeInstances: regex used to keep only a subset of instance names
Example:
layout.addConnectivityRoute("M3", r"^G$", "-", "nolabel", 1, "", "")
addOrthogonalConnectivityRoute(...)
layout.addOrthogonalConnectivityRoute(
verticalLayer,
horizontalLayer,
regex,
options,
cuts,
excludeInstances,
includeInstances,
accessLayer=None,
)
Arguments:
verticalLayer: layer used for the trunkhorizontalLayer: layer used for branchesregex: net regex matched againstnodeGraphListoptions: currently accepted for API symmetry; route-label suppression usesnolabelcuts: currently stored but not used to size the cuts; the implementation uses1x2or2x1excludeInstances: regex for dropping instancesincludeInstances: regex for limiting candidate instancesaccessLayer: terminal access layer collected withinstance.getTerminalAccess(...); defaults toverticalLayer
Behavior:
- collects terminal access rectangles on
accessLayer - finds a free vertical trunk track on
verticalLayer - creates horizontal branches on
horizontalLayer - uses
1x2for vertical access rectangles and2x1for horizontal access rectangles - places a
1x2trunk cut between branch and trunk
Example:
layout.addOrthogonalConnectivityRoute("M2", "M3", r"^D$", "nolabel", 1, "", "", accessLayer="M1")
Route types
Straight -
Connects one instance terminal to one other instance terminal with horizontal metal on one layer.
make test PYTHON=/opt/eda/python3/bin//python3
Straight with layer transition
A straight route can also add start/end cuts when the source rectangles are on another layer.
This example routes on M3 from NCHDL:D and uses fillvcut plus start/end cut offsets.
Straight with horizontal fill cuts
This example uses fillhcut on NCHDL:G.
Left -|--
Routes one-to-many on shared net D from two left-column instances to one right-column instance.
Right --|-
Routes one-to-many on shared net S from one left-column instance to two right-column instances.
Vertical ||
Creates a straight vertical connection between stacked NCHDL:D terminals.
Vertical with antenna
With antenna, the vertical trunk is promoted two routing layers up when there is enough height, with 1x2 cuts at the two ends.
If there is not enough height, it falls back to the normal vertical trunk.
U left |-
Builds a vertical trunk to the left of stacked NCHDL:D terminals and reconnects both ends back into it.
U right -|
Builds a vertical trunk to the right of stacked NCHDL:D terminals and reconnects both ends back into it.
U top --|
Builds a horizontal bar above two NCHDL:G terminals and drops vertical stubs down to them.
U bottom |--
Builds a horizontal bar below two NCHDL:G terminals and rises vertical stubs up to them.
Left-down-left-up
Enabled with route type -|-- plus option leftdownleftup.
This is a specialized two-level detour shape.
Left-up-left-down
Enabled with route type -|-- plus option leftupleftdown.
This is the mirrored specialized two-level detour.
Strap
Enabled with option strap.
- default: horizontal one-to-many straps from one anchor terminal to several peers
- add
verticalto strap vertically instead
Horizontal strap:
Vertical strap:
Orthogonal connectivity route
This is the preferred two-layer routing API for a vertical trunk plus horizontal branches.
The demo uses shared net D and collects M1 device access before routing on M2 and M3.
Options
options is a comma-separated string. Current Route parsing in cicpy supports these names.
Working options
onTopB,onTopT,onTopL,onTopRUsed mainly byaddRouteConnection(...)to choose which rectangle becomes the start rectangle.offsethigh,offsetlowOffsets the start-side horizontal stub by one route width.offsethighend,offsetlowendOffsets the stop-side horizontal stub by one route width.trackNMoves the left/right trunk byN * ROUTE.horizontalgrid.routeWidth=<rule>Uses another width rule from the technology file instead ofwidth.startLayer=<layer>,stopLayer=<layer>Forces the copied start/stop rectangles onto a specific layer before route generation.trimstartleft,trimstartright,trimendleft,trimendrightTrims the source rectangles before building left/right routes.leftdownleftup,leftupleftdownSelects the specialized detour routes shown above.strapUses strap routing instead of the normal left/right/straight logic.verticalOnly meaningful together withstrap; switches strap routing to vertical.noSpaceRemoves the default space between the source geometry and the left/right trunk.novertDisables the trunk segment in left/right routes.fillhcutForces horizontal2x1cuts on horizontal access rectangles.fillvcutForces vertical1x2cuts on vertical access rectangles.antennaPromotes tall vertical routes two layers up when legal.nolabelSuppresses route net-name text in the output.
Classic cut options
nostartcut,noendcutstartoffsetcuthigh,startoffsetcutlowendoffsetcuthigh,endoffsetcutlow<N>startcuts,<N>startvcuts<N>endcuts,<N>endvcuts<N>cuts,<N>vcuts
Current constraint:
- all generated cuts are normalized to
1x2or2x1 1x1is not used
Lower-level escape hatch
addDirectedRoute(...)
addDirectedRoute(...) still exists for explicit path routing, but it is not the default API for these docs.
Use it when routing must be driven by a specific instance-path expression instead of a shared net in nodeGraph.