In reply to PJ:
I was now looking in more detail.
You are reading from your uninitialized memory. This is really not useful, because it returns only x on your interface.
And I modified your monitor to:
task run_phase(uvm_phase phase);
sequence_item transaction;
transaction = sequence_item::type_id::create("transaction");
forever begin
@ (posedge vif.clk);
transaction.data_in = vif.din;
transaction.wr_en = vif.wr_en;
transaction.rd_en = vif.rd_en;
//transaction.data_ram = vif.mem;
@ (posedge vif.clk);
transaction.data_out = vif.dout;
//$display("ram=%h",vif.mem);
item_collected_port.write(transaction);
`uvm_info("FIFO_MONITOR", $psprintf("Wrote transaction %s",transaction.convert2string()), UVM_LOW);
end
endtask:run_phase
See the additional clockedge befor vif.dout will be stored.