Regarding breaking IEEE library, it has something to do with how VUnit adds its own OSVVM version to the "work" lib.
VUnit does never add OSVVM, or any other resource to the "work" lib. If that is happening, it's a misconfiguration or a bug.
VUnit's add_osvvm adds OSVVM to library OSVVM.
The vunit_osvvm script from OSVB (https://github.com/umarcor/osvb/blob/main/AXI4Stream/test/osvvm/vunit_osvvm.py) adds resources to libraries OSVVM, OSVVM_Common and OSVVM_AXI4.
By definition, a library named "work" cannot be used. Even though some vendors/simulators support it, it should never be done.
no, I read what you wrote in OSVB, I removed add_osvvm and instead had this:
So, let's step back. What do you want to achieve? Tell something such as "I am want to compile OSVVM's core and use the Scoreboard in a VUnit testbench", or "I want to compile OSVVMLibraries and use OSVVM's AXI VCs".
run.py
or how to install/build VUnit/OSVVM. I just need the testbench file.
add_osvvm
alone should suffice. Nevertheless, I'm willing to understand what's the problem you are hitting.
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
library OSVVM ;
context osvvm.OsvvmContext ;
library vunit_lib;
context vunit_lib.vunit_context;
entity mwe_tb is
generic (runner_cfg : string);
end entity mwe_tb;
-- Error: tb_mwe.vhd:16:1: no declaration for "osvvm"
-- package ScoreBoardPkg_slv is new
-- OSVVM.ScoreboardGenericPkg generic map(
-- ExpectedType => std_logic_vector,
-- ActualType => std_logic_vector,
-- Match => std_match,
-- expected_to_string => to_hstring,
-- actual_to_string => to_hstring
-- );
-- Error: tb_mwe.vhd: failed to find a primary design unit 'scoreboardgenericpkg' in library 'lib'
package ScoreBoardPkg_slv is new
work.ScoreboardGenericPkg generic map(
ExpectedType => std_logic_vector,
ActualType => std_logic_vector,
Match => std_match,
expected_to_string => to_hstring,
actual_to_string => to_hstring
);
architecture tb of mwe_tb is
begin
main_proc : process begin
test_runner_setup(runner, runner_cfg);
if run("test1") then
--noop
end if;
test_runner_cleanup(runner);
end process;
test_runner_watchdog(runner, 1 ms);
end tb;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
library OSVVM ;
context osvvm.OsvvmContext ;
package ScoreBoardPkg_myslv is new
OSVVM.ScoreboardGenericPkg generic map(
ExpectedType => std_logic_vector,
ActualType => std_logic_vector,
Match => std_match,
expected_to_string => to_hstring,
actual_to_string => to_hstring
);
library vunit_lib;
context vunit_lib.vunit_context;
entity mwe_tb is
generic (runner_cfg : string);
end entity mwe_tb;
architecture tb of mwe_tb is
begin
main_proc : process begin
test_runner_setup(runner, runner_cfg);
if run("test1") then
--noop
end if;
test_runner_cleanup(runner);
end process;
test_runner_watchdog(runner, 1 ms);
end tb;
#!/usr/bin/env python3
from pathlib import Path
from vunit import VUnit
ROOT = Path(__file__).parent
VU = VUnit.from_argv()
VU.add_osvvm()
VU.add_library("lib").add_source_files([ROOT / "tb_apanella.vhd"])
VU.main()
py run.py '<library_name_set>.<testbench_name_set>.<test-case-name_set>' -v