Get from fifo return prevoius valu

Hi guys,
I’m struggling with get() from fifo…I’m trying to compare the items get from

this is my code


  int unsigned counted_request;
  int unsigned counted_received;
  uvm_tlm_analysis_fifo #(frame_sync_item) profile_ref_fifo;
  uvm_tlm_analysis_fifo #(traffic_profile_item) profile_dut_fifo;

 task run_phase (uvm_phase phase);
    data_item       data_item_collected_trans;
    data_item       profile_ref_fifo_trans;
    traffic_profile_item  traffic_profile_item_collected_trans;
    traffic_profile_item  profile_dut_fifo_trans;

    forever begin
        
        data_item_collected_trans = data_item::type_id::create("data_item_collected_trans");
        profile_ref_fifo.get(data_item_collected_trans);
        counted_request ++; 

        // Sampled reference profile:
        profile_ref_fifo_trans = data_item::type_id::create("profile_ref_fifo_trans");
        profile_ref_fifo_trans.acm_prof = data_item_collected_trans.acm_prof;                
        
        traffic_profile_item_collected_trans = traffic_profile_item::type_id::create("traffic_profile_item_collected_trans");
        profile_dut_fifo.get(traffic_profile_item_collected_trans);      
        counted_received ++;      
        
        // Sampled reference profile:
        profile_dut_fifo_trans = traffic_profile_item::type_id::create("profile_dut_fifo");
        profile_dut_fifo_trans.acm_prof = traffic_profile_item_collected_trans.acm_prof;
        
        uvm_report_info(get_name(), $sformatf("%d) TX == REFERENCE -> prof = %p", counted_request,  profile_ref_fifo_trans.acm_prof), UVM_LOW);
        uvm_report_info(get_name(), $sformatf("%d) RX ==       DUT -> prof = %p", counted_received, profile_dut_fifo_trans.acm_prof), UVM_LOW);
     end
endtask 
...

The code for comparison is after the upper one.

It’s seems that after some forever cycles the value get from REF fifo is the one of the previous cycle…
this is the output, where, for example, in step 3 reference modu should be 6.
Something I don’t understand with get() tasks?

@ 1508788.75 ns: 1) TX == REFERENCE → prof = '{enabled:'h0, cod:'h1, mod:'h5, power:'h1, traff:'h0}
@ 1508788.75 ns: 1) RX == DUT → prof = '{enabled:'h0, cod:'h1, mod:'h5, power:'h1, traff:'h0}

@ 1558228.75 ns: 2) TX == REFERENCE → acm_prof = '{enabled:'h0, cod:'h1, mod:'h4, power:'h1, traf:'h0}
@ 1558228.75 ns: 2) RX == DUT → acm_prof = '{enabled:'h0, cod:'h1, mod:'h4, power:'h1, traff:'h0}

@ 1607666.25 ns: 3) TX == REFERENCE → acm_prof = '{enabled:'h0, cod:'h1, mod:'h4, power:'h1, traff:'h0}
@ 1607666.25 ns: 3) RX == DUT → acm_prof = '{enabled:'h0, cod:'h1, mod:'h6, power:'h0, traff:'h1}

@ 1657106.25 ns: 4) TX == REFERENCE → acm_prof = '{enabled:'h0, cod:'h1, mod:'h0, power:'h0, traff:'h1}
@ 1657106.25 ns: 4) RX == DUT → acm_prof = '{enabled:'h0, cod:'h1, mod:'h4, power:'h1, traff:'h0}

If i comment the line

profile_dut_fifo.get(traffic_profile_item_collected_trans);

outputs are correct…

In reply to alexkidd84:

Try to check for the size of the fifo. i think the size of fifo will be one by default.

In reply to Anudeep J:

thanks!
I have to clone the items before pushing them into the fifos, but I prefer to solve the issue using try_get() instead of get().