Folder structure simplfied

This commit is contained in:
=
2026-06-06 16:43:26 +08:00
parent 8da92ced57
commit 8a17f1dde0
138 changed files with 10429 additions and 1432 deletions
+298 -6
View File
@@ -5,20 +5,74 @@ import numpy as np
from . import taper
from ...structures import *
from ...geometry import *
from ...routing import Route
# import nazca.interconnects as IC
# class Route(IC.Interconnect):
# pass
from ...structures import _my_polygon
from ...geometry import _my_polygon
from ...basic import __cell_arg__
class ring_bus_wg :
## two types:
## DC, BDC
"""
ring bus wg primitive component.
This component builds the ring bus wg layout cell.
Parameters
----------
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
R_cp : int, optional
Radius parameter in microns. Default is 20.
w_bus : float, optional
Width parameter in microns. Default is 0.5.
bend_DC : bool, optional
Value for the bend_DC parameter. Default is True.
w_wg : float, optional
Width parameter in microns. Default is 0.5.
dLc : float, optional
Value for the dLc parameter. Default is 10.
dAc : float, optional
Value for the dAc parameter. Default is 10.
euler_transistion : bool, optional
Value for the euler_transistion parameter. Default is False.
dL_trans : float, optional
Value for the dL_trans parameter. Default is 10.
dA_trans : float, optional
Value for the dA_trans parameter. Default is 30.
R_max_trans : int, optional
Radius parameter in microns. Default is 100.
w_trans : float, optional
Width parameter in microns. Default is 0.5.
euler_anti_bend : bool, optional
Value for the euler_anti_bend parameter. Default is False.
R_max_anti : int, optional
Radius parameter in microns. Default is 100.
R_min_anti : int, optional
Radius parameter in microns. Default is 10.
A_anti : Any, optional
Angle parameter in degrees. Default is None.
res : float, optional
Value for the res parameter. Default is 0.1.
wg_Ltp : int, optional
Value for the wg_Ltp parameter. Default is 5.
dL_p2p : Optional[float], optional
Value for the dL_p2p parameter. Default is None.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
end_patch : bool, optional
Value for the end_patch parameter. Default is False.
clothoid_order : int, optional
Value for the clothoid_order parameter. Default is 1.
"""
def __init__(self,
xs: str='strip',
R_cp: int = 20,
@@ -183,6 +237,68 @@ class ring_bus_wg :
class ADC_STD_2x2:
"""
ADC STD 2x2 primitive component.
This component builds the ADC STD 2x2 layout cell.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
wu0 : float, optional
Value for the wu0 parameter. Default is 0.45.
wu1 : float, optional
Value for the wu1 parameter. Default is 0.61.
wu_in : float, optional
Value for the wu_in parameter. Default is 0.45.
wu_out : float, optional
Value for the wu_out parameter. Default is 0.8.
wd0 : float, optional
Value for the wd0 parameter. Default is 0.33.
wd1 : float, optional
Value for the wd1 parameter. Default is 0.2.
wd_in : float, optional
Value for the wd_in parameter. Default is 0.45.
wd_out : float, optional
Value for the wd_out parameter. Default is 0.8.
Lu : int, optional
Length parameter in microns. Default is 33.
Ld : int, optional
Length parameter in microns. Default is 33.
angle : float, optional
Angle parameter in degrees. Default is 20.
g0 : float, optional
Value for the g0 parameter. Default is 0.2.
g1 : float, optional
Value for the g1 parameter. Default is 0.2.
sbend_type : str, optional
Value for the sbend_type parameter. Default is 'euler'.
Rmax : Any, optional
Radius parameter in microns. Default is None.
Rmin : int, optional
Radius parameter in microns. Default is 5.
Ru0 : int, optional
Radius parameter in microns. Default is 0.
Ru1 : int, optional
Radius parameter in microns. Default is 20.
Rd0 : int, optional
Radius parameter in microns. Default is 20.
Rd1 : int, optional
Radius parameter in microns. Default is 0.
tp_angle : int, optional
Value for the tp_angle parameter. Default is 2.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
euler_points : int, optional
Value for the euler_points parameter. Default is 64.
res : float, optional
Value for the res parameter. Default is 0.1.
"""
def __init__ (self,
name: Optional[str] = None,
xs: str='strip',
@@ -504,6 +620,42 @@ class ADC_STD_2x2:
class DC(ADC_STD_2x2):
"""
DC primitive component.
This component builds the DC layout cell.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
w_cp : float, optional
Width parameter in microns. Default is 0.45.
w_wg : float, optional
Width parameter in microns. Default is 0.45.
L_cp : float, optional
Length parameter in microns. Default is 30.
angle : float, optional
Angle parameter in degrees. Default is 20.
gap : float, optional
Spacing or gap parameter in microns. Default is 0.2.
sbend_type : str, optional
Value for the sbend_type parameter. Default is 'circular'.
Rmax : float, optional
Radius parameter in microns. Default is None.
Rmin : float, optional
Radius parameter in microns. Default is 5.
R0 : float, optional
Radius parameter in microns. Default is 10.
tp_angle : float, optional
Value for the tp_angle parameter. Default is 2.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
"""
def __init__(self,
name: Optional[str] = None,
xs:str='strip',
@@ -580,6 +732,38 @@ class DC(ADC_STD_2x2):
return C
class BS_tdc(ADC_STD_2x2):
"""
BS tdc primitive component.
This component builds the BS tdc layout cell.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
wa0 : float, optional
Value for the wa0 parameter. Default is 0.35.
wa1 : float, optional
Value for the wa1 parameter. Default is 0.45.
wb0 : float, optional
Value for the wb0 parameter. Default is 0.55.
wb1 : float, optional
Value for the wb1 parameter. Default is 0.45.
w_wg : float, optional
Width parameter in microns. Default is 0.45.
gap : float, optional
Spacing or gap parameter in microns. Default is 0.2.
Lt : float, optional
Length parameter in microns. Default is 20.
R0 : float, optional
Radius parameter in microns. Default is 30.
angle : float, optional
Angle parameter in degrees. Default is 15.
sbend_type : str, optional
Value for the sbend_type parameter. Default is 'circle'.
"""
def __init__(self,
name: Optional[str]=None,
xs:str ='strip',
@@ -622,6 +806,52 @@ class BS_tdc(ADC_STD_2x2):
class MDM(ADC_STD_2x2):
"""
MDM primitive component.
This component builds the MDM layout cell.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
xs : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
wb0 : float, optional
Value for the wb0 parameter. Default is 0.45.
wb1 : float, optional
Value for the wb1 parameter. Default is 0.61.
wb_in : float, optional
Value for the wb_in parameter. Default is 0.45.
wb_out : float, optional
Value for the wb_out parameter. Default is 0.88.
w_wg : float, optional
Width parameter in microns. Default is 0.45.
w0 : float, optional
Width parameter in microns. Default is 0.33.
w1 : float, optional
Width parameter in microns. Default is 0.2.
gap0 : float, optional
Spacing or gap parameter in microns. Default is 0.2.
Lt_bus : float, optional
Length parameter in microns. Default is 20.
R0 : float, optional
Radius parameter in microns. Default is 40.
angle : float, optional
Angle parameter in degrees. Default is 22.5.
Lt_cp : float, optional
Length parameter in microns. Default is None.
gap1 : float, optional
Spacing or gap parameter in microns. Default is None.
Lb0 : float, optional
Length parameter in microns. Default is None.
symmetric_BUS : bool, optional
Value for the symmetric_BUS parameter. Default is True.
single_end : bool, optional
Value for the single_end parameter. Default is True.
Rmin : float, optional
Radius parameter in microns. Default is 8.
"""
def __init__(self,
name: Optional[str] = None,
xs:str='strip',
@@ -749,10 +979,34 @@ class MDM(ADC_STD_2x2):
class DC_bend :
'''
This is a class for bend directional coupler for broadband and fabrication tolerant power splitting.
Written by HU GAOLEI at 2022.5.15.
'''
"""
This is a class for bend directional coupler for broadband and fabrication tolerant power splitting.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
w_in : float, optional
Width parameter in microns. Default is 0.45.
w_out : float, optional
Width parameter in microns. Default is 0.45.
gap : float, optional
Spacing or gap parameter in microns. Default is 0.2.
r_in : float, optional
Radius parameter in microns. Default is 40.
theta_arc : float, optional
Angle parameter in degrees. Default is 30.
w_wg : float, optional
Width parameter in microns. Default is 0.45.
theta_ext : float, optional
Angle parameter in degrees. Default is 15.
xs_wg : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
show_pins : bool, optional
Whether to draw pin markers in the generated layout. Default is False.
"""
def __init__(
self,
@@ -903,6 +1157,44 @@ class DC_bend :
class DC_pX_3sg:
"""
DC pX 3sg primitive component.
This component builds the DC pX 3sg layout cell.
Parameters
----------
name : Optional[str], optional
Unique identifier for the device cell. Default is None.
xs_wg : str, optional
Layer or cross-section name used by the device. Default is 'strip'.
Lc1 : float, optional
Length parameter in microns. Default is 10.
Lp1 : float, optional
Length parameter in microns. Default is 5.
Lc2 : float, optional
Length parameter in microns. Default is 10.
Lt : float, optional
Length parameter in microns. Default is 1.
w_cp : float, optional
Width parameter in microns. Default is 0.5.
dw : float, optional
Value for the dw parameter. Default is 0.1.
gap : float, optional
Spacing or gap parameter in microns. Default is 0.2.
R0 : float, optional
Radius parameter in microns. Default is 10.
A : float, optional
Angle parameter in degrees. Default is 15.
w_wg : float, optional
Width parameter in microns. Default is 0.45.
pX_type : str, optional
Value for the pX_type parameter. Default is 'symmetric'.
port_symmetric : bool, optional
Value for the port_symmetric parameter. Default is True.
sharp_patch : bool, optional
Whether to add geometry patches for sharp corners or cladding continuity. Default is True.
"""
def __init__(self,
name: Optional[str] = None,
xs_wg:str='strip',