Trace templates
A trace template holds information about a cross-section of a port or a trace. To learn more about trace templates, please have a look at the following tutorial: Trace templates.
Inside a pdk you can usually find a set of predefined trace templates that can be used to create your traces. For example, If you want to draw a waveguide with SiFab pdk, you can choose one of the following trace templates:
SiWireWaveguideTemplate
SiRibWaveguideTemplate
SiNWireWaveguideTemplate
More information about these standard SiFab trace templates can be found in the SiFab documentation: SiFab waveguide templates.
WindowWaveguideTemplate
If you want to define a customized trace template for a waveguide, you can create a class that inherits from i3.WindowWaveguideTemplate
.
Inside the example below, the windows are defined with i3.PathTraceWindow
.
You can find out more about different types of windows in Windows.
- class ipkiss3.all.WindowWaveguideTemplate
Template PCell for an Optical Waveguide Trace based on TraceWindows.
- Parameters:
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
Views
- class Layout
- Parameters:
- windows: List with type restriction, allowed types: <class ‘ipkiss3.pcell.trace.window.window._TraceWindow’>
List of Trace Windows that know how to draw themselves relative to the shape of the Trace
- core_width: float and number > 0
width of the waveguide core
- core_layer: __Layer__
layer used to define the core of the waveguide
- pin_shape: Shape
shape to be used for the pins
- trace_template_for_ports: _TraceTemplate.Layout
Trace template to be used for the ports. Default = this template
- width: float and int, float, integer, floating and number >= 0
- control_shape_layer: __Layer__
layer on which the control shape is drawn
- draw_control_shape:
draws the control shape on top of the waveguide
- 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)
- 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
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 class MyWgTemplate(i3.WindowWaveguideTemplate): class Layout(i3.WindowWaveguideTemplate.Layout): core_width = i3.PositiveNumberProperty(default=0.45, doc="Core width of the waveguide") cladding_width = i3.PositiveNumberProperty(default=4.0, doc="Cladding width of the waveguide") def _default_cover_layers(self): # Layer for Manhattan rectangles # (drawn in waveguide bends when the waveguide manhattan parameter = True) return [] def _default_windows(self): return [ i3.PathTraceWindow( layer=i3.TECH.PPLAYER.SI, start_offset=-0.5 * self.core_width, end_offset=+0.5 * self.core_width, ), i3.PathTraceWindow( layer=i3.TECH.PPLAYER.SI_CLADDING, start_offset=-0.5 * self.cladding_width, end_offset=+0.5 * self.cladding_width, ), ] # Instantiate the new waveguide template to use it in our waveguide below wg_tmpl = MyWgTemplate() wg = i3.RoundedWaveguide(trace_template=wg_tmpl) wg_lay = wg.Layout(shape=[(0, 0), (10, 0), (10, 10)]) wg_lay.visualize(annotate=True)
- .
# for now disabled: .. autoattribute:: Netlist
TaperedWaveguideTemplate
This trace template is used to create i3.TaperedWaveguide
.
Instead of specifying two different trace templates inside i3.TaperedWaveguide
, it is also possible to specify one i3.TaperedWaveguideTemplate
.
The two different trace templates for the straight and bend sections are then selected in different parameters for this template.
- class ipkiss3.all.TaperedWaveguideTemplate
A trace template for a TaperedWaveguide
- Parameters:
- straight_trace_template: PCell and _TraceTemplate, required
template for the straight sections.
- trace_template: PCell and _TraceTemplate, required
template for the start, end and bend sections.
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
Views
- class Layout
- Parameters:
- flatten_waveguides:
If true, all waveguides will be flattened one level to reduce hierarchy
- min_straight_section_length: float and number > 0
minimum_length of the straight template section.
- 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. If
None
, the default taper lengths for each transition are chosen for each transition.- manhattan:
Adds rectangular blocks in the bends to avoid as much as possible non-manhattan angles.
- core_width: float and number > 0
width of the waveguide core
- pin_shape: Shape
shape to be used for the pins
- trace_template_for_ports: _TraceTemplate.Layout
Trace template to be used for the ports. Default = this template
- flatten_contents:
if True, it will insert the referred trace as elements in the layout, rather than as an Instance
- 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
- keep_original_trace_template:
- width: float and int, float, integer, floating and number >= 0
- control_shape_layer: __Layer__
layer on which the control shape is drawn
- draw_control_shape:
draws the control shape on top of the waveguide
- 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)
- 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
- min_straight: float and int, float, integer, floating and number >= 0
The minimum length of any straight sections in the route
- 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
ElectricalWireTemplate
This is a trace template for a simple electrical implementation of a trace (wire).
An example where this trace template is used can be found in the documentation of i3.ElectricalWire
.
- class ipkiss3.all.ElectricalWireTemplate
A TraceTemplate to easily create electrical wires
- Parameters:
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
Views
- class Layout
- Parameters:
- layer: __Layer__
- pin_shape: Shape
shape to be used for the pins
- trace_template_for_ports: _TraceTemplate.Layout
Trace template to be used for the ports. Default = this template
- control_shape_layer: __Layer__
layer on which the control shape is drawn
- draw_control_shape:
draws the control shape on top of the waveguide
- width: float and number > 0
Width of the electrical trace
- 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
- class Netlist
- Parameters:
- trace_template_for_terms: _TraceTemplate.Netlist
Trace template to be used for the terms. Default = this template
- 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
ElectricalWindowWireTemplate
With i3.ElectricalWindowWireTemplate
, it is also possible to customize your windows of your trace templates for your electrical wires.
This way you can build more custom & specialized wires.
- class ipkiss3.all.ElectricalWindowWireTemplate
An advanced trace template that is used to define electrical wires using ‘windows’. These windows will be extruded extruded along the shape of the wire
- Parameters:
- name: String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
The unique name of the pcell
See also
Notes
This trace template is only useful in more advanced usecases. When you want to create simple wires, ElectricalWireTemplate should be sufficient.
Views
- class Layout
- Parameters:
- windows: List with type restriction, allowed types: <class ‘ipkiss3.pcell.trace.window.window._TraceWindow’>
List of Trace Windows that know how to draw themselves relative to the shape of the Trace
- layer: __Layer__
- pin_shape: Shape
shape to be used for the pins
- trace_template_for_ports: _TraceTemplate.Layout
Trace template to be used for the ports. Default = this template
- control_shape_layer: __Layer__
layer on which the control shape is drawn
- draw_control_shape:
draws the control shape on top of the waveguide
- width: float and number > 0
Width of the electrical trace
- 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
import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 etpl = i3.ElectricalWindowWireTemplate() etpl.Layout() wire = i3.ElectricalWire(name="my_wire_with_windows", trace_template=etpl) layout = wire.Layout(shape=[(0.0, 0.0), (30.0, 0.0), (30.0, 20.0), (15.0, 30.0)]) layout.visualize(annotate=True)
"""Windows provide you the possiblity to create more advanced wires""" import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 etpl = i3.ElectricalWindowWireTemplate() metal_layer = i3.PPLayer(process=i3.TECH.METAL.DEFAULT_PROCESS, purpose=i3.TECH.PURPOSE.DF.LINE) windows = [i3.PathTraceWindow(layer=metal_layer, start_offset=-1, end_offset=0)] etpl.Layout(draw_control_shape=True, windows=windows) wire = i3.ElectricalWire(name="my_wire_with_windows2", trace_template=etpl) layout = wire.Layout(shape=[(0.0, 0.0), (30.0, 0.0), (30.0, 20.0), (15.0, 30.0)]) layout.visualize()
"""A toy example that uses PeriodicReferenceTraceWindow""" import si_fab.all as pdk # noqa: F401 import ipkiss3.all as i3 from ipkiss3.pcell.trace.window.reference_window import PeriodicReferenceTraceWindow from ipkiss.process import PPLayer metal_layer = PPLayer(process=i3.TECH.METAL.DEFAULT_PROCESS, purpose=i3.TECH.PURPOSE.DF.LINE) class MyCell(i3.PCell): class Layout(i3.LayoutView): def _generate_elements(self, elems): elems += i3.Rectangle(layer=metal_layer, box_size=(2.0, 2.0)) return elems my_layout = MyCell().Layout() etpl = i3.ElectricalWindowWireTemplate() windows = [PeriodicReferenceTraceWindow(reference=my_layout, pitch=3.0)] etpl.Layout(windows=windows) wire = i3.ElectricalWire(name="my_crazy_ewire", trace_template=etpl) layout = wire.Layout(shape=[(0.0, 0.0), (30.0, 0.0), (30.0, 20.0), (15.0, 30.0)]) layout.visualize()
- class Netlist
- Parameters:
- trace_template_for_terms: _TraceTemplate.Netlist
Trace template to be used for the terms. Default = this template
- 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