Skip to content

API

add_bundle_astar

add_bundle_astar(
    component: ProtoTKCell,
    ports1: list[PortLike],
    ports2: list[PortLike],
    spacing: Um,
    bend: KCellSpec,
    straight: KCellSpec,
    layers: Iterable[LayerLike],
    grid_unit: Int = 500,
) -> list[None]

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
spacing Um

the spacing between the waveguides in the bundle

required
bend KCellSpec

the bend-spec to create bends with

required
straight KCellSpec

the straight-spec to create straights with

required
layers Iterable[LayerLike]

the layers to avoid.

required
grid_unit Int

the discretization unit for the a-star algorithm.

500

add_fan_in

add_fan_in(
    c: ProtoTKCell,
    inputs: list[PortLike],
    straight: KCellSpec,
    bend: KCellSpec,
    x_bundle_dbu: Dbu | None = None,
    y_bundle_dbu: Dbu | None = None,
    spacing_dbu: Dbu | None = None,
    start_dir: OrientationChar | None = None,
) -> NDArray[int64]

Add a fan-in to a parent component.

Parameters:

Name Type Description Default
c 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_dbu Dbu | None

the x-location where to form the confluence of the bundle will be two bend radiuses from the inputs if not given.

None
y_bundle_dbu Dbu | None

the y-location where to form the confluence of the bundle will be somewhere in the middle if not given.

None
spacing_dbu Dbu | None

the spacing between waveguides in the bundle

None
start_dir OrientationChar | None

the start direction of the bundle (derived from ports if not given)

None

add_route_astar

add_route_astar(
    c: ProtoTKCell,
    start: PortLike,
    stop: PortLike,
    straight: KCellSpec,
    bend: KCellSpec,
    layers: Iterable[LayerLike],
    grid_unit: Dbu,
) -> None

Add an a-star route to a component.

Parameters:

Name Type Description Default
c 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

add_route_from_corners

add_route_from_corners(
    c: ProtoTKCell,
    start: PortLike,
    stop: PortLike,
    corners: PointsDbu,
    straight: KCellSpec,
    bend: KCellSpec,
) -> None

Add a corners-based route to a component.

Parameters:

Name Type Description Default
c ProtoTKCell

the component to add the route to

required
start PortLike

the start port

required
stop PortLike

the stop port

required
corners PointsDbu

the corners in between start and stop.

required
straight KCellSpec

the straight-spec to create straights from

required
bend KCellSpec

the bend-spec to create bends from

required

add_route_from_steps

add_route_from_steps(
    c: ProtoTKCell,
    start: PortLike,
    stop: PortLike,
    steps: list[StepDbu],
    straight: KCellSpec,
    bend: KCellSpec,
) -> None

Add a steps-based route to a component.

Parameters:

Name Type Description Default
c ProtoTKCell

the component to add the route to

required
start PortLike

the start port

required
stop PortLike

the stop port

required
steps list[StepDbu]

the steps in between start and stop.

required
straight KCellSpec

the straight-spec to create straights from

required
bend KCellSpec

the bend-spec to create bends from

required

find_route_astar

find_route_astar(
    c: ProtoTKCell,
    start: PortLike,
    stop: PortLike,
    straight: KCellSpec,
    bend: KCellSpec,
    layers: Iterable[LayerLike],
    grid_unit: Dbu,
) -> PointsDbu