Running UVM 1.2 Testbench - Quick Start
A quick guide to compile and run a UVM 1.2 testbench with QuestaSim or other simulators.
Step 1: Download UVM Library
Download the UVM 1.2 library from Accellera.
Step 2: Extract and Locate Package
After extraction, the main package file is located at:
uvm-1.2/src/uvm_pkg.sv
Step 3: Configure Compilation
QuestaSim Commands
# Create work library
vlib myWork
vmap work myWork
# Compile with UVM
vlog -work myWork -f tb.f +define+UVM_NO_DPI
# Run simulation
vsim -c work.tb_top -do "run -all"
File List (tb.f)
# UVM package include path
+incdir+uvm-1.2/src
# UVM package
uvm-1.2/src/uvm_pkg.sv
# Your testbench files
+incdir+./tb
./tb/tb_pkg.sv
./tb/tb_top.sv
Important Flags
| Flag | Description |
|---|---|
+incdir+<path> | Add include directory for `include directives |
+define+UVM_NO_DPI | Disable DPI (required if DPI not supported) |
+UVM_TESTNAME=<test> | Specify test to run (runtime) |
+UVM_VERBOSITY=<level> | Set message verbosity (UVM_LOW, UVM_MEDIUM, UVM_HIGH) |
Example Run Command
vsim -c work.tb_top +UVM_TESTNAME=my_test +UVM_VERBOSITY=UVM_MEDIUM -do "run -all"
Note: The
+define+UVM_NO_DPIflag is needed when your simulator doesn't support DPI or you want to avoid DPI compilation. For full functionality including backdoor access, DPI should be enabled.
Comments (0)
Leave a Comment