From 0e5aa57df2b02519b3feb76aabf12527863b5e5f Mon Sep 17 00:00:00 2001 From: Mikael Henriksson <mike.zx@hotmail.com> Date: Thu, 13 Apr 2023 13:49:08 +0200 Subject: [PATCH] Make VUnit VHDL-tests working directory insensitive, closes #197 --- b_asic/codegen/testbench/test.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/b_asic/codegen/testbench/test.py b/b_asic/codegen/testbench/test.py index 2fd049a1..d0f45588 100755 --- a/b_asic/codegen/testbench/test.py +++ b/b_asic/codegen/testbench/test.py @@ -1,13 +1,19 @@ #!/usr/bin/env python3 +from os.path import abspath, dirname +from sys import argv + from vunit import VUnit -vu = VUnit.from_argv() +# Absolute path of the testbench directory +testbench_path = dirname(abspath(__file__)) + +vu = VUnit.from_argv(argv=['--output-path', f'{testbench_path}/vunit_out'] + argv[1:]) lib = vu.add_library("lib") lib.add_source_files( [ - "*.vhdl", + f'{testbench_path}/*.vhdl', ] ) lib.set_compile_option("modelsim.vcom_flags", ["-2008"]) -- GitLab