optical pins name revised. Pin type added
This commit is contained in:
@@ -167,8 +167,12 @@ class ring_bus_wg :
|
||||
w=[self.w_bus,self.w_bus,self.w_trans,(self.w_trans+self.w_wg)/2,self.w_wg],xs=self.xs,
|
||||
spiral_order=[1,self.clothoid_order,1,1],
|
||||
sharp_patch=sharp_patch,end_patch=self.end_patch)
|
||||
ar = cp.cell.put('a1',0,0,0).pin['b1']
|
||||
al = cp.cell.put('a1',0,0,180,flip=1).pin['b1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ar = cp.cell.put('a1',0,0,0).pin['b1']
|
||||
ar = cp.cell.put('opt_a1',0,0,0).pin['opt_b1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: al = cp.cell.put('a1',0,0,180,flip=1).pin['b1']
|
||||
al = cp.cell.put('opt_a1',0,0,180,flip=1).pin['opt_b1']
|
||||
|
||||
nd.strt(length=w_crack,width=self.w_bus,xs=self.xs).put(-w_crack/2,0,0)
|
||||
nd.strt(length=w_crack,width=self.w_wg,xs=self.xs).put(ar.x-w_crack/2,ar.y,0)
|
||||
@@ -183,8 +187,12 @@ class ring_bus_wg :
|
||||
cp = circle(xs=self.xs,radius=self.R_cp, width = self.w_bus, theta_start = 270-self.dAc/2, theta_stop=270+self.dAc/2,res=self.res,
|
||||
# n_points=self.n_points,
|
||||
sharp_patch=sharp_patch).cell.put(0,self.R_cp,0)
|
||||
al = cp.pin['a1']
|
||||
ar = cp.pin['b1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: al = cp.pin['a1']
|
||||
al = cp.pin['opt_a1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ar = cp.pin['b1']
|
||||
ar = cp.pin['opt_b1']
|
||||
|
||||
self.L = self.L + self.R_cp*self.dAc/180*np.pi
|
||||
|
||||
@@ -201,8 +209,12 @@ class ring_bus_wg :
|
||||
Anti = circle(xs=self.xs,radius=self.R_max_anti, width = self.w_trans, theta_start = 90, theta_stop=90+self.A_anti,res=self.res,
|
||||
# n_points=self.n_points,
|
||||
sharp_patch=sharp_patch)
|
||||
ar = Anti.cell.put('b1',TR.pin['b0']).pin['a1']
|
||||
al = Anti.cell.put('b1',TL.pin['b0'],flip=1).pin['a1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: ar = Anti.cell.put('b1',TR.pin['b0']).pin['a1']
|
||||
ar = Anti.cell.put('opt_b1',TR.pin['b0']).pin['opt_a1']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: al = Anti.cell.put('b1',TL.pin['b0'],flip=1).pin['a1']
|
||||
al = Anti.cell.put('opt_b1',TL.pin['b0'],flip=1).pin['opt_a1']
|
||||
|
||||
self.L = self.L + self.R_max_anti*self.A_anti*2*180/np.pi
|
||||
|
||||
@@ -221,8 +233,12 @@ class ring_bus_wg :
|
||||
self.L = self.L + dL_patch*2
|
||||
|
||||
# self.dL_patch = dL_patch
|
||||
nd.Pin(name='a1',pin=TPL.pin['b0'],width=self.w_wg).put()
|
||||
nd.Pin(name='b1',pin=TPR.pin['b0'],width=self.w_wg).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a1',pin=TPL.pin['b0'],width=self.w_wg).put()
|
||||
nd.Pin(name='opt_a1',pin=TPL.pin['b0'],width=self.w_wg,type="optical:").put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b1',pin=TPR.pin['b0'],width=self.w_wg).put()
|
||||
nd.Pin(name='opt_b1',pin=TPR.pin['b0'],width=self.w_wg,type="optical:").put()
|
||||
|
||||
nd.strt(length=0.1,width=TPL.pin['b0'].width,xs=self.xs).put(TPL.pin['b0'].move(-0.05,0,0))
|
||||
nd.strt(length=0.1,width=TPR.pin['b0'].width,xs=self.xs).put(TPR.pin['b0'].move(-0.05,0,0))
|
||||
@@ -400,7 +416,9 @@ class ADC_STD_2x2:
|
||||
self.tp_angle = tp_angle
|
||||
self.sharp_patch = sharp_patch
|
||||
self.cell = self.generate_gds(err=0,show_pins=show_pins)
|
||||
self.L = np.abs(self.cell.pin['a1'].x - self.cell.pin['b1'].x)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: self.L = np.abs(self.cell.pin['a1'].x - self.cell.pin['b1'].x)
|
||||
self.L = np.abs(self.cell.pin['opt_a1'].x - self.cell.pin['opt_b1'].x)
|
||||
|
||||
def generate_gds(self,err=0,show_pins=False):
|
||||
|
||||
@@ -445,7 +463,9 @@ class ADC_STD_2x2:
|
||||
|
||||
# attach_in = circle(angle=self.angle,radius=self.Rd0,width=self.wd0+err,xs=self.xs).cell.put('a1',0,vtx_lower_y[0]/2+vtx_lower_y[-1]/2,180,flip=0)
|
||||
# attach_in = circle(angle=self.angle,radius=self.Rd0,width=self.wd0+err,xs=self.xs).cell.put('b1',attach_in.pin['b1'],flip=0)
|
||||
pin_a2=nd.taper(width1=self.wd0+err,width2=self.wd_in,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pin_a2=nd.taper(width1=self.wd0+err,width2=self.wd_in,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
pin_a2=nd.taper(width1=self.wd0+err,width2=self.wd_in,length=Ltp,xs=self.xs).put(attach_in.pin['opt_b1']).pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_a2.width).put()
|
||||
|
||||
else :
|
||||
@@ -455,7 +475,9 @@ class ADC_STD_2x2:
|
||||
pin_a2 = nd.taper(xs=self.xs,length=Ltp,width1=self.wd0+err,width2=self.wd_in).put(temp.pin['b0']).pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_a2.width).put()
|
||||
|
||||
nd.Pin(name='a2',width=self.wd_in,pin=pin_a2).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a2',width=self.wd_in,pin=pin_a2).put()
|
||||
nd.Pin(name='opt_a2',width=self.wd_in,pin=pin_a2,type="optical:").put()
|
||||
|
||||
if (self.Rd1!=0):
|
||||
## placing the adiabatic bend attachment to lower waveguide, output port, label 1
|
||||
@@ -476,7 +498,9 @@ class ADC_STD_2x2:
|
||||
|
||||
# attach_in = circle(angle=self.angle,radius=self.Rd1,width=self.wd1+err,xs=self.xs).cell.put('a1',self.Ld,vtx_lower_y[1]/2+vtx_lower_y[-2]/2,0,flip=1)
|
||||
# attach_in = circle(angle=self.angle,radius=self.Rd1,width=self.wd1+err,xs=self.xs).cell.put('b1',attach_in.pin['b1'],flip=1)
|
||||
pin_b2=nd.taper(width1=self.wd1+err,width2=self.wd_out,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pin_b2=nd.taper(width1=self.wd1+err,width2=self.wd_out,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
pin_b2=nd.taper(width1=self.wd1+err,width2=self.wd_out,length=Ltp,xs=self.xs).put(attach_in.pin['opt_b1']).pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_b2.width).put()
|
||||
|
||||
_dX_ = abs(pin_b2.x - self.Ld)
|
||||
@@ -488,7 +512,9 @@ class ADC_STD_2x2:
|
||||
pin_b2 = nd.taper(xs=self.xs,length=Ltp,width1=self.wd1+err,width2=self.wd_out).put().pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_b2.width).put()
|
||||
|
||||
nd.Pin(name='b2',width=self.wd_out,pin=pin_b2).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b2',width=self.wd_out,pin=pin_b2).put()
|
||||
nd.Pin(name='opt_b2',width=self.wd_out,pin=pin_b2,type="optical:").put()
|
||||
|
||||
|
||||
if (self.Ru0!=0):
|
||||
@@ -511,7 +537,9 @@ class ADC_STD_2x2:
|
||||
# attach_in = circle(angle=self.angle,radius=self.Ru0,width=self.wu0+err,xs=self.xs).cell.put('a1',0,vtx_upper_y[0]/2+vtx_upper_y[-1]/2,180,flip=1)
|
||||
# attach_in = circle(angle=self.angle,radius=self.Ru0,width=self.wu0+err,xs=self.xs).cell.put('b1',attach_in.pin['b1'],flip=1)
|
||||
|
||||
pin_a1=nd.taper(width1=self.wu0+err,width2=self.wu_in,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pin_a1=nd.taper(width1=self.wu0+err,width2=self.wu_in,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
pin_a1=nd.taper(width1=self.wu0+err,width2=self.wu_in,length=Ltp,xs=self.xs).put(attach_in.pin['opt_b1']).pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_a1.width).put()
|
||||
|
||||
_dX_ = abs(pin_a1.x)
|
||||
@@ -523,7 +551,9 @@ class ADC_STD_2x2:
|
||||
pin_a1 = nd.taper(xs=self.xs,length=Ltp,width1=self.wu0+err,width2=self.wu_in).put().pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_a1.width).put()
|
||||
|
||||
nd.Pin(name='a1',width=self.wu_in,pin=pin_a1).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a1',width=self.wu_in,pin=pin_a1).put()
|
||||
nd.Pin(name='opt_a1',width=self.wu_in,pin=pin_a1,type="optical:").put()
|
||||
|
||||
if (self.Ru1!=0):
|
||||
if (self.sbend_type=='euler'):
|
||||
@@ -546,7 +576,9 @@ class ADC_STD_2x2:
|
||||
|
||||
# attach_in = circle(angle=self.angle,radius=self.Ru1,width=self.wu1+err,xs=self.xs).cell.put('a1',self.Lu,vtx_upper_y[1]/2+vtx_upper_y[-2]/2,0,flip=0)
|
||||
# attach_in = circle(angle=self.angle,radius=self.Ru1,width=self.wu1+err,xs=self.xs).cell.put('b1',attach_in.pin['b1'],flip=0)
|
||||
pin_b1=nd.taper(width1=self.wu1+err,width2=self.wu_out,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pin_b1=nd.taper(width1=self.wu1+err,width2=self.wu_out,length=Ltp,xs=self.xs).put(attach_in.pin['b1']).pin['b0']
|
||||
pin_b1=nd.taper(width1=self.wu1+err,width2=self.wu_out,length=Ltp,xs=self.xs).put(attach_in.pin['opt_b1']).pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_b1.width).put()
|
||||
else :
|
||||
Ltp = np.max([5,np.abs(self.wu1+err-self.wu_out)/np.tan(self.tp_angle/180*pi)])
|
||||
@@ -555,7 +587,9 @@ class ADC_STD_2x2:
|
||||
pin_b1 = nd.taper(xs=self.xs,length=Ltp,width1=self.wu1+err,width2=self.wu_out).put().pin['b0']
|
||||
patch = nd.strt(xs=self.xs,length=0.01,width=pin_b1.width).put()
|
||||
|
||||
nd.Pin(name='b1',width=self.wu_out,pin=pin_b1).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b1',width=self.wu_out,pin=pin_b1).put()
|
||||
nd.Pin(name='opt_b1',width=self.wu_out,pin=pin_b1,type="optical:").put()
|
||||
|
||||
dY1 = np.abs(pin_a1.y-pin_a2.y)
|
||||
dX1 = np.abs(pin_a1.x-pin_a2.x)
|
||||
@@ -576,10 +610,18 @@ class ADC_STD_2x2:
|
||||
# nd.strt(length=L_patch,width=W_patch,layer=layers).put(np.min([pin_b1.x,pin_b2.x]),(pin_b1.y+self.wu_out/2-self.wd_out/2+pin_b2.y)/2,0)
|
||||
|
||||
if show_pins:
|
||||
nd.put_stub(pinname='a1',pinsize=3)
|
||||
nd.put_stub(pinname='a2',pinsize=3)
|
||||
nd.put_stub(pinname='b1',pinsize=3)
|
||||
nd.put_stub(pinname='b2',pinsize=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.put_stub(pinname='a1',pinsize=3)
|
||||
nd.put_stub(pinname='opt_a1',pinsize=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.put_stub(pinname='a2',pinsize=3)
|
||||
nd.put_stub(pinname='opt_a2',pinsize=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.put_stub(pinname='b1',pinsize=3)
|
||||
nd.put_stub(pinname='opt_b1',pinsize=3)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.put_stub(pinname='b2',pinsize=3)
|
||||
nd.put_stub(pinname='opt_b2',pinsize=3)
|
||||
|
||||
return C
|
||||
|
||||
@@ -597,24 +639,34 @@ class ADC_STD_2x2:
|
||||
else :
|
||||
raise Exception("ERROR: In <mxpic::passive::ADC_STD_2x2::generate_test_gds>, <gc> is not recongized as a cell")
|
||||
|
||||
inst = self.cell.put('a1',-self.L/2,self.cell.pin['a1'].y,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: inst = self.cell.put('a1',-self.L/2,self.cell.pin['a1'].y,0)
|
||||
inst = self.cell.put('opt_a1',-self.L/2,self.cell.pin['opt_a1'].y,0)
|
||||
pic_strip = Route(radius=15,width=self.wu_in,xs=self.xs)
|
||||
|
||||
GT_U_In = gc_cell.put('g1',-dX_gc2gc/2,dY_gc2gc/2,180)
|
||||
nd.taper(width1=GT_U_In.pin['g1'].width,width2=self.wu_in,length=5,xs=self.xs).put(GT_U_In.pin['g1'])
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['a1']).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['a1']).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['opt_a1']).put()
|
||||
|
||||
GT_D_In = gc_cell.put('g1',-dX_gc2gc/2,-dY_gc2gc/2,180)
|
||||
nd.taper(width1=GT_D_In.pin['g1'].width,width2=self.wd_in,length=5,xs=self.xs).put(GT_D_In.pin['g1'])
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['a2'],width=self.wd_in).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['a2'],width=self.wd_in).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['opt_a2'],width=self.wd_in).put()
|
||||
|
||||
GT_U_Out = gc_cell.put('g1', dX_gc2gc/2,dY_gc2gc/2,0)
|
||||
nd.taper(width1=GT_U_Out.pin['g1'].width,width2=self.wu_out,length=5,xs=self.xs).put(GT_U_Out.pin['g1'])
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['b1'],width=self.wu_out).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['b1'],width=self.wu_out).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['opt_b1'],width=self.wu_out).put()
|
||||
|
||||
GT_D_Out = gc_cell.put('g1', dX_gc2gc/2,-dY_gc2gc/2,0)
|
||||
nd.taper(width1=GT_D_Out.pin['g1'].width,width2=self.wd_out,length=5,xs=self.xs).put(GT_D_Out.pin['g1'])
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['b2'],width=self.wd_out).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['b2'],width=self.wd_out).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch,pin2=inst.pin['opt_b2'],width=self.wd_out).put()
|
||||
|
||||
return C
|
||||
|
||||
@@ -707,28 +759,48 @@ class DC(ADC_STD_2x2):
|
||||
gc_OU = gc_cell.put('g1',dX_gc2gc,-dY_gc2gc,0)
|
||||
gc_OD = gc_cell.put('g1',dX_gc2gc,0,0)
|
||||
# Put DC
|
||||
inst = self.cell.put('a1',-self.L/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: inst = self.cell.put('a1',-self.L/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
inst = self.cell.put('opt_a1',-self.L/2+dX_gc2gc/2,self.cell.pin['opt_a1'].y-dY_gc2gc/2,0)
|
||||
|
||||
# Connect all the ports
|
||||
stripe=Route(radius=self.Ru0, width=self.wu_in, xs="strip")
|
||||
|
||||
if (abs(inst.pin['b1'].y - inst.pin['b2'].y)<10) :
|
||||
temp = stripe.sbend_route(pin=inst.pin['a1'],offset=5).put(flip=1)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: if (abs(inst.pin['b1'].y - inst.pin['b2'].y)<10) :
|
||||
if (abs(inst.pin['opt_b1'].y - inst.pin['opt_b2'].y)<10) :
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = stripe.sbend_route(pin=inst.pin['a1'],offset=5).put(flip=1)
|
||||
temp = stripe.sbend_route(pin=inst.pin['opt_a1'],offset=5).put(flip=1)
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=temp.pin['b0'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
temp = stripe.sbend_route(pin=inst.pin['a2'],offset=5).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = stripe.sbend_route(pin=inst.pin['a2'],offset=5).put()
|
||||
temp = stripe.sbend_route(pin=inst.pin['opt_a2'],offset=5).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=temp.pin['b0'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
temp = stripe.sbend_route(pin=inst.pin['b1'],offset=5).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = stripe.sbend_route(pin=inst.pin['b1'],offset=5).put()
|
||||
temp = stripe.sbend_route(pin=inst.pin['opt_b1'],offset=5).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=temp.pin['b0'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
temp = stripe.sbend_route(pin=inst.pin['b2'],offset=5).put(flip=1)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = stripe.sbend_route(pin=inst.pin['b2'],offset=5).put(flip=1)
|
||||
temp = stripe.sbend_route(pin=inst.pin['opt_b2'],offset=5).put(flip=1)
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=temp.pin['b0'],arrow=False,original_function=not sharp_patch).put()
|
||||
else :
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['opt_a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['opt_a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['opt_b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['opt_b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
return C
|
||||
|
||||
class BS_tdc(ADC_STD_2x2):
|
||||
@@ -941,7 +1013,9 @@ class MDM(ADC_STD_2x2):
|
||||
Rd0=R0,Rd1=R0,
|
||||
angle=angle)
|
||||
|
||||
self.L = np.abs(self.cell.pin['a1'].x-self.cell.pin['b1'].x)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: self.L = np.abs(self.cell.pin['a1'].x-self.cell.pin['b1'].x)
|
||||
self.L = np.abs(self.cell.pin['opt_a1'].x-self.cell.pin['opt_b1'].x)
|
||||
|
||||
def generate_test_gds(self,gc,dX_gc2gc=300,dY_gc2gc=40,sharp_patch=True):
|
||||
with nd.Cell(name=self.cell.cell_name+"_test", instantiate=False) as C:
|
||||
@@ -949,10 +1023,16 @@ class MDM(ADC_STD_2x2):
|
||||
gc_cell = __cell_arg__(arg=gc,arg_name="gc",func_name="mxpic::MDM::generate_test_gds")
|
||||
|
||||
# Put DC
|
||||
L_taper = (np.abs(self.cell.pin['a1'].width-gc_cell.pin['g1'].width))/np.tan(2/180*pi)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: L_taper = (np.abs(self.cell.pin['a1'].width-gc_cell.pin['g1'].width))/np.tan(2/180*pi)
|
||||
L_taper = (np.abs(self.cell.pin['opt_a1'].width-gc_cell.pin['g1'].width))/np.tan(2/180*pi)
|
||||
|
||||
mdm_In = self.cell.put('b1',-dX_gc2gc/2 + self.L + 25+L_taper,0,180)
|
||||
mdm_Out = self.cell.put('b1', dX_gc2gc/2 - self.L - 25-L_taper,0,0,flip=1)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: mdm_In = self.cell.put('b1',-dX_gc2gc/2 + self.L + 25+L_taper,0,180)
|
||||
mdm_In = self.cell.put('opt_b1',-dX_gc2gc/2 + self.L + 25+L_taper,0,180)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: mdm_Out = self.cell.put('b1', dX_gc2gc/2 - self.L - 25-L_taper,0,0,flip=1)
|
||||
mdm_Out = self.cell.put('opt_b1', dX_gc2gc/2 - self.L - 25-L_taper,0,0,flip=1)
|
||||
|
||||
|
||||
GC_IU = gc_cell.put('g1',-dX_gc2gc/2,dY_gc2gc/2,180)
|
||||
@@ -962,16 +1042,26 @@ class MDM(ADC_STD_2x2):
|
||||
|
||||
# # Connect all the ports
|
||||
stripe=Route(radius=10, width=self.w_wg, xs="strip")
|
||||
nd.taper(width1=mdm_In.pin['a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_In.pin['a1'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.taper(width1=mdm_In.pin['a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_In.pin['a1'])
|
||||
nd.taper(width1=mdm_In.pin['opt_a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_In.pin['opt_a1'])
|
||||
stripe.sbend_p2p(pin2=GC_IU.pin['g1'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
stripe.sbend_p2p(pin1=GC_ID.pin['g1'],pin2=mdm_In.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=GC_ID.pin['g1'],pin2=mdm_In.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=GC_ID.pin['g1'],pin2=mdm_In.pin['opt_a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
nd.taper(width1=mdm_Out.pin['a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_Out.pin['a1'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.taper(width1=mdm_Out.pin['a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_Out.pin['a1'])
|
||||
nd.taper(width1=mdm_Out.pin['opt_a1'].width,width2=gc_cell.pin['g1'].width,length=L_taper,xs='strip').put(mdm_Out.pin['opt_a1'])
|
||||
stripe.sbend_p2p(pin1=GC_OU.pin['g1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=GC_OD.pin['g1'],pin2=mdm_Out.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=GC_OD.pin['g1'],pin2=mdm_Out.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=GC_OD.pin['g1'],pin2=mdm_Out.pin['opt_a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
|
||||
stripe.taper_p2p(pin1=mdm_In.pin['b1'],pin2=mdm_Out.pin['b1'],arrow=False).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.taper_p2p(pin1=mdm_In.pin['b1'],pin2=mdm_Out.pin['b1'],arrow=False).put()
|
||||
stripe.taper_p2p(pin1=mdm_In.pin['opt_b1'],pin2=mdm_Out.pin['opt_b1'],arrow=False).put()
|
||||
|
||||
return C
|
||||
|
||||
@@ -1095,10 +1185,18 @@ class DC_bend :
|
||||
|
||||
## Put pins
|
||||
nd.Pin(name="a0", width=self.w_wg).put((port_in1.pin['b0'].x+port_in2.pin['b0'].x)/2, (port_in1.pin['b0'].y+port_in2.pin['b0'].y)/2, 180)
|
||||
nd.Pin(name="a1", width=self.w_wg).put(port_in1.pin['b0'])
|
||||
nd.Pin(name="a2", width=self.w_wg).put(port_in2.pin['b0'])
|
||||
nd.Pin(name="b1", width=self.w_wg).put(port_out1.pin['b0'])
|
||||
nd.Pin(name="b2", width=self.w_wg).put(port_out2.pin['b0'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name="a1", width=self.w_wg).put(port_in1.pin['b0'])
|
||||
nd.Pin(name="opt_a1", width=self.w_wg,type="optical:").put(port_in1.pin['b0'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name="a2", width=self.w_wg).put(port_in2.pin['b0'])
|
||||
nd.Pin(name="opt_a2", width=self.w_wg,type="optical:").put(port_in2.pin['b0'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name="b1", width=self.w_wg).put(port_out1.pin['b0'])
|
||||
nd.Pin(name="opt_b1", width=self.w_wg,type="optical:").put(port_out1.pin['b0'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name="b2", width=self.w_wg).put(port_out2.pin['b0'])
|
||||
nd.Pin(name="opt_b2", width=self.w_wg,type="optical:").put(port_out2.pin['b0'])
|
||||
self.width = np.abs(port_out1.pin['b0'].y - port_out2.pin['b0'].y)
|
||||
self.length = np.abs(port_out1.pin['b0'].x - port_in1.pin['b0'].x)
|
||||
if self.show_pins:
|
||||
@@ -1144,15 +1242,27 @@ class DC_bend :
|
||||
gc_OU = gc_cell.put('g1',dX_gc2gc,-dY_gc2gc,0)
|
||||
gc_OD = gc_cell.put('g1',dX_gc2gc,0,0)
|
||||
# Put DC
|
||||
dL_DC = self.cell.pin['b1'].x - self.cell.pin['a1'].x
|
||||
inst = self.cell.put('a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dL_DC = self.cell.pin['b1'].x - self.cell.pin['a1'].x
|
||||
dL_DC = self.cell.pin['opt_b1'].x - self.cell.pin['opt_a1'].x
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: inst = self.cell.put('a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
inst = self.cell.put('opt_a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['opt_a1'].y-dY_gc2gc/2,0)
|
||||
|
||||
# Connect all the ports
|
||||
stripe=Route(radius=10, width=self.w_wg, xs="strip")
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=inst.pin['opt_a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=inst.pin['opt_a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=inst.pin['opt_b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=inst.pin['opt_b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
return C
|
||||
|
||||
|
||||
@@ -1237,7 +1347,9 @@ class DC_pX_3sg:
|
||||
self.cellU = cells[2]
|
||||
self.cellD = cells[1]
|
||||
|
||||
self.L = np.abs(self.cell.pin['a1'].x - self.cell.pin['b1'].x)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: self.L = np.abs(self.cell.pin['a1'].x - self.cell.pin['b1'].x)
|
||||
self.L = np.abs(self.cell.pin['opt_a1'].x - self.cell.pin['opt_b1'].x)
|
||||
self.length = self.L
|
||||
|
||||
def generate_gds(self,err=0):
|
||||
@@ -1261,7 +1373,9 @@ class DC_pX_3sg:
|
||||
cp_u_r = nd.bend(radius=self.R0,angle=self.A,xs=self.xs_wg,width=w_cp).put(flip=0)
|
||||
cp_u_r = nd.taper(width1=w_cp,width2=self.w_wg,xs=self.xs_wg,length=2).put()
|
||||
|
||||
nd.Pin(name='a1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width).put()
|
||||
nd.Pin(name='opt_a1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width,type="optical:").put()
|
||||
|
||||
## middle segment phase shifter
|
||||
if self.pX_type == "symmetric":
|
||||
@@ -1280,7 +1394,9 @@ class DC_pX_3sg:
|
||||
cp_u_r = nd.bend(radius=self.R0,angle=self.A,xs=self.xs_wg,width=w_cp).put(flip=1)
|
||||
cp_u_r = nd.taper(width1=w_cp,width2=self.w_wg,xs=self.xs_wg,length=2).put()
|
||||
|
||||
nd.Pin(name='b1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width).put()
|
||||
nd.Pin(name='opt_b1',pin=cp_u_r.pin['b0'],width=cp_u_r.pin['b0'].width,type="optical:").put()
|
||||
|
||||
nd.Pin(name='b0').put(cp_u.pin['b0'])
|
||||
|
||||
@@ -1299,7 +1415,9 @@ class DC_pX_3sg:
|
||||
cp_d_r = nd.bend(radius=self.R0,angle=self.A,xs=self.xs_wg,width=w_cp).put()
|
||||
# cp_d_r = nd.taper(width1=w_cp,width2=self.w_wg,xs=self.xs_wg,length=2).put()
|
||||
|
||||
nd.Pin(name='a2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width).put()
|
||||
nd.Pin(name='opt_a2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width,type="optical:").put()
|
||||
|
||||
## middle segment phase shifter
|
||||
if self.pX_type == "symmetric":
|
||||
@@ -1323,7 +1441,9 @@ class DC_pX_3sg:
|
||||
else:
|
||||
cp_d_r = nd.bend(radius=self.R0,angle=self.A,xs=self.xs_wg,width=w_cp).put(flip=1)
|
||||
|
||||
nd.Pin(name='b2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width).put()
|
||||
nd.Pin(name='opt_b2',pin=cp_d_r.pin['b0'],width=cp_d_r.pin['b0'].width,type="optical:").put()
|
||||
nd.Pin(name='b0').put(cp_d.pin['b0'])
|
||||
|
||||
|
||||
@@ -1331,8 +1451,12 @@ class DC_pX_3sg:
|
||||
wgUp = CUP.put(0,(w_cp/2+gap/2),0)
|
||||
wgDown = CDOWN.put(0,-(w_cp/2+gap/2),0)
|
||||
|
||||
wgUp.raise_pins(['a1','b1'],['a1','b1'])
|
||||
wgDown.raise_pins(['a2','b2'],['a2','b2'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: wgUp.raise_pins(['a1','b1'],['a1','b1'])
|
||||
wgUp.raise_pins(['opt_a1','opt_b1'],['opt_a1','opt_b1'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: wgDown.raise_pins(['a2','b2'],['a2','b2'])
|
||||
wgDown.raise_pins(['opt_a2','opt_b2'],['opt_a2','opt_b2'])
|
||||
nd.Pin(name='a0').put((self.Lc1+self.Lc2+self.Lp1+self.Lt*2)/2,0,180)
|
||||
nd.Pin(name='b0').put((self.Lc1+self.Lc2+self.Lp1+self.Lt*2)/2,0,0)
|
||||
|
||||
@@ -1355,15 +1479,27 @@ class DC_pX_3sg:
|
||||
gc_OU = gc_cell.put('g1',dX_gc2gc,-dY_gc2gc,0)
|
||||
gc_OD = gc_cell.put('g1',dX_gc2gc,0,0)
|
||||
# Put DC
|
||||
dL_DC = self.cell.pin['b1'].x - self.cell.pin['a1'].x
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: dL_DC = self.cell.pin['b1'].x - self.cell.pin['a1'].x
|
||||
dL_DC = self.cell.pin['opt_b1'].x - self.cell.pin['opt_a1'].x
|
||||
# inst = self.cell.put('a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
DC_pX3 = self.cell.put('a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: DC_pX3 = self.cell.put('a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['a1'].y-dY_gc2gc/2,0)
|
||||
DC_pX3 = self.cell.put('opt_a1',-dL_DC/2+dX_gc2gc/2,self.cell.pin['opt_a1'].y-dY_gc2gc/2,0)
|
||||
|
||||
# Connect all the ports
|
||||
stripe=Route(radius=10, width=self.w_wg, xs="strip")
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=DC_pX3.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=DC_pX3.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=DC_pX3.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=DC_pX3.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=DC_pX3.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_IU.pin['g1'],pin2=DC_pX3.pin['opt_a1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=DC_pX3.pin['a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_ID.pin['g1'],pin2=DC_pX3.pin['opt_a2'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=DC_pX3.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OD.pin['g1'],pin2=DC_pX3.pin['opt_b1'],arrow=False,original_function=not sharp_patch).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=DC_pX3.pin['b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
stripe.sbend_p2p(pin1=gc_OU.pin['g1'],pin2=DC_pX3.pin['opt_b2'],arrow=False,original_function=not sharp_patch).put()
|
||||
return C
|
||||
|
||||
|
||||
Reference in New Issue
Block a user