How To: Use UVM in DSim Desktop
Prerequisites
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. In the Visual Studio Code (VSC) Explorer, navigate to the folder where you want to create your DSim Project File (.dpf), right-click the folder and select DSim Desktop: New Project.
3. Add files to your project, adding -uvm <version>
to the compile options of every file and file list that require the UVM package, where <version>
is either 1.2
, 1.1d
, or 1.1b
. These are the files and file lists under LIBRARY CONFIGURATION. For example, in the Configure File tab:
-uvm 1.2 for the Options.
4. Add a simulation configuration to elaborate your top-level module with the -genimage image -uvm <version>
option. For example, in the Configure Simulation tab:
Elab 1 for the Simulation Name.
-top work.tb -genimage image -uvm 1.2 +acc+b for the Options.
5. For each UVM test, add a simulation configuration to run your elaborated image with the -image image -uvm <version>
option. For example, in the Configure Simulation tab:
Sim 1 for the Simulation Name.
-image image -uvm 1.2 -waves waves.mxd +UVM_NO_RELNOTES +UVM_TESTNAME=test_1 for the Options.
6. Compile your project by clicking the 'Compile Project' button beside LIBRARY CONFIGURATION.
7. Elaborate your project by clicking the 'Run' button beside the "elaborate" simulation configuration from step 4. For example, Elab 1 under the SIMULATION CONFIGURATION.
8. Run your project by clicking the 'Run' button beside any "run" simulation configurations from step 5. For example, Sim 1 under the SIMULATION CONFIGURATION.
9. Anytime you recompile your project, a library, or a file under LIBRARY CONFIGURATION, you will have to re-run the "elaborate" simulation configuration before re-running a "run" simulation configuration.
Example design
For an example, use the uvm-hello-world example design. If you haven't already done so,
1. Download uvm-hello-world-main.zip.
2. Extract the zip file into a folder with read/write access.
3. Open the folder and rename the subfolder uvm-hello-world-main to uvm-hello-world.
4. Follow the instructions in README.md To simulate with DSim Desktop.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article