Hello,
I am following this link for creating an uvm_config_db set method Issue with putting an array of interface into uvm_config_db | Verification Academy
Code :
parameter int myparams[4] = '{0,1,2,3}
for (genvar i = 0; i < 4; i++) begin
output_interface #(myparams[i]) output_intfi;
uvm_config_db #(virtual output_interface#(myparams[i]))::set(null, “*”, “OUTPUT_INTF”, output_intf[i]);
end
Switch DUT(.clk(Clock),
…
.port0(Output_intf[0].data_out),
.port1(Output_intf[1].data_out),
.port2(Output_intf[2].data_out))
Error found while trying to cross reference
token ‘output_intf’.
Source Info : .port0(Output_intf[0].data_out)
Any help on how to resolve this error would be of much help.
Have you tried using only output_intf instead of output_intf[i] in the instance creation and set?
In reply to sharvil111:
Thanks for the reply. (I am trying to create testbench for a switch which has 1 input, 1 memory and 4 output interface.In order to create 4 output interface instead of explicitly doing a uvm_config_db set for output_intf[0]…output_intf[4] I tried doing it in a single step using the for loop. )
I edited the set line again such that the name (output_intf[0]…)
uvm_config_db #(virtual output_interface#(myparams[i]))::set(null, “*”, $sformat (“output_intf[%0d]”,i), output_intf[i]);
The one you suggest is for creating a single interface.
In reply to Aparna Elango:
I have created a sample example at EDAPlayground. This is similar to your requirement.
Using the above sample, I create instances of interfaces and pass them to TB.
In reply to sharvil111:
Thank you so much. The Example was very clear.