I have a 'parametrised' module(lets say mod) that has a 'parametrised' interface (lets say intf) inside it . I do the following in my top module:
initial
begin
uvm_config_db #(virtual intf)::set(null, "uvm_test_top", "vif", test_mod.test_intf);
run_test();
$finish;
end
test_mod is an instance of type mod (instantiated in top module). test_intf is an instance of type intf instantiated inside module mod. I tried to use permit_unmatched_virtual_intf flag with vsim command but I still get the error "interface must be assigned a matching interface or virtual interface".
I changed the above line to:
uvm_config_db #(virtual intf#(LINK_SPEED(4'h2))::set(null, "uvm_test_top", "vif", test_mod.test_intf);
Where LINK_SPEED is the parameter. Now this gives me the next error("[NOVIF] virtual interface must be set for: uvm_test_top.vif") in uvm_test class where I do the following in the build phase:
if(!uvm_config_db#( virtual intf)::get(this, "", "vif", hook))
`uvm_fatal("NOVIF",{"virtual interface must be set for: ",get_full_name(),".vif"});
hook is declared as : virtual intf hook. If I try to parametrise the hook declaration and the above statement, I go back to the original error. Can somebody help ?