Intro
Questa comes with pre-compiled UVM package and the source files. No need to recompile it. To use UVM, just use uvmcontrol switch to enable it.
1 |
vsim -uvmcontrol=all |
or in modelsim.ini
1 2 |
[vsim] UVMControl = all |
Below shows the meaning of each -uvmcontrol option. Default is to use all.
Debug visibility
You can use below to turn on visibility at top level
1 |
vsim -voptargs=+acc=lprn+top |
or turn on visibility at blockA and blockB
1 |
vsim -optargs=+acc=lprn+top.blockA+top.blockB |
Just note turning on visibility may affect optimization so you want to enable visibility selectively.
Class nomenclature
In UVM print out messages, you may see something like @uart_item@2. Here each class instance is assigned a unique ID in the format of @class_type@#, where class_type is the name of the class type and # is assigned to uniquely identify an instance. So @uart_item@2 is the 2nd instance of the class type uart_item.
Note if a class is instantiated with different parameters, the corresponding classes are treated differently.
1 2 3 4 5 |
class example #(int size =1); ... end class example #(3) example_inst1 =new(); example #(4) example_inst2 =new(); |
For above code, Questa will use /top/example/example__1 for the first class and /top/example/example__2 for the 2nd class.
UVM Commands
You can enter below UVM commands in Questa transcript window to show debug information.
For example, you can do uvm call and it bounces back the result.
1 2 |
VSIM 8> uvm call top.blockA.get_full_name() # top.blockA |
Now we open Questa and load a sample UVM test bench. The Questa window may look like below.
Where you can clearly see Instance window which lists classes and their instances, and Transcript window where you can type in TCL command.
In Transcript window, we type in
1 |
uvm printtoplogy |
and the result is as below.
In Transcript window, we type in
1 |
uvm printfactory |
and it shows factory info such as class override as below.
So above says driverA is overriden by driver2A. If we check uvm_test_top module, line 35 shows drive2A type overrides driveA type.
Another way to check override information is to do
1 |
find insource "_override(driver" |
and the result is shown as
Or you can even do
1 |
uvm printconfig |
There are lots of info bounced back so it is intended for experienced UVM designer.
Next let’s check a configuration, num_sequence_A_grandparent, of i2_agentA sequencer. In instance window, we right click on i2_agent sequencer and select UVM and then View UVM Details.
The UVM Detail window is as below and it shows num_sequence_A_grandparent is written value 2 once but no read and is written value 4 once and there is a read (so value 4 is used in configuration).
The same info can be displayed by using “find insource” as well.
Note the displayed code are in green color and they are hyperlinked. Double click on the code will get you to the source code.
Another useful uvm command is “uvm displayobjects” to check objections raised by sequencers and result is
Good tutorial about using UVM static commands to browse through UVM structures. Hope there is a part talking about waveform debugging, breakpoint, step execution, etc.
Overall not bad for a beginner to touch UVM debugging in Questa. Some images are small and blurred.