Setting verbosity level to components from test

Is it possible to set verbosity level (using set_report_id_verbosity) from build phase of test file to a macro in build phase of agent component ?

I tried something like this:

env_h.ahb_agent.set_report_id_verbosity(“ahb_agent”,UVM_HIGH);

where, ahb_agent is the name of the agent.

but I get error. (I guessed i would get error)

** Error: test_lib.sv(35): Field/method name (ahb_agent) not in ‘env_h’

I wanted to know is it even possible to set verbosity between same phases in two different files?

Thank you.

In reply to rakesh2learn:

As build_phase() is top-down, test creates object on env_h but env build_phase is not yet executed and you don’t have object created on ahb_agent handle.

Move same code to connect_phase() or any other phase after build_phase().

But in above case also you should get error for “NULL handle dereference”. Check if handle name for ahb_agent is correct.

In reply to mayurkubavat:

I have created handle for agent, in that case also

** Error: test_lib.sv(35): Field/method name (ahb_agent1) not in ‘env_h’

Anyways, I got your point (top-down approach). Thank you.