893 lines
39 KiB
Python
893 lines
39 KiB
Python
from typing import Any, Optional
|
|
import nazca as nd
|
|
import numpy as np
|
|
|
|
# from mxpic.passive.unit import PS_3xg
|
|
|
|
from ..structures import *
|
|
from ..routing import Route
|
|
|
|
from ..primitives.pic import *
|
|
from ..electronics import Vias
|
|
|
|
import pandas as pd
|
|
|
|
from ..primitives.passive import waveguide, PS_2st, PS_2st_Straight
|
|
|
|
from ..basic import __cell_arg__
|
|
|
|
""" Default 50:50 beam splitter generation using standard DC """
|
|
def __BS_generate__(BS,xs,func_name):
|
|
if (BS==None):
|
|
BS_cell = DC(xs=xs,w_cp=0.45,w_wg=0.45,L_cp=9.27,angle=10,R0=15,Rmax=15,Rmin=15).cell
|
|
|
|
elif (isinstance(BS,nd.Cell)):
|
|
BS_cell = BS
|
|
|
|
elif (hasattr(BS,'cell')):
|
|
BS_cell = BS.cell
|
|
|
|
else :
|
|
print ("WARNING:: In <"+func_name+">, BS not recognizable, Standard DC genereated")
|
|
BS_cell = DC(xs=xs,w_cp=0.45,w_wg=0.45,L_cp=9.27,angle=10,R0=15,Rmax=15,Rmin=15).cell
|
|
|
|
return BS_cell
|
|
|
|
|
|
|
|
class MZI:
|
|
def __init__(self,
|
|
name: Optional[str]=None,
|
|
xs_wg: str='strip',
|
|
w_wg: float=0.45,
|
|
dL_Amzi: float=0,
|
|
L_arm: int=150,
|
|
R_bend: int=10,
|
|
D_arm: int=75,
|
|
D_port: Any=None,
|
|
w_arm: float = 1.0,
|
|
|
|
xs_heater: str = 'heater',
|
|
w_heater: float=0,
|
|
Ltp: int = 15,
|
|
|
|
xs_metal: str = 'metal',
|
|
w_metal: float=10,
|
|
|
|
via_h2m: Any = None,
|
|
isl: Any = None,
|
|
|
|
outer_isl: bool = True,
|
|
dual_ht: bool=True,
|
|
L_patch: float = 0.5,
|
|
BS: Any=None,
|
|
BS2: Any=None,
|
|
sharp_patch: bool=True,
|
|
show_pins: bool=False) -> None:
|
|
"""_summary_
|
|
|
|
Args:
|
|
name (_type_, optional): Name of the device, None means no instance cell will be created. Defaults to None.
|
|
xs_wg (str, optional): The xsection of the waveguide. Defaults to 'strip'.
|
|
w_wg (float, optional): The width of the ouput waveguide. Defaults to 0.45.
|
|
dL_Amzi (int, optional): The asysmmetric length of AMZI. Defaults to 0.
|
|
L_arm (int, optional): Length of the arms. Defaults to 150.
|
|
R_bend (int, optional): Bneding radius of internal attachment. Defaults to 10.
|
|
D_arm (int, optional): Distance of arms. Defaults to 75.
|
|
D_port (_type_, optional): Distance of ports. If None, distance of BS ports will be used. Defaults to None.
|
|
w_arm (float, optional): Width of arms, if you need wide arm to decrease phase errors. Defaults to 1.0.
|
|
xs_heater (str, optional): xsection of heaters. Defaults to 'heater'.
|
|
w_heater (int, optional): Width of heaters. Defaults to 0.
|
|
Ltp (int, optional): Taper length of the wider arm to the thinner waveguide. Defaults to 15.
|
|
xs_metal (str, optional): Xsection of metal. Defaults to 'metal'.
|
|
w_metal (int, optional): Width of the attached metal. Defaults to 10.
|
|
via_h2m (_type_, optional): The class of the vias. Defaults to None.
|
|
isl (_type_, optional): The class of the isolation trench. Defaults to None.
|
|
outer_isl (bool, optional): Flag of whether to place outside isolation. Defaults to True.
|
|
dual_ht (bool, optional): Flag of whether to have two heaters. Defaults to True.
|
|
BS (_type_, optional): The cell class for the first beamsplitter. Defaults to None.
|
|
BS2 (_type_, optional): The cell class for the first beamsplitter. Defaults to None.
|
|
sharp_patch (bool, optional): Flag of whether to add sharp_patch to the device. Defaults to True.
|
|
show_pins (bool, optional): Flag of whether to show pins in the waveguide. Defaults to False.
|
|
|
|
Raises:
|
|
Exception: _description_
|
|
Exception: _description_
|
|
"""
|
|
self.name = name
|
|
if (self.name==None):
|
|
self.instantiate = False
|
|
else :
|
|
self.instantiate = True
|
|
|
|
|
|
self.xs_wg = xs_wg
|
|
self.w_wg = w_wg
|
|
self.dL_Amzi = dL_Amzi
|
|
self.L_arm = L_arm
|
|
self.R_bend = R_bend
|
|
self.D_arm = D_arm
|
|
self.D_port = D_port
|
|
self.w_arm = w_arm
|
|
self.xs_heater = xs_heater
|
|
self.w_heater = w_heater
|
|
|
|
self.xs_metal = xs_metal
|
|
self.via_h2m = via_h2m
|
|
self.isl = isl
|
|
self.w_metal = w_metal
|
|
self.xs_metal = xs_metal
|
|
self.L_patch = L_patch
|
|
self.Ltp = Ltp
|
|
|
|
with nd.Cell(instantiate=self.instantiate,name=self.name) as C:
|
|
|
|
if (BS2==None):
|
|
BS2 = BS
|
|
|
|
## revised in 2022.12.28, for general BS function
|
|
cell_BS = __BS_generate__(BS=BS,xs=xs_wg,func_name="mxpic::functional::MZI")
|
|
cell_BS2 = __BS_generate__(BS=BS2,xs=xs_wg,func_name="mxpic::functional::MZI")
|
|
|
|
dY1 = np.abs(cell_BS.pin['b1'].y - cell_BS.pin['b2'].y)
|
|
dY2 = np.abs(cell_BS2.pin['b1'].y - cell_BS2.pin['b2'].y)
|
|
# dX = np.abs(cell_BS.pin['a1'].x - cell_BS.pin['b1'].x)
|
|
|
|
BS1 = cell_BS.put('b1',-L_arm/2-R_bend*2-2.5,dY1/2,180)
|
|
BS2 = cell_BS2.put('b2', L_arm/2+R_bend*2+2.5,dY2/2,0,flip=0)
|
|
|
|
pic = Route(width=w_wg,radius=R_bend,xs=xs_wg,adapt_width=True,adapt_xs=True)
|
|
|
|
|
|
""" Placing Input and Output ports """
|
|
|
|
pin_in_name = []
|
|
for str,Pin in cell_BS.ic_pins():
|
|
pin_in_name = pin_in_name+[str]
|
|
|
|
# print("DEBUG - A")
|
|
|
|
if ('a2' in pin_in_name):
|
|
if (D_port==None):
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=self.xs_wg).put(BS1.pin['a2'])
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=self.xs_wg).put(BS1.pin['a1'])
|
|
|
|
elif(isinstance(D_port,int) or isinstance(D_port,float)):
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='a1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='a2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
else :
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
|
|
pin_out_name = []
|
|
for str,Pin in cell_BS2.ic_pins():
|
|
pin_out_name = pin_out_name+[str]
|
|
|
|
|
|
if ('a2' in pin_out_name):
|
|
if (D_port==None):
|
|
nd.Pin(name='b2',pin=BS2.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=self.xs_wg).put(BS2.pin['a2'])
|
|
nd.Pin(name='b1',pin=BS2.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=self.xs_wg).put(BS2.pin['a1'])
|
|
|
|
elif(isinstance(D_port,int) or isinstance(D_port,float)):
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='b1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='b2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
|
|
else :
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
|
|
|
|
|
|
|
|
w_ht_u = w_heater
|
|
|
|
if (dual_ht): w_ht_d = w_heater ## single heater selection
|
|
|
|
else : w_ht_d = 0
|
|
|
|
|
|
""" Function of bend heater MZI are abondonded, please use MZI_NS_Ubend as replacement """
|
|
""" 2023.03.22 """
|
|
# """ Placing Heaters """
|
|
# if (bend_heater==False):
|
|
arm_upper = waveguide(xs_wg=xs_wg,L_wg=L_arm,w_wg=w_arm,w_port=w_wg,
|
|
shape='strip',LOWER_ISL=outer_isl,
|
|
xs_heater=xs_heater,w_heater=w_ht_u,L_heater=L_arm,
|
|
xs_metal=xs_metal,w_metal=w_metal,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
Ltp=Ltp,
|
|
# ).cell.put(0,D_arm/2+dL,0) ### Revised in 2022.10.08 after finding the FSR of testing device is 2 time than design
|
|
).cell.put(0,D_arm/2+dL_Amzi/2,0)
|
|
arm_down = waveguide(xs_wg=xs_wg,L_wg=L_arm,w_wg=w_arm,w_port=w_wg,
|
|
shape='strip',UPPER_ISL=outer_isl,
|
|
xs_heater=xs_heater,w_heater=w_ht_d,L_heater=L_arm,
|
|
xs_metal=xs_metal,w_metal=w_metal,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
Ltp=self.Ltp
|
|
).cell.put(0,-D_arm/2,0)
|
|
|
|
pic.sbend_p2p(pin1=BS1.pin['b1'],pin2=arm_upper.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
|
pic.sbend_p2p(pin1=BS1.pin['b2'],pin2=arm_down.pin['a1'],arrow=False,original_function=not sharp_patch).put()
|
|
pic.sbend_p2p(pin1=BS2.pin['b2'],pin2=arm_upper.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
|
pic.sbend_p2p(pin1=BS2.pin['b1'],pin2=arm_down.pin['b1'],arrow=False,original_function=not sharp_patch).put()
|
|
|
|
|
|
for str,Pin in arm_upper.ic_pins():
|
|
if (str=='ep1') : nd.Pin(name='ep1',pin=Pin).put()
|
|
if (str=='en1') : nd.Pin(name='en1',pin=Pin).put()
|
|
|
|
for str,Pin in arm_down.ic_pins():
|
|
if (str=='ep1') : nd.Pin(name='ep2',pin=Pin).put()
|
|
if (str=='en1') : nd.Pin(name='en2',pin=Pin).put() ## revise 2022.08.18
|
|
|
|
|
|
if (show_pins):
|
|
nd.put_stub()
|
|
|
|
self.cell = C
|
|
self.L = np.abs(self.cell.pin['a1'].x-self.cell.pin['b1'].x)
|
|
|
|
class MZI_NS:
|
|
def __init__(self,
|
|
name: str,
|
|
BS: Any,
|
|
xs_wg: str,
|
|
|
|
w1: float,
|
|
w2: float,
|
|
L0: Any,
|
|
Ln: Any,
|
|
Ls: Any,
|
|
Ltp: Any,
|
|
R_bend: Any,
|
|
w_wg: float,
|
|
L_patch: Any,
|
|
D_arm: int = 40,
|
|
L12: Any=None,
|
|
w_heater: float = 0,
|
|
L_ht: Any = None,
|
|
via_h2m: Any = None,
|
|
isl: Any = None,
|
|
show_pins: bool=False,
|
|
D_port: Any = None,
|
|
sharp_patch: bool =True,
|
|
dual_ht: bool = False,
|
|
) -> None:
|
|
if (name==None):
|
|
instantiate = False
|
|
else :
|
|
instantiate = True
|
|
|
|
if (L12 == None):
|
|
L12 = Ltp
|
|
|
|
BS = __cell_arg__(arg=BS,arg_name="BS",func_name="mxpic::functional::MZI_NS_ubend")
|
|
with nd.Cell(name=name,instantiate=instantiate) as C:
|
|
|
|
pic_strip = Route(radius=R_bend,width=w_wg,xs=xs_wg)
|
|
|
|
_L_ = abs(BS.pin['a1'].x-BS.pin['b1'].x)
|
|
|
|
_W_ = abs(BS.pin['b1'].y-BS.pin['b2'].y)
|
|
|
|
|
|
|
|
PS = PS_2st_Straight(xs_wg=xs_wg,w_wg=w_wg,w1=w1,w2=w2,L1=Ln,L2=Ls,L_wg=0.25,
|
|
L12=L12,L_tp=Ltp,w_heater=w_heater,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
L_ht=L_ht)
|
|
PS_U = PS.cell.put('a1',-PS.L_arm/2,D_arm/2,0)
|
|
|
|
BS1 = BS.put('b1',-R_bend*2-L_patch-PS.L_arm/2,_W_/2,180)
|
|
BS2 = BS.put('b2', R_bend*2+L_patch+PS.L_arm/2,_W_/2,0,flip=0)
|
|
|
|
pic = Route(width=w_wg,radius=R_bend,xs=xs_wg,adapt_width=True,adapt_xs=True)
|
|
|
|
""" Plcaing b2 pin """
|
|
pin_in_name = []
|
|
for str,Pin in BS.ic_pins():
|
|
pin_in_name = pin_in_name+[str]
|
|
# pin_in_name.append(str)
|
|
|
|
if ('a2' in pin_in_name):
|
|
if (D_port==None):
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
|
|
nd.Pin(name='b2',pin=BS2.pin['a2']).put()
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
elif(isinstance(D_port,int) or isinstance(D_port,float)):
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='a1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='a2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='b1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='b2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
else :
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
|
|
# print("SEGEMENT")
|
|
|
|
pic_strip.sbend_p2p(pin1=PS_U.pin['a1'],pin2=BS1.pin['b1'],Lstart=L_patch/4).put()
|
|
pic_strip.sbend_p2p(pin1=PS_U.pin['b1'],pin2=BS2.pin['b2'],Lstart=L_patch/4).put()
|
|
|
|
if (dual_ht==False):
|
|
w_ht_D = 0
|
|
|
|
PS = PS_2st_Straight(xs_wg=xs_wg,w_wg=w_wg,w1=w2,w2=w1,L1=Ln,L2=Ls,L_wg=0.25,
|
|
L12=L12,L_tp=Ltp,w_heater=w_ht_D,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
L_ht=L_ht)
|
|
PS_D = PS.cell.put('a1',-PS.L_arm/2,-D_arm/2,0)
|
|
|
|
pic_strip.sbend_p2p(pin1=PS_D.pin['a1'],pin2=BS1.pin['b2'],Lstart=L_patch/4).put()
|
|
pic_strip.sbend_p2p(pin1=PS_D.pin['b1'],pin2=BS2.pin['b1'],Lstart=L_patch/4).put()
|
|
|
|
if (w_heater>0):
|
|
nd.Pin(name='ep1',pin=PS_U.pin['ep1']).put()
|
|
nd.Pin(name='en1',pin=PS_U.pin['en1']).put()
|
|
|
|
if (dual_ht==True):
|
|
nd.Pin(name='ep2',pin=PS_D.pin['ep1']).put()
|
|
nd.Pin(name='en2',pin=PS_D.pin['en1']).put()
|
|
|
|
if (show_pins):
|
|
nd.put_stub()
|
|
|
|
self.cell = C
|
|
|
|
class MZI_NS_ubend:
|
|
def __init__(self,
|
|
name: str,
|
|
BS: Any,
|
|
xs_wg: str,
|
|
w1: float,
|
|
w2: float,
|
|
L0: Any,
|
|
Ln: Any,
|
|
Ls: Any,
|
|
Ltp: Any,
|
|
R_bend: Any,
|
|
w_wg: float,
|
|
L_patch: Any,
|
|
L12: Any=None,
|
|
w_ht: float = 0,
|
|
L_ht: int = 0,
|
|
via_h2m: Any = None,
|
|
isl: Any = None,
|
|
show_pins: bool=False,
|
|
D_port: Any=None,
|
|
sharp_patch: bool=True,
|
|
dual_ht: bool=False,
|
|
) -> None:
|
|
if (name==None):
|
|
instantiate = False
|
|
else :
|
|
instantiate = True
|
|
|
|
if (L12 == None):
|
|
L12 = Ltp
|
|
|
|
BS = __cell_arg__(arg=BS,arg_name="BS",func_name="mxpic::functional::MZI_NS_ubend")
|
|
with nd.Cell(name=name,instantiate=instantiate) as C:
|
|
|
|
pic = Route(radius=R_bend,width=w_wg,xs=xs_wg)
|
|
|
|
_L_ = abs(BS.pin['a1'].x-BS.pin['b1'].x)
|
|
|
|
_W_ = abs(BS.pin['b1'].y-BS.pin['b2'].y)
|
|
|
|
BS1 = BS.put('b1',-R_bend*2-L_patch/2,_W_/2,180)
|
|
BS2 = BS.put('b2', R_bend*2+L_patch/2,_W_/2,0)
|
|
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
|
|
""" Plcaing b2 pin """
|
|
pin_in_name = []
|
|
for str,Pin in BS.ic_pins():
|
|
pin_in_name = pin_in_name+[str]
|
|
# pin_in_name.append(str)
|
|
|
|
if ('a2' in pin_in_name):
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.Pin(name='b2',pin=BS2.pin['a2']).put()
|
|
|
|
if (D_port==None):
|
|
nd.Pin(name='b2',pin=BS2.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=xs_wg).put(BS2.pin['a2'])
|
|
nd.Pin(name='b1',pin=BS2.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=xs_wg).put(BS2.pin['a1'])
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=xs_wg).put(BS1.pin['a2'])
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=xs_wg).put(BS1.pin['a1'])
|
|
|
|
elif(isinstance(D_port,int) or isinstance(D_port,float)):
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='b1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS2.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS2.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='b2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a1'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a1'].y)),
|
|
original_function=not sharp_patch).put(flip=1)
|
|
nd.Pin(name='a1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic.sbend_route(radius=R_bend,width=w_wg,pin=BS1.pin['a2'],length1=L_patch/4,length2=L_patch/4,offset=abs(D_port/2-abs(BS1.pin['a2'].y)),
|
|
original_function=not sharp_patch).put(flip=0)
|
|
nd.Pin(name='a2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
|
|
PS_L1 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w1,w2=w2,L1=Ln/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
L12=L12,L_tp=Ltp,w_heater=w_ht,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
L_ht=L_ht).cell.put('a1',BS1.pin['b1'].x+L_patch/4+R_bend,BS1.pin['b1'].y+L_patch/4+R_bend,90)
|
|
pic.bend_route_p2p(pin1=PS_L1.pin['a1'],pin2=BS1.pin['b1']).put()
|
|
pic.bend_route_p2p(pin1=PS_L1.pin['b1'],pin2=BS2.pin['b2']).put()
|
|
|
|
if (dual_ht):
|
|
w_ht_d=w_ht
|
|
else:
|
|
w_ht_d = 0
|
|
PS_L2 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w2,w2=w1,L1=Ls/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
L12=L12,L_tp=Ltp,w_heater=w_ht_d,
|
|
via_h2m=via_h2m,
|
|
isl=isl,
|
|
L_ht=L_ht).cell.put('a1',BS1.pin['b1'].x+L_patch/4+R_bend,BS1.pin['b2'].y-L_patch/4-R_bend,-90,flip=1)
|
|
pic.bend_route_p2p(pin1=PS_L2.pin['a1'],pin2=BS1.pin['b2']).put()
|
|
pic.bend_route_p2p(pin1=PS_L2.pin['b1'],pin2=BS2.pin['b1']).put()
|
|
|
|
if (w_ht>0):
|
|
nd.Pin(name='ep1',pin=PS_L1.pin['ep1']).put()
|
|
nd.Pin(name='en1',pin=PS_L1.pin['en1']).put()
|
|
if (dual_ht):
|
|
nd.Pin(name='ep2',pin=PS_L2.pin['ep1']).put()
|
|
nd.Pin(name='en2',pin=PS_L2.pin['en1']).put()
|
|
|
|
if (show_pins):
|
|
nd.put_stub()
|
|
|
|
self.cell = C
|
|
|
|
class MZI_2st_ubend:
|
|
def __init__(self,
|
|
name: str,
|
|
BS1: Any,
|
|
BS2: Any,
|
|
BS3: Any,
|
|
xs_wg: str,
|
|
w1: float,
|
|
w2: float,
|
|
L0: Any,
|
|
Ln1: Any,
|
|
Ls1: Any,
|
|
Ln2: Any,
|
|
Ls2: Any,
|
|
Ltp: Any,
|
|
R_bend: Any,
|
|
w_wg: float,
|
|
L_patch: Any,
|
|
via_h2m: Any = None,
|
|
isl: Any = None,
|
|
L12: Any=None) -> None:
|
|
if (name==None):
|
|
instantiate = False
|
|
else :
|
|
instantiate = True
|
|
|
|
with nd.Cell(name=name,instantiate=instantiate) as C:
|
|
BS1 = __cell_arg__(arg=BS1,arg_name="BS1",func_name="mxpic::functional::MZI_2st_ubend")
|
|
BS2 = __cell_arg__(arg=BS2,arg_name="BS1",func_name="mxpic::functional::MZI_2st_ubend")
|
|
BS3 = __cell_arg__(arg=BS3,arg_name="BS1",func_name="mxpic::functional::MZI_2st_ubend")
|
|
|
|
pic_strip = Route(radius=R_bend,width=w_wg,xs=xs_wg)
|
|
|
|
_L1_ = abs(BS1.pin['a1'].x-BS1.pin['b1'].x)
|
|
_L2_ = abs(BS2.pin['a1'].x-BS2.pin['b1'].x)
|
|
_L3_ = abs(BS3.pin['a1'].x-BS3.pin['b1'].x)
|
|
|
|
_W1_ = abs(BS1.pin['b1'].y-BS1.pin['b2'].y)
|
|
_W2_ = abs(BS2.pin['b1'].y-BS2.pin['b2'].y)
|
|
_W3_ = abs(BS3.pin['b1'].y-BS3.pin['b2'].y)
|
|
|
|
BSM = BS2.put('a1',-_L2_/2,_W2_/2,0)
|
|
BS1 = BS1.put('b1',-_L2_/2-R_bend*4-L_patch,_W2_/2,180)
|
|
BS2 = BS3.put('a1', _L2_/2+R_bend*4+L_patch,_W2_/2,0)
|
|
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
|
|
nd.Pin(name='b1',pin=BS2.pin['b1']).put()
|
|
nd.Pin(name='b2',pin=BS2.pin['b2']).put()
|
|
|
|
PS_L1 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w1,w2=w2,L1=Ln1/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
via_h2m=via_h2m,isl=isl,
|
|
L12=L12,L_tp=Ltp,w_heater=0).cell.put('a1',BS1.pin['b1'].x+L_patch/4+R_bend,BS1.pin['b1'].y+L_patch/4+R_bend,90)
|
|
pic_strip.bend_route_p2p(pin1=PS_L1.pin['a1'],pin2=BS1.pin['b1']).put()
|
|
pic_strip.bend_route_p2p(pin1=PS_L1.pin['b1'],pin2=BSM.pin['a1']).put()
|
|
|
|
PS_L2 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w2,w2=w1,L1=Ls1/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
via_h2m=via_h2m,isl=isl,
|
|
L12=L12,L_tp=Ltp,w_heater=0).cell.put('a1',BS1.pin['b1'].x+L_patch/4+R_bend,BS1.pin['b2'].y-L_patch/4-R_bend,-90,flip=1)
|
|
pic_strip.bend_route_p2p(pin1=PS_L2.pin['a1'],pin2=BS1.pin['b2']).put()
|
|
pic_strip.bend_route_p2p(pin1=PS_L2.pin['b1'],pin2=BSM.pin['a2']).put()
|
|
|
|
PS_R1 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w2,w2=w1,L1=Ln2/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
via_h2m=via_h2m,isl=isl,
|
|
L12=L12,L_tp=Ltp,w_heater=0).cell.put('a1',BSM.pin['b1'].x+L_patch/4+R_bend,BSM.pin['b1'].y+L_patch/4+R_bend,90)
|
|
pic_strip.bend_route_p2p(pin1=PS_R1.pin['b1'],pin2=BS2.pin['a1']).put()
|
|
pic_strip.bend_route_p2p(pin1=PS_R1.pin['a1'],pin2=BSM.pin['b1']).put()
|
|
|
|
PS_R2 = PS_2st(xs_wg=xs_wg,w_wg=w_wg,w1=w1,w2=w2,L1=Ls2/2+L0,L2=L0,R_bend=R_bend,L_wg=0.25,
|
|
via_h2m=via_h2m,isl=isl,
|
|
L12=L12,L_tp=Ltp,w_heater=0).cell.put('a1',BSM.pin['b1'].x+L_patch/4+R_bend,BSM.pin['b2'].y-L_patch/4-R_bend,-90,flip=1)
|
|
pic_strip.bend_route_p2p(pin1=PS_R2.pin['b1'],pin2=BS2.pin['a2']).put()
|
|
pic_strip.bend_route_p2p(pin1=PS_R2.pin['a1'],pin2=BSM.pin['b2']).put()
|
|
|
|
self.cell = C
|
|
|
|
class MZI_Eubend:
|
|
def __init__(self,
|
|
name: str,
|
|
BS: Any,
|
|
w_arm: float,
|
|
w_wg: float,
|
|
L_arm: Any,
|
|
dL_Amzi: float,
|
|
L_patch: Any,
|
|
xs_wg: str,
|
|
Rmax: int = 30,
|
|
Rmin: int = 10,
|
|
dL: float = 0.1,
|
|
w_arm_min: Optional[float] = None,
|
|
show_pins: bool=False,
|
|
sharp_patch: bool=True) -> None:
|
|
|
|
if (name==None):
|
|
instantiate = False
|
|
else :
|
|
instantiate = True
|
|
|
|
if (w_arm_min==None):
|
|
w_arm_min = w_arm
|
|
|
|
BS = __cell_arg__(arg=BS,arg_name="BS1",func_name="mxpic::functional::MZI_2st_ubend")
|
|
|
|
with nd.Cell(name=name,instantiate=instantiate) as C:
|
|
|
|
EUB_90 = Clothoid(R=[Rmax,Rmin,Rmax],w=[w_wg,w_arm],A=[0,45,90],dL_wg=dL,end_patch=False)
|
|
EUB_180 = Clothoid(R=[Rmax,Rmin,Rmax],w=[w_arm,w_arm_min,w_arm],A=[0,90,180],dL_wg=dL,end_patch=False)
|
|
|
|
R90_eff = EUB_90.sz[0]
|
|
R180_eff = EUB_180.sz[1]
|
|
|
|
BS1 = BS.put('b1',-R90_eff-R180_eff/2-L_patch/2,BS.pin['b1'].y,180)
|
|
BS2 = BS.put('b1', R90_eff+R180_eff/2+L_patch/2,BS.pin['b1'].y,0,flip=1)
|
|
|
|
tl = nd.strt(length=L_patch/2,xs=xs_wg,width=BS1.pin['b1'].width).put(BS1.pin['b1'])
|
|
EUB_90.cell.put('a1',tl.pin['b0'],flip=0)
|
|
nd.strt(length=L_arm/2+dL_Amzi/2,xs=xs_wg,width=w_arm).put()
|
|
tl = EUB_180.cell.put(flip=1)
|
|
tr = nd.strt(length=abs(tl.pin['b1'].x-BS2.pin['b1'].x)-R90_eff,xs=xs_wg,width=BS2.pin['b1'].width).put(BS2.pin['b1'])
|
|
tr = EUB_90.cell.put('a1',tr.pin['b0'],flip=1)
|
|
nd.strt(length=abs(tr.pin['b1'].y - tl.pin['b1'].y),xs=xs_wg,width=w_arm).put(tr.pin['b1'])
|
|
|
|
tl = nd.strt(length=L_patch/2,xs=xs_wg,width=BS1.pin['b2'].width).put(BS1.pin['b2'])
|
|
EUB_90.cell.put('a1',tl.pin['b0'],flip=1)
|
|
nd.strt(length=L_arm/2,xs=xs_wg,width=w_arm).put()
|
|
tl = EUB_180.cell.put(flip=0)
|
|
|
|
tr = nd.strt(length=abs(tl.pin['b1'].x-BS2.pin['b2'].x)-R90_eff,xs=xs_wg,width=BS2.pin['b2'].width).put(BS2.pin['b2'])
|
|
tr = EUB_90.cell.put('a1',tr.pin['b0'],flip=0)
|
|
nd.strt(length=abs(tr.pin['b1'].y - tl.pin['b1'].y),xs=xs_wg,width=w_arm).put(tr.pin['b1'])
|
|
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
|
|
""" Plcaing b2 pin """
|
|
pin_in_name = []
|
|
for str,Pin in BS.ic_pins():
|
|
pin_in_name = pin_in_name+[str]
|
|
# pin_in_name.append(str)
|
|
|
|
if ('a2' in pin_in_name):
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.Pin(name='b2',pin=BS2.pin['a2']).put()
|
|
|
|
|
|
self.cell = C
|
|
|
|
class MZI_Ubend(MZI_NS_ubend):
|
|
def __init__(self,
|
|
name: str,
|
|
BS: Any,
|
|
L_arm: Any,
|
|
xs_wg: str='strip',
|
|
w_arm: float=1.0,
|
|
L_tp: int=10,
|
|
R_bend: int=10,
|
|
w_wg: float=0.45,
|
|
L_patch: float=0.5,
|
|
w_ht: float=0,
|
|
L_ht: int=0,
|
|
via_h2m: Any=None,
|
|
isl: Any=None,
|
|
show_pins: bool=False, D_port: Any=None, sharp_patch: bool=True,dual_ht: bool=False) -> None:
|
|
super().__init__(name=name, BS=BS, xs_wg=xs_wg,
|
|
w1=w_arm, w2=w_arm,
|
|
L0=(L_arm-L_tp*2)/3,
|
|
Ln=(L_arm-L_tp*2)/3,
|
|
Ls=(L_arm-L_tp*2)/3,
|
|
Ltp=L_tp,
|
|
R_bend=R_bend,
|
|
w_wg=w_wg,
|
|
L_patch=L_patch,
|
|
L12=0,
|
|
w_ht=w_ht,
|
|
L_ht=L_ht, via_h2m=via_h2m, isl=isl, show_pins=show_pins, D_port=D_port, sharp_patch=sharp_patch,dual_ht=dual_ht)
|
|
|
|
class MZI_Butterfly:
|
|
def __init__(self,
|
|
name: Optional[str]=None,
|
|
xs_wg: str='strip',
|
|
w_wg: float=0.45,
|
|
dL_AMZI: float=0,
|
|
L_arm: int=150,
|
|
L_inner: int = 10,
|
|
R_bend: int=10,
|
|
D_port: Any=None,
|
|
w_arm: float = 1.0,
|
|
|
|
xs_ht: str = 'heater',
|
|
w_ht: float=0,
|
|
Ltp: int = 15,
|
|
|
|
xs_metal: str = 'metal',
|
|
w_metal: float=10,
|
|
|
|
via_h2m: Any = None,
|
|
isl: Any = None,
|
|
|
|
outer_isl: bool = True,
|
|
dual_ht: bool=True,
|
|
L_patch: float = 0.5,
|
|
BS: Any=None,
|
|
BS2: Any=None,
|
|
sharp_patch: bool=True,
|
|
show_pins: bool=False) -> None:
|
|
self.name = name
|
|
if (name!=None):
|
|
self.instantiate = True
|
|
else:
|
|
self.instantiate = False
|
|
|
|
self.xs_wg = xs_wg
|
|
self.w_wg = w_wg
|
|
self.dL_Amzi = dL_AMZI
|
|
self.R_bend = R_bend
|
|
self.L_arm = L_arm
|
|
self.D_port = D_port
|
|
self.w_arm = w_arm
|
|
self.xs_heater = xs_ht
|
|
self.w_heater = w_ht
|
|
self.Ltp = Ltp
|
|
self.xs_metal = xs_metal
|
|
self.w_metal = w_metal
|
|
self.L_patch = L_patch
|
|
self.L_inner = L_inner
|
|
self.dual_ht = dual_ht
|
|
|
|
self.via_h2m = via_h2m
|
|
self.isl = isl
|
|
|
|
self.sharp_patch = sharp_patch
|
|
|
|
## revised in 2022.12.28, for general BS function
|
|
if (BS!=None and BS2==None):
|
|
BS2 = BS
|
|
cell_BS = __BS_generate__(BS=BS,xs=xs_wg,func_name="mxpic::functional::MZI_Butterfly")
|
|
cell_BS2 = __BS_generate__(BS=BS2,xs=xs_wg,func_name="mxpic::functional::MZI_Butterfly")
|
|
|
|
self.BS = cell_BS
|
|
self.BS2 = cell_BS2
|
|
|
|
self.cell = self.generate_gds(self)
|
|
|
|
|
|
def generate_gds(self,show_pin=False):
|
|
with nd.Cell(name=self.name,instantiate=self.instantiate) as C:
|
|
|
|
pic_strip = Route(radius=self.R_bend,width=self.w_wg,width2_mm=self.w_arm,sharp_patch=self.sharp_patch,
|
|
xs=self.xs_wg)
|
|
dY_BS1 = abs(self.BS.pin['b1'].y - self.BS.pin['b2'].y)
|
|
BS1 = self.BS.put('b1',-self.R_bend-self.L_inner/2,dY_BS1/2,180)
|
|
|
|
dY_BS2 = abs(self.BS2.pin['b1'].y - self.BS2.pin['b2'].y)
|
|
BS2 = self.BS2.put('b2',self.R_bend+self.L_inner/2,dY_BS2/2,0)
|
|
|
|
# print("BS1=%.3f BS2=%.3f" %(dY_BS1,dY_BS2))
|
|
|
|
LU = self.L_arm + self.dL_Amzi/2
|
|
HT_U = waveguide(w_heater=self.w_heater,L_wg=LU,L_heater=LU,
|
|
w_wg=self.w_arm,Ltp=self.Ltp,w_port=self.w_wg,
|
|
isl=self.isl,w_metal=self.w_metal,
|
|
via_h2m=self.via_h2m).cell.put('a1',-LU/2,dY_BS1/2+self.R_bend*4+self.L_patch,0)
|
|
|
|
pic_strip.ubend_route(pin=BS1.pin['b1'],length=self.L_patch/2,offset=self.R_bend*2).put()
|
|
pic_strip.ubend_p2p(pin2=HT_U.pin['a1'],length=self.L_patch/2).put()
|
|
|
|
pic_strip.ubend_route(pin=BS2.pin['b2'],length=self.L_patch/2,offset=self.R_bend*2).put(flip=1)
|
|
pic_strip.ubend_p2p(pin2=HT_U.pin['b1'],length=self.L_patch/2).put()
|
|
|
|
if (self.w_heater>0):
|
|
nd.Pin(name="ep1",pin=HT_U.pin['ep1']).put()
|
|
nd.Pin(name="en1",pin=HT_U.pin['en1']).put()
|
|
|
|
LD = self.L_arm
|
|
if(self.dual_ht):
|
|
w_ht_d = self.w_heater
|
|
else:
|
|
w_ht_d = 0
|
|
HT_D = waveguide(w_heater=w_ht_d,L_wg=LD,L_heater=LD,
|
|
w_wg=self.w_arm,Ltp=self.Ltp,w_port=self.w_wg,
|
|
isl=self.isl,
|
|
via_h2m=self.via_h2m).cell.put('a1',-LD/2,-dY_BS1/2-self.R_bend*4-self.L_patch,0)
|
|
|
|
if (w_ht_d>0 and self.dual_ht):
|
|
nd.Pin(name="ep2",pin=HT_D.pin['ep1']).put()
|
|
nd.Pin(name="en2",pin=HT_D.pin['en1']).put()
|
|
|
|
pic_strip.ubend_route(pin=BS1.pin['b2'],length=self.L_patch/2,offset=self.R_bend*2).put(flip=1)
|
|
pic_strip.ubend_p2p(pin2=HT_D.pin['a1'],length=self.L_patch/2).put()
|
|
|
|
pic_strip.ubend_route(pin=BS2.pin['b1'],length=self.L_patch/2,offset=self.R_bend*2).put()
|
|
pic_strip.ubend_p2p(pin2=HT_D.pin['b1'],length=self.L_patch/2).put()
|
|
|
|
|
|
""" Placing Input and Output ports """
|
|
|
|
pin_in_name = []
|
|
for str,Pin in self.BS.ic_pins():
|
|
pin_in_name = pin_in_name+[str]
|
|
|
|
if ('a2' in pin_in_name):
|
|
if (self.D_port==None):
|
|
nd.Pin(name='a2',pin=BS1.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=self.xs_wg).put(BS1.pin['a2'])
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS1.pin['a2'].width,xs=self.xs_wg).put(BS1.pin['a1'])
|
|
|
|
elif(isinstance(self.D_port,int) or isinstance(self.D_port,float)):
|
|
temp = pic_strip.sbend_route(pin=BS1.pin['a1'],length1=self.L_patch/4,length2=self.L_patch/4,
|
|
offset=abs(self.D_port/2-abs(BS1.pin['a1'].y))).put(flip=1)
|
|
nd.Pin(name='a1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic_strip.sbend_route(pin=BS1.pin['a2'],length1=self.L_patch/4,length2=self.L_patch/4,
|
|
offset=abs(self.D_port/2-abs(BS1.pin['a2'].y))).put(flip=0)
|
|
nd.Pin(name='a2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
else :
|
|
nd.Pin(name='a1',pin=BS1.pin['a1']).put()
|
|
|
|
pin_out_name = []
|
|
|
|
for str,Pin in self.BS2.ic_pins():
|
|
pin_out_name = pin_out_name+[str]
|
|
|
|
if ('a2' in pin_out_name):
|
|
if (self.D_port==None):
|
|
nd.Pin(name='b2',pin=BS2.pin['a1']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=self.xs_wg).put(BS2.pin['a2'])
|
|
nd.Pin(name='b1',pin=BS2.pin['a2']).put()
|
|
nd.strt(length=0.005,width=BS2.pin['a2'].width,xs=self.xs_wg).put(BS2.pin['a1'])
|
|
|
|
elif(isinstance(self.D_port,int) or isinstance(self.D_port,float)):
|
|
|
|
temp = pic_strip.sbend_route(pin=BS2.pin['a2'],length1=self.L_patch/4,length2=self.L_patch/4,
|
|
offset=abs(self.D_port/2-abs(BS2.pin['a1'].y))).put(flip=0)
|
|
nd.Pin(name='b1',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
|
|
temp = pic_strip.sbend_route(pin=BS2.pin['a1'],length1=self.L_patch/4,length2=self.L_patch/4,
|
|
offset=abs(self.D_port/2-abs(BS2.pin['a2'].y))).put(flip=1)
|
|
nd.Pin(name='b2',pin=temp.pin['b0'].move(-0.05,0,0)).put()
|
|
else:
|
|
raise Exception("ERROR:: In <mxpic::functionalll::MZI>, <D_port> type error")
|
|
|
|
else :
|
|
nd.Pin(name='b1',pin=BS2.pin['a1']).put()
|
|
|
|
|
|
return C
|
|
|
|
def generate_test_gds(self,dXgc2gc,dYgc2gc,gc,w_wg=0.5,R_bend=10,name=None):
|
|
if (isinstance(gc,nd.Cell)) :
|
|
gc_cell = gc
|
|
elif (hasattr(gc,"cell")):
|
|
gc_cell = gc.cell
|
|
|
|
gds_name = None
|
|
if (name is None):instantiate = False
|
|
else:instantiate = True
|
|
|
|
with nd.Cell(name=name,instantiate=instantiate) as C:
|
|
|
|
if ("g1" in gc_cell.pin):
|
|
pin_gc = "g1"
|
|
elif ("a0" in gc_cell.pin):
|
|
pin_gc = "a0"
|
|
|
|
GC1Instr = gc_cell.put(pin_gc,0,0,180)
|
|
GC2Instr = gc_cell.put(pin_gc,dXgc2gc,0,0)
|
|
|
|
""" Placing GC inputs """
|
|
if ("a2" in self.cell.pin):
|
|
GC3Instr = gc_cell.put(pin_gc,0,dYgc2gc,180)
|
|
|
|
if ("b2" in self.cell.pin):
|
|
GC4Instr = gc_cell.put(pin_gc,dXgc2gc,dYgc2gc,0)
|
|
dYcell = abs(self.cell.pin['b1'].y - self.cell.pin['b2'].y)
|
|
dYoffset = -(dYcell - dYgc2gc)/2
|
|
else:
|
|
dYoffset = 0
|
|
|
|
dXcell = abs(self.cell.pin['a1'].x - self.cell.pin['b1'].x)
|
|
dXoffset = -(dXcell - dXgc2gc)/2
|
|
cellInstr = self.cell.put('a1',dXoffset,dYoffset,0,flip=1)
|
|
|
|
pic = Route(xs=self.xs_wg,width=w_wg,radius=R_bend,sharp_patch=self.sharp_patch)
|
|
|
|
pic.sbend_p2p(pin1=cellInstr.pin['a1'],pin2=GC1Instr.pin[pin_gc]).put()
|
|
pic.sbend_p2p(pin1=cellInstr.pin['b1'],pin2=GC2Instr.pin[pin_gc]).put()
|
|
|
|
if ("a2" in cellInstr.pin):
|
|
pic.sbend_p2p(pin1=cellInstr.pin['a2'],pin2=GC3Instr.pin[pin_gc]).put()
|
|
if ("b2" in cellInstr.pin):
|
|
pic.sbend_p2p(pin1=cellInstr.pin['b2'],pin2=GC4Instr.pin[pin_gc]).put()
|
|
|
|
return C
|
|
|