In reply to svq:
The current method will work.
But, I think if you change your approach little it will more efficient and won’t require wait logic.
- your input is out of order and via temp_store and shorting you making as like DUT order and store into before queue.
But, i think as you already shorted in like output order you need to store in “analysis fifo” instead of queue as Christopher mentioned.
//Somewhere else as per your TB.
1) Out of order A0,A3,A2,A1 // original
2) Short transaction and store inside fifo. // befor_fifo = A0,A1,A2,A3
3) Dut is already providing in order. // after_fifo = A0,A1,A2,A3
task run_phase (uvm_phase phase);
forever begin
if( after_fifo.used() && before_fifo.used() ) begin
before_fifo.get (before_txn); // before data packet
after_fifo.get (after_txn); // after data packet
if ( ! after_txn.compare(before_txn) ) `uvm_error ("SCB_CHECK","TX_MISMATCH");
// If compare data used for comparison between before and after txn. Then it won't require in this case
// compare_data();
end
#1ns; // to advance time in case of fifo empty
end
endtask
// In run phase
Thanks!