updated with github #5

Merged
PotatoMaxwell merged 19 commits from qinyue_main into develope 2026-06-01 05:21:23 +00:00
14 changed files with 628 additions and 122 deletions
Showing only changes of commit 392e6d655e - Show all commits
+2
View File
@@ -25,6 +25,8 @@ Important functions:
`../mxpic_router` checkout to `sys.path` when present. `../mxpic_router` checkout to `sys.path` when present.
- `require_router_stack` (`backend/router_dependency.py` line 31) imports - `require_router_stack` (`backend/router_dependency.py` line 31) imports
`mxpic_router`, `nazca`, and the route backend used by `mxpic_router`. `mxpic_router`, `nazca`, and the route backend used by `mxpic_router`.
The preferred route backend is `mxpic_forge.Route`; if it is absent,
`mxpic_router` falls back to Nazca `interconnects.Interconnect`.
`gdstk` is checked only when SVG preview generation requests it. `gdstk` is checked only when SVG preview generation requests it.
## Generated Files ## Generated Files
+3 -2
View File
@@ -10,8 +10,9 @@ Organization : OptiHK Limited
The Flask server can launch for login, dashboard, canvas editing, YAML The Flask server can launch for login, dashboard, canvas editing, YAML
generation, and PDK browsing without importing `mxpic_router` or `mxpic_forge`. generation, and PDK browsing without importing `mxpic_router` or `mxpic_forge`.
Build actions require the matched `mxpic_router` and `mxpic_forge` checkouts; Build actions require `mxpic_router` and Nazca. When `mxpic_forge.Route` is not
SVG preview generation also requires `gdstk`. available, routing falls back to Nazca `interconnects.Interconnect`; SVG preview
generation also requires `gdstk`.
## Start on the office LAN ## Start on the office LAN
+3 -2
View File
@@ -12,8 +12,9 @@ flask
## Build-Time Router Stack ## Build-Time Router Stack
Login, dashboard, canvas editing, YAML generation, and PDK browsing run without Login, dashboard, canvas editing, YAML generation, and PDK browsing run without
importing `mxpic_router` or `mxpic_forge`. Build actions require the matched importing `mxpic_router` or `mxpic_forge`. Build actions require `mxpic_router`
`mxpic_router` and `mxpic_forge` checkouts; SVG preview generation also requires and Nazca. When `mxpic_forge.Route` is unavailable, routing falls back to
Nazca `interconnects.Interconnect`; SVG preview generation also requires
`gdstk`. `gdstk`.
## PDK and Technology Roots ## PDK and Technology Roots
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -6
View File
@@ -60,18 +60,18 @@ def require_router_stack(require_gdstk: bool = False) -> RouterStackStatus:
try: try:
router_builder = importlib.import_module("mxpic_router.builder") router_builder = importlib.import_module("mxpic_router.builder")
route_factory = getattr(router_builder, "_import_mxpic_forge_route") route_factory = getattr(router_builder, "_import_route_backend")
route_factory() route_backend = route_factory()
checked.append("mxpic_forge Route") checked.append(getattr(route_backend, "backend_name", "route backend"))
except Exception as exc: except Exception as exc:
missing.append(f"mxpic_forge Route: {exc}") missing.append(f"route backend: {exc}")
if missing: if missing:
details = "; ".join(missing) details = "; ".join(missing)
raise RouterStackUnavailable( raise RouterStackUnavailable(
"Required mxpic_router runtime stack is unavailable. " "Required mxpic_router runtime stack is unavailable. "
"Build actions require the matched mxpic_router and mxpic_forge checkouts, " "Build actions require mxpic_router, Nazca, and either mxpic_forge Route "
f"Nazca, and gdstk for SVG preview generation. Details: {details}" f"or the Nazca Interconnect fallback. gdstk is also required for SVG preview generation. Details: {details}"
) )
return RouterStackStatus(ok=True, router_root=router_root, checked=checked) return RouterStackStatus(ok=True, router_root=router_root, checked=checked)
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 165 KiB

@@ -25,21 +25,10 @@ pins:
# 2. Instances (The sub-components dropped onto this canvas) # 2. Instances (The sub-components dropped onto this canvas)
instances: instances:
MMI_1: MZM_1:
component: Silterra/EMO1_2ML_CU_Al_RDL/primitives/multimode_interferometers/1x2MMI_1310nm_TE_Silterra_202603_ZKY_v2 component: Silterra/EMO1_2ML_CU_Al_RDL/composites/Mach_Zender_modulators/MZI_SiN400_Si220_PIN_mod_1310_L1300_QY_202603
x: 557.2 x: 222.2
y: -1888.3 y: -473.8
rotation: 0.0
flip: 0
flop: 0
mirror: false
settings:
length:
MMI_2:
component: Silterra/EMO1_2ML_CU_Al_RDL/primitives/multimode_interferometers/1x2MMI_1310nm_TE_Silterra_202603_ZKY_v2
x: 689.2
y: -1797.5
rotation: 0.0 rotation: 0.0
flip: 0 flip: 0
flop: 0 flop: 0
@@ -48,19 +37,6 @@ instances:
length: length:
elements: elements:
port:
type: port
x: 50.0
y: -150.0
angle: 180.0
pin_number: 1
pitch: 10
layer: WG_CORE
width: 0.5
description: ""
pins:
- name: port_io1
role: io1
port: port:
type: port type: port
x: 50.0 x: 50.0
@@ -80,10 +56,3 @@ bundles:
output_bus: output_bus:
routing_type: euler_bend routing_type: euler_bend
links: links:
- from: MMI_1:b1
to: MMI_2:a1
xsection: strip
family: optical
width: 0.45
radius: 10
routing_type: euler_bend
Binary file not shown.
+4 -2
View File
@@ -132,7 +132,7 @@ assert(
routerDependencyPy.includes('require_gdstk: bool = False') && routerDependencyPy.includes('require_gdstk: bool = False') &&
routerDependencyPy.includes('importlib.import_module("nazca")') && routerDependencyPy.includes('importlib.import_module("nazca")') &&
routerDependencyPy.includes('mxpic_router.builder') && routerDependencyPy.includes('mxpic_router.builder') &&
routerDependencyPy.includes('_import_mxpic_forge_route'), routerDependencyPy.includes('_import_route_backend'),
'router dependency gate should validate mxpic_router, Nazca, optional gdstk, and route backend imports' 'router dependency gate should validate mxpic_router, Nazca, optional gdstk, and route backend imports'
); );
@@ -151,7 +151,9 @@ if (fs.existsSync(routerDir)) {
routerBuilderPy.includes('_port_element_pin_entries') && routerBuilderPy.includes('_port_element_pin_entries') &&
routerBuilderPy.includes('_anchor_element_pin_entries') && routerBuilderPy.includes('_anchor_element_pin_entries') &&
routerBuilderPy.includes('_metadata_pins') && routerBuilderPy.includes('_metadata_pins') &&
routerBuilderPy.includes('link.src_pin'), routerBuilderPy.includes('link.src_pin') &&
routerBuilderPy.includes('_NazcaInterconnectRoute') &&
routerBuilderPy.includes('_import_route_backend'),
'mxpic_router builder should register named element pins and route through pin endpoints' 'mxpic_router builder should register named element pins and route through pin endpoints'
); );
} }