Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 28 16:19
    creiter64 commented #797
  • Jun 28 13:08
    eine labeled #799
  • Jun 28 13:08
    eine labeled #799
  • Jun 28 13:07
    eine review_requested #799
  • Jun 28 13:05
    eine labeled #839
  • Jun 28 13:05
    eine labeled #839
  • Jun 28 10:25
    creiter64 opened #846
  • Jun 27 18:42
    Hardolaf commented #728
  • Jun 27 18:40
    cmarqu commented #728
  • Jun 27 15:38
    Hardolaf commented #728
  • Jun 27 14:50
    Hardolaf commented #728
  • Jun 23 17:14
    GlenNicholls commented #842
  • Jun 23 17:12
    GlenNicholls commented #842
  • Jun 23 13:57
    Hardolaf commented #728
  • Jun 23 13:41
    cmarqu commented #728
  • Jun 23 13:28
    std-max opened #845
  • Jun 23 11:44
    std-max opened #844
  • Jun 23 11:31
    std-max commented #356
  • Jun 23 11:24
    umarcor commented #658
  • Jun 23 11:18
    umarcor commented #842
Unai Martinez-Corral
@umarcor

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".

Aaron Panella
@a-panella
I just wanted to be able to follow Jim's quickref example for scoreboards, but ran into issues when trying to instantiate a generic pkg
Unai Martinez-Corral
@umarcor
I need to know what is the testbench entrypoint you are using (expecting to use). Is it a regular VUnit testbench, with a runner (string) top-level generic?
Or are you taking an OSVVM testbench as a foundation?
Aaron Panella
@a-panella
yes, same as I've used for all my other vunit testbenches, except in this one I am trying to use scoreboards;
Unai Martinez-Corral
@umarcor
Nice! Can you provide a MWE of the testbench file, including how you instantiate the scoreboard?
Don't worry about the run.py or how to install/build VUnit/OSVVM. I just need the testbench file.
Unai Martinez-Corral
@umarcor
As Jim commented, I've been lately looking into the details of how to combine OSVVMLibraries and VUnit. There are some corner cases, but your use case should be supported already. Since the Scoreboards are part of OSVVM's core, you don't need to download OSVVM on your own, nor use OSVB's scripts. Just using VUnit's add_osvvm alone should suffice. Nevertheless, I'm willing to understand what's the problem you are hitting.
Hold on a sec! This was merged after v4.6.0! VUnit/vunit@3a81795
Maybe that's causing your problem. Check the commit SHA of the VUnit version you are using. It needs to be from the last 7 days. If it's 9 days old, it's too old.
Aaron Panella
@a-panella
commit 58145ae779a140f9acd94e60d43741b84c75c5ab
2021-10-26 10:04 -0400 Colby Davis o Skip non-generic osvvm packages when the │Refs: [master], {origin/master}, {origin/HEAD}, v4.6.0-3-g58145ae7
Unai Martinez-Corral
@umarcor
That's good. The current master, one commit ahead of the fix.
Aaron Panella
@a-panella
yep
Unai Martinez-Corral
@umarcor
It might sound stupid, but remove vunit_out or use --clean, just in case.
Aaron Panella
@a-panella
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;
--clean did not improve anything, but maybe you can see in the MWE above if I've done anything really silly :)
Unai Martinez-Corral
@umarcor
I can reproduce the:
1: no declaration for "osvvm"
OSVVM.ScoreboardGenericPkg generic map(
^
Unai Martinez-Corral
@umarcor
Oh my! @a-panella, you are instantiating the package below the entity declaration! Therefore the scope is empty! Of course it cannot see OSVVM, neither vunit_lib, nor IEEE.. nothing at all!
Just reorder the content in your testbench file:
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;
This is the run script I used:
#!/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()
Unai Martinez-Corral
@umarcor
Before you say anything, do not feel ashamed at all. That's a very very very common mistake we all do.
Aaron Panella
@a-panella
@umarcor RIP, thanks for noticing that, I will move it in my tb
Unai Martinez-Corral
@umarcor

Note that you then might need to make it visible below, in order to use it in the architecture:

use work.ScoreBoardPkg_myslv;

Actually, you can change the name back to the original.

Aaron Panella
@a-panella
Yeah okay that is the dumbest thing I've done iin a while, sorry for wasting your time with it
Unai Martinez-Corral
@umarcor
It's ok. It was little time, and it served as an excuse for you to read and try OSVB (even though it was not necessary in the end) :laughing:
Aaron Panella
@a-panella
Actually I wasn't aware of OSVB until you posted it yesterday, I will look into, it looks very useful :)
Unai Martinez-Corral
@umarcor
It's basically a place for gathering proofs of concept and examples about how to combine VUnit, OSVVM, cocotb, UVVM and SVUnit. Not a project per se, but a trigger for the frameworks/methodologies to work together.
Feel free to reach if you have further issues combining VUnit and OSVVM.
Aaron Panella
@a-panella
thanks, I will
deepnlights
@deepnlights
image.png
I think VUnit doesn't support .awc file under using Riviera-PRO simualtion tool.
Does anyone know how to load waveform file using Riviera-PRO?
Dominic
@abaebae
@deepnlights if you generate the file via Riviera-Pro Gui just use the option Save to Macro.... This will generate a wave.do file VUnit can source
Jim Lewis
@JimLewis
@a-panella @umarcor This is why I put package instances in a separate file by themselves - even though they are short. They are a design unit and they require their own set of package references.
deepnlights
@deepnlights
@abaebae It's working. I appreciate for your help!
dpaul
@dpaul24
I am trying to run the /VUnit/vunit/blob/master/vunit/vhdl/verification_components/test/tb_axi_lite_master.vhd (I have my own master instantiated in the TB) and I am always getting a failure due to "core_pkg.vhd line 84". It has something to do with the mock() and unmock() procedures. Commenting them out but that does not help. Where can I gain some extra insight regarding these mock() and unmock() so that I can understand the failure better?
Lars Asplund
@LarsAsplund
@dpaul24 You can read more about mocking here: http://vunit.github.io/logging/user_guide.html#mocking
dpaul
@dpaul24
@LarsAsplund Thank you!
dpaul
@dpaul24
@umarcor @LarsAsplund > From what I have learnt up to now, multiple test-cases can be defined inside a VUnit TB using the run() procedure. The string depicting the test-case name inside the run("...") should not contain blank spaces, e.g. run("Test_single_write") is the correct way. In such a situation if the command py run.py <library_name_set>.<testbench_name_set>.<test-case-name_set> -v can be used to run selective test-cases. However if some uses run("Test single write"), using blank spaces within the string, then run.py will ignore that particular test-case.
Can anyone of your please confirm the above?
I mean VUnit will not throw an error when run("Test single write") is used, but if blank spaces is used within the string, then that particular test-case cannot be selectively run.
Unai Martinez-Corral
@umarcor
@dpaul24 you need to quote the test name in the CLI. Otherwise, the terminal (bash, powershell) is splitting the args, before reaching the tool (Python, VUnit).
py run.py '<library_name_set>.<testbench_name_set>.<test-case-name_set>' -v
That's annoying but standard terminal/shell behaviour.
dpaul
@dpaul24
@umarcor Ah ha! I got it now, thank you.
Either use no blank spaces or use quotes "....".
Lars Asplund
@LarsAsplund
@dpaul24 In the early days of VUnit, prior to the first public release, we had internal discussions about test case naming. Whether we should have arbitrary strings or restrict ourselves to identifier naming rules. SW unit test frameworks typically have identifier rules so there is a familarity with that. However, in the typical unit testing framework the test case is represented by a method or a function in which case naming is limited. To allow naming strategies that are very verbose, for example those promoted by BDD, we decided to go for an approach that allows for natural language naming. Some people still prefer identifier naming but VUnit doesn't impose such restrictions.
Carlos Alberto Ruiz Naranjo
@qarlosalberto
is it possible to pass a dictionary as generic from run.py to ModelSim test?
Unai Martinez-Corral
@umarcor
@qarlosalberto check the json4vhdl example