From 9706030ab2b488e6ebcc21f9bd652c1adb917cee Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 24 Feb 2025 13:35:37 +0100 Subject: [PATCH] Automatic sourcing of nxdesignsuite --- scripts/gantry.py | 6 +++--- scripts/source_and_run.sh | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 scripts/source_and_run.sh diff --git a/scripts/gantry.py b/scripts/gantry.py index c57a2fd..622b2d0 100644 --- a/scripts/gantry.py +++ b/scripts/gantry.py @@ -49,14 +49,14 @@ def synth( topdef: Annotated[str, typer.Argument(help="Top Definition entity to synthesize")] = "", library: Annotated[str, typer.Option("--library", "-l", help="Library to compile from, defaults to \"work\"")] = "work" ): - proc = subprocess.run(["nxpython", f"{gantry_install_path}/nxp_script.py", "synthDesign", library, topdef]) + proc = subprocess.run(["source_and_run.sh", f"{gantry_install_path}/nxp_script.py", "synthDesign", library, topdef]) @hardware.command(help="Places the provided top level design using NXPython. Make sure you run this with NXPython.") def place( topdef: Annotated[str, typer.Argument(help="Top Definition entity to synthesize")] = "", library: Annotated[str, typer.Option("--library", "-l", help="Library to compile from, defaults to \"work\"")] = "work" ): - proc = subprocess.run(["nxpython", f"{gantry_install_path}/nxp_script.py", "placeDesign", library, topdef]) + proc = subprocess.run(["source_and_run.sh", f"{gantry_install_path}/nxp_script.py", "placeDesign", library, topdef]) @hardware.command(help="Routes the provided top level design using NXPython. Make sure you run this with NXPython.") @@ -64,7 +64,7 @@ def route( topdef: Annotated[str, typer.Argument(help="Top Definition entity to synthesize")] = "", library: Annotated[str, typer.Option("--library", "-l", help="Library to compile from, defaults to \"work\"")] = "work" ): - proc = subprocess.run(["nxpython", f"{gantry_install_path}/nxp_script.py", "routeDesign", library, topdef]) + proc = subprocess.run(["source_and_run.sh", f"{gantry_install_path}/nxp_script.py", "routeDesign", library, topdef]) @hardware.command(help="") def build(): diff --git a/scripts/source_and_run.sh b/scripts/source_and_run.sh new file mode 100755 index 0000000..8fae2ec --- /dev/null +++ b/scripts/source_and_run.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +source /gsl/cad/modules/init/bash + +module add /gsl/cad/modules/modulefiles/nanoxplore/nxdesignsuite/24.3.0.0 +nxpython $@