Fixed GHDL docker script and improved elab.py to not be dir dependent

This commit is contained in:
Erik Örtenberg 2025-02-14 13:31:25 +01:00
parent ff39403875
commit 2ee6fd77f5
2 changed files with 7 additions and 5 deletions

View File

@ -21,10 +21,11 @@ def runDesign(topDef: str, arch: str, lib: str, std: str):
libPath = os.path.join(os.getcwd(), lib) libPath = os.path.join(os.getcwd(), lib)
wavePath = os.path.join(os.getcwd(), "wave") wavePath = os.path.join(os.getcwd(), "wave")
command = [ ## may add -v for verbose command = [ ## may add -v for verbose
"ghdl", "-r", f"{topDef}", f"{arch}", "ghdl", "--elab-run", f"--workdir={lib}", f"--work={lib}", f"--std={std}",
f"--wave=../wave/{topDef}-{arch}.ghw" ##, "--read-wave-opt=<See" "-o", f"{lib}/{topDef}-{arch}", f"{topDef}", f"{arch}",
f"--wave=wave/{topDef}-{arch}.ghw" ##, "--read-wave-opt=<See"
] ]
subprocess.run(command, cwd=libPath) subprocess.run(command)
command = [ command = [
"gtkwave", f"{topDef}-{arch}.ghw", "--rcvar", "gtkwave", f"{topDef}-{arch}.ghw", "--rcvar",
"do_initial_zoom_fit yes"] "do_initial_zoom_fit yes"]

View File

@ -1,3 +1,4 @@
#!/bin/bash #!/bin/bash
VARS="$@"
docker run -t -v /$(pwd):/src -w /src ghdl/ghdl:5.0.0-dev-gcc-ubuntu-24.04 bash -c "ghdl $@" COMMAND="ghdl $VARS"
docker run -it -v .:/src -w /src ghdl/ghdl:5.0.0-dev-gcc-ubuntu-24.04 bash -c "$COMMAND"