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.
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.
filename: str, required
filename from which to load the layout data
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
The unique name of the pcell
Ignore undefined layers (True), or throw exception when a layer is not found (False).
Maps PPLayers to gds-layers
view_name: str, optional
The name of the view
Number of grid cells per design unit
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
""" 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()
""" 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)