In reply to chr_sue:
I’m only using try functions to debug and print things out. I’ve made a custom uvm_tlm_analysis_fifo based on the uvm one. I added print statement in the write function:
class bvm_tlm_analysis_fifo #(type T = int) extends uvm_tlm_fifo #(T);
// Port: analysis_export #(T)
//
// The analysis_export provides the write method to all connected analysis
// ports and parent exports:
//
//| function void write (T t)
//
// Access via ports bound to this export is the normal mechanism for writing
// to an analysis FIFO.
// See write method of <uvm_tlm_if_base #(T1,T2)> for more information.
uvm_analysis_imp #(T, bvm_tlm_analysis_fifo #(T)) analysis_export;
// Function: new
//
// This is the standard uvm_component constructor. ~name~ is the local name
// of this component. The ~parent~ should be left unspecified when this
// component is instantiated in statically elaborated constructs and must be
// specified when this component is a child of another UVM component.
function new(string name , uvm_component parent = null);
super.new(name, parent, 0); // analysis fifo must be unbounded
analysis_export = new("analysis_export", this);
endfunction
const static string type_name = "bvm_tlm_analysis_fifo #(T)";
virtual function string get_type_name();
return type_name;
endfunction
function void write(input T t);
my_pkt t1;
if($cast(t1, t)) begin
if(this.try_put(t1)) // unbounded => must succeed
`uvm_info("SB: packet written to fifo:", t1.convert2string(), UVM_LOW)
else
`uvm_info("SB:", "try_put failed", UVM_LOW)
end // if($cast(t1, t))
else begin
`uvm_fatal(get_type_name(), "Unsupported UVM transaction format!");
end
endfunction
endclass
Result is try_put always succeeds. I print out unique packets (no duplicates) with the “packet written to fifo” statement. But the duplicates are still written to the fifo! So, again, I really think it’s this uvm fifo and it’s frustrating.