I use the following function in the test for view the structural composition of the testbench classes and the factory setup:
function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
this.print();
factory.print();
endfunction
I got the following error:
** Error (suppressible): axi_test.sv(23): (vlog-7027) The name ('factory.print
‘) was not found in the current scope. Please verify the spelling of the name ’
factory.print’.
print() method call on factory prints the state of the uvm_factory, including registered types, instance overrides, and type overrides. While this.print() prints component hierarchy.
uvm_coreservice_t is a common point for all central uvm services such as uvm_factory, uvm_report_server, etc. Look into base/uvm_coreservice.svh for more.
Note that uvm_coreservice_t is applicable ONLY to UVM 1.2.
Since UVM 1.2 is still not an official release of UVM, it is recommended to use UVM 1.1d which is shipped pre-compiled with Questa. UVM 1.2 should be used only for testing.
To display the current factory status in UVM 1.1d, you can use factory.print() from your test, typically in the end_of_elaboration_phase().
class axi_test extends uvm_test;
//factory registration
`uvm_component_utils(axi_test)
//constructor
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction: new
//build phase
function void build_phase(uvm_phase phase);
super.build_phase(phase);
endfunction: build_phase
//view the structural composition of the testbench classes and the
//factory setup
function void end_of_elaboration_phase(uvm_phase phase);
super.end_of_elaboration_phase(phase);
this.print();
factory.print();
endfunction