# How to use tlm\_analysis\_fifo?

**URL:** <https://verificationacademy.com/forums/t/how-to-use-tlm-analysis-fifo/28716>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [July 18, 2013, 11:08am UTC](https://verificationacademy.com/forums/t/how-to-use-tlm-analysis-fifo/28716 "2013-07-18T11:08:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [July 18, 2013, 8:17pm UTC](https://verificationacademy.com/forums/t/how-to-use-tlm-analysis-fifo/28716/2 "2013-07-18T20:17:00Z")

</div>

If these FIFOs are all inside the same scoreboard, then you can instantiate the uvm\_tlm\_analysis\_fifo’s inside your scoreboard. Then have a write method in your scoreboard do the selective writes to your analysis fifos.

```auto
class my_scoreboard extends uvm_scoreboard;
`uvm_component_utils(my_scoreboard)
function new (string name, uvm_component parent);
    super.new(name, parent);
  endfunction

uvm_analysis_imp #(my_transaction1, my_scoreboard) analysis_export; // connects to monitor

// these could be the same transaction types
uvm_tlm_analysis_fifo #(my_transaction2) fifo1;
uvm_tlm_analysis_fifo #(my_transaction3) fifo2;

function build_phase(uvm_phase phase);
  analysis_export = new("analysis_imp", this);
  fifo1 = new("fifo1",this);
  fifo2 = new("fifo2",this);
endfunction

function void write (my_transaction1 t1);
  if (t1.something)
      begin 
      // might need to create or clone t2
      fifo1.write(t2)
      end
   else
   begin 
      // might need to create or clone t3
      fifo1.write(t3)
   end
endfunction

// other scoreboard code that get()s transactions from the fifos.

endclass

```

---

_[View the full topic](https://verificationacademy.com/forums/t/how-to-use-tlm-analysis-fifo/28716)._
