Importing Layouts from GDSII

If you have existing GDSII layouts it is possible to import them into IPKISS. All you have to do is make sure the imported layers are defined in the technology and add ports. Circuit models can also be added to an imported GDSII cell so that it would behave like a normal IPKISS PCell.

GDSCell

class ipkiss3.all.GDSCell(*args, **kwargs)

A utility PCell that imports its layout from a GDSII file.

This component enables you to use static, non-ipkiss components in an ipkiss design. By exploiting inheritance you can extend this component with additional information that isn’t available in the GDS file

By default, a prefix will be added to the cells names read from the GDSII file. This prefix is by default equal to name (when set) or empty otherwise. The prefix can be selectively added by passing a library with predefined cells in unprefixed_library: Whenever a cell is found in unprefixed_library, its name will not receive a prefix. This can be used to ensure that predefined cells can be re-used as child cells within GDSCells.

Parameters:

filename: str, required

filename from which to load the layout data

cell_name: optional

GDS cell name to be imported (default is name if name given).

prefix: str, optional

prefix to be prepended to loaded cell names

unprefixed_library: Library, optional

Library with PCells which will not receive a name prefix when read from GDSII

cell_instances: _PCellInstanceDict, optional

name: optional

The unique name of the pcell

Views

Layout
Parameters:

ignore_undefined_layers: optional

Ignore undefined layers (True), or throw exception when a layer is not found (False).

layer_map: optional

Maps PPLayers to gds-layers

view_name: str, optional

The name of the view

grids_per_unit: locked

Number of grid cells per design unit

units_per_grid: locked

Ratio of grid cell and design unit

grid: float and number > 0, locked

design grid. Extracted by default from TECH.METRICS.GRID

unit: float and number > 0, locked

design unit. Extracted by default from TECH.METRICS.UNIT

Examples

""" This example shows the most basic usage of GDSCell"""

import ipkiss3.all as i3

class MyCell(i3.PCell):
    class Layout(i3.LayoutView):

        def _generate_elements(self, elems):
            elems += i3.Circle(i3.Layer(1), radius=10.0)
            return elems

cell = MyCell()
layout = cell.Layout()
layout.write_gdsii('my_cell.gds')

cell = i3.GDSCell(filename='my_cell.gds')

layout = cell.Layout()
# note that some layers will not show up when no display styles
# have been defined for the imported layer.
layout.visualize()
../../_images/GDSCell1.png
""" This example shows how you can extend GDSCell to add ports"""

import ipkiss3.all as i3

class MyCell(i3.PCell):
    class Layout(i3.LayoutView):
        def _generate_elements(self, elems):
            elems += i3.Circle(i3.Layer(1), radius=10.0)
            return elems

cell = MyCell(name="my_cell")
layout = cell.Layout()
layout.write_gdsii('my_cell.gds')

class MyCellWithPorts(i3.GDSCell):

    def _default_filename(self):
        return 'my_cell.gds'

    def _default_cell_name(self):
        return 'my_cell'

    class Layout(i3.GDSCell.Layout):

        def _generate_ports(self, ports):
            ports += i3.OpticalPort(name='my_port', position=(10.0, 10.0), angle=45.0)
            return ports

cell = MyCellWithPorts()
layout = cell.Layout()
layout.visualize(annotate=True)
../../_images/GDSCell2.png