Traces

A trace is a PCell that is created by extruding a trace template over a specified shape and is used to connect ports with the same trace templates on a chip. Waveguides are traces in the optical domain while electrical connections are traces in the electrical domain.

Waveguide

The i3.Waveguide class creates a waveguide by drawing a trace template over a specified shape. To learn more about defining individual waveguides in IPKISS, have a look at the Waveguide tutorial. This class only creates straight waveguides.

class ipkiss3.all.Waveguide

A basic implementation of an optical trace

Parameters:
trace_template: PCell and _WaveguideTemplate
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:
contents: PCell and _Trace, locked

Examples

import si_fab.all as pdk
import ipkiss3.all as i3

trace_template = pdk.SiWireWaveguideTemplate()
wg = i3.Waveguide(trace_template=trace_template)
wg_layout = wg.Layout(shape=[(0.0, 0.0), (20.0, 0.0)])
wg_layout.visualize()
../../../_images/trace-1.png

Views

class Layout
Parameters:
core_layer: __Layer__

layer used to define the core of the waveguide

input_port: TracePort
trace_template_for_ports: _TraceTemplate.Layout

Trace template to be used for the ports.

shape: Shape

Shape from which the Trace is calculated

cover_layers: List with type restriction, allowed types: <class ‘ipkiss.primitives.layer.Layer’>

layers that can be used to generate additional coverage of the trace (e.g. manhattan corners)

control_shape_layer: __Layer__

layer on which the control shape is drawn

output_port: TracePort
draw_control_shape:

draws the control shape on top of the waveguide

contents_transformation: GenericNoDistortTransform

transformation to apply to the contents

flatten_contents:

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

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

Other Parameters:
center_line_shape: locked

Automatically calculated shape of the center line of the trace

RoundedWaveguide

The i3.RoundedWaveguide class creates a type of waveguide with a rounded shape, determined by the rounding parameters. The rounding parameters consist of a bend radius and a rounding algorithm.

class ipkiss3.all.RoundedWaveguide

A waveguide with a rounded shape

Parameters:
trace_template: PCell and _WaveguideTemplate
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:
contents: PCell and _Trace, locked

Examples

import si_fab.all as pdk
import ipkiss3.all as i3

trace_template = pdk.SiWireWaveguideTemplate()
wg = i3.RoundedWaveguide(trace_template=trace_template)
wg_layout = wg.Layout(
    shape=[(0.0, 0.0), (20.0, 0.0), (20.0, 20.0)],
    bend_radius=10,
    rounding_algorithm=i3.EulerRoundingAlgorithm(),
)
wg_layout.visualize()
../../../_images/trace-2.png

Views

class Layout
Parameters:
output_port: TracePort
trace_template_for_ports: _TraceTemplate.Layout

Trace template to be used for the ports.

shape: Shape

Shape from which the Trace is calculated

cover_layers: List with type restriction, allowed types: <class ‘ipkiss.primitives.layer.Layer’>

layers that can be used to generate additional coverage of the trace (e.g. manhattan corners)

reverse_individual_bends: list<( bool, bool or int )>

When set to True, it will generate the individual bends backwards. This has only effect when the bend algorithm is not symmetric. Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

rounding_algorithms:

Rounding algorithm for every individual bend. Can be circular, spline, … Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

bend_radii: list<number > 0>

Bend radius for every individual bend.

reverse_bends:

When set to True, it will generate the bends backwards. This has only effect when the bend algorithm is not symmetric.

remove_straight_angles:

Removes the waypoints with straight angles. Set to False if the algorithm uses waypoint-specific information.

core_layer: __Layer__

layer used to define the core of the waveguide

input_port: TracePort
control_shape_layer: __Layer__

layer on which the control shape is drawn

draw_control_shape:

draws the control shape on top of the waveguide

contents_transformation: GenericNoDistortTransform

transformation to apply to the contents

flatten_contents:

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

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

manhattan:

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.

rounding_algorithm:

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

bend_radius: float and number > 0

Bend radius for the auto-generated bends.

