API¶
Add a bundle route using the a-star algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ProtoTKCell
|
The component to add the route into. |
required |
ports1
|
list[PortLike]
|
the start ports |
required |
ports2
|
list[PortLike]
|
the end ports |
required |
straight
|
KCellSpec
|
the straight-spec to create straights with |
required |
bend
|
KCellSpec
|
the bend-spec to create bends with |
required |
layers
|
Iterable[LayerLike]
|
the layers to avoid. |
required |
grid_unit
|
Int
|
the discretization unit for the a-star algorithm. |
500
|
spacing
|
Length
|
the spacing between the waveguides in the bundle |
required |
clearance
|
Length
|
extra space (um) between the bundle body and any
obstacle on |
0.0
|
fan_in
|
FanStrategy
|
how the start ( |
'manhattan'
|
fan_out
|
FanStrategy | None
|
how the end ( |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
BundleResult | list[None]
|
class: |
BundleResult | list[None]
|
path lengths, and the bundle centerline. |
Add a fan-in to a parent component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ProtoTKCell
|
the component to add the fan-in to |
required |
inputs
|
list[PortLike]
|
the list of ports to start from |
required |
straight
|
KCellSpec
|
the straight-spec to create straights from |
required |
bend
|
KCellSpec
|
the bend-spec to create bends from |
required |
x_bundle
|
Length | None
|
the x-location (µm) where to form the confluence of the bundle. Will be two bend radii from the inputs if not given. |
None
|
y_bundle
|
Length | None
|
the y-location (µm) where to form the confluence of the bundle. Will be somewhere in the middle if not given. |
None
|
spacing
|
Length | None
|
the spacing (µm) between waveguides in the bundle |
None
|
start_dir
|
OrientationChar | None
|
the start direction of the bundle (derived from ports if not given) |
None
|
strategy
|
FanStrategy
|
fan-in strategy. A string ( |
'manhattan'
|
Returns:
| Type | Description |
|---|---|
NDArray[int64]
|
|
list[FanLeg]
|
bundle-side stop positions and |
tuple[NDArray[int64], list[FanLeg]]
|
class: |
tuple[NDArray[int64], list[FanLeg]]
|
|
tuple[NDArray[int64], list[FanLeg]]
|
maps back to the caller's |
tuple[NDArray[int64], list[FanLeg]]
|
lateral position). Each leg carries its placed instances |
tuple[NDArray[int64], list[FanLeg]]
|
( |
Add an a-star route to a component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ProtoTKCell
|
the component to add the route to |
required |
start
|
PortLike
|
the start port |
required |
stop
|
PortLike
|
the stop port |
required |
straight
|
KCellSpec
|
the straight-spec to create straights from |
required |
bend
|
KCellSpec
|
the bend-spec to create bends from |
required |
layers
|
Iterable[LayerLike]
|
the layers to avoid |
required |
grid_unit
|
Dbu
|
the discretization unit for the a-star algorithm |
required |
clearance
|
Length
|
extra space (µm) between the route body and any
obstacle on |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
Route
|
class: |
Route
|
(start port, intermediate corners, stop port) and whose |
|
Route
|
|
|
Route
|
in µm ( |
Deprecated: use add_route_manual(corners=...).
Deprecated: use add_route_manual(steps=...).
Derive placement nets from routing RouteNetSpec objects.
For each routing net, extract instance names from port names by longest-prefix match against instance_names. Group routing nets by net name and filter out single-instance (intra-device) nets. Supply nets (detected by name prefix) receive a lower weight so placement is not dominated by power routing.
When inst_centers_dbu and dbu are given, each pin also carries its real offset from the instance center (derived from the port position), so wirelength optimization sees true pin positions instead of instance centers — this is what makes orientation optimization meaningful.
Returns a list of PlacementNetSpec dicts suitable for
place_auto().
Find an a-star route without adding it to the component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
ProtoTKCell
|
the component to find the route in |
required |
start
|
PortLike
|
the start port |
required |
stop
|
PortLike
|
the stop port |
required |
straight
|
KCellSpec
|
the straight-spec to create straights from |
required |
bend
|
KCellSpec
|
the bend-spec to create bends from |
required |
layers
|
Iterable[LayerLike]
|
the layers to avoid |
required |
grid_unit
|
Dbu
|
the discretization unit for the a-star algorithm |
required |
clearance
|
Length
|
extra space (µm) between the route body and any
obstacle on |
0.0
|
Returns:
| Type | Description |
|---|---|
PointsDbu
|
The corners of the route as a list of points in dbu. |
Automatically place instances using openroad-style or tiling mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c
|
ProtoTKCell
|
component/KCell to place instances in. |
required |
instances
|
list[str] | list[PlacedInstanceSpec]
|
list of instance names or specs. |
required |
nets
|
list[PlacementNetSpec] | list[object]
|
placement netlist — either |
required |
mode
|
PlacementMode
|
"openroad", "tiling", or "auto". |
'auto'
|
objective
|
PlacementObjective | None
|
objective weights. |
None
|
constraints
|
PlacementConstraints | None
|
placement constraints (min_spacing, bbox, fences, ...). |
None
|
routing_feedback
|
RoutingFeedbackConfig | None
|
reserved for future routing-in-loop strategies. |
None
|
apply
|
bool
|
apply placement in-place when True. |
True
|
apply_orientation
|
bool
|
also apply the optimizer's chosen orientation to
the geometry. Only meaningful when the optimizer is allowed to
choose one at all — see |
True
|
iterations
|
int
|
optimizer iteration budget. |
30
|
Returns:
| Type | Description |
|---|---|
PlacementReport
|
Structured placement report with final locations and metrics. |
Place abstract component rectangles without a KCell.
KCell-free companion to place_auto for external layout tools that
hold component geometry (centers, sizes, pin offsets) outside a
kfactory layout. All coordinates are integer DBU. The report's
placements maps each instance name to its optimized center; the
caller applies the moves itself (there is no apply step).
When constraints lacks a bbox, a default envelope is derived
from the instance rectangles, grown so total instance area over
envelope area stays within density_target.
@tags livewire dbu coordinates
Run place_auto with mode="openroad".
Run place_auto with mode="tiling".