Hello
Here is the code that I use and works for me:
module bb_tb ();
ifc_ulpi ifc_ulpi();
initial
begin
uvm_config_db#(virtual ifc_ulpi)::set(uvm_top, "", "ifc_ulpi", ifc_ulpi);
run_test();
end
endmodule
class class_bb_test extends uvm_test;
virtual ifc_ulpi ifc_ulpi;
function void build_phase(uvm_phase phase);
super.build_phase(phase);
if (!uvm_config_db#(virtual ifc_ulpi)::get(this, "", "ifc_ulpi", this.ifc_ulpi))
`uvm_fatal("NOVIF",{"virtual interface must be set for: ", get_full_name(),".ifc_ulpi"});
endfunction
endclass
I think when you use uvm_top for the set it makes that entry visible from the top down to all lower level classes.