The uvm_tlm_analysis_fifo always return the last value when get()

I start to use get() function to dump my analysis FIFO when FIFO is at the size I wanted, but the get() function always return the last entry of the FIFO.

Thanks,

Allen

===================================================================================
Here is the code.

uvm_tlm_analysis_fifo #(axi_slv_seq_item) src_fifo;

task run ();
axi_slv_seq_item axi_read;

forever
begin
   @ (posedge axi_mon.ACLK);
   
   if (src_fifo.used() == 10)
   begin
       while (src_fifo.used() > 0)
       begin
          src_fifo.get(axi_read);
          `uvm_info(get_type_name(), $sformatf("Data Src %h", axi_read.RDATA, UVM_LOW)
       end
   end
end

=======================================================================================
The value I push into the FIFO:

UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 260 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH a919b6136b4f28f0
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 270 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH d99a16034c49cf39
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 280 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH aad9c9b6eb476441
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 290 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH bbb8c156628085d0
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 300 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 61940712d5e33bbb
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 310 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 9db415f47edc2b7a
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 320 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 469fa4a3072b5f77
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 330 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH cd5ea1abc9ab9b41
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 340 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 191f66fea3173983
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 350 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 6c7c0ff4a1c17f21
UVM_INFO VERILOG/sv/axi/axi_r_monitor.sv(76) @ 360 ns: uvm_test_top.dma_tb0.dma_axi_env.s_axi_agt.mon_r [axi_r_monitor] PUSH 268c193eb88c3ffa

==================================================================
The value push out of the FIFO

UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa
UVM_INFO VERILOG/sv/scoreboard/data_scoreboard.sv(51) @ 680 ns: uvm_test_top.dma_tb0.dma_data_sb [data_scoreboard] Data Src 268c193eb88c3ffa

Most likely because you are not cloning the transaction getting pushed into the FIFO. You are pushing the same object into the fifo.

In reply to dave_59:

Hi Dave,

You are right. Once I cloned the object. I don’t see the same data any more.

Thanks,

Allen

In reply to Allen Shen:

Hi Allen and Dave:

I think I have met similar problem too. But I don’t know what does the clone mean in your post.

Would you please give it a look for it My Question in uvmworld.org please?

Thanks