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
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.
For advanced examples on how to use GDSCell, have a look at the GDSII Import and GDSII remap examples.
- Parameters:
- filename: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters, required
filename from which to load the layout data
- unprefixed_library: Library
Library with PCells which will not receive a name prefix when read from GDSII
- prefix: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters
prefix to be prepended to loaded cell names
- cell_name: ( str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters ), *None allowed*
GDS cell name to be imported (default is name if name given).
- 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_map:
Maps PPLayers to gds-layers
- ignore_undefined_layers: ( bool, bool_ or int )
Ignore undefined layers (True), or throw exception when a layer is not found (False).
- 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
Basic example to illustrate the use of GDSCell:
import si_fab.all as pdk # noqa import ipkiss3.all as i3 wg_lv = i3.Waveguide().Layout() wg_lv.write_gdsii("waveguide.gds") wg_imported = i3.GDSCell(filename="waveguide.gds") wg_imported_lv = wg_imported.Layout() wg_imported_lv.visualize()
The layer_map property allows you to change how the gds-layers are mapped onto ipkiss layers:
def __example2(): import si_fab.all as pdk # noqa import ipkiss3.all as i3 wg_lv = i3.Waveguide().Layout() wg_lv.write_gdsii("waveguide.gds") from ipkiss.process.layer_map import GenericGdsiiPPLayerInputMap layer_map = GenericGdsiiPPLayerInputMap( ignore_undefined_mappings=True, pplayer_map={ # only define a mapping for the Core layer. # the cladding layer will be ignored, because ignore_undefined_mappings is set to True (i3.TECH.PROCESS.WG, i3.TECH.PURPOSE.LF.LINE): (4, 2) }, ) wg_imported = i3.GDSCell(filename="waveguide.gds") wg_imported_lv = wg_imported.Layout(layer_map=layer_map) wg_imported_lv.visualize() # by default the layer map default in the technology is used # we can make a copy and modify it. # Take for example that the wg-core layer would be written to # the (5, 2) gdsii-tuple instead of (4, 2) # we can generate such a GDS by adapting the output map: from ipkiss.process.layer_map import GenericGdsiiPPLayerOutputMap # we make a copy, so that we can freely modify it. pplayer_map = dict(i3.TECH.GDSII.LAYERTABLE) pplayer_map[i3.TECH.PROCESS.WG, i3.TECH.PURPOSE.LF.LINE] = (5, 2) output_layer_map = GenericGdsiiPPLayerOutputMap(pplayer_map=pplayer_map) # now we use it to write our GDS: wg_lv.write_gdsii("waveguide_B.gds", layer_map=output_layer_map) # If we would use GDSCell to read this GDS, we would get an error # because the (5, 2) layer is not recognized. # To resolve this, we define an input layer map based on # our modified layer table. input_layer_map = GenericGdsiiPPLayerInputMap(pplayer_map=pplayer_map) wg_imported = i3.GDSCell(filename="waveguide_B.gds") wg_imported_lv = wg_imported.Layout(layer_map=input_layer_map) wg_imported_lv.visualize()
FileInputGdsii
- class ipkiss.io.input_gdsii.FileInputGdsii
Reads GDSII stream from file
- Parameters:
- log_bufsize: optional
size of the input buffer, for logging
- prefix: str and String that contains only ISO/IEC 8859-1 (extended ASCII py3) or pure ASCII (py2) characters, optional
prefix to be applied to the Structure names in the input library. Use to make sure input names are unique.
- layer_map: optional
Layer map of input data
- scaling: float and number > 0, optional
Scaling factor of input data into library
- i_stream: optional
Input stream
- read()
read data from a stream
- Returns:
- Parsed data