Other Parameters:
center_line_shape: locked

Automatically calculated shape of the center line of the trace

Using maximum bend radius in a RoundedWaveguide

It is possible to calculate the maximum bend radius that can be used for each bend in a given shape. This bend radius can then be specified in i3.RoundedWaveguide to obtain a waveguide which uses the maximum possible radius in each bend.

ipkiss3.all.maximum_bend_radii(control_shape, rounding_algorithms=<class 'ipkiss.geometry.shapes.modifiers.ShapeRound'>, reverse_individual_bends=None)

Calculate the maximum bend radius for each turn to be made along a control shape

An open shape with N points has N-2 turns (the first turn is in the 2nd point and so forth), and thus returns N-2 radii.

For a closed shape, the first turn is in the 1st point (from the last to the 2nd) and so forth. A shape with N points has N turns and returns N radii

The return value can be passed directly to the bend_radii parameter of i3.RoundedTrace.Layout or i3.RoundedWaveguide.Layout

Parameters:
control_shape: Shape or np.ndarray

The control shape which will be rounded

rounding_algorithms: List[ShapeRound, SplineRoundingAlgorithm()] or single value

The rounding algorithms to apply in each turn in the shape. When a single rounding algorithm is given it will be used for the whole shape. If a rounding algorithm is None, no rounding is applied and the maximum bend radius can be infinite.

reverse_individual_bends: List[bool] or None

For each turn, whether to reverse the bend (applicable for asymmetric bends)

Returns:
max_radii: List[float]

Returns the maximum bend radius in each turn.

Raises:
Raises a ValueError if the shape contains an angle for which the required radius cannot be calculated.

Examples

import ipkiss3.all as i3
control_shape = i3.Shape([(0.0, 0.0), (20.0, 0.0), (30.0, 10.0), (-10.0, 10.0), (-10.0, 40.0)])
rmax = i3.maximum_bend_radii(control_shape)  #  use the default circular rounding
waveguide =  i3.RoundedWaveguide()
waveguide_layout = waveguide.Layout(shape=control_shape, bend_radii=rmax)
waveguide_layout.visualize()
../../../_images/trace-3.png
import ipkiss3.all as i3
round_spline = i3.SplineRoundingAlgorithm(adiabatic_angles=(0, 30))
control_shape = i3.Shape([(0.0, 0.0), (100.0, 0.0), (100.0, 120.0), (200.0, 120.0),
                          (200.0, -100.0), (300.0, 75.0)])
rmax = i3.maximum_bend_radii(control_shape,
                             rounding_algorithms=round_spline,
                             reverse_individual_bends=[False, True, False, False])
waveguide = i3.RoundedWaveguide()
waveguide_layout = waveguide.Layout(shape=control_shape, rounding_algorithm=round_spline, bend_radii=rmax)
waveguide_layout.visualize()
../../../_images/trace-4.png

TaperedWaveguide

The i3.TaperedWaveguide class creates a waveguide that automatically tapers between two waveguide templates: one which is defined for the straight sections (straight_trace_template), and one which is defined for the start, end and bend sections (trace_template).

class ipkiss3.all.TaperedWaveguide

A Rounded Waveguide that tapers to another template (straight_trace_template) in straight sections

Parameters:
fixed_bend90: ( PCell ), *None allowed*

PCell used for the 90 degree bends in the route. The angle should be a 90 degree bend and have exactly two optical ports. The trace template of the bend should match trace_template. Bends are assumed to be bi-directional in the routing.

straight_trace_template: PCell and _TraceTemplate

template for the straight sections.

trace_template: PCell and _TraceTemplate

template for the start, end and bend sections.

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:
contents: PCell and _Trace, locked

Examples

"""A TaperedWaveguide automatically transitions (=tapers) between different waveguide types."""
import si_fab.all as pdk  # noqa: F401

import ipkiss3.all as i3
from picazzo3.traces.rib_wg import RibWaveguideTemplate

rib_tmpl = RibWaveguideTemplate()
rib_tmpl.Layout(core_width=0.6)
rib_tmpl_wide = RibWaveguideTemplate()
rib_tmpl_wide.Layout(core_width=1.6)

