def __init__(self, name, cells, size, edge_gap=0, prefix=''): Cell.__init__(self, name) size=np.asarray(size) cell_layers=set() for c in cells: cell_layers |= set(c.get_layers()) cell_layers=list(cell_layers) d_layers=cell_layers #Create alignment marks styles=['A' if i%2 else 'C' for i in range(len(d_layers))] am = AlignmentMarks(styles, d_layers) ver = Verniers(styles, d_layers) for e in ver.elements: e.translate((310,-150)) am.add(e) am_bbox=am.bounding_box am_size=np.array([am_bbox[1,0]-am_bbox[0,0], am_bbox[1,1]-am_bbox[0,1]]) sp=size - am_size - edge_gap self.add(CellArray(am, 2, 1, sp, -am_bbox[0]+0.5*edge_gap)) #Create text for l in d_layers: text=Label(prefix+cells[0].name, 150, (am_size[0]+edge_gap, +edge_gap), layer=l) self.add(text) bbox=text.bounding_box t_width = bbox[1,0]-bbox[0,0] #Pattern reference cells spacings, corners, widths=[],[],[] for c in cells: bbox=c.bounding_box corners.append(bbox[0]) bbox = np.array([bbox[1][0]-bbox[0][0], bbox[1][1]-bbox[0][1]]) spacings.append(bbox*1.5) widths.append((bbox*1.5)[0]) self.N=0 origin = edge_gap * np.array([1,1]) n_cols=_divide_cols(size[0]-2*edge_gap, widths) for (c, w, n, s, cr) in zip(cells, widths, n_cols, spacings, corners): if ((origin[0]-cr[0])<(am_size[0]+t_width)) or ((origin[0]+n*s[0]) > (size[0]-am_size[0])): origin[1]=am_size[1]+edge_gap height=size[1]-2*edge_gap-am_size[1] else: origin[1]=edge_gap height=size[1]-2*edge_gap rows=np.floor(height/s[1]) ar=CellArray(c, n, rows, s, origin-cr) self.add(ar) self.N+=rows*n origin += s[0] * n *np.array([1,0])
def __init__(self, name, cells=None, block_gap=400): Cell.__init__(self, name) self.cells=cells self.cell_layers=self._cell_layers() self._label=None self.edge_gap=block_gap/2.
def __init__(self, name, cell, size, spacing=None, edge_gap=0, prefix=''): Cell.__init__(self, name) size=np.asarray(size) cell_layers=cell.get_layers() d_layers=cell_layers #Create alignment marks styles=['A' if i%2 else 'C' for i in range(len(d_layers))] am = AlignmentMarks(styles, d_layers) ver = Verniers(styles, d_layers) for e in ver.elements: e.translate((310,-150)) am.add(e) am_bbox = am.bounding_box am_size = am_bbox[1]-am_bbox[0] sp = size - am_size - edge_gap self.add(CellArray(am, 2, 1, sp, -am_bbox[0]+0.5*edge_gap)) #Create text for l in d_layers: text=Label(prefix+cell.name, 150, (am_size[0]+edge_gap, +edge_gap), layer=l) bbox=text.bounding_box t_width = bbox[1,0]-bbox[0,0] self.add(text) bbox = cell.bounding_box corner=bbox[0] bbox = bbox[1]-bbox[0] #Pattern reference cell if spacing is None: spacing= bbox*(1.5) self.N=0 # upper area cols=np.floor((size[0]-2*edge_gap + spacing[0])/spacing[0]) rows=np.floor((size[1]-am_size[1]-2*edge_gap)/spacing[1]) origin = np.ceil((am_size[1])/spacing[1])\ * spacing * np.array([0,1]) + edge_gap - corner ar=CellArray(cell, cols, rows, spacing, origin) self.add(ar) self.N+=rows*cols # lower area cols=np.floor((size[0]-2*am_size[0]-t_width-2*edge_gap)/spacing[0]) rows=np.ceil(am_size[1]/spacing[1]) origin = np.ceil((am_size[0]+t_width)/spacing[0])\ * spacing * np.array([1,0]) + edge_gap - corner ar=CellArray(cell, cols, rows, spacing, origin) self.add(ar) self.N+=rows*cols