optical pins name revised. Pin type added
This commit is contained in:
@@ -116,15 +116,29 @@ class YBranch:
|
||||
vtx = np.c_[vtx_x,vtx_y]
|
||||
_my_polygon(layer_wg=layers,vtx=vtx).put(0,0,0)
|
||||
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('a1',self.L,self.w[-1]/2 - self.w_port/2,0)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('a1',temp.pin['b1'],flip=1)
|
||||
nd.Pin(name='b1',width=self.w_port).put(temp.pin['b1'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('a1',self.L,self.w[-1]/2 - self.w_port/2,0)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('opt_a1',self.L,self.w[-1]/2 - self.w_port/2,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('a1',temp.pin['b1'],flip=1)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('opt_a1',temp.pin['opt_b1'],flip=1)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b1',width=self.w_port).put(temp.pin['b1'])
|
||||
nd.Pin(name='opt_b1',width=self.w_port,type="optical:").put(temp.pin['opt_b1'])
|
||||
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('a1',self.L,-self.w[-1]/2 + self.w_port/2,0,flip=1)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('a1',temp.pin['b1'],flip=0)
|
||||
nd.Pin(name='b2',width=self.w_port).put(temp.pin['b1'])
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('a1',self.L,-self.w[-1]/2 + self.w_port/2,0,flip=1)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=0,theta_stop=self.A_att,width=self.w_port).cell.put('opt_a1',self.L,-self.w[-1]/2 + self.w_port/2,0,flip=1)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('a1',temp.pin['b1'],flip=0)
|
||||
temp = circle(xs=self.xs,radius=self.R_att,theta_start=-self.A_att,theta_stop=0,width=self.w_port).cell.put('opt_a1',temp.pin['opt_b1'],flip=0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b2',width=self.w_port).put(temp.pin['b1'])
|
||||
nd.Pin(name='opt_b2',width=self.w_port,type="optical:").put(temp.pin['opt_b1'])
|
||||
|
||||
nd.Pin(name='a1',width=self.w[0]).put(0,0,180)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a1',width=self.w[0]).put(0,0,180)
|
||||
nd.Pin(name='opt_a1',width=self.w[0],type="optical:").put(0,0,180)
|
||||
|
||||
if (show_pins):
|
||||
nd.put_stub()
|
||||
@@ -227,7 +241,9 @@ class Ybranch_3wg:
|
||||
self.L_in_tp = L_in_tp
|
||||
|
||||
self.cell = self.generate_gds(sharp_patch=sharp_patch)
|
||||
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,sharp_patch,err_asy=0):
|
||||
with nd.Cell(instantiate=self.instantiate,name=self.name) as C:
|
||||
@@ -248,19 +264,25 @@ class Ybranch_3wg:
|
||||
t_d = nd.taper(width2=w0,width1=w1,length=Lcp,xs=xs).put(0,-(w1/2+w0/2+gap),0)
|
||||
t_in = nd.taper(width1=w_wg,width2=w0,length=L_in_tp,xs=xs).put(-L_in_tp,0,0)
|
||||
t_in = nd.strt(width=w_wg,length=L_attach,xs=xs).put(t_in.pin['a0'],flip=0)
|
||||
nd.Pin(name='a1',pin=t_in.pin['b0']).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='a1',pin=t_in.pin['b0']).put()
|
||||
nd.Pin(name='opt_a1',pin=t_in.pin['b0'],type="optical:").put()
|
||||
|
||||
au = nd.bend(radius=R0,angle=angle,xs=xs,width=w0).put(t_u.pin['b0'],flip=0)
|
||||
au = nd.bend(radius=R0,angle=angle,xs=xs,width=w0).put(au.pin['b0'],flip=1)
|
||||
au = nd.taper(width1=w0,width2=w_wg,length=L_in_tp,xs=xs).put(au.pin['b0'],flip=0)
|
||||
au = nd.strt(width=w_wg,length=L_attach,xs=xs).put(au.pin['b0'],flip=0)
|
||||
nd.Pin(name='b1',pin=au.pin['b0']).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b1',pin=au.pin['b0']).put()
|
||||
nd.Pin(name='opt_b1',pin=au.pin['b0'],type="optical:").put()
|
||||
|
||||
ad = nd.bend(radius=R0,angle=angle,xs=xs,width=w0).put(t_d.pin['b0'],flip=1)
|
||||
ad = nd.bend(radius=R0,angle=angle,xs=xs,width=w0).put(ad.pin['b0'],flip=0)
|
||||
ad = nd.taper(width1=w0,width2=w_wg,length=L_in_tp,xs=xs).put(ad.pin['b0'],flip=0)
|
||||
ad = nd.strt(width=w_wg,length=L_attach,xs=xs).put(ad.pin['b0'],flip=0)
|
||||
nd.Pin(name='b2',pin=ad.pin['b0']).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: nd.Pin(name='b2',pin=ad.pin['b0']).put()
|
||||
nd.Pin(name='opt_b2',pin=ad.pin['b0'],type="optical:").put()
|
||||
|
||||
|
||||
if (sharp_patch==True):
|
||||
@@ -279,7 +301,9 @@ class Ybranch_3wg:
|
||||
|
||||
gc_cell = __cell_arg__(arg=gc,arg_name="gc",func_name="mxpic::Ybranch_3wg::generate_test_gds")
|
||||
|
||||
inst = self.cell.put('a1',-self.L/2,0,0)
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: inst = self.cell.put('a1',-self.L/2,0,0)
|
||||
inst = self.cell.put('opt_a1',-self.L/2,0,0)
|
||||
|
||||
gc_In = gc_cell.put('g1',-dX_gc2gc/2,0,180)
|
||||
gc_O1 = gc_cell.put('g1',dX_gc2gc/2, dY_gc2gc/2,0)
|
||||
@@ -287,10 +311,16 @@ class Ybranch_3wg:
|
||||
pic_strip = Route(radius=Rbend,width=self.w_wg,xs=self.xs)
|
||||
|
||||
pic_strip.taper(pin=gc_O1.pin['g1'],width1=gc_O1.pin['g1'].width,width2=self.w_wg,length=5,arrow=False)
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['b1'],arrow=False).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['b1'],arrow=False).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['opt_b1'],arrow=False).put()
|
||||
|
||||
pic_strip.taper(pin=gc_O2.pin['g1'],width1=gc_O2.pin['g1'].width,width2=self.w_wg,length=5,arrow=False)
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['b2'],arrow=False).put()
|
||||
pic_strip.taper_p2p(pin1=gc_In.pin['g1'],pin2=inst.pin['a1'],arrow=False).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['b2'],arrow=False).put()
|
||||
pic_strip.sbend_p2p(original_function=not sharp_patch, pin2=inst.pin['opt_b2'],arrow=False).put()
|
||||
## revised in 2026.06.07 by Qin Yue
|
||||
# legacy: pic_strip.taper_p2p(pin1=gc_In.pin['g1'],pin2=inst.pin['a1'],arrow=False).put()
|
||||
pic_strip.taper_p2p(pin1=gc_In.pin['g1'],pin2=inst.pin['opt_a1'],arrow=False).put()
|
||||
|
||||
return C
|
||||
|
||||
Reference in New Issue
Block a user