Uvm_tlm_analysis_fifo contents are being overwritten during consecutive valid transactions in my uvm_scoreboard

Hello Everyone,

I would like to ask some help regarding my testbench. It seems that when I try to compare consecutive valid transactions, the expected data for the 1st valid input is overwritten by the expected data for the 2nd valid input. I tried storing the fifo contents in a separate queue but it doesn’t work.

I am using 2 uvm_tlm_analysis_fifo in my SB. These are for the observed data(from the monitor) and the expected data(from the model).

Below is a snippet of the log results:

UVM_INFO cal_scoreboard.sv(35) @ 1300000: uvm_test_top.env.sb [SB] Collected Expected Data: size = 1, output_c = 5c422167
UVM_INFO cal_driver.sv(75) @ 1300000: uvm_test_top.env.agt.drv [DRV] Starting transaction()…
UVM_INFO cal_model.sv(26) @ 1500000: uvm_test_top.env.mdl [MDL] Write start…
UVM_INFO cal_model.sv(28) @ 1500000: uvm_test_top.env.mdl [MDL] Input Values:
input_a = 7b5a6558
input_b = 61400af1
UVM_INFO cal_model.sv(37) @ 1500000: uvm_test_top.env.mdl [MDL] Calculate Expected Value…
UVM_INFO cal_model.sv(30) @ 1500000: uvm_test_top.env.mdl [MDL] exp_value = dc9a7049


Name Type Size Value

txn_collected cal_transaction - @4123
input_a integral 32 'h0
input_b integral 32 'h0
input_valid integral 1 'h0
op integral 2 'h0
output_c integral 64 'h5c422167
output_valid integral 1 'h0

UVM_INFO cal_scoreboard.sv(38) @ 1500000: uvm_test_top.env.sb [SB] Collected Expected Data After get(obs_val): size = 1, output_c = dc9a7049
UVM_INFO cal_scoreboard.sv(46) @ 1500000: uvm_test_top.env.sb [SB] exp_queue size = 1
UVM_ERROR cal_scoreboard.sv(54) @ 1500000: uvm_test_top.env.sb [SB] Compare: Fail!
expected value = dc9a7049
observed value = 5c422167
UVM_INFO cal_scoreboard.sv(30) @ 1500000: uvm_test_top.env.sb [SB] Collect Data…

As seen in the log file, the 1st expected data was able to be received by my scoreboard during @1300000 then the 2nd expected data was received @1500000. But when I try to print the 1st data in my “exp_val_q” queue, exp_val_q[0] is being overwritten AFTER got_port.get(obs_val) even though it does not update my exp_val_q.

You may check my environment in the eda_playground(Please run base_test) to get the error

I would really appreciate it if someone can help me.

Thanks!

In reply to Jembui:

I do not understand what you are doing with the queue exp_val_q. Yoau are using uvm_analysis_fifos on both sides. They are storing data and you do not need an additional storage element.
I might be caused by this.
BTW, please write clean code. A macro does not require a ; at its end.