How time advances in uvm scoreboard

In reply to svq:

Hi,
My apologies for possibly a very silly question for most people. In a uvm scoreboard in the run phase, if we have below code,


task run_phase (uvm_phase phase);
forever begin
after_fifo.get (after_txn);  // this is an uvm tlm analysis fifo which is getting the output txn from dut via monitor)
if (before_queue.size())     // before_queue is populated by a uvm_tlm_analysis_imp port's write methode when it receives packet from input monitor
compare_data();
end
endtask

My understanding is that in this case, if the before_queue is empty when after_fifo gets a txn, no comparison can happen until after_fifo gets another transaction and checks the size of before_queue. This would be a wrong implementation since last txn wll not get compared if after_fifo gets the last txn before before_queue correct? forever begin in run phase wouldn’t change this right?

I do not understand why you are mixing tlm_analysis_fifo and a queue.
You should use for both data streams tlm_analysis_fifo.
Then you can execute on both fifos a get. The get is a blocking statment and you do not have to check any fifo size.
After getting both transactions in the scoreboard you can compare the values and the scoreboard is progressing to the next pair of transactions.