functionvoid test_base::start_of_simulation_phase(uvm_phase phase); super.start_of_simulation_phase(phase); uvm_top.print_topology(); // Will not compile in UVM-1.2 factory.print(); // Will not compile in UVM-1.2 endfunction
Global handles uvm_top and factory in uvm_pkg have been removed in
UVM-1.2 and later
Mechanism in UVM-1.1 and
UVM-1.2
Call the get() method of the class to retrieve the
singleton handle.
1 2 3 4 5
functionvoid test_base::start_of_simulation_phase(uvm_phase phase); super.start_of_simulation_phase(phase); uvm_root::get().print_topology(); // Works in UVM-1.1 & UVM-1.2 uvm_factory::get().print(); // Works in UVM-1.1 & UVM-1.2 endfunction
uvm_coreservice_t is the uvm-1.2 mechanism for
accessing all the central UVM services such as
uvm_root,uvm_factory,
uvm_report_server, etc.
1 2 3 4 5 6 7
// Using the uvm_coreservice_t: uvm_coreservice_t cs; uvm_factory f; uvm_root top; cs = uvm_coreservice_t::get(); f = cs.get_factory(); top = cs.get_root();
Check all configuration settings in a components configuration table
to determine if the setting has been used, overridden or not used. When
recurse is 1 (default), configuration for this and all child
components are recursively checked. This function is automatically
called in the check phase, but can be manually called at any time.
To get all configuration information prior to the run phase, do
something like this in your top object:
A default sequence is a root sequence, so the pre/post
body methods are executed and objection are raised/dropped
there
Test sequence:
A test sequence is a root sequence, so the pre/post
body methods are executed. However, for a test sequence,
starting_phase is null and so the objection is
not handled in the sequence. The test must raise and drop objections
Subsequence:
Not a root sequence, so pre/post body methods are
not executed. The root sequence which ultimately called the subsequence
handles the objections, using one of the two options above.
If a sequence is call via a `uvm_do
variant, the it is defined as a subsequence and its
pre/post_body() methods are not executed.
objection change in UVM1.2
Raising or dropping objections directly from
starting_phase is deprecated
The system task has no versions to accept octal data or decimal
data.
The 1st argument is the data file name.
The 2nd argument is the array to receive the data.
The 3rd argument is an optional start address, and if you provide
it, you can also provide
The 4th argument optional end address.
Note, the 3rd and 4th argument address is for array not data
file.
If the memory addresses are not specified anywhere, then the system
tasks load file data sequentially from the lowest address toward the
highest address.
The standard before 2005 specify that the system tasks load file data
sequentially from the left memory address bound to the right memory
address bound.
A range of contiguous bits can be selected and is known as
part-select. There are two types of part-selects, one
with a constant part-select and another with an
indexed part-select
1 2
reg [31:0] addr; addr [23:16] = 8'h23; //bits 23 to 16 will be replaced by the new value 'h23 -> constant part-select
Having a variable part-select allows it to be used effectively in
loops to select parts of the vector. Although the starting bit can be
varied, the width has to be
constant.
[<start_bit +: ] // part-select increments from
start-bit
[<start_bit -: ] // part-select decrements from
start-bit
-lca: Enables Limited Customer Availability feature,
which is not fully test
+vpi: Enables the use of VPI PLI access
routines.
Verilog PLI (Programming Language Interface) is a mechanism to
invoke C or C++ functions from Verilog code.
-P <pli.tab>: Specifies a PLI table file
${VERDI_HOME}/share/PLI/VCS/LINUX64/novas.tb
+define+=: Define a text macro,
Test for this definition in your Verilog source code using the
`ifdef compiler directive
+define+SIMULATION when compiling
`ifdef SIMULATOIN in code
-debug_access: Enables dumping to FSDB/VPD, and
limited read/callback capability. Use -debug_access+classs
for testbench debug, and debug_access+all for all debug
capabilities. Refer the VCS user guide for more granular options for
debug control under the switch debug_access and refer to
debug_region for region control
-y : Specifies a Verilog library
directory to search for module definitons
-v <filename>: Specifies a Verilog library
file to search for module definitons
+nospecify: Suppresses module path delays and time
checks in specify blocks
-l <filename>: (lower case L) Specifies a log
file where VCS records compilation message and runtime messages if you
include the -R, -RI, or -RIG option
+vcs+fsdbon: A compile-time
substitute for $fsdbDumpvars system task. The
+vcs+fsdbon switch enables dumping for the entire
design. If you do not add a corresponding
-debug_access* switch, then -debug_access is
automatically added. Note that you must also set
VERDI_HOME.
$ ./simv
FSDB Dumper for VCS, Release Verdi_S-2021.09-SP2-2, Linux
x86_64/64bit, 05/22/2022 (C) 1996 - 2022 by Synopsys, Inc. *Verdi* :
Create FSDB file 'novas.fsdb' *Verdi* : Begin traversing the scopes,
layer (0). *Verdi* : End of traversing.
+vcs+vcdpluson: A compile-time
substitute for $vcdpluson system task. The
+vcs+vcdpluson switch enables dumping for the entire
design. If you do not add a corresponding
-debug_access* switch, then -debug_access is
automatically added
$ ./simv
VCD+ Writer S-2021.09-SP2-2_Full64 Copyright (c) 1991-2021 by
Synopsys Inc.
+incdir+<directory>: Specifies the directories
that contain the files you specified with the `include
compiler directive. You can specify more than on directory, separating
each path name with the + character.
Compile time Use Model
Just add the -kdb option to VCS executables when running
simulation
Three steps flow:
vlogan/vhdlan/syscan -kdb
Compile design and generate un-resolved KDB to
./work
vcs -kdb -debug_access+all <other option>
Generate elaborated KDB to ./sim.dadir
Two steps flow:
vcs -kdb -debug_access+all <other option>
Compile design and generate elaborated KDB to
./simv.dadir
Common simv Option
-gv <gen=value>: override runtime VHDL generics
*
-ucli: stop at Tcl prompt upon start-up
-i <run.tcl>: execute specified Tcl script upon
start-up
-l <logfile>: create runtime logfile
-gui: create runtime logfile
-xlrm: allow relaxed/non-LRM compliant code
-cm <options>: enable coverate options
verdi binkey
SHIFT+A: Find Signal/Find Instance/Find
Instport
SHIFT+S: Find Scope
module traverse
Show Calling
Show Definition
Double-Click instance name is same with click
Show Definition
Double-Click module name is same with click Show
Calling
signal traverse
Driver
Load
Double-Click signal name is same with click
Driver
-simBin <simv_executable>: Specify the path of the
simulation binary file.
-dbdir: Specify the daidir (simv.daidir ) directory to
load
In the VCS two-step flow, the VCS generated KDB (kdb.elab++) is saved
under the simv.daidir/ directory (like
simv.daidir/kdb.elab++).
-f file_name / -file file_name: Load an ASCII file
containing design source files and additional simulator options
Import Design from UFE
Knowledge Database (KDB): As it compiles the design,
the Verdi platform uses its internal synthesis technology to recognize
and extract specific structural, logical, and functional information
about the design and stores the resulting detailed design information in
the KDB
The Unified Compiler Flow (UFE) uses VCS with the -kdb
option and the generated simv.daidar includes the
KDB information
verdi -dbdir simv.daidir
Use the new -dbdir option to specify the simv.daidir
directory
verdi -simBin simv
Load simv.daidir from the same
directory as simv and invoke Verdi if
simv.daidir is available
verdi -ssf novas.fsdb
Load KDB automatically from FSDB,
For 2 and 3, use the -dbdir option to load
simv.dadir if you have move it to somewhere else
Reference Design
and FSDB on the Command Line
1
verdi -f <source_file_name> -ssf <fsdb_file_name>
Where, source_file_name is the source file name and fsdb_file_name is
the name of the FSDB file