RoutePortsAroundCorner

class picazzo3.container.route_ports.RoutePortsAroundCorner

Routes ports around a corner of the component in a given direction.

Parameters
trace_template: ( PCell and _WaveguideTemplate ), *None allowed*

Template for all ports, defaults to TECH.PCELLS.WG.DEFAULT.When set to None, the waveguide templates of the ports will be used.

auto_transition: ( bool, bool_, bool or int )

If True, automatically transition all ports of contents to the given trace template. If False, no transitions are applied, which might lead to a discontinuity in the waveguide. Also, if trace_template is None, no transitions are applied.

port_labels: ( List with type restriction, allowed types: <class ‘str’> ), *None allowed*

Labels of the ports to be processed. Set to None to process all ports.

contents: PCell

the contents of the container: the child cell

external_port_names: str

Dictionary for remapping of the port names of the contents to the external ports

name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters

The unique name of the pcell

Other Parameters
trace_templates: List with type restriction, allowed types: <class ‘ipkiss3.pcell.cell.pcell.PCell’>, locked

list of templates to apply to all ports

waveguides: List with type restriction, allowed types: <class ‘ipkiss3.pcell.cell.pcell.PCell’>, locked
bundle: ( PCell ), locked, *None allowed*

bundle of waveguides added to the contents, generated based on the supplied waveguides list

Views

class Layout
Parameters
first_step_direction: List with value restriction, allowed values: [C2(0.000000, 1.000000), C2(0.000000, -1.000000), C2(1.000000, 0.000000), C2(-1.000000, 0.000000)]

The direction to take when rounding the corner. By default it is 90 degrees off the output direction

first_step_spacing: float and number > 0

The spacing between the routes ( in the section after the first bend )

reference_coordinate_first_step: float

The minimum 1D coordinate of the first bend of the routes

max_s_bend_angle: float and ]0.0,90.0]
spacing: float

spacing between adjacent output waveguides

target_coordinate: ( float ), *None allowed*

The coordinate where the endpoints of the waveguides are aligned. An x-coordinate when routing toEAST or WEST, a y-coordinate when routing to NORTH or SOUTH. When the waveguides extend beyond thetarget coordinate, the value is ignored.

align_outputs: ( bool, bool_, bool or int )

If True, all outputs will be aligned to the outermost waveguide end, even if it extends beyond its target coordinate.

output_direction: List with value restriction, allowed values: [C2(1.000000, 0.000000), C2(-1.000000, 0.000000), C2(0.000000, 1.000000), C2(0.000000, -1.000000)]

direction of the output waveguides. Should be EAST, WEST, NORTH or SOUTH

reference_coordinate: ( float ), *None allowed*

The coordinate where the first waveguide will be aligned. An x-coordinate if routed towards NORTH or SOUTH,a y-coordinate when routed towards EAST or WEST. If not specified, the x or y coordinate of the first port is taken.

area_layer_on: ( bool, bool_, bool or int )

When True, the waveguide area will be covered by i3.Rectangles on all cover layers.

view_name: String that contains only alphanumeric characters from the ASCII set or contains _$. ASCII set is extended on PY3.

The name of the view

routes:

routes along which the waveguides will be generated

contents_transformation: GenericNoDistortTransform
flatten_contents: ( bool, bool_, bool or int )

if True, it will insert the contents as elements in the layout, rather than as an Instance

manhattan: ( bool, bool_, bool or int )

Adds rectangular blocks in the bends to avoid as much as possible non-manhattan angles.

angle_step: float and number > 0

Angle step for rounding.

bend_radius: float and number > 0

Bend radius for the auto-generated bends.

rounding_algorithm:

Rounding algorithm used to generate the bends. Can be circular, spline, ….

Other Parameters
max_s_bend_angles: locked
spacings_from_reference: locked
target_coordinates: locked

Examples

../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-1.png
from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner

my_ring = RingRect180DropFilter()

my_ring_routed = RoutePortsAroundCorner(contents=my_ring, port_labels=["W1", "W0"])  # ports to be routed

layout = my_ring_routed.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-2.png
"""By default, the area between the routes is drawn,
you can override this using the area_layer_on parameter"""
from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner

my_ring = RingRect180DropFilter()

my_ring_routed = RoutePortsAroundCorner(contents=my_ring, port_labels=["W1", "W0"])  # ports to be routed

layout = my_ring_routed.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    area_layer_on=False,
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-3.png
"""Instead of E0, W0, E1, (east 0, west 0 ) ...
we can also use the actual port names as port labels"""
from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner

my_ring = RingRect180DropFilter()

my_ring_routed = RoutePortsAroundCorner(contents=my_ring, port_labels=["in1", "out2"])  # ports to be routed

layout = my_ring_routed.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-4.png
"""Be aware that the order of the port_labels is used to determine to the order of the created routes.
If you encounter crossing routes, you might want to change the order of the labels"""
from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner

my_ring = RingRect180DropFilter()
layout = my_ring.Layout()

# We first route the E0 (east0 ) port, if we had chosen
# ['W1', 'W0', 'E0'] this would have resulted in crossing waveguides
my_ring = RoutePortsAroundCorner(contents=layout, port_labels=["E0", "W1", "W0"])

layout = my_ring.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    reference_coordinate_first_step=-20.0,
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-5.png
"""As most containers, RoutePortsAroundCorner supports auto transitions.
This means that you can choose a trace template for the routes that's different
from the one used in the contents.
"""
from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner
from picazzo3.traces.wire_wg import WireWaveguideTemplate

my_ring = RingRect180DropFilter()
my_ring.Layout()

wtpl = WireWaveguideTemplate()
wtpl.Layout(core_width=0.7)

my_ring = RoutePortsAroundCorner(
    trace_template=wtpl, auto_transition=True, contents=my_ring, port_labels=["E0", "W1", "W0"]
)

layout = my_ring.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    reference_coordinate_first_step=-20.0,
    target_coordinate=40.0,
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-6.png
"""The target_coordinate parameter can be used to specify
the 'target coordinate' of the routes. This is illustrated in this example"""

from technologies import silicon_photonics  # noqa: F401
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
from picazzo3.container.route_ports import RoutePortsAroundCorner

my_ring = RingRect180DropFilter()
layout = my_ring.Layout()

# We first route the E0 (east0 ) port, if we had chosen
# ['W1', 'W0', 'E0'] this would have resulted in crossing waveguides
my_ring = RoutePortsAroundCorner(contents=layout, port_labels=["E0", "W1", "W0"])

layout = my_ring.Layout(
    first_step_direction=i3.DIRECTION.SOUTH,  # when rounding corner, go this direction first
    output_direction=i3.DIRECTION.EAST,  # final output direction
    reference_coordinate_first_step=-20.0,
    target_coordinate=40.0,
    first_step_spacing=8.0,  # Spacing between the waveguides.
)
layout.visualize(annotate=True)
../../../../_images/picazzo3-container-route_ports-RoutePortsAroundCorner-7.png