def _generate_instances(self, insts): insts += i3.SRef(reference=self.cross_marks[0]) insts += i3.SRef(reference=self.cross_marks[1]) vern_1_horz_trans = i3.VMirror() + \ i3.Translation((0, -self.cross_boundary_width * 0.5 - self.vern_cross_spacing - (self.vern_bar_length + self.vern_bar_extra_length) - self.vern_layer_gap)) insts += i3.SRef(reference=self.verniers[0], transformation=vern_1_horz_trans) vern_2_horz_trans = i3.Translation((0, -self.cross_boundary_width * 0.5 - self.vern_cross_spacing - (self.vern_bar_length + self.vern_bar_extra_length))) insts += i3.SRef(reference=self.verniers[1], transformation=vern_2_horz_trans) vern_1_vert_trans = i3.Rotation(rotation=90) + \ i3.Translation((-self.cross_boundary_width*0.5 - self.vern_cross_spacing - (self.vern_bar_length + self.vern_bar_extra_length) - self.vern_layer_gap, 0)) insts += i3.SRef(reference=self.verniers[0], transformation=vern_1_vert_trans) vern_2_vert_trans = i3.Rotation(rotation=270) + \ i3.Translation((-self.cross_boundary_width*0.5 - (self.vern_bar_length + self.vern_bar_extra_length) - self.vern_cross_spacing, 0)) insts += i3.SRef(reference=self.verniers[1], transformation=vern_2_vert_trans) return insts
def _generate_elements(self, elems): for counter, child in enumerate(self.DC_list): if (counter % 2 == 0): name = child.name elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="{}".format(name[0:10]), # coordinate=(4650.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation( (0.0, 0.0), -90.0) + i3.Translation( (3000 - 450, -2000 + 4500 * counter / 2))) else: elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="R=200_L=80", alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=80.0, transformation=i3.Rotation( (0.0, 0.0), -90.0) + i3.Translation( (3000 - 450, -2700 + 4500 * counter / 2))) # elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, # center=(0, 0), # box_size=(500, 300)) return elems
def spiralcircuit(wgw, nl, i_s, s, il, tl, gwgw, gsl, gp, gdc, w_ebeam=4): # wgw [int] -> waveguide width # nl -> Number of loops in the spiral # i_s -> inner size of the spiral coordinate2 # s -> spacing between the individual loops # il -> incoupling length # tl -> taper length # gwgw = 10 # width of the waveguide for the grating # gsl = 78 # grating socket length # gp = 2.3 # grating period length # gdc = [0-1] -> grating duty cycle w_core = wgw + w_ebeam w_clad = wgw + 3 * w_ebeam gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) sp = spiral(wgw, nl, i_s, s, il) wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "spiral": sp, "taper2": t, "grating2": g }) print i_s[0] circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2, 0)), "taper1": i3.Translation((gsl, 0)), "spiral": i3.Translation((gsl + tl, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + # i3.Translation(( # gsl + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)), i3.Translation((gsl + 2 * tl + i_s[0] + 4 * (nl - 1) * s + 300 + 2 * il, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2 + 2 * tl + i_s[0] + 4 * (nl - 1) * s + 300 + 2 * il, 0)) }) return circuit
def _default_child_transformations(self): trans = dict() trans["DUT"] = i3.IdentityTransform() nw = self.dut.size_info().north_west for cnt in range(2**self.dut.levels): trans["gr_out_{}".format(cnt)] = i3.Rotation( rotation=-90.0) + i3.Translation( translation=(nw[0] + cnt * self.sep, nw[1] + 180)) trans["gr_in"] = i3.Rotation(rotation=-90.0) + i3.Translation( translation=(nw[0] - 1 * self.sep, nw[1] + 180)) return trans
def FBMSwaveguidecircuit(wg_length, wg_width, taper_length, grating_wg_width, grating_socket_length, grating_period, grating_dc): # wg_length [int] -> waveguide length # wg_width [int] -> waveguide width # taper_length [int] -> taper length # grating_wg_width [int] -> width of the waveguide for the grating # grating_socket_length [int] -> grating socket length # grating_period [int] -> grating period # grating_dc [0-1] -> grating duty cycle gwg = gratingwaveguide(grating_wg_width) g = grating(gwg, grating_socket_length, grating_period, grating_dc) (wgt, wg) = FBMSwaveguide(wg_width, wg_length) t = taper(gwg, wgt, taper_length) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "wire": wg, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((g.Layout.view.socket_length / 2, 0)), "taper1": i3.Translation((g.Layout.view.socket_length, 0)), "wire": i3.Translation((g.Layout.view.socket_length + t.Layout.view.end_position[0], 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((g.Layout.view.socket_length + 2 * t.Layout.view.end_position[0] + wg.Layout.view.shape[1][0], 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((g.Layout.view.socket_length * 3 / 2 + 2 * t.Layout.view.end_position[0] + wg.Layout.view.shape[1][0], 0)) }) return circuit
def waveguidecircuit(wg_length, w_core, w_clad, taper_length, grating_wg_width, grating_socket_length, grating_period, grating_dc): # wg_length [int] -> waveguide length # wg_width [int] -> waveguide width # taper_length [int] -> taper length # grating_wg_width [int] -> width of the waveguide for the grating # grating_socket_length [int] -> grating socket length # grating_period [int] -> grating period # grating_dc [0-1] -> grating duty cycle wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) wg = wgt() wg.Layout(shape=[(0, 0), (wg_length, 0)]) gwg = gratingwaveguide(grating_wg_width) g = grating(gwg, grating_socket_length, grating_period, grating_dc) t = taper(gwg, wgt, taper_length) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "wire": wg, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((grating_socket_length / 2, 0)), "taper1": i3.Translation((grating_socket_length, 0)), "wire": i3.Translation((grating_socket_length + taper_length, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((grating_socket_length + 2 * taper_length + wg_length, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((grating_socket_length * 3 / 2 + 2 * taper_length + wg_length, 0)) }) return circuit
def _generate_elements(self, elems): for counter, child in enumerate(self.DC_list): name = child.name elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="{}_{}".format(name, self.cell.wg_t1.name), # coordinate=(1300.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0, transformation=i3.Translation( (2500, 100 + 10000 * counter))) elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="{}_{}".format(name, self.cell.wg_t1.name), # coordinate=(-2000, -150), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation( (0.0, 0.0), 90.0) + i3.Translation( (450, -2000 + 10000 * counter))) return elems
def _default_connectors(self): conn = [] conn.append(("gr_in:out", "DUT:in", manhattan)) insts = self.get_child_instances() n_gratings = 2**self.dut.levels for cnt in range(n_gratings): cnt2 = 2**self.dut.levels - cnt grating_name = "gr_out_{}".format(cnt) dut_port_name = "out{}".format(cnt2) grating_port = insts[grating_name].ports["out"] dut_port = insts["DUT"].ports[dut_port_name] # Case 1 the grating coupler is on the right of the outputs if grating_port.position.x > dut_port.position.x + 70.0: conn.append(("gr_out_{}:out".format(cnt), "DUT:out{}".format(cnt2), manhattan)) # Case 2 the grating coupler is on the left - some bending is required. elif grating_port.position.x < dut_port.position.x: p1 = (dut_port.x + 30 + cnt * 5, 220 + cnt * 5) from functools import partial cr = partial(manhattan, control_points=[p1]) conn.append(("gr_out_{}:out".format(cnt), "DUT:out{}".format(cnt2), cr)) # Case 3 the grating coupler is more or less in the middle, use sbends else: p1 = (dut_port.x + 30 + cnt * 5, 220 + cnt * 5) T = i3.Rotation(rotation=-90.0) + i3.Translation( translation=p1) from functools import partial cr = combine_connectors([sbend, manhattan], [T]) conn.append(("gr_out_{}:out".format(cnt), "DUT:out{}".format(cnt2), cr)) return conn
def _generate_elements(self, elems): for counter, child in enumerate(self.DC_list): name = child.name elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="{}_{}".format(name, self.cell.wg_t1.name), # coordinate=(1300.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0, transformation=i3.Translation( (1500, 100 + 10000 * counter))) elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text="{}_{}".format(name, self.cell.wg_t1.name), # coordinate=(-2000, -150), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation( (0.0, 0.0), 90.0) + i3.Translation( (450, -2000 + 10000 * counter))) for i in range(0, 4, 1): #dicing marker right 16 squares elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(100, -3000 + 100 + 10000 * i - 2000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(100, -3000 - 100 + 10000 * i - 2000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(-100, -3000 + 100 + 10000 * i - 2000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(-100, -3000 - 100 + 10000 * i - 2000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(300, -3000 + 100 + 6000 * 3 + 10000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(300, -5000 - 100), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(-300, -3000 + 100 + 6000 * 3 + 10000), box_size=(100, 100)) elems += i3.Rectangle(layer=i3.TECH.PPLAYER.WG.TEXT, center=(-300, -5000 - 100), box_size=(100, 100)) return elems
def _default_child_transformations(self): d = {} for counter, child in enumerate(self.Spiral_list): ip = child.ports["in"].position #print self.child_cells['InPort' + str(counter)].ports["out"].position #print self.child_cells['OutPort' + str(counter)].ports.position print '----------------' print 'spiral length:', child.total_length print 'counter: ', counter #print ip op = child.ports["out"].position #print op print 'The lateral size of the spiral is', op[0] - ip[0] print 'The type of mask is: ', self.tipo print 'The number of widths is: ', self.n print 'The number of lengths is: ', self.lengths print 'The width number is: ', self.width print '----------------' iz = child.inner_size sx = iz[1] + 200 #sx=1200 if self.tipo == 1: d['Spiral' + str(counter)] = i3.Translation( translation=(-(op[0] - ip[0]) / 2, self.n * counter * sx)) d['InPort' + str(counter)] = i3.HMirror() + i3.Translation( translation=(-self.chip_length / 2.0 - self.couplingWG_l, self.n * counter * sx)) d['OutPort' + str(counter)] = i3.Translation( translation=(self.chip_length / 2.0 + self.couplingWG_l, self.n * counter * sx)) if self.tipo == 2: d['Spiral' + str(counter)] = i3.Translation( translation=(-(op[0] - ip[0]) / 2, -(self.n + 0.5) * counter * sx)) #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4)-self.couplingWG_l, -(self.n+0.5)*counter*sx)) #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R+(((self.n+0.5)*counter+self.width)*sx/4), self.chip_length*(3/4)+(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx)) d['InPort' + str(counter)] = i3.HMirror() + i3.Translation( translation=(-self.chip_length * (1 / 2) - 2000, -(self.n + 0.5) * counter * sx)) d['OutPort' + str(counter)] = i3.Rotation( rotation=90) + i3.Translation(translation=( (op[0] - ip[0]) / 2 + 2 * self.R + (((self.n + 0.5) * counter + self.width) * sx / 4), 3000 + self.chip_length * (3 / 4) + (self.width + counter - (((counter + 1) - 1.0) % self.lengths)) * sx)) #For awg's #if self.tipo==2: #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+0.5)*counter*sx)) #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4.0), -(self.n+0.5)*counter*sx)) #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R #+(((self.n+0.5)*counter+self.width)*sx/100.0) #, self.chip_length*(2/4.0)+ #(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx)) return d
def _default_child_transformations(self): incoupler_t =fc_t1 = i3.Rotation(rotation=00.0) #+ i3.Translation(translation=(-(self.chip_length*0.5-self.coupler_p),0.0)) outcoupler_t = i3.Rotation(rotation=180.0) #+ i3.Translation(translation=(self.chip_length*0.5-self.coupler_p,0.0)) L1=self.L1 #s=270 s=0 #z=2500 z=0 #socket_length=2*self.period*int(self.nperiods)+2*10 socket_lengthout=2*(sum(self.Lec)+sum(self.Loc))+2*self.periodout*int(self.nperiodsout)+1*10 socket_lengthin=2*self.periodin*int(self.nperiodsin)+0*10 xin=0.75*self.periodin*int(self.nperiodsin) xout=0.75*(self.periodout*int(self.nperiodsout)+sum(self.Lec)+sum(self.Loc)) print "socket_lengthout: ", socket_lengthout print "socket_lengthin: ", socket_lengthin #print self.child_cells['incoupling1'].FGC.Layout.socket_length child_transformations={ #"incoupling1" : i3.Rotation(rotation=00.0) +i3.Translation(translation=(-z-socket_lengthin#-50.0#-self.transition_length_couplerin #,-s)), #"outcoupling1" : i3.Rotation(rotation=180.0) +i3.Translation(translation=(L1#+50.0#+self.transition_length_couplerout+self.increment-z #,-s)), "incoupling1" : i3.Rotation(rotation=00.0) +i3.Translation(translation=(-z#-socket_lengthin#-50.0#-self.transition_length_couplerin ,-s)), "outcoupling1" : i3.Rotation(rotation=180.0) +i3.Translation(translation=(L1+socket_lengthout-100#+50.0#+self.transition_length_couplerout+self.increment-z ,-s)), # "inlens1" : i3.Rotation(rotation=00.0) +i3.Translation(translation=(-z-self.transition_length_couplerin-socket_lengthin+xin,-s)), #"outlens1" : i3.Rotation(rotation=180.0) +i3.Translation(translation=(L1+self.transition_length_couplerin+self.increment-z-xin,-s)), # "am1" : i3.Translation(translation=(self.chip_length*0.5-1000,0.0)), # "am2" : i3.Translation(translation=(-self.chip_length*0.5+1000,0.0)), # "am3" : i3.Translation(translation=(-self.chip_length*0.5+5000,0.0)), # "am4" : i3.Translation(translation=(self.chip_length*0.5-5000,0.0)) , } return child_transformations
def _default_child_transformations(self): d = {} for counter, child in enumerate(self.s_length_vec): #ip= child.ports["in"].position #print self.child_cells['InPort' + str(counter)].ports["out"].position #print self.child_cells['OutPort' + str(counter)].ports.position print '----------------' #print 'spiral length:', child.total_length print 'counter: ', counter print 'self.n = ', self.n print 'self.width: ', self.width #print 'sx: ', sx if self.tipo == 1: sx = 70 a = 0.5 print 2 * (22362 * 0.5 - self.couplingWG_l) print 'tipo = ', self.tipo #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, self.n*counter*sx)) #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*0.5, (self.n+a)*counter*sx)) #d['OutPort' + str(counter)] = i3.Translation(translation=(self.chip_length*0.5, (self.n+a)*counter*sx)) d['InPort' + str(counter)] = i3.HMirror() + i3.Translation( translation=(-22362 * 0.5 + self.couplingWG_l, (self.n + a) * counter * sx)) d['OutPort' + str(counter)] = i3.Translation( translation=(22362 * 0.5 - self.couplingWG_l, (self.n + a) * counter * sx)) #if self.tipo==2: #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+0.5)*counter*sx)) #d['InPort' + str(counter)] = i3.HMirror()+ i3.Translation(translation=(-self.chip_length*(3/4)-self.couplingWG_l, -(self.n+0.5)*counter*sx)) #d['OutPort' + str(counter)] = i3.Rotation(rotation=90) + i3.Translation(translation=((op[0]-ip[0])/2+2*self.R+(((self.n+0.5)*counter+self.width)*sx/4), self.chip_length*(3/4)+(self.width+counter-(((counter+1)-1.0)%self.lengths))*sx)) if self.tipo == 2: sx = 100 #d['Spiral' + str(counter)] = i3.Translation(translation=(-(op[0]-ip[0])/2, -(self.n+1)*counter*sx)) a = 7.0 print 'increment of length between waveguides of same width: ', ( self.n + a) * 1 * sx + ((self.n + a) * 1 + 0) * sx print 'increment of length between waveguides of same length group: ', ( self.n + a) * 0 * sx + ( (self.n + a) * 0 + self.width) * sx d['InPort' + str(counter)] = i3.HMirror() + i3.Translation( translation=(0.0 - self.chip_length * 0.5, -(self.n + a) * counter * sx)) d['OutPort' + str(counter)] = i3.Rotation( rotation=90) + i3.Translation(translation=( (((self.n + a) * counter + self.width) * sx), self.chip_length * 0.5 + (self.width + counter - (((counter + 1) - 1.0) % self.lengths)) * sx)) return d
def _generate_elements(self, elems): elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.dc.name, self.cell.wg_t1.name), coordinate=(1350.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0) elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.dc2.name, self.cell.wg_t1.name), coordinate=(4650.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0) elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.dc.name, self.cell.wg_t1.name), coordinate=(-3000.0, -150.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation((0.0, 0.0), 90.0)) elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.dc2.name, self.cell.wg_t1.name), coordinate=(-5000.0, -3450.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation((0.0, 0.0), 90.0)) # elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, # text='Name={}_R={}_delay={}'.format(name, self.R, self.delay_length), # # coordinate=(0.0, -counter * 5 * self.R - 2 * self.R + 50.0 # -100 # ), # alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), # font=2, # height=20.0) return elems
def spiralcircuit(wgw, nl, i_s, s, il, tl, gwgw, gsl, gp, gdc, w_ebeam=1.5): w_core = wgw + w_ebeam w_clad = wgw + 3 * w_ebeam gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) sp = spiral(wgw, nl, i_s, s, il) wgt = WireWaveguideTemplate() wgt.Layout(core_width=w_core, cladding_width=w_clad) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "spiral": sp, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2, 0)), "taper1": i3.Translation((gsl, 0)), "spiral": i3.Translation((gsl + tl, 0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2 + 2 * tl + i_s[0] + (4 * nl + 1) * s + 2 * il, 0)) }) return circuit
def _default_child_transformations(self): trans = dict() nw = len(self.m_spacing) for cnt, mod in enumerate(self.modulators): t = (100.0, self.center_grating_coupler_y + (-nw / 2.0 + 0.5 + cnt) * self.grating_coupler_spacing) trans["grating_in_{}".format(cnt)] = i3.Translation(translation=t) t = (2500/2.0 , self.center_grating_coupler_y + (-nw / 2.0 + 0.5 + cnt) * self.grating_coupler_spacing) trans["mod_{}".format(cnt)] = i3.Translation(translation=t) trans["grating_out_{}".format(cnt)] = i3.Rotation(rotation=180.0) + i3.Translation(translation=(2500, self.center_grating_coupler_y + (-nw / 2.0 + 0.5 + cnt) * self.grating_coupler_spacing)) return trans
def ringcircuit3(radius, gap, wg_ring_width, wg_coupler_width, angle, lx, ly, tl, gwgw, gsl, gp, gdc): gwg = gratingwaveguide(gwgw) g = grating(gwg, gsl, gp, gdc) r = ring3(radius, gap, wg_ring_width, wg_coupler_width, angle) wgt = WireWaveguideTemplate() wgt.Layout(core_width=wg_coupler_width, cladding_width=wg_coupler_width + 6) t = taper(gwg, wgt, tl) circuit = PlaceAndAutoRoute(child_cells={ "grating1": g, "taper1": t, "ring": r, "taper2": t, "grating2": g }) circuit_layout = circuit.Layout( child_transformations={ "grating1": i3.Translation((gsl / 2.0, ly)), "taper1": i3.Translation((gsl, ly)), "ring": i3.Translation((gsl + tl + lx / 2.0, radius + gap + wg_ring_width / 2.0 + wg_coupler_width / 2.0)), "taper2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl + 2 * tl + lx, ly)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180, absolute_rotation=False) + i3.Translation((gsl * 3 / 2.0 + 2 * tl + lx, ly)) }) return circuit
def _generate_elements(self, elems): # The shape of the coupon you want to print for i in range(16): elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(500, -3 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(4950, -3 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) for i in range(16): elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(500, 507 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(4950, 507 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) for i in range(16): elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(500, 1017 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) elems += i3.PolygonText(layer=i3.Layer(5), coordinate=(4950, 1017 + i * 30), text=str(300 + i * 50), alignment=(i3.TEXT.ALIGN.CENTER, i3.TEXT.ALIGN.TOP), font=i3.TEXT.FONT.DEFAULT, height=22, transformation=i3.Rotation((0.0, 0.0), 0.0)) return elems
def _default_child_transformations(self): trans = dict() from routing.transforms import relative_placer trans["sp_0_0"] = i3.Rotation(rotation=30.0) + i3.Translation( translation=(10.0, 10.0)) trans["sp_1_0"] = relative_placer( self.child_cells, trans, "sp_0_0:out1", "sp_1_0:in1", (self.spacing_x, -self.spacing_y / 2), 0.0) trans["sp_1_1"] = relative_placer( self.child_cells, trans, "sp_0_0:out2", "sp_1_1:in1", (self.spacing_x, +self.spacing_y / 2), 0.0) return trans
def _default_child_transformations(self): trans = dict() row = 3000 trans["CHILD0"] = (0, 0) trans["CHILD1"] = i3.HMirror(2500) - i3.Translation((5000, 0)) trans['CHILD2'] = (-15000, -5000) trans['CHILD3'] = (-15000, 0) trans['CHILD4'] = (-15000, 2000 + row * 1) trans['CHILD5'] = (-15000, 2000 + row * 2) trans['CHILD6'] = (-15000, 2000 + row * 3) trans['CHILD7'] = (-15000, 2000 + row * 4) trans['CHILD8'] = (-15000, 2000 + row * 5) trans['CHILD9'] = (-15000, 2000 + row * 6) trans['CHILD10'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 0)) trans['CHILD11'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000)) trans['CHILD12'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 1)) trans['CHILD13'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 2)) trans['CHILD14'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 3)) trans['CHILD15'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 4)) trans['CHILD16'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 5)) trans['CHILD17'] = i3.Rotation(rotation=180) + i3.Translation( (15000, 5000 + row * 6)) # trans['CHILD14'] = (-15000, 0 + row * -1) # trans['CHILD15'] = (-15000, 0 + row * 0) # trans['CHILD16'] = (-15000, 0 + row * 1) # trans['CHILD17'] = (-15000, 0 + row * 2) # trans['CHILD18'] = (-15000, 0 + row * 3) # trans['CHILD19'] = (-15000, 0 + row * 4) # trans['CHILD20'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 0)) # trans['CHILD21'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 1)) # trans['CHILD22'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 2)) # trans['CHILD23'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 3)) # trans['CHILD24'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 4)) # trans['CHILD25'] = i3.Rotation(rotation=180) + i3.Translation((15000, 0 + row * 5)) return trans
def _default_child_transformations(self): trans = dict() column = 10000 # trans["dircoup1"] = (1650, 0) # trans["dircoup2"] = (4950, 0) # trans['mzi_22_22_0'] = (0, 0) trans['ring0'] = (1500, 0) # trans['ring1'] = (2500, 0 + column) # trans['ring2'] = (2500, 0 + 2 * column) # trans['ring3'] = (1500, 0 + 3 * column) trans["taper0"] = (0, 2500) trans["taper1"] = (0, -2500) trans["taper2"] = i3.Rotation(rotation=-90) + i3.Translation((2500, 5000)) trans["taper3"] = i3.HMirror(0) + i3.Translation((4000, -5.5)) return trans
def _generate_instances(self, insts): sr1 = i3.ShapeCircle(center=(0.0, 0.0), radius=self.radius) #, line_width = 200) sr2 = i3.ShapeCircle( center=(0.0, 0.0), radius=self.radius - self.vacuum_channel_circular) #, line_width = 200) #Rectangles sc1 = i3.ShapeRectangle( center=(self.cInp.x - self.radius, -self.radius), box_size=(self.radius * 2, self.radius * 2 + 100)) #100 has to be linked to channel input width)) #Define the boundaries for shapes br1 = i3.Boundary(layer=self.layer, shape=sr1) br2 = i3.Boundary(layer=self.layer, shape=sr2) bc1 = i3.Boundary(layer=self.layer, shape=sc1) #Substruct boundaries and add to the element list b_sub = br1 - br2 s = i3.Structure(elements=b_sub) b_sub = b_sub[0] - bc1 s = i3.Structure(elements=b_sub) insts += i3.SRef(s) #Input channel - segment channel1 = microfluidics.Channel( trace_template=self.cell.channel_template) channel1_lo = channel1.Layout( shape=[(0, 0), (0, self.inlet_channel_length + self.vacuum_channel_circular * 0.5)]) insts += i3.SRef(channel1_lo, position=(0, self.radius - self.vacuum_channel_circular * 0.5), transformation=i3.Rotation((0.0, 0.0), 0.0)) return insts
def __example1(cls): from technologies import silicon_photonics from picazzo3.fibcoup.curved import FiberCouplerCurvedGrating from picazzo3.routing.place_route import PlaceComponents from ipkiss3 import all as i3 from routing.route_through_control_points import RouteManhattanControlPoints # Placing the components of the circuit gr = FiberCouplerCurvedGrating() circuit = PlaceComponents(child_cells={ 'gr': gr, 'grb1': gr, 'grb2': gr }) circuit_layout = circuit.Layout( child_transformations={ 'gr': (0, 0), 'grb1': (-100, 0), 'grb2': i3.Rotation(rotation=180.0) + i3.Translation((+100, 0)) }) # We now use the placed components and make waveguides. control_points = [(-40, 20), (50, 0)] route = RouteManhattanControlPoints( input_port=circuit_layout.instances['grb1'].ports['out'], output_port=circuit_layout.instances['grb2'].ports['out'], control_points=control_points, rounding_algorithm=None) wire = i3.RoundedWaveguide() wl = wire.Layout(shape=route) # We create a new placecomponents with the wire included. circuit_child_cells = dict(circuit.child_cells) circuit_child_cells['wire'] = wire circuit_with_wire = PlaceComponents(child_cells=circuit_child_cells) circuit_with_wire_layout = circuit_with_wire.Layout( child_transformations=circuit_layout.child_transformations) circuit_with_wire_layout.visualize()
def relative_placer(childcell_dict, transformation_dict, port1, port2, translation=(0.0, 0.0), rotation=0.0): port_strings = [port1, port2] layouts = [] ports = [] instance_names = [] for p in port_strings: instance_name, port_name = p.split(":") instance_names.append([instance_name]) layouts.append(childcell_dict[instance_name].get_default_view( i3.LayoutView)) ports.append(layouts[-1].ports[port_name]) return i3.Rotation(rotation_center=ports[1], rotation=rotation) + \ i3.vector_match_transform(ports[1], ports[0]) + \ i3.Translation(translation=translation) + transformation_dict[instance_names[0][0]]
def _generate_elements(self, elems): elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.mmi22.get_default_view(i3.LayoutView).name, self.cell.wg_t1.name), coordinate=(1300.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0) elems += i3.PolygonText(layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_{}'.format(self.cell.mmi22.get_default_view(i3.LayoutView).name, self.cell.wg_t1.name), coordinate=(-2000.0, -150.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation((0.0, 0.0), 90.0)) return elems
def _generate_elements(self, elems): elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_port_15'.format( self.cell.mmi1_21.get_default_view(i3.LayoutView).name), coordinate=(200.0, 100.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=20.0) elems += i3.PolygonText( layer=i3.TECH.PPLAYER.WG.TEXT, text='Name={}_port_15'.format( self.cell.mmi1_21.get_default_view(i3.LayoutView).name), # coordinate=(-4000.0, -1650.0), alignment=(i3.TEXT_ALIGN_LEFT, i3.TEXT_ALIGN_LEFT), font=2, height=200.0, transformation=i3.Rotation((0.0, 0.0), 90.0) + i3.Translation( (-2050, -2000))) return elems
def _default_child_transformations(self): trans = dict() column = 4000 # trans['ring0'] = (600, 0) # trans['ring1'] = (600, 1 * column) # trans['ring2'] = (600, 2 * column) # # trans['ring3'] = (1300, 8000 + 2 * column ) for i in range(0, 5, 1): trans["taperH{}".format(i)] = (0, column * i + 100 * self.offset) trans["taperV{}".format(i)] = i3.Rotation( rotation=-90) + i3.Translation( (4000 + column * i - 100 * self.offset, 20000)) trans["recH{}".format(i)] = (900, column * i + 100 * self.offset) trans["recV{}".format(i)] = (4000 + column * i - 100 * self.offset, 20000 - 900) # trans["taper0"] = (0, 0) # trans["taper1"] = i3.HMirror(0) + i3.Translation((2500, -1500)) # trans["taper2"] = i3.HMirror(0) + i3.Translation((2500, 1500)) # # trans["taper3"] = (0, 1 * column) # trans["taper4"] = i3.HMirror(0) + i3.Translation((2500, -1500 + 1 * column)) # # trans["taper5"] = i3.HMirror(0) + i3.Translation((2500, 1500 + 1 * column)) # # trans["taper6"] = (0, 2 * column) # trans["taper7"] = i3.HMirror(0) + i3.Translation((2500, -1500 + 2 * column)) # trans["taper8"] = i3.HMirror(0) + i3.Translation((2500, 1500 + 2 * column)) # # trans["taper9"] = (0, 3800 + 2 * column) # # trans["taper10"] = i3.HMirror(0) + i3.Translation((2500, -1500 + 3 * column)) # # trans["taper11"] = i3.HMirror(0) + i3.Translation((3000, 6500+ 2 * column)) # # trans["taper12"] = i3.HMirror(0) + i3.Translation((3000, 9500+ 2 * column)) return trans
def _default_child_transformations(self): trans = dict() row = 5000 trans["CHILD0"] = (0, 0) #MMI trans["CHILD1"] = i3.HMirror(2500) - i3.Translation( (5000, 0)) #MMI trans["CHILD2"] = i3.HMirror(0) + i3.Translation((20000, 0)) # MMI trans["CHILD3"] = i3.Translation((16000, 10000)) # MMI trans['CHILD4'] = i3.VMirror(0) + i3.Translation( (16000, 20000)) #MMI trans['CHIL0'] = (-16000, -4000 + row * 0) trans['CHIL1'] = (-16000, -4000 + row * 1) trans['CHIL2'] = (-16000, -4000 + row * 2) trans['CHIL3'] = (-16000, -4000 + row * 3) trans['CHIL4'] = (-16000, -4000 + row * 4) trans['CHIL5'] = (-16000, -4000 + row * 5) trans['CHIL6'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 0)) trans['CHIL7'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 1)) trans['CHIL8'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 2)) trans['CHIL9'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 3)) trans['CHIL10'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 4)) trans['CHIL11'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 5)) trans['CHIL12'] = (4000, -4000 + row * 0) trans['CHIL13'] = (4000, -4000 + row * 1) trans['CHIL14'] = (4000, -4000 + row * 2) trans['CHIL15'] = (4000, -4000 + row * 3) trans['CHIL16'] = (4000, -4000 + row * 4) trans['CHIL17'] = (4000, -4000 + row * 5) trans['CHIL18'] = (-16000, -4000 + row * 0) trans['CHIL19'] = (-16000, -4000 + row * 1) trans['CHIL20'] = (-16000, -4000 + row * 2) trans['CHIL21'] = (-16000, -4000 + row * 3) trans['CHIL22'] = (-16000, -4000 + row * 4) trans['CHIL23'] = (-16000, -4000 + row * 5) trans['CHIL24'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 0)) trans['CHIL25'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 1)) trans['CHIL26'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 2)) trans['CHIL27'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 3)) trans['CHIL28'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 4)) trans['CHIL29'] = i3.Rotation(rotation=180) + i3.Translation( (16000, -1000 + row * 5)) # for _ in np.arange(10): # trans['CHIL{}'.format(_)] = NotImplemented for _ in range(30, 36, 1): trans['CHIL{}'.format(_)] = (4000, -4000 + row * (_ - 30)) # trans['CHIL30'] = (4000, -4000 + row * 0) # trans['CHIL31'] = (4000, -4000 + row * 1) # trans['CHIL32'] = (4000, -4000 + row * 2) # trans['CHIL33'] = (4000, -4000 + row * 3) # trans['CHIL34'] = (4000, -4000 + row * 4) # trans['CHIL35'] = (4000, -4000 + row * 5) # trans['CHILD23'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) # trans['CHILD24'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) # trans['CHILD25'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) # trans['CHILD26'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) # trans['CHILD27'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) # trans['CHILD28'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) # trans['CHILD29'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) # trans['CHILD32'] = (-14500, -3000 + row * 0) # trans['CHILD33'] = (-14500, -3000 + row * 1) # trans['CHILD34'] = (-14500, -3000 + row * 2) # trans['CHILD35'] = (-14500, -3000 + row * 3) # trans['CHILD36'] = (-14500, -3000 + row * 4) # trans['CHILD37'] = (-14500, -3000 + row * 5) # trans['CHILD38'] = (-14500, -3000 + row * 6) # trans['CHILD39'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0)) # trans['CHILD40'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1)) # trans['CHILD41'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2)) # trans['CHILD42'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3)) # trans['CHILD43'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4)) # trans['CHILD44'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5)) # trans['CHILD45'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6)) # trans['CHILD46'] = (-2500, -3000 + row * 0) # trans['CHILD47'] = (-2500, -3000 + row * 1) # trans['CHILD48'] = (-2500, -3000 + row * 2) # trans['CHILD49'] = (-2500, -3000 + row * 3) # trans['CHILD50'] = (-2500, -3000 + row * 4) # trans['CHILD51'] = (-2500, -3000 + row * 5) # trans['CHILD52'] = (-2500, -3000 + row * 6) # trans['CHILD53'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) # trans['CHILD54'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) # trans['CHILD55'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) # trans['CHILD56'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) # trans['CHILD57'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) # trans['CHILD58'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) # trans['CHILD59'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) # # trans['CHILD60'] = (-14500, -3000 + row * 0) # trans['CHILD61'] = (-14500, -3000 + row * 1) # trans['CHILD62'] = (-14500, -3000 + row * 2) # trans['CHILD63'] = (-14500, -3000 + row * 3) # trans['CHILD64'] = (-14500, -3000 + row * 4) # trans['CHILD65'] = (-14500, -3000 + row * 5) # trans['CHILD66'] = (-14500, -3000 + row * 6) # trans['CHILD67'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0)) # trans['CHILD68'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1)) # trans['CHILD69'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2)) # trans['CHILD70'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3)) # trans['CHILD71'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4)) # trans['CHILD72'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5)) # trans['CHILD73'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6)) # trans['CHILD74'] = (-2500, -3000 + row * 0) # trans['CHILD75'] = (-2500, -3000 + row * 1) # trans['CHILD76'] = (-2500, -3000 + row * 2) # trans['CHILD77'] = (-2500, -3000 + row * 3) # trans['CHILD78'] = (-2500, -3000 + row * 4) # trans['CHILD79'] = (-2500, -3000 + row * 5) # trans['CHILD80'] = (-2500, -3000 + row * 6) # trans['CHILD81'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) # trans['CHILD82'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) # trans['CHILD83'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) # trans['CHILD84'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) # trans['CHILD85'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) # trans['CHILD86'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) # trans['CHILD87'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) return trans
def _default_child_transformations(self): d={} a=2.2 for counter, child in enumerate(self.MZI_22_22_list): if self.tipo==1: d['mzi_22_22_' + str(counter)] = i3.Translation(translation=((-1)**counter*2*self.R,counter*5*self.R)) d['InPort1_' + str(counter)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, counter*5*self.R-2.2*self.R)) d['OutPort1_' + str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5, counter*5*self.R-2.2*self.R)) d['InPort2_' + str(counter)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, counter*5*self.R+2.2*self.R)) d['OutPort2_' + str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5, counter*5*self.R+2.2*self.R)) print 'transformation ' +str(counter) + ' is ' +str(d) if self.tipo==2: #l_coupling=self.child_cells['Coupler'].l_coupling #radius=self.child_cells['Coupler'].local_bend_radius print 'R= ',self.R #print 'translation port: ' ##For w=20 d['mzi_22_22_' + str(counter)] = i3.Translation(translation=(counter*850+1200+1000+200,-counter*5*self.R)) d['InPort1_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter-a*self.R)) d['OutPort1_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+counter*50+counter*4*self.R+a*self.R-100, self.R*a)) d['InPort2_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter+a*self.R)) d['OutPort2_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+counter*50+counter*4*self.R-100, self.R*a)) d['InPortWG1'] = i3.HMirror()+i3.Translation(translation=(1500, 1000.0)) d['OutPortWG1']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5-500, self.R*a)) d['InPortWG2'] = i3.HMirror()+i3.Translation(translation=(1500, -3400+670)) d['OutPortWG2']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+2500, self.R*a)) d['InPortWG3'] = i3.HMirror()+i3.Translation(translation=(1500, -6500)) d['OutPortWG3']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+5600, self.R*a)) #d['mzi_22_22_' + str(counter)] = i3.Translation(translation=(counter*850+1200+1000+200,-counter*5*self.R)) #d['InPort1_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter-a*self.R)) #d['OutPort1_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1100+counter*50+counter*4*self.R+a*self.R-100, self.R*a)) #d['InPort2_'+ str(counter)] = i3.HMirror()+i3.Translation(translation=(1500, -5*self.R*counter+a*self.R)) #d['OutPort2_'+ str(counter)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1100+counter*50+counter*4*self.R-100, self.R*a)) #d['InPortWG1'] = i3.HMirror()+i3.Translation(translation=(1500, 1000.0)) #d['OutPortWG1']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5-500+1200, self.R*a)) #d['InPortWG2'] = i3.HMirror()+i3.Translation(translation=(1500, -3400+670)) #d['OutPortWG2']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+2500+1100, self.R*a)) #d['InPortWG3'] = i3.HMirror()+i3.Translation(translation=(1500, -6500)) #d['OutPortWG3']= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+5600+1400, self.R*a)) ################ for counter2, child in enumerate(self.MZI_12_22_list): if self.tipo==1: d['mzi_12_22_' + str(counter+1+counter2)] = i3.Translation(translation=((-1)**counter2*2*self.R-self.length_22+counter*50+counter*4*self.R,(counter+1+counter2)*5*self.R)) d['InPort_' + str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(-self.chip_length*0.5, (counter+1+counter2)*5*self.R)) d['OutPort1_' + str(counter+1+counter2)]= i3.Translation(translation=(self.chip_length*0.5-self.bend_radius*counter*0.2-a*self.R-550, (counter+1+counter2)*5*self.R-2.2*self.R)) d['OutPort2_' + str(counter+1+counter2)]= i3.Translation(translation=(self.chip_length*0.5-self.bend_radius*counter*0.2-550, (counter+1+counter2)*5*self.R+2.2*self.R)) if self.tipo==2: #l_coupling=self.child_cells['Coupler'].l_coupling #radius=self.child_cells['Coupler'].local_bend_radius print 'R= ',self.R a=2.2 b=500 d['mzi_12_22_'+ str(counter+1+counter2)] = i3.Translation(translation=((counter+2+counter2)*850+1200+200+580,-(counter+1+counter2)*5*self.R-b)) d['InPort_'+ str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(1500, -(5*self.R)*(counter+1+counter2)-b)) d['OutPort1_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+(counter+1+counter2)*50+a*self.R+(counter+1+counter2)*4*self.R+b, self.R*a)) d['OutPort2_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+(counter+1+counter2)*50+(counter+1+counter2)*4*self.R+b,self.R*a)) #d['mzi_12_22_'+ str(counter+1+counter2)] = i3.Translation(translation=((counter+2+counter2)*850+1200+200+580+1000,-(counter+1+counter2)*5*self.R-b)) #d['InPort_'+ str(counter+1+counter2)] = i3.HMirror()+i3.Translation(translation=(1500, -(5*self.R)*(counter+1+counter2)-b)) #d['OutPort1_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1200+(counter+1+counter2)*50+a*self.R+(counter+1+counter2)*4*self.R+b, self.R*a)) #d['OutPort2_'+ str(counter+1+counter2)]= i3.Rotation(rotation=90.0)+i3.Translation(translation=(self.chip_length*0.5+1200+(counter+1+counter2)*50+(counter+1+counter2)*4*self.R+b,self.R*a)) ################ print '__________________________' print "Last layout child cell done" print d print '_ _ _ _ _ _ _ _ _ _ _ _ _ ' return d
"grating2": FGC1, "my_wire_t3": wg_left, "my_wire_t4": wg_rigth, }, ) my_circuit_layout1 = my_circuit.Layout( child_transformations={ "grating1": i3.Translation((-socket_lentgh_def / 2 + field_Ebeamx / 2 + socket_lentgh_def, field_Ebeamy)), "taper_G_c1": i3.Translation((field_Ebeamx / 2 + socket_lentgh_def, field_Ebeamy)), "taper_G_c2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180.0, absolute_rotation=False) + i3.Translation((field_Ebeamx / 2 + field_Ebeamx + wg_length - socket_lentgh_def, field_Ebeamy)), "grating2": i3.Rotation(rotation_center=(0.0, 0.0), rotation=180.0, absolute_rotation=False) + i3.Translation((socket_lentgh_def / 2 + field_Ebeamx / 2 + field_Ebeamx + wg_length - socket_lentgh_def, field_Ebeamy)), }) my_circuit_layout1.visualize() my_circuit_layout1.write_gdsii("grating_11.gds")
def _default_child_transformations(self): trans = dict() row = 3000 trans["CHILD0"] = (0, 0) #MMI trans["CHILD1"] = i3.HMirror(1250) - i3.Translation((2500, 0)) #MMI trans['CHILD2'] = (-14500, -3000 + row * 0) trans['CHILD3'] = (-14500, -3000 + row * 1) trans['CHILD4'] = (-14500, -3000 + row * 2) trans['CHILD5'] = (-14500, -3000 + row * 3) trans['CHILD6'] = (-14500, -3000 + row * 4) trans['CHILD7'] = (-14500, -3000 + row * 5) trans['CHILD8'] = (-14500, -3000 + row * 6) trans['CHILD9'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0)) trans['CHILD10'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1)) trans['CHILD11'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2)) trans['CHILD12'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3)) trans['CHILD13'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4)) trans['CHILD14'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5)) trans['CHILD15'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6)) trans['CHILD16'] = (-2500, -3000 + row * 0) trans['CHILD17'] = (-2500, -3000 + row * 1) trans['CHILD18'] = (-2500, -3000 + row * 2) trans['CHILD19'] = (-2500, -3000 + row * 3) trans['CHILD20'] = (-2500, -3000 + row * 4) trans['CHILD21'] = (-2500, -3000 + row * 5) trans['CHILD22'] = (-2500, -3000 + row * 6) trans['CHILD23'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) trans['CHILD24'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) trans['CHILD25'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) trans['CHILD26'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) trans['CHILD27'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) trans['CHILD28'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) trans['CHILD29'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) trans["CHILD30"] = (12000, 0) #MMI trans["CHILD31"] = i3.HMirror(1250) + i3.Translation((9500, 0)) #MMI trans['CHILD32'] = (-14500, -3000 + row * 0) trans['CHILD33'] = (-14500, -3000 + row * 1) trans['CHILD34'] = (-14500, -3000 + row * 2) trans['CHILD35'] = (-14500, -3000 + row * 3) trans['CHILD36'] = (-14500, -3000 + row * 4) trans['CHILD37'] = (-14500, -3000 + row * 5) trans['CHILD38'] = (-14500, -3000 + row * 6) trans['CHILD39'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0)) trans['CHILD40'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1)) trans['CHILD41'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2)) trans['CHILD42'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3)) trans['CHILD43'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4)) trans['CHILD44'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5)) trans['CHILD45'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6)) trans['CHILD46'] = (-2500, -3000 + row * 0) trans['CHILD47'] = (-2500, -3000 + row * 1) trans['CHILD48'] = (-2500, -3000 + row * 2) trans['CHILD49'] = (-2500, -3000 + row * 3) trans['CHILD50'] = (-2500, -3000 + row * 4) trans['CHILD51'] = (-2500, -3000 + row * 5) trans['CHILD52'] = (-2500, -3000 + row * 6) trans['CHILD53'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) trans['CHILD54'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) trans['CHILD55'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) trans['CHILD56'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) trans['CHILD57'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) trans['CHILD58'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) trans['CHILD59'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) trans['CHILD60'] = (-14500, -3000 + row * 0) trans['CHILD61'] = (-14500, -3000 + row * 1) trans['CHILD62'] = (-14500, -3000 + row * 2) trans['CHILD63'] = (-14500, -3000 + row * 3) trans['CHILD64'] = (-14500, -3000 + row * 4) trans['CHILD65'] = (-14500, -3000 + row * 5) trans['CHILD66'] = (-14500, -3000 + row * 6) trans['CHILD67'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 0)) trans['CHILD68'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 1)) trans['CHILD69'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 2)) trans['CHILD70'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 3)) trans['CHILD71'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 4)) trans['CHILD72'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 5)) trans['CHILD73'] = i3.Rotation(rotation=180) + i3.Translation((14500, 0 + row * 6)) trans['CHILD74'] = (-2500, -3000 + row * 0) trans['CHILD75'] = (-2500, -3000 + row * 1) trans['CHILD76'] = (-2500, -3000 + row * 2) trans['CHILD77'] = (-2500, -3000 + row * 3) trans['CHILD78'] = (-2500, -3000 + row * 4) trans['CHILD79'] = (-2500, -3000 + row * 5) trans['CHILD80'] = (-2500, -3000 + row * 6) trans['CHILD81'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 0)) trans['CHILD82'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 1)) trans['CHILD83'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 2)) trans['CHILD84'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 3)) trans['CHILD85'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 4)) trans['CHILD86'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 5)) trans['CHILD87'] = i3.Rotation(rotation=180) + i3.Translation((26500, 0 + row * 6)) return trans