Good day!
i have a design, in which input data go to the output without delay:
assign data_out = data_in;
assign valid_out = valid_in;
looked on the behaviour on “wave”, output data appears one delta later, then input.
input and output monitors are objects of a same class. they collect data like this:
@(posedge clk iff valid);
trnx.data = data;
mon_ap.write(trnx);
in scoreboard i use separate write functions for input and output monitors and store results in two queues. after that i want to gather data from both of them and to make a comparison.
after_fifo.get(t_after);
predicted_t_after_queue.pop_back(t_predicted);
...
when test encounters “pop_back” line, it sends an error, that queue is empty, and my test dies. so it’s not a safety way to just use queues if there are no delays between input and output.
i tried to rewrite my code, using wait statement or whie cycle. none of it works: events never happen.
after_fifo.get(t_after);
wait (predicted_t_after_queue.size);
predicted_t_after_queue.pop_back(t_predicted);
after_fifo.get(t_after);
while (!predicted_t_after_queue.size) @(predicted_t_after_queue.size);
predicted_t_after_queue.pop_back(t_predicted);
how do i synchronize these flows?
thank you.