The hidden UVM documentation

Easy access to all docs from UVM 1.1d to IEEE 1800.2-2020



Unit Testing UVM code with SVUnit

You see a UVM_ERROR in a simulation.

Now the debug begins. Is the bug in the RTL or in the Testbench? How do you know?

Your unit tests of your UVM code should be giving you the answer.

Learning Unit Testing with SVUnit

SVUnit Documentation

Videos about SVUnit

SVUnit articles

SVUnit Examples

Downloading SVUnit

You will need perl to run SVUnit. There is not specific requirement for a recent version. I have Perl v5.32.1 which works.

Downloading SVMock

git clone https://github.com/tudortimi/svmock.git

Small tips when using SVUnit

Integrating SVUnit into any crazy simulator setup

Some companies have crazy simulator setups that make SVUnit harder to adopt.

But fear not. SVUnit has ways around this obstacle. SVUnit runs in two phases:

  1. A Build phase that generates all required SystemVerilog code and compile files.
  2. A Run phase where a simulator is called with all the generated code.

runSVUnit calls both phases, but the build phase is a separate script (buildSVUnit) that works in isolation.

You can call buildSVUnit directly like this:

buildSVUnit -o obj --uvm --mock

buildSVUnit will create all requred files in the obj directory. You can then invoke your simulator with your own crazy setup. SVUnit will print the full command that it is going to invoke the simulator with. You can use this string integrate SVUnit into your flow. For Example:

runSVUnit -o obj --uvm --sim ius

Assume that you want to integrate SVUnit into your flow that runs Cadence Incisive. Run runSVUnit in a temporary directory on a machine that doesn't have Cadence Incisive installed. Use the tail of the output from runSVUnit to integrate SVUnit into your flow:

cd obj; irun -l run.log  -uvm -f .svunit.f +define+SVUNIT_VERSION='"SVUnit unrel"' +define+RUN_SVUNIT_WITH_UVM   -top testrunner +SVUNIT_FILTER=*
sh: irun: command not found