How to use tlm_analysis_fifo?

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.

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