diff --git a/cspdk/si220/cells.py b/cspdk/si220/cells.py index ddd64fa..a5c2a1d 100644 --- a/cspdk/si220/cells.py +++ b/cspdk/si220/cells.py @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -836,5 +834,5 @@ def array( if __name__ == "__main__": - t = grating_coupler_rectangular_rc() + t = crossing_sc() t.show() diff --git a/cspdk/si220/samples/circuit_simulations_sc_with_routing.py b/cspdk/si220/samples/circuit_simulations_sc_with_routing.py index 1b40b43..9704eae 100644 --- a/cspdk/si220/samples/circuit_simulations_sc_with_routing.py +++ b/cspdk/si220/samples/circuit_simulations_sc_with_routing.py @@ -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() diff --git a/cspdk/si220/tech.py b/cspdk/si220/tech.py index e08b6b3..c876a70 100644 --- a/cspdk/si220/tech.py +++ b/cspdk/si220/tech.py @@ -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 @@ -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, @@ -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__": @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 4ff4140..bc1925f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/tests/gds_ref_si220/array.gds b/tests/gds_ref_si220/array.gds index 1f95853..df24132 100644 Binary files a/tests/gds_ref_si220/array.gds and b/tests/gds_ref_si220/array.gds differ diff --git a/tests/gds_ref_si220/bend_metal.gds b/tests/gds_ref_si220/bend_metal.gds new file mode 100644 index 0000000..d433446 Binary files /dev/null and b/tests/gds_ref_si220/bend_metal.gds differ diff --git a/tests/gds_ref_si220/grating_coupler_array.oas b/tests/gds_ref_si220/grating_coupler_array.oas deleted file mode 100644 index 6f2cbe6..0000000 Binary files a/tests/gds_ref_si220/grating_coupler_array.oas and /dev/null differ diff --git a/tests/gds_ref_si220/straight_metal.gds b/tests/gds_ref_si220/straight_metal.gds new file mode 100644 index 0000000..eeb5cce Binary files /dev/null and b/tests/gds_ref_si220/straight_metal.gds differ diff --git a/tests/gds_ref_si220/straight_sc.oas b/tests/gds_ref_si220/straight_sc.oas deleted file mode 100644 index 9d44493..0000000 Binary files a/tests/gds_ref_si220/straight_sc.oas and /dev/null differ diff --git a/tests/gds_ref_si220/taper_sc.oas b/tests/gds_ref_si220/taper_sc.oas deleted file mode 100644 index 68cac4c..0000000 Binary files a/tests/gds_ref_si220/taper_sc.oas and /dev/null differ diff --git a/tests/gds_ref_si500/mmi1x2.gds b/tests/gds_ref_si500/mmi1x2.gds index c055cdb..f7dfe6e 100644 Binary files a/tests/gds_ref_si500/mmi1x2.gds and b/tests/gds_ref_si500/mmi1x2.gds differ diff --git a/tests/gds_ref_si500/mmi1x2_rc.gds b/tests/gds_ref_si500/mmi1x2_rc.gds index c055cdb..f7dfe6e 100644 Binary files a/tests/gds_ref_si500/mmi1x2_rc.gds and b/tests/gds_ref_si500/mmi1x2_rc.gds differ diff --git a/tests/gds_ref_si500/mmi1x2_ro.gds b/tests/gds_ref_si500/mmi1x2_ro.gds index f802265..1792d54 100644 Binary files a/tests/gds_ref_si500/mmi1x2_ro.gds and b/tests/gds_ref_si500/mmi1x2_ro.gds differ diff --git a/tests/gds_ref_si500/mmi2x2.gds b/tests/gds_ref_si500/mmi2x2.gds index 80a928b..db6dd2a 100644 Binary files a/tests/gds_ref_si500/mmi2x2.gds and b/tests/gds_ref_si500/mmi2x2.gds differ diff --git a/tests/gds_ref_si500/mmi2x2_rc.gds b/tests/gds_ref_si500/mmi2x2_rc.gds index 80a928b..db6dd2a 100644 Binary files a/tests/gds_ref_si500/mmi2x2_rc.gds and b/tests/gds_ref_si500/mmi2x2_rc.gds differ diff --git a/tests/gds_ref_si500/mmi2x2_ro.gds b/tests/gds_ref_si500/mmi2x2_ro.gds index 1495089..7d8d487 100644 Binary files a/tests/gds_ref_si500/mmi2x2_ro.gds and b/tests/gds_ref_si500/mmi2x2_ro.gds differ diff --git a/tests/gds_ref_si500/mzi.gds b/tests/gds_ref_si500/mzi.gds index b25f0d3..ab0a411 100644 Binary files a/tests/gds_ref_si500/mzi.gds and b/tests/gds_ref_si500/mzi.gds differ diff --git a/tests/gds_ref_si500/mzi_rc.gds b/tests/gds_ref_si500/mzi_rc.gds index b25f0d3..ab0a411 100644 Binary files a/tests/gds_ref_si500/mzi_rc.gds and b/tests/gds_ref_si500/mzi_rc.gds differ diff --git a/tests/gds_ref_si500/mzi_ro.gds b/tests/gds_ref_si500/mzi_ro.gds index 6a74987..bc06da5 100644 Binary files a/tests/gds_ref_si500/mzi_ro.gds and b/tests/gds_ref_si500/mzi_ro.gds differ diff --git a/tests/gds_ref_si500/taper.gds b/tests/gds_ref_si500/taper.gds index 847cb80..91bc773 100644 Binary files a/tests/gds_ref_si500/taper.gds and b/tests/gds_ref_si500/taper.gds differ diff --git a/tests/gds_ref_si500/taper_rc.gds b/tests/gds_ref_si500/taper_rc.gds index 847cb80..91bc773 100644 Binary files a/tests/gds_ref_si500/taper_rc.gds and b/tests/gds_ref_si500/taper_rc.gds differ diff --git a/tests/gds_ref_si500/taper_ro.gds b/tests/gds_ref_si500/taper_ro.gds index fea988d..a04c58e 100644 Binary files a/tests/gds_ref_si500/taper_ro.gds and b/tests/gds_ref_si500/taper_ro.gds differ diff --git a/tests/test_netlists_si220.py b/tests/test_netlists_si220.py index 0ba2811..356a178 100644 --- a/tests/test_netlists_si220.py +++ b/tests/test_netlists_si220.py @@ -11,7 +11,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): +def activate_pdk() -> None: PDK.activate() gf.clear_cache() diff --git a/tests/test_netlists_si220/test_netlists_bend_metal_.yml b/tests/test_netlists_si220/test_netlists_bend_metal_.yml new file mode 100644 index 0000000..3534c43 --- /dev/null +++ b/tests/test_netlists_si220/test_netlists_bend_metal_.yml @@ -0,0 +1,5 @@ +instances: {} +name: bend_euler_RNone_A90_P0_3e16ea58 +nets: [] +placements: {} +ports: {} diff --git a/tests/test_netlists_si220/test_netlists_grating_coupler_array_.yml b/tests/test_netlists_si220/test_netlists_grating_coupler_array_.yml index c2c187e..f21b195 100644 --- a/tests/test_netlists_si220/test_netlists_grating_coupler_array_.yml +++ b/tests/test_netlists_si220/test_netlists_grating_coupler_array_.yml @@ -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: diff --git a/tests/test_netlists_si220/test_netlists_straight_metal_.yml b/tests/test_netlists_si220/test_netlists_straight_metal_.yml new file mode 100644 index 0000000..c16e9ce --- /dev/null +++ b/tests/test_netlists_si220/test_netlists_straight_metal_.yml @@ -0,0 +1,5 @@ +instances: {} +name: straight_L10_WNone_CSme_3feaad2d +nets: [] +placements: {} +ports: {} diff --git a/tests/test_netlists_si500.py b/tests/test_netlists_si500.py index 07de58e..38a010f 100644 --- a/tests/test_netlists_si500.py +++ b/tests/test_netlists_si500.py @@ -10,8 +10,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): - gf.clear_cache() +def activate_pdk() -> None: PDK.activate() gf.clear_cache() diff --git a/tests/test_netlists_sin300.py b/tests/test_netlists_sin300.py index 45868d4..784e022 100644 --- a/tests/test_netlists_sin300.py +++ b/tests/test_netlists_sin300.py @@ -10,7 +10,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): +def activate_pdk() -> None: PDK.activate() gf.clear_cache() @@ -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) diff --git a/tests/test_pdk_si220.py b/tests/test_pdk_si220.py index fc376b0..332b00f 100644 --- a/tests/test_pdk_si220.py +++ b/tests/test_pdk_si220.py @@ -9,7 +9,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): +def activate_pdk() -> None: PDK.activate() gf.clear_cache() diff --git a/tests/test_pdk_si220/test_settings_bend_metal_.yml b/tests/test_pdk_si220/test_settings_bend_metal_.yml new file mode 100644 index 0000000..6fba775 --- /dev/null +++ b/tests/test_pdk_si220/test_settings_bend_metal_.yml @@ -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 diff --git a/tests/test_pdk_si220/test_settings_grating_coupler_array_.yml b/tests/test_pdk_si220/test_settings_grating_coupler_array_.yml index 40299e4..fa9695a 100644 --- a/tests/test_pdk_si220/test_settings_grating_coupler_array_.yml +++ b/tests/test_pdk_si220/test_settings_grating_coupler_array_.yml @@ -1,5 +1,5 @@ info: {} -name: grating_coupler_array_P_72908cae +name: grating_coupler_array_P_672610bf settings: centered: true cross_section: xs_sc diff --git a/tests/test_pdk_si220/test_settings_straight_metal_.yml b/tests/test_pdk_si220/test_settings_straight_metal_.yml new file mode 100644 index 0000000..6009473 --- /dev/null +++ b/tests/test_pdk_si220/test_settings_straight_metal_.yml @@ -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 diff --git a/tests/test_pdk_si500.py b/tests/test_pdk_si500.py index da4f67c..efc00fb 100644 --- a/tests/test_pdk_si500.py +++ b/tests/test_pdk_si500.py @@ -9,7 +9,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): +def activate_pdk() -> None: PDK.activate() gf.clear_cache() diff --git a/tests/test_pdk_sin300.py b/tests/test_pdk_sin300.py index ed3032f..7e4571f 100644 --- a/tests/test_pdk_sin300.py +++ b/tests/test_pdk_sin300.py @@ -9,7 +9,7 @@ @pytest.fixture(autouse=True) -def activate_pdk(): +def activate_pdk() -> None: PDK.activate() gf.clear_cache()