optical pins name revised. Pin type added

This commit is contained in:
=
2026-06-07 22:56:33 +08:00
parent a4ac88f002
commit 8462c3397f
262 changed files with 3251 additions and 1134 deletions
+93 -31
View File
@@ -125,8 +125,12 @@ class waveguide:
nd.taper(length=Ltp,width1=w_port,width2=w_wg,xs=xs_wg).put(-L_wg/2,0,0)
nd.strt(length=L_wg-2*Ltp,width=w_wg,xs=xs_wg).put()
nd.taper(length=Ltp,width2=w_port,width1=w_wg,xs=xs_wg).put()
nd.Pin(name='a1',width=w_wg).put(-L_wg/2,0,180)
nd.Pin(name='b1',width=w_wg).put( L_wg/2,0,0)
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',width=w_wg).put(-L_wg/2,0,180)
nd.Pin(name='opt_a1',width=w_wg,type="optical:").put(-L_wg/2,0,180)
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',width=w_wg).put( L_wg/2,0,0)
nd.Pin(name='opt_b1',width=w_wg,type="optical:").put( L_wg/2,0,0)
L_heater = np.min([L_wg,L_heater])
### placing heaters
@@ -170,8 +174,12 @@ class waveguide:
wg_in = nd.strt(length=L_wg_side,width=w_wg,xs=xs_wg).put(-ubend_offset/2,0,90)
bd.cell.put(flip=1)
wg_out = nd.strt(length=L_wg_side,width=w_wg,xs=xs_wg).put()
nd.Pin(name='a1',width=w_wg,pin=wg_in.pin['a0']).put()
nd.Pin(name='b1',width=w_wg,pin=wg_out.pin['b0']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',width=w_wg,pin=wg_in.pin['a0']).put()
nd.Pin(name='opt_a1',width=w_wg,pin=wg_in.pin['a0'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',width=w_wg,pin=wg_out.pin['b0']).put()
nd.Pin(name='opt_b1',width=w_wg,pin=wg_out.pin['b0'],type="optical:").put()
else:
R_ht = R_bend
L_wg_mid = ubend_offset-R_bend*2
@@ -181,8 +189,12 @@ class waveguide:
nd.strt(length=L_wg_mid,width=w_wg,xs=xs_wg).put()
nd.bend(radius=R_bend,width=w_wg,xs=xs_wg).put(flip=1)
wg_out = nd.strt(length=L_wg_side,width=w_wg,xs=xs_wg).put()
nd.Pin(name='a1',width=w_wg,pin=wg_in.pin['a0']).put()
nd.Pin(name='b1',width=w_wg,pin=wg_out.pin['b0']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',width=w_wg,pin=wg_in.pin['a0']).put()
nd.Pin(name='opt_a1',width=w_wg,pin=wg_in.pin['a0'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',width=w_wg,pin=wg_out.pin['b0']).put()
nd.Pin(name='opt_b1',width=w_wg,pin=wg_out.pin['b0'],type="optical:").put()
L_heater = np.max([L_wg_mid+R_bend+w_metal*2,L_heater])
L_heater = np.min([L_wg,L_heater])
@@ -412,8 +424,12 @@ class PS_2st:
VIA_L.pin['b0'].y+self.w_metal/2+self.isl.sp_isl_metal + L_side,0)
nd.Pin(name='a1',pin=start.pin['a0']).put()
nd.Pin(name='b1',pin=end.pin['b0']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',pin=start.pin['a0']).put()
nd.Pin(name='opt_a1',pin=start.pin['a0'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',pin=end.pin['b0']).put()
nd.Pin(name='opt_b1',pin=end.pin['b0'],type="optical:").put()
return C
@@ -565,8 +581,12 @@ class PS_2st_Straight:
""" Placing Isolation trench with the parameter pack <isl> """
nd.Pin(name='a1',pin=start.pin['a0']).put()
nd.Pin(name='b1',pin=end.pin['b0']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',pin=start.pin['a0']).put()
nd.Pin(name='opt_a1',pin=start.pin['a0'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',pin=end.pin['b0']).put()
nd.Pin(name='opt_b1',pin=end.pin['b0'],type="optical:").put()
return C
@@ -600,21 +620,35 @@ class PSR_1x2:
with nd.Cell(instantiate=False) as C:
PSR_inst = PSR_cell.put('a1',0,0,0)
## revised in 2026.06.07 by Qin Yue
# legacy: PSR_inst = PSR_cell.put('a1',0,0,0)
PSR_inst = PSR_cell.put('opt_a1',0,0,0)
MDM_inst = MDM_cell.put('b1',PSR_inst.pin['b1'].x+L_tp,PSR_inst.pin['b1'].y,PSR_inst.pin['b1'].a)
## revised in 2026.06.07 by Qin Yue
# legacy: MDM_inst = MDM_cell.put('b1',PSR_inst.pin['b1'].x+L_tp,PSR_inst.pin['b1'].y,PSR_inst.pin['b1'].a)
MDM_inst = MDM_cell.put('opt_b1',PSR_inst.pin['opt_b1'].x+L_tp,PSR_inst.pin['opt_b1'].y,PSR_inst.pin['opt_b1'].a)
# taper_xs2xs(xs_1=MDM_inst.pin['b1'].xs,xs_2=PSR_inst.pin['b1'].xs,w_1=MDM_inst.pin['b1'].width,w_2=PSR_inst.pin['b1'].width,L_taper=L_tp).cell.put(MDM_inst.pin['b1'])
nd.taper(length=L_tp,width1=PSR_inst.pin['b1'].width,width2=MDM_inst.pin['b1'].width,xs=xs).put(PSR_inst.pin['b1'])
## revised in 2026.06.07 by Qin Yue
# legacy: nd.taper(length=L_tp,width1=PSR_inst.pin['b1'].width,width2=MDM_inst.pin['b1'].width,xs=xs).put(PSR_inst.pin['b1'])
nd.taper(length=L_tp,width1=PSR_inst.pin['opt_b1'].width,width2=MDM_inst.pin['opt_b1'].width,xs=xs).put(PSR_inst.pin['opt_b1'])
nd.Pin(name='a1',pin=PSR_inst.pin['a1']).put()
nd.Pin(name='b1',pin=MDM_inst.pin['a1']).put()
nd.Pin(name='b2',pin=MDM_inst.pin['a2']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',pin=PSR_inst.pin['a1']).put()
nd.Pin(name='opt_a1',pin=PSR_inst.pin['opt_a1'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',pin=MDM_inst.pin['a1']).put()
nd.Pin(name='opt_b1',pin=MDM_inst.pin['opt_a1'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b2',pin=MDM_inst.pin['a2']).put()
nd.Pin(name='opt_b2',pin=MDM_inst.pin['opt_a2'],type="optical:").put()
if (show_pins):
nd.put_stub(pinsize=2)
self.cell = C
self.L = np.abs(self.cell.pin['a1'].x - np.max([self.cell.pin['b1'].x,self.cell.pin['b2'].x]))
## revised in 2026.06.07 by Qin Yue
# legacy: self.L = np.abs(self.cell.pin['a1'].x - np.max([self.cell.pin['b1'].x,self.cell.pin['b2'].x]))
self.L = np.abs(self.cell.pin['opt_a1'].x - np.max([self.cell.pin['opt_b1'].x,self.cell.pin['opt_b2'].x]))
def generate_test_gds(self,gc,gc_IN=None,gc2gc_dX=140,gc2gc_dY=40):
with nd.Cell(name=self.cell.cell_name+"_test", instantiate=False) as C:
@@ -634,9 +668,15 @@ class PSR_1x2:
PSR_test = self.cell.put(-self.L/2,0,0)
stripe=Route(radius=10, width=self.w_wg, xs="strip")
stripe.taper_p2p(pin1=PSR_test.pin['a1'],pin2=GC_I.pin['g1'],arrow=False).put()
stripe.sbend_p2p(pin1=PSR_test.pin['b1'],pin2=GC_OU.pin['g1'],arrow=False).put()
stripe.sbend_p2p(pin1=PSR_test.pin['b2'],pin2=GC_OD.pin['g1'],arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.taper_p2p(pin1=PSR_test.pin['a1'],pin2=GC_I.pin['g1'],arrow=False).put()
stripe.taper_p2p(pin1=PSR_test.pin['opt_a1'],pin2=GC_I.pin['g1'],arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.sbend_p2p(pin1=PSR_test.pin['b1'],pin2=GC_OU.pin['g1'],arrow=False).put()
stripe.sbend_p2p(pin1=PSR_test.pin['opt_b1'],pin2=GC_OU.pin['g1'],arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.sbend_p2p(pin1=PSR_test.pin['b2'],pin2=GC_OD.pin['g1'],arrow=False).put()
stripe.sbend_p2p(pin1=PSR_test.pin['opt_b2'],pin2=GC_OD.pin['g1'],arrow=False).put()
return C
@@ -669,20 +709,34 @@ class Brag_WDM:
with nd.Cell(instantiate=False) as C:
Brag_inst = Brag_cell.put('a1',0,0,0)
## revised in 2026.06.07 by Qin Yue
# legacy: Brag_inst = Brag_cell.put('a1',0,0,0)
Brag_inst = Brag_cell.put('opt_a1',0,0,0)
MDM_inst = MDM_cell.put('b1',Brag_inst.pin['a1'].x-L_tp,Brag_inst.pin['a1'].y,Brag_inst.pin['a1'].a)
## revised in 2026.06.07 by Qin Yue
# legacy: MDM_inst = MDM_cell.put('b1',Brag_inst.pin['a1'].x-L_tp,Brag_inst.pin['a1'].y,Brag_inst.pin['a1'].a)
MDM_inst = MDM_cell.put('opt_b1',Brag_inst.pin['opt_a1'].x-L_tp,Brag_inst.pin['opt_a1'].y,Brag_inst.pin['opt_a1'].a)
nd.taper(length=L_tp,width1=Brag_inst.pin['b1'].width,width2=MDM_inst.pin['b1'].width,xs='strip').put(Brag_inst.pin['a1'])
## revised in 2026.06.07 by Qin Yue
# legacy: nd.taper(length=L_tp,width1=Brag_inst.pin['b1'].width,width2=MDM_inst.pin['b1'].width,xs='strip').put(Brag_inst.pin['a1'])
nd.taper(length=L_tp,width1=Brag_inst.pin['opt_b1'].width,width2=MDM_inst.pin['opt_b1'].width,xs='strip').put(Brag_inst.pin['opt_a1'])
nd.Pin(name='b1',pin=Brag_inst.pin['b1']).put()
nd.Pin(name='a1',pin=MDM_inst.pin['a1']).put()
nd.Pin(name='b2',pin=MDM_inst.pin['a2']).put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b1',pin=Brag_inst.pin['b1']).put()
nd.Pin(name='opt_b1',pin=Brag_inst.pin['opt_b1'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='a1',pin=MDM_inst.pin['a1']).put()
nd.Pin(name='opt_a1',pin=MDM_inst.pin['opt_a1'],type="optical:").put()
## revised in 2026.06.07 by Qin Yue
# legacy: nd.Pin(name='b2',pin=MDM_inst.pin['a2']).put()
nd.Pin(name='opt_b2',pin=MDM_inst.pin['opt_a2'],type="optical:").put()
if (show_pins):
nd.put_stub(pinsize=2)
self.cell = C
self.L = np.abs(self.cell.pin['a1'].x - np.max([self.cell.pin['b1'].x,self.cell.pin['b2'].x]))
## revised in 2026.06.07 by Qin Yue
# legacy: self.L = np.abs(self.cell.pin['a1'].x - np.max([self.cell.pin['b1'].x,self.cell.pin['b2'].x]))
self.L = np.abs(self.cell.pin['opt_a1'].x - np.max([self.cell.pin['opt_b1'].x,self.cell.pin['opt_b2'].x]))
def generate_test_gds(self,gc,gc2gc_dX=140,gc2gc_dY=40,dX_offset=50):
with nd.Cell(name=self.cell.cell_name+"_test", instantiate=False) as C:
@@ -697,13 +751,21 @@ class Brag_WDM:
GC_O1 = gc_cell.put('g1', gc2gc_dX/2,0,0)
GC_O2 = gc_cell.put('g1', gc2gc_dX/2+dX_offset,-gc2gc_dY,0)
INSTR = self.cell.put('a1',-self.L/2,0,0)
## revised in 2026.06.07 by Qin Yue
# legacy: INSTR = self.cell.put('a1',-self.L/2,0,0)
INSTR = self.cell.put('opt_a1',-self.L/2,0,0)
stripe=Route(radius=10, width=self.w_wg, xs="strip")
stripe.taper_p2p(pin1=INSTR.pin['a1'],pin2=GC_I.pin['g1'],arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.taper_p2p(pin1=INSTR.pin['a1'],pin2=GC_I.pin['g1'],arrow=False).put()
stripe.taper_p2p(pin1=INSTR.pin['opt_a1'],pin2=GC_I.pin['g1'],arrow=False).put()
stripe.taper(pin=INSTR.pin['b1'],width1=INSTR.pin['b1'].width,width2=GC_O1.pin['g1'].width,length=10,arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.taper(pin=INSTR.pin['b1'],width1=INSTR.pin['b1'].width,width2=GC_O1.pin['g1'].width,length=10,arrow=False).put()
stripe.taper(pin=INSTR.pin['opt_b1'],width1=INSTR.pin['opt_b1'].width,width2=GC_O1.pin['g1'].width,length=10,arrow=False).put()
stripe.sbend_p2p(pin2=GC_O1.pin['g1'],arrow=False).put()
stripe.ubend_p2p(pin1=INSTR.pin['b2'],pin2=GC_O2.pin['g1'],arrow=False).put()
## revised in 2026.06.07 by Qin Yue
# legacy: stripe.ubend_p2p(pin1=INSTR.pin['b2'],pin2=GC_O2.pin['g1'],arrow=False).put()
stripe.ubend_p2p(pin1=INSTR.pin['opt_b2'],pin2=GC_O2.pin['g1'],arrow=False).put()
return C