Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #228

Merged
merged 99 commits into from
Nov 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
9576c22
Merge pull request #204 from SiEPIC/SiEPIC.scripts.replace_cell
lukasc-ubc Feb 12, 2024
eba25af
wip #205
lukasc-ubc Feb 14, 2024
c71d2d9
Bump black in /klayout_dot_config/python/SiEPIC/tidy3d/requirements
dependabot[bot] Mar 20, 2024
08532fb
Update extend.py
lukasc-ubc Mar 23, 2024
35a1546
Update run-layout-tests.yml
lukasc-ubc Mar 23, 2024
88fbc52
Update run-layout-tests.yml
lukasc-ubc Mar 23, 2024
c391f54
Merge pull request #207 from SiEPIC/extend.find_components
lukasc-ubc Mar 23, 2024
1f25f51
Fix number of periods not passing to CDC model
mustafacc Mar 23, 2024
d78bd03
Merge branch 'master' of https://github.com/SiEPIC/SiEPIC-Tools
mustafacc Mar 23, 2024
498714a
Merge pull request #206 from SiEPIC/dependabot/pip/klayout_dot_config…
lukasc-ubc Mar 23, 2024
5458f2f
Fix OPICS loading contraDC element parameters
mustafacc Mar 24, 2024
077a2ba
Merge branch 'master' of https://github.com/SiEPIC/SiEPIC-Tools
mustafacc Mar 24, 2024
87faff8
opics fixes WIP
lukasc-ubc Mar 24, 2024
c5293e3
Update utils.py
lukasc-ubc Mar 24, 2024
bab30a5
Create pcell_python_GDSfactory2.lym
lukasc-ubc May 3, 2024
ba08aa4
Update run-layout-tests.yml
lukasc-ubc May 3, 2024
0e11b26
Update run-layout-tests.yml
lukasc-ubc May 3, 2024
8512017
Component min spacing (#210)
lukasc-ubc May 3, 2024
e2c8318
v0.5.7
lukasc-ubc May 3, 2024
f3637db
Update run-layout-tests.yml
lukasc-ubc May 9, 2024
7023aa5
Update docker-image.yml
lukasc-ubc May 9, 2024
b8fa9d2
verification: print error messages
lukasc-ubc May 9, 2024
c93ae0f
Update Functional Layout Check.lym
lukasc-ubc May 14, 2024
af8f3ad
verification fix
lukasc-ubc May 17, 2024
fc05bcc
v0.5.8
lukasc-ubc May 17, 2024
4fdbc5a
Update __init__.py
lukasc-ubc May 17, 2024
b657c2e
Update sampling.py
lukasc-ubc Jun 21, 2024
7b61ecd
v0.5.9
lukasc-ubc Jun 21, 2024
cf9897d
Update Dockerfile (#213)
seanlam-ece Jun 21, 2024
8148767
layout_waveguide2/3 update
lukasc-ubc Jul 1, 2024
b1de6cf
create_cell2 function
lukasc-ubc Jul 3, 2024
dab83d9
strip2rib pcell function
lukasc-ubc Jul 3, 2024
53bb742
make_pin: option for layer name
lukasc-ubc Jul 3, 2024
2691501
Create KLayout-SiEPIC-Tools Python Programming.ipynb
lukasc-ubc Jul 6, 2024
b5a6a0b
find_pins, hierarchical improvement (WIP)
lukasc-ubc Jul 6, 2024
5208aaf
cell.find_pin improvement
lukasc-ubc Jul 8, 2024
2b1e637
new load_layout function
lukasc-ubc Jul 8, 2024
9d0e835
new SiEPIC.utils.waveguide_length function
lukasc-ubc Jul 8, 2024
dec8aaf
sliver fix #214
lukasc-ubc Jul 8, 2024
2857971
verification: shapesoutside check, fix
lukasc-ubc Jul 13, 2024
3404bc6
v0.5.10
lukasc-ubc Jul 13, 2024
ab37a79
fixes to SiEPIC.scripts.connect_pins_with_waveguide
lukasc-ubc Jul 17, 2024
9b78557
netlist via Script, updated unit test
lukasc-ubc Jul 17, 2024
34d2e69
unit tests
lukasc-ubc Jul 17, 2024
f029312
unit testing
lukasc-ubc Jul 17, 2024
6aae38b
unit testing, SiEPIC.utils
lukasc-ubc Jul 17, 2024
0f4d0d2
Pin verification #215
lukasc-ubc Jul 18, 2024
4cf1be8
Pin verification #215 (fix)
lukasc-ubc Jul 18, 2024
76fbbc0
Update run-layout-tests.yml
lukasc-ubc Jul 19, 2024
c81b4c2
Unit testing: SiEPIC.scripts.instantiate_all_library_cells: add termi…
lukasc-ubc Jul 19, 2024
5b69b64
Update run-layout-tests.yml
lukasc-ubc Jul 19, 2024
c9911f8
Jupyter notebook, Programming
lukasc-ubc Jul 19, 2024
1491feb
Update extend.py
lukasc-ubc Jul 19, 2024
e7cc365
Update run-layout-tests.yml
lukasc-ubc Jul 19, 2024
85cd0d9
minor errors
lukasc-ubc Jul 23, 2024
c8aaea5
bezier bend, sbend, taper
lukasc-ubc Jul 25, 2024
425aa3d
Update __init__.py
lukasc-ubc Jul 25, 2024
ed2e2cf
bezier update
lukasc-ubc Jul 29, 2024
b9db833
fix menu Layout > Show selected components
lukasc-ubc Jul 29, 2024
43b3d59
Bézier curves, PCell
lukasc-ubc Jul 29, 2024
574bbd0
Update README.md
lukasc-ubc Oct 2, 2024
055eb7f
remove Radius check in Verification
lukasc-ubc Oct 9, 2024
224b115
simply loading PDK libraries
lukasc-ubc Oct 19, 2024
76b5122
Update test_load_libraries.py
lukasc-ubc Oct 19, 2024
25f3a59
Update run-layout-tests.yml
lukasc-ubc Oct 19, 2024
39c8fbe
Create python-publish.yml
lukasc-ubc Oct 19, 2024
d02200c
update scripts.load_klayout_library
lukasc-ubc Oct 19, 2024
2fbbc75
Update run-layout-tests.yml
lukasc-ubc Oct 19, 2024
b7c4e42
v0.5.14
lukasc-ubc Oct 19, 2024
16c3cbd
Merge branch 'load_klayout_library'
lukasc-ubc Oct 19, 2024
20fa0a2
Update python-publish.yml
lukasc-ubc Oct 19, 2024
b259f4a
benchmark 100 MZIs
lukasc-ubc Oct 20, 2024
678ec01
FaML function and tests
lukasc-ubc Oct 26, 2024
97cbf32
Merge pull request #224 from SiEPIC/FaML
lukasc-ubc Oct 26, 2024
91184bd
v0.5.15
lukasc-ubc Oct 26, 2024
294a491
pytest update
lukasc-ubc Oct 28, 2024
b9a1fc5
SiEPIC.utils.geometry.box_bezier_corners (new)
lukasc-ubc Oct 28, 2024
15b22df
Update .gitignore
lukasc-ubc Oct 28, 2024
c909c9e
Update scripts.py
lukasc-ubc Oct 28, 2024
d871d0d
Update layout.py
lukasc-ubc Oct 28, 2024
329f114
Update test_FaML.py
lukasc-ubc Oct 28, 2024
70e0279
SiEPIC.scripts.load_klayout_library: abs path
lukasc-ubc Oct 28, 2024
c0993d0
Merge pull request #225 from SiEPIC/dev
lukasc-ubc Oct 28, 2024
97f2fd0
Create check-path-length.yml
lukasc-ubc Oct 28, 2024
5f0f1b4
Update layout.py
lukasc-ubc Oct 28, 2024
f8c07d4
Update check-path-length.yml
lukasc-ubc Oct 28, 2024
3989cc8
fix for SiEPIC.scripts.replace_cell()
lukasc-ubc Oct 31, 2024
d2a5658
fix for SiEPIC.utils.layout.coupler_array()
lukasc-ubc Oct 31, 2024
c730283
version check
lukasc-ubc Oct 31, 2024
51be44f
remove temporary files
lukasc-ubc Oct 31, 2024
08ed14f
Merge pull request #226 from SiEPIC/dev
lukasc-ubc Oct 31, 2024
3c4a4f6
requirements
lukasc-ubc Oct 31, 2024
f70e85c
new: SiEPIC.scripts.layout_diff
lukasc-ubc Nov 4, 2024
0e2669a
Update __init__.py
lukasc-ubc Nov 4, 2024
f2cb25c
Update test_scripts_layout_diff.py
lukasc-ubc Nov 4, 2024
e150999
Merge pull request #227 from SiEPIC/version_check
lukasc-ubc Nov 4, 2024
178d416
test SiEPIC.utils.layout.coupler_array()
lukasc-ubc Nov 4, 2024
1eff6d0
v0.5.16
lukasc-ubc Nov 4, 2024
739a351
unit tests, remove temporary files
lukasc-ubc Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
layout_waveguide2/3 update
- docstring
- parameter checking: CML
- added option for drawing PinRec & DevRec layers in layout_waveguide3()
lukasc-ubc committed Jul 1, 2024
commit 8148767dbd066a6e1c8e545b4a60dfacf9d11953
174 changes: 88 additions & 86 deletions klayout_dot_config/python/SiEPIC/utils/layout.py
Original file line number Diff line number Diff line change
@@ -209,24 +209,24 @@ def layout_waveguide4(cell, dpath, waveguide_type, debug=False):
return waveguide_length


'''
Create a waveguide, in a specific technology
inputs
- cell: into which Cell we add the waveguide
from SiEPIC.utils import get_layout_variables
TECHNOLOGY, lv, layout, cell = get_layout_variables()
- pts
- params, obtained from load_Waveguides_by_Tech and Waveguides.XML
must be a primitive waveguide type containing <component> info
output:
- waveguide
- DevRec, PinRec
by Lukas Chrostowski
'''


def layout_waveguide3(cell, pts, params, debug=False):

def layout_waveguide3(cell, pts, params, debug=False, drawRec=True):
'''
Create a waveguide, in a specific technology
inputs
- cell: into which Cell we add the waveguide
from SiEPIC.utils import get_layout_variables
TECHNOLOGY, lv, layout, cell = get_layout_variables()
- pts: a list of pya.Points, in database units (e.g., nm)
- params, obtained from load_Waveguides_by_Tech and Waveguides.XML
must be a primitive waveguide type containing <component> info
output:
- waveguide
- DevRec, PinRec
by Lukas Chrostowski
'''
if debug:
print('SiEPIC.utils.layout.layout_waveguide3: ')

@@ -239,10 +239,18 @@ def layout_waveguide3(cell, pts, params, debug=False):
from SiEPIC.extend import to_itype
wg_width = to_itype(params['width'], dbu)
radius = float(params['radius'])
model = params['model']
if 'model' not in params.keys():
params['model'] = ''
cellName = 'Waveguide'
CML = params['CML']
waveguide_type = params['waveguide_type']
if 'CML' not in params.keys():
params['CML'] = ''
if 'bezier' not in params.keys():
params['adiabatic'] = False
params['bezier'] = ''
if 'waveguide_type' in params.keys():
waveguide_type = params['waveguide_type']
else:
waveguide_type = params['name']

if debug:
print(' - waveguide params: %s' % (params))
@@ -260,25 +268,15 @@ def layout_waveguide3(cell, pts, params, debug=False):

# Draw the marking layers
from SiEPIC.utils import angle_vector
LayerPinRecN = layout.layer(TECHNOLOGY['PinRec'])

make_pin(cell, 'opt1', pts[0], wg_width, LayerPinRecN, angle_vector(pts[0]-pts[1]) % 360)
make_pin(cell, 'opt2', pts[-1], wg_width, LayerPinRecN,
angle_vector(pts[-1]-pts[-2]) % 360)

from pya import Trans, Text, Path, Point

'''
t1 = Trans(angle_vector(pts[0]-pts[1])/90, False, pts[0])
cell.shapes(LayerPinRecN).insert(Path([Point(-10, 0), Point(10, 0)], wg_width).transformed(t1))
cell.shapes(LayerPinRecN).insert(Text("opt1", t1, 0.3/dbu, -1))

t = Trans(angle_vector(pts[-1]-pts[-2])/90, False, pts[-1])
cell.shapes(LayerPinRecN).insert(Path([Point(-10, 0), Point(10, 0)], wg_width).transformed(t))
cell.shapes(LayerPinRecN).insert(Text("opt2", t, 0.3/dbu, -1))
'''
if drawRec:
LayerPinRecN = layout.layer(TECHNOLOGY['PinRec'])
make_pin(cell, 'opt1', pts[0], wg_width, LayerPinRecN, angle_vector(pts[0]-pts[1]) % 360)
make_pin(cell, 'opt2', pts[-1], wg_width, LayerPinRecN,
angle_vector(pts[-1]-pts[-2]) % 360)
LayerDevRecN = layout.layer(TECHNOLOGY['DevRec'])

LayerDevRecN = layout.layer(TECHNOLOGY['DevRec'])
from pya import Trans, Text, Path, Point

# Compact model information
angle_vec = angle_vector(pts[0]-pts[1])/90
@@ -309,64 +307,68 @@ def layout_waveguide3(cell, pts, params, debug=False):

t = Trans(angle, False, pt3)
import re
CML = re.sub('design kits/', '', CML, flags=re.IGNORECASE)
# CML = CML.lower().replace('design kits/','') # lower: to make it case insensitive, in case WAVEGUIDES.XML contains "Design Kits/" rather than "Design kits/"
text = Text('Lumerical_INTERCONNECT_library=Design kits/%s' % CML, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt2)
text = Text('Component=%s' % model, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt5)
text = Text('cellName=%s' % cellName, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pts[0])
pts_txt = str([[round(p.to_dtype(dbu).x, 3), round(p.to_dtype(dbu).y, 3)]
for p in pts]).replace(', ', ',')
text = Text(
'Spice_param:wg_length=%.9f wg_width=%.3g points="%s" radius=%.3g' %
(waveguide_length*1e-6, wg_width*1e-9, pts_txt, radius*1e-6), t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt4)
text = Text(
'Length=%.3f (microns)' % (waveguide_length), t, 0.5*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt6)
text = Text('waveguide_type=%s' % waveguide_type, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
if params['CML']:
CML = re.sub('design kits/', '', params['CML'], flags=re.IGNORECASE)
# CML = CML.lower().replace('design kits/','') # lower: to make it case insensitive, in case WAVEGUIDES.XML contains "Design Kits/" rather than "Design kits/"
text = Text('Lumerical_INTERCONNECT_library=Design kits/%s' % CML, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt2)
text = Text('Component=%s' % params['model'], t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt5)
text = Text('cellName=%s' % cellName, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pts[0])

if drawRec:
pts_txt = str([[round(p.to_dtype(dbu).x, 3), round(p.to_dtype(dbu).y, 3)]
for p in pts]).replace(', ', ',')
text = Text(
'Spice_param:wg_length=%.9f wg_width=%.3g points="%s" radius=%.3g' %
(waveguide_length*1e-6, wg_width*1e-9, pts_txt, radius*1e-6), t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt4)
text = Text(
'Length=%.3f (microns)' % (waveguide_length), t, 0.5*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)
t = Trans(angle, False, pt6)
text = Text('waveguide_type=%s' % waveguide_type, t, 0.1*wg_width, -1)
text.halign = halign
shape = cell.shapes(LayerDevRecN).insert(text)

return waveguide_length


'''
Create a waveguide, in a specific technology
inputs
- TECHNOLOGY, layout, cell:
from SiEPIC.utils import get_layout_variables
TECHNOLOGY, lv, layout, cell = get_layout_variables()
- layers: list of text names, e.g., ['Waveguide']
- widths: list of floats in units Microns, e.g., [0.50]
- offsets: list of floats in units Microns, e.g., [0]
- pts: a list of pya.Points, e.g.
L=15/dbu
pts = [Point(0,0), Point(L,0), Point(L,L)]
- radius: in Microns, e.g., 5
- adiab: 1 = Bezier curve, 0 = radial bend (arc)
- bezier: the bezier parameter, between 0 and 0.45 (almost a radial bend)
- sbends (optional): sbends (Boolean)
Note: bezier parameters need to be simulated and optimized, and will depend on
wavelength, polarization, width, etc. TM and rib waveguides don't benefit from bezier curves
most useful for TE
by Lukas Chrostowski
'''


def layout_waveguide2(TECHNOLOGY, layout, cell, layers, widths, offsets, pts, radius, adiab, bezier, sbends = True):
'''
Create a waveguide, in a specific technology
inputs
- TECHNOLOGY, layout, cell:
from SiEPIC.utils import get_layout_variables
TECHNOLOGY, lv, layout, cell = get_layout_variables()
- layers: list of text names, e.g., ['Waveguide']
- widths: list of floats in units Microns, e.g., [0.50]
- offsets: list of floats in units Microns, e.g., [0]
- pts: a list of pya.Points, in database units (e.g., nm)
e.g.
L=15/dbu
pts = [Point(0,0), Point(L,0), Point(L,L)]
- radius: in Microns, e.g., 5
- adiab: 1 = Bezier curve, 0 = radial bend (arc)
- bezier: the bezier parameter, between 0 and 0.45 (almost a radial bend)
- sbends (optional): sbends (Boolean)
Note: bezier parameters need to be simulated and optimized, and will depend on
wavelength, polarization, width, etc. TM and rib waveguides don't benefit from bezier curves
most useful for TE
by Lukas Chrostowski
'''
from SiEPIC.utils import arc_xy, arc_bezier, angle_vector, angle_b_vectors, inner_angle_b_vectors, translate_from_normal
from SiEPIC.extend import to_itype
from SiEPIC.utils.geometry import bezier_parallel