Pushing back pkt from driver to scoreboard based on agent number

 
// env code 
function void build_phase(uvm_phase phase);
    super.build_phase(phase);
    for (int agt_num=0; agt_num<`AGENT_NUM; agt_num++)begin
        // create 
        f_agent[agt_num].agent_num = agt_num;
        f_scb[agt_num].env_ptr = this;
    end
  endfunction : build_phase

// scoreboard code
seq_item tx_q [$];
virtual function void write_drv(seq_item obj);
    env_ptr.f_scb[obj.f_dest_addr].tx_q.push_back(obj); // push back is not happening
   `uvm_info(get_type_name(), $sformatf("Value of Queue =%p", tx_q), UVM_LOW)
  endfunction: write_drv

  1. I wanted to store the packet based on the agent number and the destination address in the queue, so I that I can takeout for comparison based on agent and destination address

In reply to muku_383:

Do you have multiple analsysis ports in your scoreboard? have you declared a uvm_analysis_imp_decl for all the respective ports?

In reply to muku_383:
Use instead of a queue a uvm_tlm_analysis_fifo. This is the dedicated storage element for your scenario.
wrt to your problem:
env_ptr.f_scb[obj.f_dest_addr].tx_q.push_back(obj);

In the build_phase you are using the agent number as argument. In the write function you are using the dest_addr of your seq_item. This might not be the agent number. And the index might not be contigious.

In reply to maddy0812:

Yes.

In reply to muku_383:

As chr_sue pointed out, your usage of the scoreboards agent number might be the issue.

Curious as to how you are confirming that the pushback isnt happening. through the watch window or print statements? if its thru the watch window, do you see any other indices added to the f_scb?

In reply to maddy0812:

In reply to muku_383:
As chr_sue pointed out, your usage of the scoreboards agent number might be the issue.
Curious as to how you are confirming that the pushback isnt happening. through the watch window or print statements? if its thru the watch window, do you see any other indices added to the f_scb?

Used uvm_falat if the size of queue is equal to zero, and other indices is getting printed if I am pushing to another queue.