From 6364b434d42d82ad443a193a2fb0a17af8a9e8dc Mon Sep 17 00:00:00 2001 From: Troy Tamas Date: Mon, 13 May 2024 12:05:06 +0900 Subject: [PATCH] modifying tech to allow multi-cs routing. adding 'sim' option to install to more easily get all packages required for running tests --- cspdk/si220/tech.py | 83 ++++++++++++++++++++++++++++++++++---------- docs/cells_si220.rst | 2 +- docs/cells_si500.rst | 17 +-------- pyproject.toml | 5 +++ 4 files changed, 72 insertions(+), 35 deletions(-) diff --git a/cspdk/si220/tech.py b/cspdk/si220/tech.py index a46271c..92f3d05 100644 --- a/cspdk/si220/tech.py +++ b/cspdk/si220/tech.py @@ -27,6 +27,11 @@ class LayerMapCornerstone(LayerMap): LABEL_SETTINGS: Layer = (100, 0) LABEL_INSTANCE: Layer = (101, 0) + STRIP_INTENT: Layer = (200, 1) + RIB_INTENT: Layer = (201, 1) + NITRIDE_INTENT: Layer = (202, 1) + PAD_INTENT: Layer = (203, 1) + LAYER = LayerMapCornerstone() @@ -100,36 +105,74 @@ def get_layer_stack( cladding_layers_rib = (LAYER.SLAB,) cladding_offsets_rib = (5,) -xf_sc = partial(gf.cross_section.strip, layer=LAYER.WG, width=0.45) + +def _create_cross_section_function( + intent_layer: Layer, + physical_layer: Layer, + default_width: float, + other_section_settings: list[dict] | None = None, + base_function: callable = gf.cross_section.strip, + **kwargs, +): + def cs_func(layer=intent_layer, width=default_width): + physical_layer_section = gf.Section( + width=width, layer=physical_layer, name="wg_physical" + ) + if other_section_settings: + other_sections = [ + gf.Section(**section_settings) + for section_settings in other_section_settings + ] + else: + other_sections = [] + sections = [physical_layer_section] + other_sections + return base_function(width=width, layer=layer, sections=sections, **kwargs) + + return cs_func + + +xf_sc = _create_cross_section_function( + intent_layer=LAYER.STRIP_INTENT, + physical_layer=LAYER.WG, + default_width=0.45, +) + xf_so = partial(xf_sc, width=0.40) -xf_rc = partial( - gf.cross_section.strip, - layer=LAYER.WG, - width=0.45, - sections=(gf.Section(width=10.45, layer="SLAB", name="slab", simplify=50 * nm),), +xf_rc = _create_cross_section_function( + intent_layer=LAYER.RIB_INTENT, + physical_layer=LAYER.WG, + default_width=0.45, + other_section_settings=[ + dict(width=10.45, layer="SLAB", name="slab", simplify=50 * nm) + ], radius=25, radius_min=25, ) xf_ro = partial(xf_rc, width=0.40) -xf_rc_tip = partial( - gf.cross_section.strip, - sections=(gf.Section(width=0.2, layer="SLAB", name="slab"),), +xf_rc_tip = _create_cross_section_function( + intent_layer=LAYER.STRIP_INTENT, + physical_layer=LAYER.WG, + default_width=0.45, + other_section_settings=[dict(width=0.2, layer="SLAB", name="slab")], ) -xf_sc_heater_metal = partial( - gf.cross_section.strip_heater_metal, - layer=LAYER.WG, - heater_width=2.5, +xf_sc_heater_metal = _create_cross_section_function( + intent_layer=LAYER.STRIP_INTENT, + physical_layer=LAYER.WG, + default_width=0.45, + base_function=gf.cross_section.strip_heater_metal, layer_heater=LAYER.HEATER, - width=0.45, + heater_width=2.5, ) -metal_routing = partial( - gf.cross_section.cross_section, - layer=LAYER.PAD, - width=10.0, + +metal_routing = _create_cross_section_function( + intent_layer=LAYER.PAD_INTENT, + physical_layer=LAYER.PAD, + default_width=10.0, + base_function=gf.cross_section.cross_section, port_names=gf.cross_section.port_names_electrical, port_types=gf.cross_section.port_types_electrical, radius=None, @@ -151,6 +194,10 @@ def get_layer_stack( cross_sections = get_cross_sections(sys.modules[__name__]) +# def get_layer_transitions(): +# lt = { + +# } ############################ # Routing functions ############################ diff --git a/docs/cells_si220.rst b/docs/cells_si220.rst index 31311b8..c4a7238 100644 --- a/docs/cells_si220.rst +++ b/docs/cells_si220.rst @@ -1,6 +1,6 @@ -Cells Si220 +Cells Si SOI 220nm ============================= diff --git a/docs/cells_si500.rst b/docs/cells_si500.rst index cd7a110..aefb368 100644 --- a/docs/cells_si500.rst +++ b/docs/cells_si500.rst @@ -44,7 +44,7 @@ bend_s import cspdk - c = cspdk.si500.cells.bend_s(size=(11.0, 1.8), cross_section='xs_sc') + c = cspdk.si500.cells.bend_s(size=(11.0, 1.8), cross_section='xs_rc') c.plot() @@ -64,21 +64,6 @@ coupler_rc -crossing_rc ----------------------------------------------------- - -.. autofunction:: cspdk.si500.cells.crossing_rc - -.. plot:: - :include-source: - - import cspdk - - c = cspdk.si500.cells.crossing_rc() - c.plot() - - - die_rc ---------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index 98fb6a2..575b74d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,11 @@ docs = [ "matplotlib", "jupyter-book==1.0.0" ] +sim = [ + "tidy3d", + "meshio", + "meshwell" +] [tool.codespell] ignore-words-list = "te, te/tm, te, ba, fpr, fpr_spacing, ro, nd, donot, schem"