# RoutePortsAroundCorner¶

class picazzo3.container.route_ports.RoutePortsAroundCorner(*args, **kwargs)

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

Parameters: trace_template: optional Template for all ports. If None, the waveguide templates of the ports will be used auto_transition: optional 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: optional Labels of the ports to be processed. Set to None to process all ports. contents: PCell, optional the contents of the container: the child cell external_port_names: optional Dictionary for remapping of the port names of the contents to the external ports cell_instances: _PCellInstanceDict, optional name: optional The unique name of the pcell trace_templates: List with type restriction, allowed types: , locked list of templates to apply to all ports waveguides: List with type restriction, allowed types: , locked bundle: locked bundle of waveguides added to the contents, generated based on the supplied waveguides list

Views

Layout
Parameters: angle_step: float and number > 0, optional angle step for rounding first_step_direction: optional 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, optional The spacing between the routes ( in the section after the first bend ) manhattan: optional adds rectangular blocks in the bends to avoid as much as possible non-manhattan angles reference_coordinate_first_step: float, optional The minimum 1D coordinate of the first bend of the routes view_name: str, optional The name of the view max_s_bend_angle: float and ]0.0,90.0], optional rounding_algorithm: optional rounding algorithm used to generate the bends. Can be circular, spline, … spacing: float, optional spacing between adjacent output waveguides target_coordinate: optional 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: optional If True, all outputs will be aligned to the outermost waveguide end, even if it extends beyond its target coordinate. output_direction: optional direction of the output waveguides. Should be EAST, WEST, NORTH or SOUTH reference_coordinate: optional 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: optional When True, the waveguide area will be covered by i3.Rectangles on all cover layers. routes: optional routes along which the waveguides will be generated contents_transformation: GenericNoDistortTransform, optional flatten_contents: optional if True, it will insert the contents as elements in the layout, rather than as an Instance bend_radius: float and number > 0, optional bend radius for the auto-generated bends grid: float and number > 0, locked design grid. Extracted by default from TECH.METRICS.GRID grids_per_unit: locked Number of grid cells per design unit units_per_grid: locked Ratio of grid cell and design unit max_s_bend_angles: locked spacings_from_reference: locked target_coordinates: locked unit: float and number > 0, locked design unit. Extracted by default from TECH.METRICS.UNIT

Examples

""" 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
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
layout = my_ring.Layout()
from picazzo3.container.route_ports import RoutePortsAroundCorner
from picazzo3.traces.wire_wg import WireWaveguideTemplate

wtpl = WireWaveguideTemplate()
wtpl_layout = wtpl.Layout(core_width=.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()

""" 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
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
from picazzo3.container.route_ports import RoutePortsAroundCorner
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()

from technologies import silicon_photonics
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
from picazzo3.container.route_ports import RoutePortsAroundCorner
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()

""" 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
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
layout = my_ring.Layout()
from picazzo3.container.route_ports import RoutePortsAroundCorner

# 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()

""" By default the area between the routes is drawn,
you can override this using the area_layer_on parameter """
from technologies import silicon_photonics
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
from picazzo3.container.route_ports import RoutePortsAroundCorner
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()

"""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
import ipkiss3.all as i3
from picazzo3.filters.ring import RingRect180DropFilter
my_ring = RingRect180DropFilter()
layout = my_ring.Layout()
from picazzo3.container.route_ports import RoutePortsAroundCorner

# 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()