def cell(length=length, pitch=pitch, metal=metal): """Create a DBR cell. Args: length (float): pitch (float): Returns: Cell """ duty_cycle = 0.5 if metal: contact = 1 else: contact = 0 with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name, params=(length, pitch, duty_cycle, contact)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0']).put(0.5*length, 0, 90) pdk.put_stub(['a0', 'b0', 'c0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(length=length): """Create and return a DCpad cell. Args: length (float): pad length in um width (float): pad width in um Returns: Cell: pad element """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.foundry_spt = [] bb_length = length + 2*buf_length pdk.addBBmap(name, params=(length, tab_width, "RoundedRectangle"), trans=(0.5*(length-100), 0, 0)) C.default_pins('c0','c0') nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='electrical').\ put(0.5*bb_length, 0, 180) pdk.put_stub('c0', length=pinwidth['c0'], shape='circle') pdk.put_boundingbox('org', bb_length, bb_length) if icon: icon(bb_length, bb_length).put(0, 'cc') return C
def cell(length=length): """Create a photodetector RF cell. Returns: Cell """ cshift = 0 with nd.Cell(hashme=True) as C: C.default_pins('a0', 'a0') C.groupname = groupname C.foundry_spt = [] pdk.addBBmap(name) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').\ put(0, 0, 180) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='gnd').\ put(length, cshift-spaceGS-pinwidth['c0']) nd.Pin(name='c1', xs=xs['c1'], width=pinwidth['c1'], remark='signal').\ put(length, cshift) nd.Pin(name='c2', xs=xs['c2'], width=pinwidth['c2'], remark='gnd').\ put(length, cshift+spaceGS+pinwidth['c2']) pdk.put_stub(['a0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) pdk.put_stub(['c0', 'c1', 'c2']) return C
def cell(length=length, pads=pads): """Create a SOA cell. Args: length (float): SOA length in um Returns: Cell; SOA element """ nonlocal width with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name, params=(length)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, dy_io, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length, dy_io, 0) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0']).put(length / 2, dy_io, 90) if pads: bb_width = padwidth else: bb_width = width pdk.put_stub(['a0', 'b0', 'c0']) pdk.put_boundingbox('org', length, bb_width, align='lb') if icon: icon(length, bb_width).put(0, 0, 180, 'lc') cfg.cp = C.pin['b0'] return C
def cell(length=length, width=width): """Create a DCpad_lw cell. Args: length (float): length of the pad in um width (float): width of the pad in um Returns: Cell: dcpad element """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.default_pins('c0','c0') buf = 10 bb_width = width + buf bb_length = length + buf nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='electrical').\ put(0.5*bb_length, 0, 180) pdk.put_stub('c0', length=pinwidth['c0'], shape='circle') pdk.put_boundingbox('org', bb_length, bb_width) for lay, grow, acc in nd.layeriter(xs['c0']): pad = nd.geom.rounded_rect( length=length+grow, height=width, position=5) nd.Polygon(layer=lay, points=pad).\ put(C.pin['c0']) return C
def cell(diameter=diameter): """Create a DCpad cell. Args: diameter (float): diameter of circular debt Returns: Cell """ with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name) bb_width = diameter + 2*buf_width bb_length = diameter + 2*buf_length C.default_pins('c0', 'c0') nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='electrical').\ put(0.5*bb_length, 0, 180) pdk.put_stub('c0', length=pinwidth['c0'], shape='circle') pdk.put_boundingbox('org', bb_length, bb_width) for lay, grow, acc in nd.layeriter(xs['c0']): pad = nd.geom.circle(radius=0.5*diameter, N=100) nd.Polygon(layer=lay, points=pad).\ put('cc') return C
def cell(length=length, pitch=pitch, duty_cycle=duty_cycle): """Create a DBR cell. Args: length (float): length of DBR section in um pitch (float): pitch (full period) of dbr in um duty_cycle (float): duty cycle of grating (default = 0.5) Returns: Cell: dbr element """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.foundry_spt = [] pdk.addBBmap(name, params=(length, pitch, duty_cycle)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0']).put(length/2, 5.0, 90) pdk.put_stub(['a0', 'b0', 'c0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(length=length, contacts=contacts): """Create an electro-optical phase modulator (EOPM) cell. Their can be from 0 up to <contacts> contac points. They will be equidistantly spaced along the modulator. Args: length (float): length of the EOPM. contacts (int): number of contact pads (bool): draw pads Returns: Cell: eopm """ with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name, params=(length)) # modulator section: nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0'], remark='optical').put(length) # x-positions of pads: L = 0.5 * (length - pinwidth['c0']) xpos = [] if contacts > 1: for n in range(contacts): xpos.append(0.5 * pinwidth['c0'] + L * 2 * n / (contacts - 1)) elif contacts == 1: xpos = [0.5 * length] elif contacts == 0: pass for n, x in enumerate(xpos): pinname = 'c' + str(n) p1 = nd.Pin(name=pinname, xs=xs['c0'], width=pinwidth['c0']).\ put(x, 0, 90) nd.put_stub(pinname) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) cfg.cp = C.pin['b0'] return C
def cell(ID=ID): """Create a Cell_ID cell. Returns: Cell """ with nd.Cell(hashme=True) as C: pdk.addBBmap(name, params=('box', 'fname_final', length)) nd.Pin(name='a0', xs=None).put(0, 0, 180) pdk.put_boundingbox('org', length, width) C.groupname = groupname return C
def cell(length=length): """Create an Isolation cell. Returns: Cell """ with nd.Cell(hashme=True) as C: pdk.addBBmap(name, params=(length)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) C.groupname = groupname return C
def cell(): """ Create a XS-transition cell. Returns: Cell """ with nd.Cell(hashme=True) as C: pdk.addBBmap(name) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) C.groupname = groupname return C
def cell(): """Create a BB1x1 cell. Returns: Cell """ with nd.Cell(hashme=True) as C: C.foundry_spt = [] #pdk.addBBmap(name) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length, bshift) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) cfg.cp = C.pin['b0'] C.groupname = groupname return C
def cell(length=length, width=width): """Create a RFpad cell. Returns: Cell """ with nd.Cell(name=pdk._hash_name) as C: C.default_pins('c0','c0') C.groupname = groupname nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='electrical').put(0, 0, 180) pdk.put_stub('c0') pdk.put_boundingbox('org', length, width) pdk.addBBmap(name) if icon: icon(length, width).put(0) return C
def cell(): """Create a Modefilter cell. Returns: Cell """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.version = version C.store_pins = store_pins pdk.addBBmap(name) # no OD_toStd nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0'], remark='optical').put(length) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(): """Create and return a MIR_1p cell. Returns: Cell """ with nd.Cell(hashme=True) as C: C.default_pins('a0', 'a0') C.version = version C.store_pins = store_pins C.groupname = groupname pdk.addBBmap(name, params=(OD_toStd)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, 0, 180) #nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(0, 0, 180) pdk.put_stub(['a0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(length=length): """Create a EAM cell. Args: length (float): length of the eam Returns: Cell: eam element """ with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0']).put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0']).put(length, 0) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0']).put(0.5 * length, 0, 90) pdk.put_stub() pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(length=length): """Create a PhotoDetector cell. Args: length (float): length of the diode in um pad (bool): flag to add a bond pad Returns: Cell: photo diode element """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.default_pins('a0', 'a0') C.foundry_spt = [] bb_length = length+buf pdk.addBBmap(name, params=(length)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, 0, 180) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='electrical').put(bb_length) pdk.put_stub(['a0', 'c0']) pdk.put_boundingbox('org', bb_length, width) if icon: icon(bb_length, width).put(0) return C
def cell(): """ Create a MMI2x2 cell. Returns: Cell """ with nd.Cell(hashme=True) as C: C.groupname = groupname C.version = version C.store_pins = store_pins pdk.addBBmap(name, params=(OD_toStd)) nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, offset[0], 180) nd.Pin(name='a1', xs=xs['a1'], width=pinwidth['a1'], remark='optical').put(0, offset[1], 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0'], remark='optical').put(length, offset[2]) nd.Pin(name='b1', xs=xs['b1'], width=pinwidth['b1'], remark='optical').put(length, offset[3]) pdk.put_stub(['a0', 'a1', 'b0', 'b1']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) return C
def cell(cleave=cleave, length=length, height=height, coatingW=coatingW, coatingE=coatingE): """Create a Cell_Boundary cell. Returns: Cell """ with nd.Cell(hashme=True) as C: pdk.put_boundingbox('org', length, height, outline=False, \ move=(-0.5*cleave, 0.5*height-0.5*cleave)) pdk.parameters('hashme').put(0, 'cc') #TODO: No foundry specific stuff here: remove. outline = [(0, 0), (length - cleave, 0), (length - cleave, height - cleave), (0, height - cleave)] nd.Polygon(layer='Polyimide1Base', points=outline).put(0) for lay, grow, acc in nd.layeriter(xs): frame = geom.frame(sizew=cleave, sizel=length, sizeh=height, grow=grow) nd.Polygon(layer=lay, points=frame).put(0) ##adding coating to nd.Cell boundary: west and east options = { 'AR': 'Coating_AR', 'HR': 'Coating_HR', 'NO': 'Coating_NO', 'DC': 'Coating_DC' } coating_on_chip = nd.get_parameter('cell_coating_on_chip') box_coatno = [(0, 0), (cleave / 2, 0), (cleave / 2, height), (0, height)] box_coatother = [(0, 0), (coating_on_chip + 0.5 * cleave, 0), (coating_on_chip + 0.5 * cleave, height), (0, height)] pinW = nd.Pin().put(-0.5 * cleave, -0.5 * cleave) pinE = nd.Pin().put(length - 0.5 * cleave, height - 0.5 * cleave, 180) coatings = {'E': (coatingE, pinE), 'W': (coatingW, pinW)} for coat, pin in coatings.values(): if coat in options.keys(): layer = options[coat] else: print( 'Available coating options: AR | HR | NO | DC. Default is NO.' ) if coat is 'NO': box = box_coatno else: box = box_coatother nd.Polygon(layer=layer, points=box).put(pin) #Placing IOs pitch = 12.5 amount_ios = round((height - cleave - pitch) / pitch) #IOs positions lay = 'bb_pin' for no in range(0, amount_ios): pinID = 'io{:03d}'.format(no) if no % 2 is 0: angle = 7 else: angle = 0 p = nd.Pin(name=pinID).put(-cleave / 2, 12.5 + no * pitch, angle) p = nd.Pin(name='io' + str(no)).put(-cleave / 2, 12.5 + no * pitch, angle) pdk.make_pincell().put(p) nd.text(pinID, layer=lay, height=0.15, align='rc').put(p.move(-0.1)) for no in range(0, amount_ios): mo = amount_ios + no pinID = 'io{:03d}'.format(mo) if mo % 2 is 0: angle = 7 else: angle = 0 p = nd.Pin(name=pinID).put(length - cleave / 2, 2 * 12.5 + no * pitch, 180 + angle) pdk.make_pincell().put(p) nd.text(pinID, layer=lay, height=0.15, align='lc').\ put(p.move(-0.1, 0, 180)) C.groupname = groupname return C
def cell(self): """Create a Project Cell with IO postition pins. Returns: Cell: cell containing design area and cleave boundaries """ with nd.Cell(name=self.name) as C: # put the dice/cleave border frame = geom.frame(sizew=self.cleave, sizel=self.length, sizeh=self.height) nd.Polygon(layer='DiceArea', points=frame).put(0) nd.Pin('left', show=False).put(-0.5 * (self.cleave), -0.5 * self.cleave + 0.5 * self.height, 0) tdk.put_boundingbox('left', self.length, self.height) # put the pins IOcountmax = round( (self.height - self.cleave - self.pitch) / self.pitch) pin_indent = 0 ioy0 = 50 for no in range(0, IOcountmax): pinIDL = 'ioL{:03d}'.format(no) pinIDR = 'ioR{:03d}'.format(no) if no % 2 is 0: angle = 7 else: angle = 0 #IOs left p = nd.Pin(name=pinIDL, xs='Shallow', type=angle).put(-self.cleave + pin_indent, ioy0 + no * self.pitch, angle) self.arrow.put(p) nd.text(pinIDL, layer=package_pin_text, height=0.15, align='rc').put(p.move(-0.1)) #IOs right p = nd.Pin(name=pinIDR, xs='Shallow', type=angle).put(-pin_indent + self.length, ioy0 + no * self.pitch, 180 + angle) self.arrow.put(p) nd.text(pinIDR, layer=package_pin_text, height=0.15, align='rc').put(p.move(-0.575, 0, 180)) # Adding coating options = { 'AR': 'Coating_AR', 'HR': 'Coating_HR', 'NO': 'Coating_NO', 'DC': 'Coating_DC' } coating_on_chip = 100 box_coatno = [(0, 0), (self.cleave / 2, 0), (self.cleave / 2, self.height), (0, self.height)] box_coatother = [(0, 0), (coating_on_chip + 0.5 * self.cleave, 0), (coating_on_chip + 0.5 * self.cleave, self.height), (0, self.height)] pinL = nd.Pin().put(-0.5 * self.cleave, -0.5 * self.cleave) pinR = nd.Pin().put(self.length - 0.5 * self.cleave, self.height - 0.5 * self.cleave, 180) coatings = {'L': (self.coatingL, pinL), 'R': (self.coatingR, pinR)} for coat, pin in coatings.values(): if coat in options.keys(): layer = options[coat] else: print( 'Available coating options: AR | HR | NO | DC. Default is NO.' ) if coat is 'NO': box = box_coatno else: box = box_coatother nd.Polygon(layer=layer, points=box).put(pin) return C return cell
def cell(length=length, pads=pads): """Create a EOPM_RF cell. Args: length (float): modulator length in um pads (bool): draw RF pads padangle1 (float): angle of left RF pad in degrees w.r.t. modulator padangle2 (float): angle of right RF pad in degrees w.r.t. modulator Returns: Cell: eopm """ with nd.Cell(hashme=True) as C: C.groupname = groupname pdk.addBBmap(name, params=(length)) wmet = pinwidth['c0'] nd.Pin(name='a0', xs=xs['a0'], width=pinwidth['a0'], remark='optical').put(0, 0, 180) nd.Pin(name='b0', xs=xs['b0'], width=pinwidth['b0'], remark='optical').put(length, 0) nd.Pin(name='c0', xs=xs['c0'], width=pinwidth['c0'], remark='gnd').put(dx_metal, dy_metal + rfpitch + wmet, 180) nd.Pin(name='c1', xs=xs['c1'], width=pinwidth['c1'], remark='signal').put(dx_metal, dy_metal, 180) nd.Pin(name='c2', xs=xs['c2'], width=pinwidth['c2'], remark='gnd').put(dx_metal, dy_metal - rfpitch - wmet, 180) nd.Pin(name='d0', xs=xs['d0'], width=pinwidth['d0'], remark='gnd').put(length - dx_metal, dy_metal + rfpitch + wmet) nd.Pin(name='d1', xs=xs['d1'], width=pinwidth['d1'], remark='signal').put(length - dx_metal, dy_metal) nd.Pin(name='d2', xs=xs['d2'], width=pinwidth['d2'], remark='gnd').put(length - dx_metal, dy_metal - rfpitch - wmet) pdk.put_stub(['a0', 'b0']) pdk.put_boundingbox('org', length, width) if icon: icon(length, width).put(0) if pads: bend_gsg_function(angle=padangle1, **bend_gsg_params).put(C.pin['c1']) RFpadType.put() bend_gsg_function(angle=padangle2, **bend_gsg_params).put(C.pin['d1']) RFpadType.put() else: pdk.put_stub(['c0', 'c1', 'c2', 'd0', 'd1', 'd2']) cfg.cp = C.pin['b0'] return C