4 from pathlib
import Path
5 from vunit
import VUnit
7 ROOT
= Path(__file__
).parent
9 PRJ
= VUnit
.from_argv()
10 PRJ
.add_vhdl_builtins()
13 PRJ
.add_library("lib").add_source_files([
14 ROOT
/ "litedram" / "extras" / "*.vhdl",
15 ROOT
/ "litedram" / "generated" / "sim" / "*.vhdl"
18 for src_file
in ROOT
.glob("*.vhdl")
19 # Use multiply.vhd and not xilinx-mult.vhd. Use VHDL-based random.
20 if not any(exclude
in str(src_file
) for exclude
in ["xilinx-mult", "foreign_random", "nonrandom", "dmi_dtm_ecp5", "dmi_dtm_xilinx"])
23 PRJ
.add_library("unisim").add_source_files(ROOT
/ "sim-unisim" / "*.vhdl")
25 PRJ
.set_sim_option("disable_ieee_warnings", True)
29 Generate the vhdl_ls.toml file required by VHDL-LS language server.
32 parent
= Path(__file__
).parent
35 libs
= proj
.get_libraries()
37 with
open(parent
/ 'vhdl_ls.toml', "w") as f
:
39 f
.write(f
"[libraries.{lib.name}]\n")
40 files
= [str(file).replace('\\', '/') for file in lib
._source
_files
]
41 f
.write(f
"files = {json.dumps(files, indent=4)}\n")