def load_aspect(): """ Mix the aspects into their corresponding classes. """ Cell.mixin(CellAspects) Cell.mixin(CellPortProperty) Cell.mixin(NetlistAspects) Cell.mixin(Transformable) Cell.mixin(Outputs) SRef.mixin(SRefPortProperty) SRef.mixin(NetlistAspects) Shape.mixin(ShapeClipperAspects) __Polygon__.mixin(PolygonAspects) __Polygon__.mixin(NetlistAspects) __Polygon__.mixin(PolygonPortProperty) __Polygon__.mixin(PolygonClipperAspects)
if S.reference.is_layer_in_cell(layer): bbox_shape = S.bbox_info.bounding_box() layer.purpose = RDD.PURPOSE.BOUNDARY_BOX elems += Polygon(shape=bbox_shape, layer=layer) return elems class ReferenceBlocks(__Aspects__): """ Create a boundary block around the cell references in the current cell structure. """ block_elements = ElementListParameter() def create_block_elements(self, elems): for e in self.elements.sref: for layer in RDD.get_physical_layers_by_purpose(purposes=['METAL', 'GND']): if e.reference.is_layer_in_cell(layer): bbox_shape = e.bbox_info.bounding_box() elems += Polygon(shape=bbox_shape, layer=layer) return elems def write_gdsii_blocks(self, **kwargs): D = Cell(name=self.name + '_BLOCKS', elements=self.block_elements) D.gdsii_output() Cell.mixin(ReferenceBlocks)
return elems def create_derived_overlap_elements(self, elems): elems += get_process_polygons(self.elements, 'and') return elems def create_derived_diff_elements(self, elems): elems += get_process_polygons(self.elements, 'not') return elems def view_derived_merged_elements(self, **kwargs): elems = ElementList() for pg in self.derived_merged_elements: for e in pg.elements: elems += e name = '{}_{}'.format(self.name, 'DERIVED_MERGED_ELEMENTS') D = Cell(name=name, elements=elems) D.gdsii_view() def view_derived_overlap_elements(self, **kwargs): elems = ElementList() for pg in self.derived_overlap_elements: for e in pg.elements: elems += e name = '{}_{}'.format(self.name, 'DERIVED_OVERLAP_ELEMENTS') D = Cell(name=name, elements=elems) D.gdsii_view() Cell.mixin(DerivedElements)
def load_aspect(): """ Mix the aspects into their corresponding classes. """ Shape.mixin(ShapeClipperAspects) Polygon.mixin(PolygonAspects) Polygon.mixin(NetlistAspects) Polygon.mixin(PolygonPortAspects) Polygon.mixin(PolygonClipperAspects) Polygon.mixin(OutputPlotlyNetlist) SRef.mixin(SRefPortAspects) SRef.mixin(NetlistAspects) Cell.mixin(CellAspects) Cell.mixin(CellPortAspects) Cell.mixin(NetlistAspects) Cell.mixin(Transformable) Cell.mixin(OutputGdsiiAspect) Cell.mixin(OutputPlotlyNetlist)
class ElementsForModelling(__Aspects__): """ Convert the cell elements into a new set of elements for every active process. """ process_elements = ElementListParameter() overlap_elements = ElementListParameter() def create_process_elements(self, elems): elems += get_process_polygons(self.elements, 'or') return elems def create_overlap_elements(self, elems): elems += get_process_polygons(self.elements, 'and') return elems def write_gdsii_mask(self, **kwargs): elems = ElementList() for pg in self.process_elements: for e in pg.elements: elems += e D = Cell(name=self.name + '_VMODEL', elements=elems) D.gdsii_output() Cell.mixin(ElementsForModelling)