From 4327ba380d35a346bc3f883c49217c13bd272214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96rtenberg?= Date: Wed, 12 Feb 2025 10:36:50 +0100 Subject: [PATCH 1/4] fixed gantry module import --- scripts/gantry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/gantry.py b/scripts/gantry.py index 8e17038..514eca8 100644 --- a/scripts/gantry.py +++ b/scripts/gantry.py @@ -1,5 +1,5 @@ import typer -import elab +import elab as elaborate import build_env from typing_extensions import Annotated @@ -28,7 +28,7 @@ def elab( std: Annotated[str, typer.Option(help="Which VHDL standard to use. 87, 93, 93c, 00, 02 or 08", autocompletion=complete_vhdl_ver)] = "93c" ): print(f"Elaborating {topdef} with arch {arch} in library {library}. VHDL {std}") - return elab.elabDesign(topdef, arch, library, std) + return elaborate.elabDesign(topdef, arch, library, std) @software.command(help="Simulates elaborated design in GHDL and views waves in gtkwave. Automatically runs `gantry elab` on the same top def and arch.") def run( @@ -38,7 +38,7 @@ def run( std: Annotated[str, typer.Option(help="Which VHDL standard to use. 87, 93, 93c, 00, 02 or 08", autocompletion=complete_vhdl_ver)] = "93c" ): print(f"Running (and synthesizing if needed) {topdef} with arch {arch} in library {library}. VHDL {std}") - return elab.runDesign(topdef, arch, library, std) + return elaborate.runDesign(topdef, arch, library, std) @hardware.command() def build(): From 13d49672906bba2b69c55d53a255d8ddecc54a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96rtenberg?= Date: Wed, 12 Feb 2025 10:53:04 +0100 Subject: [PATCH 2/4] Fixed bug in elab script --- scripts/elab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/elab.py b/scripts/elab.py index db3d4f1..0981169 100644 --- a/scripts/elab.py +++ b/scripts/elab.py @@ -22,7 +22,7 @@ def runDesign(topDef: str, arch: str, lib: str, std: str): wavePath = os.path.join(os.getcwd(), "wave") command = [ ## may add -v for verbose "ghdl", "-r", f"{topDef}", f"{arch}", - f"--wave={os.path.join(libPath, topDef)}-{arch}.ghw" ##, "--read-wave-opt= Date: Fri, 14 Feb 2025 11:45:26 +0100 Subject: [PATCH 3/4] first install scripts, not working fully yet --- scripts/.gitignore | 1 + scripts/ghdl | 3 +++ scripts/install_docker_ghdl.sh | 4 ++++ scripts/install_gantry.sh | 6 ++++++ 4 files changed, 14 insertions(+) create mode 100755 scripts/ghdl create mode 100755 scripts/install_docker_ghdl.sh create mode 100755 scripts/install_gantry.sh diff --git a/scripts/.gitignore b/scripts/.gitignore index 9d2b7ca..d665aea 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -5,3 +5,4 @@ lib lib64 pyvenv.cfg __pycache__ +gantry diff --git a/scripts/ghdl b/scripts/ghdl new file mode 100755 index 0000000..6d98a77 --- /dev/null +++ b/scripts/ghdl @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run -t -v /$(pwd):/src -w /src ghdl/ghdl:5.0.0-dev-gcc-ubuntu-24.04 bash -c "ghdl $@" diff --git a/scripts/install_docker_ghdl.sh b/scripts/install_docker_ghdl.sh new file mode 100755 index 0000000..a67f341 --- /dev/null +++ b/scripts/install_docker_ghdl.sh @@ -0,0 +1,4 @@ +#!/usr/bin/fish + +docker pull ghdl/ghdl:5.0.0-dev-gcc-ubuntu-24.04 +fish_add_path "$(pwd)" diff --git a/scripts/install_gantry.sh b/scripts/install_gantry.sh new file mode 100755 index 0000000..673ba6c --- /dev/null +++ b/scripts/install_gantry.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +PWD=$(pwd) +printf "#!/bin/bash \n$PWD/bin/python3 $PWD/gantry.py \$@" > "$PWD/gantry" +chmod +x "$PWD/gantry" + From 2ee6fd77f5f029d77c4f36f3cf105605c810707e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96rtenberg?= Date: Fri, 14 Feb 2025 13:31:25 +0100 Subject: [PATCH 4/4] Fixed GHDL docker script and improved elab.py to not be dir dependent --- scripts/elab.py | 7 ++++--- scripts/ghdl | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/elab.py b/scripts/elab.py index 0981169..79b1441 100644 --- a/scripts/elab.py +++ b/scripts/elab.py @@ -21,10 +21,11 @@ def runDesign(topDef: str, arch: str, lib: str, std: str): libPath = os.path.join(os.getcwd(), lib) wavePath = os.path.join(os.getcwd(), "wave") command = [ ## may add -v for verbose - "ghdl", "-r", f"{topDef}", f"{arch}", - f"--wave=../wave/{topDef}-{arch}.ghw" ##, "--read-wave-opt=