Tlm_Analysis_Fifo

i have one Analysis_Fifo i am pushing data in to fifo using analysis port and using put method from different classes, is there any chance to loss data data when both things happens same time(pushing through analysis port and pushing using .put method)

thanks

No. But be careful. As long as the analysis_fifo is of unbounded length, you won’t have to worry. But be aware that the .put() method is a blocking call, so it will wait until there is room in the fifo. Of course, an unbounded fifo will always have room. The write() method uses the try_put() method and assumes that it will always succeed:


  virtual function bit try_put( input T t );
    if( !m.try_put( t ) ) begin
      return 0;
    end
  
    put_ap.write( t );
    return 1;
  endfunction 

so your bigger problem would be in trying to use the analysis_export on a bounded fifo because the try_put() would fail and the data would be lost.
As long as you keep the analysis_fifo unbounded (which it is by default), you have nothing to worry about.