Example code for multiple agents

Hi,
In my project I have 8 interfaces so I am planning to have 8 agents.
As I am new to UVM I don’t know how to do. please help me to undesrtand how to create array of agents and explanation with a piece of code.

thanks in advance!

In reply to @VlsiYJ:

Unfortunately you do not explain what kind of interfaces you have. If you have different interfaces you need agents with different content.
In your case it is highly recommended to use a UVM Framework Generator.
You’ll find such an generator at the Doulos webpage:
https://www.doulos.com/knowhow/sysverilog/uvm/easier/
After setting up the generator it creates you a complete UVM environment.

In reply to chr_sue:

My DUT is basically a switch which is connected to 8 device having same functionality. May be I was wrong which I mentioned as 8 diff interfaces.

 interconnect DUT (.clk(clk),
                   .reset_(reset_),
                   .input0_packet(dut_if1.input_packet[0]),
                   .input0_packet_v(dut_if1.input_packet_v[0]),
                   .input0_credit(dut_if1.input0_credit),

                   .output0_packet(dut_if1.output_packet[0]),
                   .output0_packet_v(dut_if1.output_packet_v[0]),
                   .output0_credit(dut_if1.output_credit[0]),
       				
                    .input1_packet  (dut_if1.input_packet[1]),
                    .input1_packet_v(dut_if1.input_packet_v[1]),
                    .input1_credit  (dut_if1.input1_credit),

                    .output1_packet  (dut_if1.output_packet[1]),
                    .output1_packet_v(dut_if1.output_packet_v[1]),
                    .output1_credit  (dut_if1.output_credit[1]),

The above piece of code I have shown is the top level connection of dut to interface. But instaed of making this as array(output_packet[1]) connection, i am trying to create instance of agents lets say my_agent[8]. i need to know what is the minimal ways to implement this funtionality.

Thanks!

In reply to @VlsiYJ:

This doesn’t matter. Finally you need 8 agents of the same type but working independently.
If an array of agents the best approach is I do not know. And all agents have to be integrated in an environment.
Again I recommend to use an UVM Framework generator.

In reply to @VlsiYJ:

So you need to have 8 instances of the same agent module. Just define an agent array and go ahead.
the only thing to pay attentions here is
a) if there is dependency between that agent instances
b) connect that agent monitors to the same scoreboard : use here generate statement

And there is alternative way to array, is using verilog generate statement.

In reply to chr_sue:

Personally I am against using any framework over UVM. It makes some chance to have new errors in your test-bench.
also how long it takes to setup/learn usage of that framework?

In reply to haykp:

Learning the setup for the UVM Framework is about 1 day, setting up for a real project is about another day. This is in average 6 weeks less than working from scratch.