I am new to UVM.How can collect packet stored in a queue as a sequence in one by one manner and run over a sequencer in uvm? Sequence body is given,build phase of the sequencer is given with getting handle of component with queue.help to solve this

task body();

my_sequencer = get_sequencer();

ERROR_bad_ace_axi_pkt: assert (!($cast(axi3_pkt, ace_axi_pkt)));

`uvm_sent(ace_axi_pkt)

endtask

function void build_phase(uvm_phase phase);
super.build_phase(phase);

//Getting the ace_snoop_agent configuration object from environment inside axi3sequencer
//------------------------------------------------------------------------
if(!uvm_config_db #(ace_snoop_agent_cfg) ::get(this,“”,“ace_snoop_agent_cfg”,ace_snoop_agent_cfg_h))
`uvm_fatal(get_full_name(),“The sequencer didn’t get the ace snoop agent config object handle”)

endfunction

In reply to nithya jinu:

Could you please show some more code to clarify your problem?
You do not store data packets(seq_items) on the generation side in a queue.
You are instructing your sequence to do this in a one-by-one manner when the processing of the actual packet has been completed.

You should do this in driver.


class t_driver extends uvm_driver #(packet);
  virtual intf vif_tb;

  static int txn_cnt;
  
  packet txn[$];
virtual task run_phase(uvm_phase phase);
    
    @(vif_tb.cb); // Give one clock to allow propagation of clocking block
    
      drive_address(txn);
     
   
    forever begin
      seq_item_port.get_next_item(req);
      `uvm_info(get_full_name(), "Driver got a sequence item", UVM_MEDIUM);

      txn.push_back(req);
    

      seq_item_port.item_done();
    end
 

  task automatic drive_address(packet txn[$]);


  endtask