def _draw_unit_cell(self): o = self.origin rect=pg.rectangle(size=(self.coverage*self.pitch,self.length),\ layer=self.layer) rect.move(origin=(0, 0), destination=o.coord) unitcell = Device() r1 = unitcell << rect unitcell.absorb(r1) r2 = unitcell << rect r2.move(origin=o.coord,\ destination=(o+Point(self.pitch,self.y_offset)).coord) r3 = unitcell << rect r3.move(origin=o.coord,\ destination=(o+Point(2*self.pitch,0)).coord) unitcell.absorb(r2) unitcell.absorb(r3) unitcell.name = "UnitCell" del rect return unitcell
def draw(self): ''' Generates layout cell based on current parameters. 'top' and 'bottom' ports are included in the cell. Returns ------- cell : phidl.Device. ''' unitcell = self._draw_unit_cell() cell = Device(self.name) cell.name = self.name cell.add_array(unitcell,columns=self.n,rows=1,\ spacing=(self.pitch*2,0)) cell.flatten() totx = self.pitch * (self.n * 2 + 1) - self.pitch * (1 - self.coverage) midx = totx / 2 finger_dist=Point(self.pitch*1,\ self.length+self.y_offset) cell = join(cell) cell.name = self.name cell.add_port(Port(name='bottom',\ midpoint=(self.origin+\ Point(midx,0)).coord,\ width=totx, orientation=-90)) cell.add_port(Port(name='top',\ midpoint=(self.origin+\ Point(midx,self.length+self.y_offset)).coord,\ width=totx, orientation=90)) del unitcell return cell
def _draw_unit_cell(self): o = self.origin rect=pg.rectangle(size=(self.coverage*self.pitch,self.length),\ layer=self.layer) rect.move(origin=(0, 0), destination=o.coord) unitcell = Device() r1 = unitcell << rect unitcell.absorb(r1) rect_partialetch=pg.rectangle(\ size=(\ (1-self.coverage)*self.pitch,self.length-self.y_offset),\ layer=LayoutDefault.layerPartialEtch) rect_partialetch.move(origin=o.coord,\ destination=(self.pitch*self.coverage,self.y_offset)) rp1 = unitcell << rect_partialetch rp2 = unitcell << rect_partialetch rp2.move(destination=(self.pitch, 0)) r2 = unitcell << rect r2.move(origin=o.coord,\ destination=(o+Point(self.pitch,self.y_offset)).coord) r3 = unitcell << rect r3.move(origin=o.coord,\ destination=(o+Point(2*self.pitch,0)).coord) unitcell.absorb(r2) unitcell.absorb(r3) unitcell.name = "UnitCell" del rect, rect_partialetch return unitcell
def draw(self): cell=Device() cell.name=self.name d_ref=cell.add_ref(cls.draw(self)) for name,port in d_ref.ports.items(): self.pad.port=port pad_ref=cell.add_ref(self.pad.draw()) pad_ref.connect(pad_ref.ports['conn'], destination=port) cell.absorb(pad_ref) cell.add_port(port,name) return cell
def draw(self): cell = Device() cell.name = self.name supercell = LFERes.draw(self) super_ref = cell.add_ref(supercell) if self.plate_position == 'out, short': plate=pg.rectangle(size=(self.etchpit.active_area.x+8*self.idt.active_area_margin,self.idt.length-self.idt.y_offset/2),\ layer=self.platelayer) plate_ref = cell.add_ref(plate, alias='Plate') transl_rel=Point(self.etchpit.x-4*self.idt.active_area_margin,self.anchor.size.y+2*self.anchor.etch_margin.y+self.bus.size.y\ +self.idt.y_offset*3/4) lr_cell = get_corners(cell)[0] lr_plate = get_corners(plate_ref)[0] plate_ref.move(origin=lr_plate.coord,\ destination=(lr_plate+lr_cell+transl_rel).coord) cell.absorb(plate_ref) del plate elif self.plate_position == 'in, short': plate=pg.rectangle(\ size=(\ self.etchpit.active_area.x-\ 2*self.idt.active_area_margin,\ self.idt.length-self.idt.y_offset/2),\ layer=self.platelayer) plate_ref = cell.add_ref(plate, alias='Plate') transl_rel=Point(self.etchpit.x+\ self.idt.active_area_margin,\ self.anchor.size.y+\ 2*self.anchor.etch_margin.y+\ self.bus.size.y+\ self.idt.y_offset*3/4) lr_cell = get_corners(cell)[0] lr_plate = get_corners(plate_ref)[0] plate_ref.move(origin=lr_plate.coord,\ destination=(lr_plate+lr_cell+transl_rel).coord) cell.absorb(plate_ref) del plate elif self.plate_position == 'out, long': plate=pg.rectangle(\ size=(self.etchpit.active_area.x+\ 8*self.idt.active_area_margin,\ self.idt.length+\ 2*self.bus.size.y+\ self.idt.y_offset),\ layer=self.platelayer) plate_ref = cell.add_ref(plate, alias='Plate') transl_rel=Point(self.etchpit.x-\ 4*self.idt.active_area_margin,\ self.anchor.size.y+2*self.anchor.etch_margin.y) lr_cell = get_corners(cell)[0] lr_plate = get_corners(plate_ref)[0] plate_ref.move(origin=lr_plate.coord,\ destination=(lr_plate+lr_cell+transl_rel).coord) cell.absorb(plate_ref) del plate elif self.plate_position == 'in, long': plate=pg.rectangle(\ size=(\ self.etchpit.active_area.x-\ 2*self.idt.active_area_margin,\ self.idt.length+\ 2*self.bus.size.y+\ self.idt.y_offset), layer=self.platelayer) plate_ref = cell.add_ref(plate, alias='Plate') transl_rel=Point(self.etchpit.x+\ self.idt.active_area_margin,\ self.anchor.size.y+2*self.anchor.etch_margin.y) lr_cell = get_corners(cell)[0] lr_plate = get_corners(plate_ref)[0] plate_ref.move(origin=lr_plate.coord,\ destination=(lr_plate+lr_cell+transl_rel).coord) cell.absorb(plate_ref) del plate for name, port in supercell.ports.items(): cell.add_port(port, name) return cell