hi All,
I’m new to uvm. by using generate we can set array of interfaces in top module. but i have to set array of virtual interfaces in program block only. please help me on following error.
Error:
Illegal operand for constant expression
this error pointing out i in below line.
uvm_config_db#(virtual intf )::set(null, $sformatf(“uvm_test_top.env.agent[%0d]”,i), “vif”, top.vif[i]);
code:
include “program_file.sv”
module top();
intf vif5;
endmodule
program automatic program_file();
int i;
initial begin
for (i= 0; i < 5; i++ ) begin
uvm_config_db#(virtual intf )::set(null, $sformatf(“uvm_test_top.env.agent[%0d]”,i), “vif”, top.vif[i]);
end
end
endprogram