hi
this is raja new to methodology.
i am working on tlm right now at the environment level.I would like to know about peek() using tlm_fifo().
my understanding is when you use peek(),it will return the transaction and wouldn’t delete the transaction is it right?
one more thing will the pointer increases to the next transaction or will it send the same transaction.
the book explains like this “Two consecutive peek() calls will
return copies of the same transaction.”
You’re right, peek() doesn’t delete the transaction from the tlm_fifo.
If you use tlm_fifo.get(), then the transaction is ‘popped’ from the FIFO, in other words you get the handle to the transaction and the FIFO removes it from its data queue. This is like popping a stack on a return from a sub-routine in the software world.
If you use tlm_fifo.peek(), then you are returned the handle to the transaction at the top of the FIFO, but the FIFO data queue remains intact.
yes i got what you said ,one more clarification will the pointer in the FIFO updates to next level or will it returns to the starting of the FIFO?
how the pointer acts…
as the ovm guide mentions “Two consecutive peek() calls will
return copies of the same transaction”.which means when you use two consecutive peeks u will get the same data which means pointer should not increase.