Programm architecture simplified so that the EDA can now run individually without generation of .gds file
This commit is contained in:
@@ -5,11 +5,12 @@
|
||||
# Organization : OptiHK Limited
|
||||
# -----------------------------------------------------------------------------
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import yaml
|
||||
|
||||
from router_dependency import require_router_stack
|
||||
|
||||
|
||||
def create_routed_layout_svg(
|
||||
yaml_content: str,
|
||||
@@ -20,15 +21,11 @@ def create_routed_layout_svg(
|
||||
prefer_full_gds: bool = False,
|
||||
) -> str:
|
||||
"""Create an SVG preview from routed GDS geometry generated by mxpic_router."""
|
||||
require_router_stack(require_gdstk=True)
|
||||
import gdstk
|
||||
|
||||
layout = yaml.safe_load(yaml_content) or {}
|
||||
cell_name = str(layout.get("name") or "layout")
|
||||
# mxpic_router is kept as a sibling repository, so the backend adds it to
|
||||
# sys.path only when the local checkout is available.
|
||||
router_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "mxpic_router"))
|
||||
if os.path.isdir(router_root) and router_root not in sys.path:
|
||||
sys.path.insert(0, router_root)
|
||||
from mxpic_router import build_project_gds
|
||||
|
||||
os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user