# Multiple UVC's/agents

**URL:** <https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [August 31, 2013, 6:07pm UTC](https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780 "2013-08-31T18:07:42Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![roopa\_wsemi](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@roopa\_wsemi](https://verificationacademy.com/forums/u/roopa_wsemi)\
**Post date:** [June 6, 2018, 8:23am UTC](https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780/10 "2018-06-06T08:23:45Z")

</div>

_In reply to [tfitz](https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780/9):_

> _In reply to [leela](https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780/9):_  
> If the DUT has 8 separate interfaces, then using an array of interfaces and an array of agents is the right way to organize things. You would only need the generate loop to connect each interface instance to the corresponding interface on the DUT. In the testbench, a regular for-loop can be employed to use the config\_db to pass each virtual interface instance down to the corresponding agent.

Hi Tom  
I have a similar issue. I have 9 interfaces and 9 agents.  
I have used a generate loop  
genvar i;  
generate  
for(i=0;i\<= `NUM\_INST i++) begin: req\_inst  
arb\_req\_if req\_if();  
initial begin  
uvm\_config\_db#(virtual arb\_req\_if)::set(uvm\_root::get(),\*,$sformatf(req\_if\_%0d,i),req\_if);  
end  
end  
endgenerate

In the env I have created the agents as arb\_req\_agent\_0. My question is how to pass the virtual interface instance to each agent using the for loop. Can you please give me an example with a snippet of code.  
In my top module instaed of the \* can I have uvm\_test\_top.env.arb\_req\_agent\_%0d. If so what is the syntax?  
Thanks

---

_[View the full topic](https://verificationacademy.com/forums/t/multiple-uvcs-agents/28780)._