twg = i3.TaperedWaveguide(trace_template=rib_tmpl, straight_trace_template=rib_tmpl_wide)
lay = twg.Layout(shape=[(0, 0), (30, 0), (30, 60)])
lay.visualize(annotate=True)
../../../_images/trace-5.png
"""TaperedWaveguide exposes the same properties as RoundedWaveguide."""

import si_fab.all as pdk  # noqa: F401

import ipkiss3.all as i3
from picazzo3.traces.rib_wg import RibWaveguideTemplate

rib_tmpl = RibWaveguideTemplate()
rib_tmpl.Layout(core_width=0.6)
rib_tmpl_wide = RibWaveguideTemplate()
rib_tmpl_wide.Layout(core_width=1.6)

twg = i3.TaperedWaveguide(trace_template=rib_tmpl, straight_trace_template=rib_tmpl_wide)
lay = twg.Layout(
    shape=[(0, 0), (50, 0), (75, 50)],
    bend_radius=30,
    # we choose a large angle_step to show how it impacts the discretisation
    angle_step=20,
)
lay.visualize(annotate=True)
../../../_images/trace-6.png

Views

class Layout
Parameters:
taper_lengths: list<number >= 0>

Lengths of the tapers for each section. Length of list must be identical to number of segments.

straight_section_positions: list<fraction>

A list of relative positions for the straight_template sections of each path segment. Length of list must be identical to number of segments.Each position is a number between 0 (closest to first waypoint) and 1 (closest to last waypoint).0.5 will place the expanded section in the middle of the segment.

straight_section_lengths: list<number >= 0>

A list of lengths for the straight_template sections of each path segment.Length of list must be identical to number of segments

flatten_waveguides:

If true, all waveguides will be flattened one level to reduce hierarchy

taper_length: ( float and int, float, integer, floating and number >= 0 ), *None allowed*

length of the taper between the regular waveguide and the expanded waveguide. Ignored if taper_lengths is set. If None, the default taper lengths for each transition are chosen for each transition.

draw_control_shape:

draws the control shape on top of the waveguide

contents_transformation: GenericNoDistortTransform

transformation to apply to the contents

flatten_contents:

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

output_port: TracePort
trace_template_for_ports: _TraceTemplate.Layout

Trace template to be used for the ports.

shape: Shape

Shape from which the Trace is calculated

cover_layers: List with type restriction, allowed types: <class ‘ipkiss.primitives.layer.Layer’>

layers that can be used to generate additional coverage of the trace (e.g. manhattan corners)

reverse_individual_bends: list<( bool, bool or int )>

When set to True, it will generate the individual bends backwards. This has only effect when the bend algorithm is not symmetric. Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

rounding_algorithms:

Rounding algorithm for every individual bend. Can be circular, spline, … Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

bend_radii: list<number > 0>

Bend radius for every individual bend.

reverse_bends:

When set to True, it will generate the bends backwards. This has only effect when the bend algorithm is not symmetric.

remove_straight_angles: *None allowed*

Remove waypoints with straight angles. When set to None, it will only remove straight angles when all the expansion parameters are calculated automatically

core_layer: __Layer__

layer used to define the core of the waveguide

input_port: TracePort
min_straight: float and int, float, integer, floating and number >= 0

The minimum length of any straight sections in the route

control_shape_layer: __Layer__

layer on which the control shape is drawn

min_straight_section_length: float and int, float, integer, floating and number >= 0

minimum_length of the straight sections.

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

start_straight: float and int, float, integer, floating and number >= 0

The length of the straight start section of the route

end_straight: float and int, float, integer, floating and number >= 0

The length of the straight end section of the route

manhattan:

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.

rounding_algorithm: *None allowed*

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

bend_radius: float and number > 0

Bend radius for the auto-generated bends.

Other Parameters:
min_length_for_taper: float and int, float, integer, floating and number >= 0, locked

minimum length needed to use tapering

center_line_shape: locked

