My env's build_phase function not invoked

Hi,

Trying to integrate an UVM based verification collateral in a verilog based environment.
I have a env by name “local_env” and I create this “local_env” in a top level env’s build phase. (tb_env is the name for top level env).
This verification infrastructure is compile and elab clean.

The problem being faced is, I am unable to see build_phase method of local_env getting called at all!
I do see the print messages from build_phase of tb_env but not local_env.

Can someone help me understand what I might have missed here.

Are you creating the lower level environment in your top level env ?

the build phase for the top level env should create any lower level env(s)

e.g.

virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
block_a_env = block_a_env_t::type_id::create(“block_a_env”,this);
block_a_env.set_config(configuration.block_a_env_config);
block_b_env = block_b_env_t::type_id::create(“block_b_env”,this);
block_b_env.set_config(configuration.block_b_env_config);
endfunction

In reply to graeme_jessiman:

Hi Jessiman,
Yes I’m creating lower level environment in top level environment.

In reply to naveensv:
If your local_env is not an extension of uvm_env it is not part of the env chain and outside of the UVM phased-approach.

In reply to naveensv:

If “local_env” is extended from uvm_component (which uvm_env is), then its build_phase should be called at some point. Without seeing any code, it is difficult to guess why. The only thing I can offer is:

Put a print statement inside the constructor of local_env to make sure it is being constructed.
Double check that you spelled build_phase() correctly — there is no error message if you misspell it.

Figured out the problem.
This was my new method in tb_env.

function new (string name, uvm_component parent);
super.new();
endfunction

After passing name and parent arguments to super.new(), it is working fine for me.

Thanks all for your valuable time.