I've built a model which consists of a 16-deep fifo of sc_biguint<X>.
Depending on a few things, I can create a "packet" from 1-6 of these
biguints. So, in order to try and make this particular piece of our
Abstract Model close to RTL functionality, I used a while loop like so:
// Psuedo code
int ctr = 0;
while (last_big) {
fifo.get(big[ctr], tlm::SHRINK);
}
fifo.nb_notify_got(tlm::UNSHRINK);
It was my impression that, since a SHRINK consumes, but doesn't notify,
basically the code would work like this:
1) biguint generator generates a 5 biguint packet, but only loads in 3
biguints, and holds on the last two.
2) My model goes through the while loop above, and once the 3 biguints
are taken, the get() should wait until more data is available.
However, in reality, this happens:
1) Identical to the previous
2) My model goes through the while loop above, and once the 3 biguints
are taken, the get() starts returning the empty data from the other 13
spots in the fifo.
Now, looking at the source code to tlm_fifo (and tlm_fifo_shrink, etc)
it's obvious as to WHY this is happening. What I want to know is,
SHOULD it be happening?
And one more little question, why was there no blocking tlm::UNSHRINK
implemented?
Thanks in advance,
-Justin R.
|