pdkmaster.io.klayout package¶
pdkmaster.io.klayout.export¶
- class pdkmaster.io.klayout.export.FileExporter(*, tech: Technology, export_name: Optional[str] = None, gds_layers: Dict[str, Union[int, Tuple[int, int]]], prims_spiceparams: SpicePrimsParamSpec)[source]¶
Bases:
object
- pdkmaster.io.klayout.export.export2db(obj: _Shape, *, export_fullshape: Optional[bool] = None, add_pin_label: bool = False, gds_layers: None = None, cell_name: None = None, merge: bool = False) Any [source]¶
- pdkmaster.io.klayout.export.export2db(obj: Union[MaskShape, MaskShapes, _Layout, Library], *, export_fullshape: None = None, add_pin_label: bool = False, gds_layers: Dict[str, Union[int, Tuple[int, int]]], cell_name: Optional[str] = None, merge: bool = False) pya.Layout
This function allows to export PDKMaster geometry/layout objects to a klayout Layout object
- Parameters:
obj – This is the object to export. There are two different call types. 1) a _Shape geometry object without mask provided 2) a MaskShape geometry or an object that contains maskshapes.
export_fullshape – only to be specified when obj is a _Shape object. If True the full MultiPartShape shape will be exported when a MultiPartShape._Part object is met. It defaults to False
add_pin_label – If True a label will exported on top of layers that are pin layers of one of the technology’s MetalWire primitives.
gds_layers – Has to be specified when obj is a MaskShape or a collection of them and should not be provided otherwise. It contains the lookup table to get the corresponding KLayout layer information for PDKMaster _DesignMask objects.
cell_name – Only to be provided when obj is a MaskShape or a collection of them but not a Library. If specified the name of the cell in which the MaskShape(s) will be exported. By default ‘anon’ will be used.
merge – Wether to merge the exported shapes or not.
- Returns:
An equivalent KLayout database object if obj is a _Shape geometry or a KLayout Layout object when obj is a MaskShape or a collection of MaskShapes. If obj is a Library a Cell will be added for each _Cell in the Library. If there are cell instances in the PDKMaster _Layout object these cells will also be exported to the output KLayout Layout object as a cell even if it is from another PDKMaster Library. An exception will be generated when two instances need to be exported to the same cell name but in a different Library.
pdkmaster.io.klayout.merge¶
- pdkmaster.io.klayout.merge_.merge(obj: _Layout) _Layout [source]¶
- pdkmaster.io.klayout.merge_.merge(obj: Cell) None
- pdkmaster.io.klayout.merge_.merge(obj: Library) None
- pdkmaster.io.klayout.merge_.merge(obj: MultiShape) _Shape
- pdkmaster.io.klayout.merge_.merge(obj: MaskShape) MaskShape
- pdkmaster.io.klayout.merge_.merge(obj: MaskShapes) MaskShapes
This function allows to use the KLayout engine to merge PDKMaster _Shape objects; either directly or as part of another PDKMaster object
Althouogh it will be tried to merge shapes there is no guarantee given that merge-able shapes are effectively merged. Currently RepeatedShape objects are retained as is and not merged with other shapes.
- Parameters:
obj – the PDKMaster object from which the shape(s) needs to be merged. obj can also be an iterable of Shape objects.
- Returns:
Return same type of object; the object may have been simplified; e.g. merging a MultiShape with all shapes overlapping can result in a Polygon or a Rect. Currently RepeatedShape and _InstanceSubLayout will not be merge and returned as is. For object of type _Cell and Library the merging will be done on the provided object and no value is returned.