How to set a queue/array in uvm_config_db?

In reply to UVM Beginner:

Hi,

Yeah. The code override it again and again.
So what I did is this:


foreach(cmd_arr[i])
  uvm_config_db#(int)::set(this, "env.e_agent*.seqr", $sformatf("cmd_arr[%0d]",i), cmd_arr[i]);

foreach(addr_arr[i])
  uvm_config_db#(bit [14:0])::set(this, "env.e_agent*.seqr", $sformatf("addr_arr[%0d]",i), addr_arr[i]);

foreach(data_arr[i])
  uvm_config_db#(bit [7:0])::set(this, "env.e_agent*.seqr", $sformatf("data_arr[%0d]",i), data_arr[i]);

Hi tfitz,

Can you explain further why the code is inefficient? I don’t know exactly how uvm_object works.
Tanks.

Regards,