0% found this document useful (0 votes)
261 views3 pages

QuestaSIM Guide

This document discusses using the Universal Verification Methodology (UVM) class library with Questa simulations. It describes how UVM can be used out-of-the-box with pre-compiled versions of UVM that ship with Questa. It also covers controlling the UVM version, compiling UVM automatically with 'vlog', and using the Questa debug package with a compiled UVM.

Uploaded by

irfanmao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
261 views3 pages

QuestaSIM Guide

This document discusses using the Universal Verification Methodology (UVM) class library with Questa simulations. It describes how UVM can be used out-of-the-box with pre-compiled versions of UVM that ship with Questa. It also covers controlling the UVM version, compiling UVM automatically with 'vlog', and using the Questa debug package with a compiled UVM.

Uploaded by

irfanmao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

 Questa/CompilingUVM

Contents

 1 Introduction
 2 Simulating the UVM Out-Of-The-Box with Questa
o 2.1 Controlling UVM Versions
 2.1.1 Modify the modelsim.ini File
 2.1.2 Command Line Switch
 3 Compiling UVM Automatically with 'vlog'
o 3.1 Questa Debug Package

Introduction
The UVM class library is an open source SystemVerilog package that relies on DPI c code in order to
implement some of the library features such as regular expression matching and register backdoor
accesses.

For UVM, we recommend using the built-in, pre-compiled UVM and DPI compiled libraries that ship
with Questa. This will remove the need to install any compilers or create a "build" environment.
Depending on the Questa version there should be at least 2-3 versions of the UVM library available.

Simulating the UVM Out-Of-The-Box with Questa


UVM can be used out of the box with Questa very easily. A precompiled, auto-loading version of
UVM is available with every release after Questa 10.0a including 10.0a. This includes the
SystemVerilog package and the DPI shared object. If any of your code imports the uvm_pkg (import
uvm_pkg::*;), then these will be loaded automatically for you.

If you have a file called hello.sv which imports the uvm_pkg, then your flow would look like this:

vlib work
vlog hello.sv
vsim hello ...
Notice that we don't have to specify +incdir+$UVM_HOME/src or add a -sv_lib command to the vsim
command to load the uvm_dpi shared object.

Controlling UVM Versions


Each release of Questa comes with multiple versions of the UVM pre-compiled and ready to load. By
default, a fresh install of Questa will load the latest version of UVM that is available in the release. If
an older version of UVM is needed, this version can be selected in one of two ways.
Modify the modelsim.ini File
Inside the modelsim.ini file, it contains a line which defines a library mapping for Questa. That line is
the mtiUvm line. It looks something like this:

mtiUvm =$MODEL_TECH/../uvm-1.1d
This example is pointing to the UVM 1.1d release included inside the Questa release. If we wanted to
upgrade to UVM 1.2, then we would simply modify the line to look like this:

mtiUvm =$MODEL_TECH/../uvm-1.2
Command Line Switch
The Questa commands can also accept a switch on the command line to tell it which libraries to look
for. This switch overrides what is specified in the modelsim.ini file if there is a conflict. The switch is '-
L'. If this switch is used, then all Questa commands with the exception of vlib will need to use the
switch.

vlib work
vlog hello.sv -L$QUESTA_HOME/uvm-1.2
vsim hello -L$QUESTA_HOME/uvm-1.2 ...

Compiling UVM Automatically with 'vlog'


To compile the UVM library automatically with 'vlog' requires a few extra steps. The uvm_pkg must
be compiled along with the uvm_dpi shared object. Additionally, +incdir+$UVM_HOME/src must be
added to any vlog command which compiles files which `include any uvm files such as
uvm_macros.svh. You would need to compile the UVM library with 'vlog' if you want to download the
UVM library manually, if a different set of defines is being applied, if there are user defined patches
or possibly for political reasons.

To compile the same hello.sv file while also compiling the uvm_pkg manually, then the flow would
look like this:

vlib work
# Compile your own UVM
vlog +incdir+$UVM_HOME/src$UVM_HOME/src/uvm_pkg.sv$UVM_HOME/s
rc/dpi/uvm_dpi.cc
# Compile your testbench code
vlog +incdir+$UVM_HOME/src hello.sv
vsim hello ...
Notice that we are specifying the dpi c code on a command line directly to vlog. Vlog handles
compiling and automatically adding a -sv_lib switch to the vsim command line for us.

Questa Debug Package


Questa includes a SystemVerilog package which enables UVM specific debug features. This package
is called questa_uvm_pkg. If the UVM library is compiled with vlog, then the questa_uvm_pkg must
also be compiled with vlog. This can be done by adding another vlog command after the uvm_pkg
compile.

vlib work
# Compile your own UVM
vlog+incdir+$UVM_HOME/src $UVM_HOME/src/uvm_pkg.sv $UVM_HOME/
src/dpi/uvm_dpi.cc
# Compile the questa_uvm_pkg
vlog+incdir+$UVM_HOME/src+incdir+$QUESTA_HOME/verilog_src/que
sta_uvm_pkg-1.2/src \
$QUESTA_HOME/verilog_src/questa_uvm_pkg-1.2/src/questa_uvm_
pkg.sv
# Compile your testbench code
vlog+incdir+$UVM_HOME/src hello.sv
vsim hello ...
The questa_uvm_pkg must be compiled because it references the uvm_pkg which was compiled with
vlog.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy