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
You can pass the dictionary as string or as the path to a file. Optionally, you can encode the string:
TB.get_tests("stringified*")[0].set_generic("tb_cfg", JSON_STR)
TB.get_tests("b16encoded stringified*")[0].set_generic("tb_cfg", b16encode(JSON_STR))
TB.get_tests("JSON file*")[0].set_generic("tb_cfg", JSON_FILE)
TB.get_tests("b16encoded JSON file*")[0].set_generic("tb_cfg", b16encode(str(TEST_PATH / JSON_FILE)))
You only need one of those. The four of them are used in the example for illustration.
Q> While running simulation using ModelSim, I am always getting the warning: " Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es)." and I want to get rid of this warning. How can I do it?
What I did and is not working>
Is there any other things I can try out from run.py?