Added VUnit run script.
authorLars Asplund <lars.anders.asplund@gmail.com>
Mon, 7 Jun 2021 20:05:57 +0000 (22:05 +0200)
committerLars Asplund <lars.anders.asplund@gmail.com>
Wed, 9 Jun 2021 16:00:53 +0000 (18:00 +0200)
The VUnit run script will find all VHDL files based on given search patterns, figure out their dependencies, and support incremental compile based on the dependencies.
The same script is used for all VUnit supported simulators. Supporting several simulators simplifies the adoption of this project.

At this point only compilation is performed. Coming commits will enable simulation of VHDL testbenches.

Signed-off-by: Lars Asplund <lars.anders.asplund@gmail.com>
run.py [new file with mode: 0644]

diff --git a/run.py b/run.py
new file mode 100644 (file)
index 0000000..7a98338
--- /dev/null
+++ b/run.py
@@ -0,0 +1,20 @@
+from pathlib import Path
+from vunit import VUnit
+from glob import glob
+
+prj = VUnit.from_argv()
+root = Path(__file__).parent
+
+lib = prj.add_library("lib")
+lib.add_source_files(root / "litedram/extras/*.vhdl")
+lib.add_source_files(root / "litedram/generated/sim/*.vhdl")
+
+# Use multiply.vhd and not xilinx-mult.vhd
+vhdl_files_in_root = glob(str(root / "*.vhdl"))
+vhdl_files_to_use = [src_file for src_file in vhdl_files_in_root if "xilinx-mult" not in src_file]
+lib.add_source_files(vhdl_to_use)
+
+unisim = prj.add_library("unisim")
+unisim.add_source_files(root / "sim-unisim/*.vhdl")
+
+prj.main()