How To: Use UVM in DSim

Modified on Tue, 9 Jul at 6:08 PM

How To: Use UVM in DSim


Prerequisites

  1. Install DSim Desktop.
  2. Tour of DSim Desktop.

Procedure

1. Include uvm_macros.svh and import the UVM package in all your design files that require them by including these 2 lines at the top of each design file.


 

`include "uvm_macros.svh"
import uvm_pkg::*;

 

2. Execute the following DSim commands either in the DSim Desktop terminal shell of Visual Studio Code (VSC), or your own terminal shell that has been configured to run DSim.


3. Compile (analyze) every file and file list that require the UVM package with the -uvm <version> option, where <version> is either 1.2, 1.1d, or 1.1b. For example:


 

dvlcom -uvm 1.2 ../tb/tb.sv

 

If you prefer to do the 2-step Method of simulation as described in How To: Simulate Mixed Language Designs, you can skip this step and go right to the next step.


4. Elaborate your top-level module with the -genimage image -uvm <version> option. For example:


 

dsim -top work.tb -genimage image -uvm 1.2 ../filelist.txt +acc+b

 

5. For each UVM test, run your elaborated image with the -image image -uvm <version> option. For example:


 

dsim -image image -uvm 1.2 -waves waves.mxd +UVM_NO_RELNOTES +UVM_TESTNAME=test_1

 

For more information about working with multiple images, see User Guide: DSim Compile Once, Run Multiple Times.


6. Anytime you recompile your design, a library, or a file, you will have to re-run the elaboration in step 4 before re-running a UVM test in step 5.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article