Compare commits

...

4 Commits

6 changed files with 22 additions and 6 deletions

1
scripts/.gitignore vendored
View File

@ -5,3 +5,4 @@ lib
lib64
pyvenv.cfg
__pycache__
gantry

View File

@ -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={os.path.join(libPath, topDef)}-{arch}.ghw" ##, "--read-wave-opt=<See"
"ghdl", "--elab-run", f"--workdir={lib}", f"--work={lib}", f"--std={std}",
"-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 = [
"gtkwave", f"{topDef}-{arch}.ghw", "--rcvar",
"do_initial_zoom_fit yes"]

View File

@ -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():

4
scripts/ghdl Executable file
View File

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

4
scripts/install_docker_ghdl.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/fish
docker pull ghdl/ghdl:5.0.0-dev-gcc-ubuntu-24.04
fish_add_path "$(pwd)"

6
scripts/install_gantry.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
PWD=$(pwd)
printf "#!/bin/bash \n$PWD/bin/python3 $PWD/gantry.py \$@" > "$PWD/gantry"
chmod +x "$PWD/gantry"