Compare commits
9 Commits
a946eb2e99
...
49f52fdcc0
| Author | SHA1 | Date | |
|---|---|---|---|
| 49f52fdcc0 | |||
| bff4787973 | |||
| 310ad49115 | |||
| b2449c5641 | |||
| 9d1cce8559 | |||
| 2ee6fd77f5 | |||
| ff39403875 | |||
| 13d4967290 | |||
| 4327ba380d |
1
scripts/.gitignore
vendored
1
scripts/.gitignore
vendored
@ -5,3 +5,4 @@ lib
|
|||||||
lib64
|
lib64
|
||||||
pyvenv.cfg
|
pyvenv.cfg
|
||||||
__pycache__
|
__pycache__
|
||||||
|
gantry
|
||||||
|
|||||||
@ -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={os.path.join(libPath, 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"]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import typer
|
import typer
|
||||||
import elab
|
import elab as elaborate
|
||||||
import build_env
|
import build_env
|
||||||
from typing_extensions import Annotated
|
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"
|
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}")
|
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.")
|
@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(
|
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"
|
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}")
|
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()
|
@hardware.command()
|
||||||
def build():
|
def build():
|
||||||
|
|||||||
4
scripts/ghdl
Executable file
4
scripts/ghdl
Executable 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
4
scripts/install_docker_ghdl.sh
Executable 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
6
scripts/install_gantry.sh
Executable 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"
|
||||||
|
|
||||||
@ -1,10 +1,14 @@
|
|||||||
click==8.1.8
|
attrs==21.4.0
|
||||||
markdown-it-py==3.0.0
|
click==8.0.4
|
||||||
mdurl==0.1.2
|
commonmark==0.9.1
|
||||||
Pygments==2.19.1
|
dataclasses==0.8
|
||||||
rich==13.9.4
|
importlib-metadata==4.8.3
|
||||||
setuptools==75.8.0
|
markdown-it-py==2.0.1
|
||||||
shellingham==1.5.4
|
mdurl==0.1.0
|
||||||
|
Pygments==2.14.0
|
||||||
|
rich==12.6.0
|
||||||
|
shellingham==1.4.0
|
||||||
type-extensions==0.1.2
|
type-extensions==0.1.2
|
||||||
typer==0.15.1
|
typer==0.10.0
|
||||||
typing_extensions==4.12.2
|
typing_extensions==4.1.1
|
||||||
|
zipp==3.6.0
|
||||||
|
|||||||
22
src/io_type_pkg.vhd
Normal file
22
src/io_type_pkg.vhd
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
library IEEE;
|
||||||
|
use IEEE.MATH_REAL.all;
|
||||||
|
|
||||||
|
package io_types is
|
||||||
|
|
||||||
|
type interface_def_t is record
|
||||||
|
name: string (1 to 20);
|
||||||
|
payload_width, control_width: natural;
|
||||||
|
end record interface_def_t;
|
||||||
|
|
||||||
|
type interface_arr_t is array (natural range <>) of interface_def_t;
|
||||||
|
|
||||||
|
constant interface_arr : interface_arr_t := (
|
||||||
|
0 => ("SoCBridge x ", 8, 2),
|
||||||
|
1 => ("SoCBridge x ", 8, 2),
|
||||||
|
2 => ("SoCBridge x ", 8, 2),
|
||||||
|
3 => ("SoCBridge x ", 8, 2),
|
||||||
|
4 => ("SoCBridge x ", 8, 2),
|
||||||
|
5 => ("SoCBridge x ", 8, 2)
|
||||||
|
);
|
||||||
|
|
||||||
|
end package io_types;
|
||||||
25
src/test.vhd
Normal file
25
src/test.vhd
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
library IEEE;
|
||||||
|
library work;
|
||||||
|
use work.io_types.all;
|
||||||
|
|
||||||
|
entity test is
|
||||||
|
port (
|
||||||
|
t : in interface_arr_t(0 to interface_arr'length - 1)
|
||||||
|
);
|
||||||
|
end entity test;
|
||||||
|
|
||||||
|
architecture rtl of test is
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
proc_name: process
|
||||||
|
begin
|
||||||
|
|
||||||
|
for x in 0 to (interface_arr'length - 1) loop
|
||||||
|
report interface_arr(x).name ;
|
||||||
|
end loop;
|
||||||
|
wait;
|
||||||
|
end process proc_name;
|
||||||
|
|
||||||
|
|
||||||
|
end architecture rtl;
|
||||||
Loading…
x
Reference in New Issue
Block a user