The DUT has almost similar input and output interface with an 8 bit data line data_in and a valid for the same, and on the output there is a data_out line and valid, the DUT calculates the sum of three sequential bytes in the stream and give out data_out in the following way…like the frst, sec and third data sequentially on data_out line will be calculated in following way
data_out_0 = data_in_0 + data_in_1 + data_in_2
data_out_1 = data_in_1 + data_in_2 + data_in_3
data_out_2 = data_in_2 + data_in_3 + data_in_4
…etc
I am just trying to think of a skeleton for UVM monitor and scoreboard for this, in order to write scoreboard for this pipelined output, is it a good idea to use semaphores in monitor ???, doing something like
semaphore lock = new(1);
task run_phase (uvm_phase phase);
fork
collect_transactions;
collect_transactions;
join
endtask: run_phase
task collect_transactions;
forever begin
lock.get();
wait for clk
…capture one byte,
// Unlock semaphore
lock.put();
…wait for one clock
collect one byte
…wait for one clock
collect another byte
endtask
but I am not sure what to do with the queue, it will get overwritten by another parallel task in fork join or if i take an automatic queue for fork join, will that work ?
Or if there is some easier way to do scoreboarding for this kind of pipelined output, please suggest.