Automatically calculated shape of the center line of the trace

ElectricalWire

The i3.ElectricWire class is an electrical implementation of a trace. This class is used to create electrical connections between components.

class ipkiss3.all.ElectricalWire

A basic electrical trace ( wire )

Parameters:
trace_template: PCell and ElectricalWireTemplate
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:
contents: PCell and _Trace, locked

Notes

This is a very basic version of an electrical wire, variations exist to suit your more advanced needs

Examples

>>> import si_fab.all as pdk
>>> import ipkiss3.all as i3
>>> etpl = i3.ElectricalWireTemplate('my_ewire_tpl')
>>> wire = i3.ElectricalWire(name="my_ewire", trace_template=etpl)
>>> layout = wire.Layout(shape=[(0, 0), (0, 50), (50, 50)])
>>> layout.visualize(annotate=True)

Views

class Layout
Parameters:
trace_template_for_ports: _TraceTemplate.Layout

Trace template to be used for the ports.

reverse_individual_bends: list<( bool, bool or int )>

When set to True, it will generate the individual bends backwards. This has only effect when the bend algorithm is not symmetric. Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

rounding_algorithms:

Rounding algorithm for every individual bend. Can be circular, spline, … Should have length equal to the shape for closed shapes, but equal to shape-2 for open shapes.

bend_radii: list<number > 0>

Bend radius for every individual bend.

reverse_bends:

When set to True, it will generate the bends backwards. This has only effect when the bend algorithm is not symmetric.

remove_straight_angles:

Removes the waypoints with straight angles. Set to False if the algorithm uses waypoint-specific information.

shape: Shape

Shape from which the Trace is calculated

cover_layers: List with type restriction, allowed types: <class ‘ipkiss.primitives.layer.Layer’>

layers that can be used to generate additional coverage of the trace (e.g. manhattan corners)

control_shape_layer: __Layer__

layer on which the control shape is drawn

draw_control_shape:

draws the control shape on top of the waveguide

contents_transformation: GenericNoDistortTransform

transformation to apply to the contents

flatten_contents:

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

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

manhattan:

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.

rounding_algorithm:

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

bend_radius: float and number > 0

Bend radius for the auto-generated bends.

Other Parameters:
center_line_shape: locked

Automatically calculated shape of the center line of the trace

Examples

import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

etpl = i3.ElectricalWireTemplate("my_ewire_tpl")
wire = i3.ElectricalWire(name="my_ewire", trace_template=etpl)
layout = wire.Layout(shape=[(0, 0), (50, 50)])
layout.visualize(annotate=True)
../../../_images/trace-7.png
"""Using the electrical wire template you can easily change the
default width of your waveguide"""
import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

etpl = i3.ElectricalWireTemplate("my_thin_ewire_tpl")
etpl.Layout(width=2.0)
wire = i3.ElectricalWire(name="my_thin_ewire", trace_template=etpl)
layout = wire.Layout(shape=[(0, 0), (50, 50)])
layout.visualize()
../../../_images/trace-8.png
"""Often you'll just want to use the default ElectricalWireTemplate
specified in the TECH file"""
import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

wire = i3.ElectricalWire(name="my_thin_ewire", trace_template=i3.TECH.PCELLS.METAL.DEFAULT)
layout = wire.Layout(shape=[(0, 0), (50, 50)])
layout.visualize()
../../../_images/trace-9.png
class Netlist
Parameters:
trace_template_for_terms: _TraceTemplate.Netlist

Trace template to be used for the terms.

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

Examples

"""Netlists of an electrical wire are most of the time very simple.
Though it's important to remark that all terms will be connected to 1 net"""

import si_fab.all as pdk  # noqa: F401
import ipkiss3.all as i3

wire = i3.ElectricalWire(name="my_wire_withnetlist")
netlist = wire.Netlist()

nets = netlist.nets

# The electrical wire only contains 1 net
assert len(nets) == 1

# And this nets contains all the given terms
assert nets[0].terms == list(netlist.terms.values())

# Let's print the terms
print(netlist.terms)