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

B136 #11

Merged
merged 2 commits into from
Mar 11, 2022
Merged

B136 #11

Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.3.6]

- change pin length from 100nm to 10nm

## [1.3.5](https://github.com/gdsfactory/ubc/pull/9)

- pins are compatible with siepic
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-e .
lygadgets
gdsfactory[full]==4.3.8
gdsfactory[full]==4.4.0
modes
2 changes: 0 additions & 2 deletions ubcpdk/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
y_adiabatic,
y_splitter,
bend_euler,
)
from ubcpdk.components.crossing import (
crossing,
ring_with_crossing,
)
Expand Down
3 changes: 2 additions & 1 deletion ubcpdk/components/add_fiber_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def add_fiber_array(
# c = gc_tm1550()
# print(c.get_ports_array())
# print(c.ports.keys())
c = pdk.straight()
# c = pdk.straight()
c = pdk.mzi()
c = add_fiber_array(component=c)
c.show()
21 changes: 14 additions & 7 deletions ubcpdk/components/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,46 @@ def y_splitter() -> Component:

import gdsfactory as gf
from gdsfactory.add_pins import add_pins_bbox_siepic
from ubcpdk.import_gds import import_gds
from ubcpdk.import_gds import import_gds_siepic_pins

from ubcpdk.components.straight import straight


dc_broadband_te = gf.partial(
import_gds,
import_gds_siepic_pins,
"ebeam_bdc_te1550.gds",
doc="Broadband directional coupler TE1550 50/50 power.",
)

dc_broadband_tm = gf.partial(
import_gds,
import_gds_siepic_pins,
"ebeam_bdc_tm1550.gds",
doc="Broadband directional coupler TM1550 50/50 power.",
)

dc_adiabatic = gf.partial(
import_gds,
import_gds_siepic_pins,
"ebeam_adiabatic_te1550.gds",
doc="Adiabatic directional coupler TE1550 50/50 power.",
)

y_adiabatic = gf.partial(
import_gds,
import_gds_siepic_pins,
"ebeam_y_adiabatic.gds",
doc="Adiabatic Y junction TE1550 50/50 power.",
)

y_splitter = gf.partial(
import_gds,
import_gds_siepic_pins,
"ebeam_y_1550.gds",
doc="Y junction TE1550 50/50 power.",
)
crossing = gf.partial(
import_gds_siepic_pins,
"ebeam_crossing4.gds",
doc="TE waveguide crossing.",
)


bend_euler = gf.partial(gf.components.bend_euler, decorator=add_pins_bbox_siepic)
mzi = gf.partial(
Expand All @@ -50,6 +56,7 @@ def y_splitter() -> Component:
ebeam_dc_halfring_straight = gf.partial(gf.components.coupler_ring)
ebeam_dc_te1550 = gf.partial(gf.components.coupler)
spiral = gf.partial(gf.components.spiral_external_io)
ring_with_crossing = gf.partial(gf.components.ring_single_dut, component=crossing)


if __name__ == "__main__":
Expand All @@ -63,7 +70,7 @@ def y_splitter() -> Component:
# print(c.ports.keys())
# c = straight()
# c = add_fiber_array(component=c)
c = mzi(splitter=y_splitter)
# c = mzi(splitter=y_splitter)
# c = gc_te1550()

# c = y_splitter()
Expand Down
18 changes: 0 additions & 18 deletions ubcpdk/components/crossing.py

This file was deleted.

67 changes: 35 additions & 32 deletions ubcpdk/import_gds.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,21 @@ def add_ports(component: Component) -> Component:
c.add_port(port)
return c


def add_ports_from_siepic_pins(
component: Component,
optical_pin_layer: Layer = LAYER.PORT,
electrical_pin_layer: Layer = LAYER.PORTE,
component: Component,
optical_pin_layer: Layer = LAYER.PORT,
electrical_pin_layer: Layer = LAYER.PORTE,
) -> Component:
"""Add ports from SiEPIC-type cells.
Looks for label, path pairs

Args:
component: component
optical_pin_layer: layer for optical pins
electrical_pin_layer: layer for electrical pins
"""
pin_layers = {
'optical': optical_pin_layer,
'electrical': electrical_pin_layer
}
Looks for label, path pairs

Args:
component: component
optical_pin_layer: layer for optical pins
electrical_pin_layer: layer for electrical pins
"""
pin_layers = {"optical": optical_pin_layer, "electrical": electrical_pin_layer}
from numpy import arctan2, degrees, isclose

# TODO: Add opt-in ports for Lumerical Interconnect simulations
Expand All @@ -114,12 +112,12 @@ def add_ports_from_siepic_pins(
label = l
labels.pop(i)
if label is None:
print(f'Warning: label not found for path: ({p1}, {p2})')
print(f"Warning: label not found for path: ({p1}, {p2})")
continue
if optical_pin_layer[0] in path.layers:
port_type = 'optical'
port_type = "optical"
elif electrical_pin_layer[0] in pin_layers:
port_type = 'electrical'
port_type = "electrical"
else:
continue

Expand All @@ -128,7 +126,7 @@ def add_ports_from_siepic_pins(
# If the port name is already used, add a number to it
i = 1
while port_name in c.ports:
port_name += f'_{i}'
port_name += f"_{i}"

angle = round(degrees(arctan2(p2[1] - p1[1], p2[0] - p1[0])) % 360)
port = Port(
Expand All @@ -137,34 +135,35 @@ def add_ports_from_siepic_pins(
width=path.widths[0][0],
orientation=angle,
layer=pin_layers[port_type],
port_type=port_type
port_type=port_type,
)

c.add_port(port)
return c


def add_siepic_labels(
component: Component,
component_name_label: str = None,
library: str = 'Design kits/ebeam',
label_layer: Layer = LAYER.DEVREC
component: Component,
component_name_label: str = None,
library: str = "Design kits/ebeam",
label_layer: Layer = LAYER.DEVREC,
) -> Component:
"""
Args:
component: component
component_name_label: name of component for SiEPIC label (defaults to component name)
library: Lumerical Interconnect library for SiEPIC label
label_layer: layer for writing SiEPIC labels
Args:
component: component
component_name_label: name of component for SiEPIC label (defaults to component name)
library: Lumerical Interconnect library for SiEPIC label
label_layer: layer for writing SiEPIC labels
"""
c = component

c.add_label(
text=f'Component={c.name if not component_name_label else component_name_label}',
text=f"Component={c.name if not component_name_label else component_name_label}",
position=c.center + (0, c.size_info.height / 6),
layer=label_layer,
)
c.add_label(
text=f'Lumerical_INTERCONNECT_library={library}',
text=f"Lumerical_INTERCONNECT_library={library}",
position=c.center - (0, c.size_info.height / 6),
layer=label_layer,
)
Expand All @@ -188,13 +187,17 @@ def add_siepic_labels(
add_pins_bbox_siepic,
gf.port.auto_rename_ports,
remove_pins,
add_ports_from_siepic_pins
add_ports_from_siepic_pins,
)

import_gds_siepic_pins = gf.partial(
gf.import_gds, gdsdir=PATH.gds, decorator=add_ports_renamed_siepic
)
import_gds_siepic_pins = gf.partial(gf.import_gds, gdsdir=PATH.gds, decorator=add_ports_renamed_siepic)


if __name__ == "__main__":
gdsname = "ebeam_crossing4.gds"
gdsname = "ebeam_y_1550.gds"
c = import_gds_siepic_pins(gdsname)
# print(c.ports)
c.show(show_ports=False)
2 changes: 1 addition & 1 deletion ubcpdk/tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LayerMapUbc:
WG2: Layer = (31, 0)
DEVREC: Layer = (68, 0)
LABEL: Layer = (10, 0)
PORT: Layer = (1, 10) # PinRec
PORT: Layer = (1, 10) # PinRec
PORTE: Layer = (1, 11) # PinRecM
FLOORPLAN: Layer = (99, 0)

Expand Down
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/bend_euler_92fd2590.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_adiabatic_te1550.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_bdc_te1550.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_bdc_tm1550.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_crossing4.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_y_1550.gds
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/ebeam_y_adiabatic.gds
Binary file not shown.
Binary file not shown.
Binary file modified ubcpdk/tests/test_components.gds/gds_ref/rotate_f258530e.gds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
settings:
changed:
component:
settings: {}
version: 0.0.1
decorator:
- function: add_ports_from_siepic_pins
- function: remove_pins
- function: auto_rename_ports
- - function: add_bbox_siepic
- function: add_pins_siepic
- function: add_siepic_labels
doc: TE waveguide crossing.
function: import_gds
gdsdir: gds
gdspath: ebeam_crossing4.gds
child: {}
default:
bend:
Expand All @@ -24,8 +33,17 @@ settings:
bend:
function: bend_euler
component:
settings: {}
version: 0.0.1
decorator:
- function: add_ports_from_siepic_pins
- function: remove_pins
- function: auto_rename_ports
- - function: add_bbox_siepic
- function: add_pins_siepic
- function: add_siepic_labels
doc: TE waveguide crossing.
function: import_gds
gdsdir: gds
gdspath: ebeam_crossing4.gds
coupler:
function: coupler_ring
gap: 0.2
Expand All @@ -40,5 +58,5 @@ settings:
info: {}
info_version: 2
module: gdsfactory.components.ring_single_dut
name: ring_single_dut_9c01015b
name: ring_single_dut_aa824f1c
version: 0.0.1