Array of interface in config_bd

how to set the array of a interface in config_bd in top module .
i am using for loop but its giving error …
please suugest me …

In reply to snayak@aimstechnology.inc:

Your question in very vague. You are going to have to post your code and the specific error message(s) you are getting so we can help.

In reply to cgales:

hi… please find my snap of code …
i have used a arry of interface …

module top;

axis_interface axis_intf[2][aclk];///my interface instantiation

initial begin
for(int i=0;i<2;i++) begin
uvm_config_db#(int)::set(uvm_top.“uvm_test_top.env.agent”,“is_active”,uvm_active);
uvm_config_db#(virtual axim_interface)::set(uvm_top,“*”,"“vif”,axim_intf[i]);
end
run_test()
end
endmodule

In reply to snayak@aimstechnology.inc:

And what is the error you are seeing? There are several issues readily apparent with your code, but it is hard to address your specific question without knowing what errors you are having and what you are trying to accomplish.

@snayak

Please use code tags to post the code. like this for better readability.

module top;
 
axis_interface axis_intf[2][aclk];///my interface instantiation
 
initial begin
for(int i=0;i<2;i++) begin
uvm_config_db#(int)::set(uvm_top."uvm_test_top.env.agent","is_active",uvm_active);
uvm_config_db#(virtual axim_interface)::set(uvm_top,"*",""vif",axim_intf[i]);
end
run_test()
end

First thing, there is “.” instead of “,”
Your code :

uvm_config_db#(int)::set(uvm_top."uvm_test_top.env.agent","is_active",uvm_active);

Fixed code :

uvm_config_db#(int)::set(uvm_top,"uvm_test_top.env.agent","is_active",uvm_active);

also no need to set is_active in for loop as there is no change. You can put it outside loop.
2nd thing, there is one extra ‘"’ quote while setting interface.
Your Code :

uvm_config_db#(virtual axim_interface)::set(uvm_top,"*",""vif",axim_intf[i]);

Fixed code :

uvm_config_db#(virtual axim_interface)::set(uvm_top,"*","vif",axim_intf[i]);

Seems like basic compilation issues :)

Also I would suggest to have different string for each interface you set in configDB

uvm_config_db#(int)::set(uvm_top."uvm_test_top.env.agent","is_active",uvm_active);
for(int i=0;i<2;i++) begin
uvm_config_db#(virtual axim_interface)::set(uvm_top,"*",$sformatf("vif[%0d]",i),axim_intf[i]);
end

Vinay Jain
v4verification.com

In reply to Vinay Jain:

You don’t want to use “*” for the target scope for your interfaces. When placing the virtual interface handles into the config_db, you should use “uvm_test_top” as the target scope. The reason for this is that your test will create the agent configuration objects and set the virtual interface handles inside the configuration object appropriately.

Also, the “is_active” field should also be part of the agent configuration object an should configured as part of the test and not from the top-level module.