Hi,
I have an interface, say ‘top_interface’.
It takes a parameter called ‘NUM_INSTS’. Based on this parameter there is an internal generate block which instantiates two other interfaces, say ‘sub_if0’ and ‘sub_if1’.
Below code for reference
interface top_interface #(parameter NUM_INSTS=2);
genvar ii;
generate
for(ii=0 ; ii<NUM_INSTS ; ii++)
begin : per_inst_if
// Sub interfaces
sub_if0 sif0();
sub_if1 sif1();
end
endgenerate
endinterface
Now, I pass this interface to my uvm_test_top using config_db. Code below (top interface instance name being ‘top_intf’)
uvm_config_db #(virtual top_interface#(.NUM_INSTS(1)))::set(null, "uvm_test_top", "top_if", top_intf)
In the base test when I get the top interface using config_db::get(), I would like to pick and pass the sub interfaces to the env hierarchy. using config_db::set()
When I try to pass, say ‘sub_if0’ from handle of the virtual interface after fetching, to the env hierarchy, I am getting compilation errors stating [MFNF] i.e. member not found.
My code for setting the sub interface to the sub hierarchy in my uvm test top. (Assume that the virtual interface handle name of ‘top_interface’ in my test top is ‘top_intf’)
foreach(top_intf.genblk1[i])
begin
uvm_config_db #(virtual sub_if0)::set(this, "*", "sif0", top_intf.per_inst_if[i].sif0);
end
What is the correct way to reference the sub interface which is part of the generate block when working with config db’s ?.
I have also tried naming the generate block, but to no avail.
Thanks
Jayant Y