I have created a component with it's ' parent ' argument as null
( i.e It comes a child of uvm_root i.e a Top - Level Component )
`include "uvm_pkg.sv"
`include "uvm_macros.svh"
import uvm_pkg::*;
class base_comp extends uvm_component ;
// Factory Registration N Std. 3 line Component Constructor
function void build_phase ( uvm_phase phase ) ;
`uvm_info( get_name , $sformatf(" In build_phase() of base_comp") , UVM_NONE )
endfunction
endclass
class my_env extends uvm_env ;
// Factory Registration N Std. 3 line Component Constructor
base_comp base_h ;
function void build_phase ( uvm_phase phase ) ;
base_h = base_comp :: type_id :: create( "base_h" , null ) ; // ' null ' parent !!
endfunction
endclass
class user_test extends uvm_test ;
// Factory Registration N Std. 3 line Component Constructor
my_env my_env_h ;
function void build_phase ( uvm_phase phase ) ;
my_env_h = my_env :: type_id :: create("my_env_h",this) ;
endfunction
endclass
module top_tb ;
initial run_test("user_test") ;
endmodule
I Observe Output as ::
UVM_INFO @ 0: reporter [RNTST] Running test user_test...
NOTE :: There is No display from the build_phase() of base_comp !!
If I Print Topology in connect_phase() of user_test , I Observe that base_comp has been created
However when I change the syntax to create ::
base_h = base_comp :: type_id :: create( "zase_h" , null ) ; // Changed the name argument
Now I Observe Output as ::
UVM_INFO @ 0: reporter [RNTST] Running test user_test...
UVM_INFO @ 0: zase_h [zase_h] In build_phase() of base_comp
[Q] So why doesn't build_phase() start in the Original Code ?