Skip to content

Commit

Permalink
Merge pull request #53 from gdsfactory/update_gdsfactory852
Browse files Browse the repository at this point in the history
update to gdsfactory 8.5.2
  • Loading branch information
joamatab authored Jul 16, 2024
2 parents 5756029 + 4ceefc9 commit f76f172
Show file tree
Hide file tree
Showing 34 changed files with 85 additions and 38 deletions.
8 changes: 3 additions & 5 deletions cspdk/si220/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def straight(
straight_so = partial(straight, cross_section="xs_so")
straight_rc = partial(straight, cross_section="xs_rc")
straight_ro = partial(straight, cross_section="xs_ro")
straight_metal = partial(straight, cross_section="metal_routing")

################
# Bends
Expand Down Expand Up @@ -98,6 +99,7 @@ def bend_euler(
bend_so = partial(bend_euler, cross_section="xs_so")
bend_rc = partial(bend_euler, cross_section="xs_rc")
bend_ro = partial(bend_euler, cross_section="xs_ro")
bend_metal = partial(bend_euler, cross_section="metal_routing")

################
# Transitions
Expand Down Expand Up @@ -743,8 +745,6 @@ def heater() -> Component:
def crossing_so() -> Component:
"""SOI220nm_1310nm_TE_STRIP_Waveguide_Crossing fixed cell."""
c = gf.import_gds(PATH.gds / "SOI220nm_1310nm_TE_STRIP_Waveguide_Crossing.gds")
c.flatten()

xc = 493.47
dx = 8.47 / 2
x = xc - dx
Expand All @@ -764,7 +764,6 @@ def crossing_so() -> Component:
def crossing_rc() -> Component:
"""SOI220nm_1550nm_TE_RIB_Waveguide_Crossing fixed cell."""
c = gf.import_gds(PATH.gds / "SOI220nm_1550nm_TE_RIB_Waveguide_Crossing.gds")
c.flatten()
xc = 404.24
dx = 9.24 / 2
x = xc - dx
Expand All @@ -785,7 +784,6 @@ def crossing_rc() -> Component:
def crossing_sc() -> Component:
"""SOI220nm_1550nm_TE_STRIP_Waveguide_Crossing fixed cell."""
c = gf.import_gds(PATH.gds / "SOI220nm_1550nm_TE_STRIP_Waveguide_Crossing.gds")
c.flatten()
xc = 494.24
yc = 800
dx = 9.24 / 2
Expand Down Expand Up @@ -836,5 +834,5 @@ def array(


if __name__ == "__main__":
t = grating_coupler_rectangular_rc()
t = crossing_sc()
t.show()
2 changes: 1 addition & 1 deletion cspdk/si220/samples/circuit_simulations_sc_with_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mzi2 = c << cells.mzi_sc(delta_length=100)
mzi2.dmove((200, 200))
# route = tech.route_single_sc(c, mzi1.ports["o2"], mzi2.ports["o1"])
route = tech.route_bundle_sc(c, [mzi1.ports["o2"]], [mzi2.ports["o1"]])
route = tech.route_bundle(c, [mzi1.ports["o2"]], [mzi2.ports["o1"]])
c.add_port(name="o1", port=mzi1.ports["o1"])
c.add_port(name="o2", port=mzi2.ports["o2"])
c.show()
Expand Down
48 changes: 30 additions & 18 deletions cspdk/si220/tech.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,21 @@ def xs_sc_heater_metal(width=Tech.width_sc, **kwargs) -> gf.CrossSection:
return xs


def metal_routing(width=10.0, **kwargs) -> gf.CrossSection:
kwargs["layer"] = kwargs.get("layer", LAYER.PAD)
kwargs["port_names"] = kwargs.get(
"port_names", gf.cross_section.port_names_electrical
)
kwargs["port_types"] = kwargs.get(
"port_types", gf.cross_section.port_types_electrical
)
kwargs["radius"] = kwargs.get("radius", 0)
kwargs["radius_min"] = kwargs.get("radius_min", kwargs["radius"])
xs = gf.cross_section.strip_heater_metal(width=width, **kwargs)
def metal_routing(
width=10.0,
radius: float = 10,
) -> gf.CrossSection:
xs = gf.cross_section.metal1(width=width, radius=radius, layer=LAYER.PAD)
if xs.name in DEFAULT_CROSS_SECTION_NAMES:
xs._name = DEFAULT_CROSS_SECTION_NAMES[xs.name]
return xs


def heater_metal(width=4.0, **kwargs) -> gf.CrossSection:
kwargs["layer"] = kwargs.get("layer", LAYER.HEATER)
xs = metal_routing(width=width, **kwargs).copy()
def heater_metal(
width=4.0,
radius: float = 10,
) -> gf.CrossSection:
xs = gf.cross_section.metal1(width=width, radius=radius, layer=LAYER.HEATER)
if xs.name in DEFAULT_CROSS_SECTION_NAMES:
xs._name = DEFAULT_CROSS_SECTION_NAMES[xs.name]
return xs
Expand Down Expand Up @@ -269,7 +265,7 @@ def route_bundle(
cross_section: CrossSectionSpec = "xs_sc",
straight: ComponentSpec = "straight_sc",
bend: ComponentSpec = "bend_sc",
taper: ComponentSpec = "taper_sc",
taper: ComponentSpec | None = "taper_sc",
) -> list[OpticalManhattanRoute]:
return gf.routing.route_bundle(
component=component,
Expand Down Expand Up @@ -353,6 +349,20 @@ def route_bundle(
taper="taper_ro",
cross_section="xs_ro",
),
route_bundle_metal=partial(
route_bundle,
straight="straight_metal",
bend="bend_metal",
taper=None,
cross_section="metal_routing",
),
route_bundle_metal_corner=partial(
route_bundle,
straight="straight_metal",
bend="wire_corner",
taper=None,
cross_section="metal_routing",
),
)

if __name__ == "__main__":
Expand All @@ -373,6 +383,8 @@ def route_bundle(
connectivity=connectivity,
)
t.write_tech(tech_dir=PATH.klayout)
print(DEFAULT_CROSS_SECTION_NAMES)
print(xs_sc() is xs_sc())
print(xs_sc().name, xs_sc().name)
# print(DEFAULT_CROSS_SECTION_NAMES)
# print(xs_sc() is xs_sc())
# print(xs_sc().name, xs_sc().name)
# c = gf.c.bend_euler(cross_section="metal_routing")
# c.pprint_ports()
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ authors = [
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent"
]
dependencies = [
"gdsfactory~=8.5.0",
"gdsfactory~=8.5.3",
"gplugins[sax]>=1,<2"
]
description = "CornerStone PDK"
Expand Down
Binary file modified tests/gds_ref_si220/array.gds
Binary file not shown.
Binary file added tests/gds_ref_si220/bend_metal.gds
Binary file not shown.
Binary file removed tests/gds_ref_si220/grating_coupler_array.oas
Binary file not shown.
Binary file added tests/gds_ref_si220/straight_metal.gds
Binary file not shown.
Binary file removed tests/gds_ref_si220/straight_sc.oas
Binary file not shown.
Binary file removed tests/gds_ref_si220/taper_sc.oas
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi1x2.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi1x2_rc.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi1x2_ro.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi2x2.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi2x2_rc.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mmi2x2_ro.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mzi.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mzi_rc.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/mzi_ro.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/taper.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/taper_rc.gds
Binary file not shown.
Binary file modified tests/gds_ref_si500/taper_ro.gds
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_netlists_si220.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand Down
5 changes: 5 additions & 0 deletions tests/test_netlists_si220/test_netlists_bend_metal_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instances: {}
name: bend_euler_RNone_A90_P0_3e16ea58
nets: []
placements: {}
ports: {}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ instances:
n_periods: 60
period: 0.63
wavelength: 1.55
name: grating_coupler_array_P_72908cae
name: grating_coupler_array_P_672610bf
nets: []
placements:
grating_coupler_rectang_ed54bb3e_-190500_-193900:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_netlists_si220/test_netlists_straight_metal_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instances: {}
name: straight_L10_WNone_CSme_3feaad2d
nets: []
placements: {}
ports: {}
3 changes: 1 addition & 2 deletions tests/test_netlists_si500.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
gf.clear_cache()
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand Down
10 changes: 5 additions & 5 deletions tests/test_netlists_sin300.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand All @@ -34,13 +34,13 @@ def _get_instance(inst):


def instances_without_info(net):
ret = {}
for k, v in net.get("instances", {}).items():
ret[k] = {
return {
k: {
"component": v.get("component", ""),
"settings": v.get("settings", {}),
}
return ret
for k, v in net.get("instances", {}).items()
}


@pytest.mark.parametrize("name", cells)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pdk_si220.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand Down
16 changes: 16 additions & 0 deletions tests/test_pdk_si220/test_settings_bend_metal_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
info:
dy: 10
length: 16.637
min_bend_radius: 7.061
radius: 10
route_info_length: 16.637
route_info_metal_routing_length: 16.637
route_info_min_bend_radius: 7.061
route_info_n_bend_90: 1
route_info_type: metal_routing
route_info_weight: 16.637
name: bend_euler_RNone_A90_P0_3e16ea58
settings:
angle: 90
cross_section: metal_routing
p: 0.5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
info: {}
name: grating_coupler_array_P_72908cae
name: grating_coupler_array_P_672610bf
settings:
centered: true
cross_section: xs_sc
Expand Down
11 changes: 11 additions & 0 deletions tests/test_pdk_si220/test_settings_straight_metal_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
info:
length: 10
route_info_length: 10
route_info_metal_routing_length: 10
route_info_type: metal_routing
route_info_weight: 10
width: 10
name: straight_L10_WNone_CSme_3feaad2d
settings:
cross_section: metal_routing
length: 10
2 changes: 1 addition & 1 deletion tests/test_pdk_si500.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_pdk_sin300.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@pytest.fixture(autouse=True)
def activate_pdk():
def activate_pdk() -> None:
PDK.activate()
gf.clear_cache()

Expand Down

0 comments on commit f76f172

Please sign in to comment.