using UVMC 2.3.0 I found out that in order to be able to call peek() on a sc_port tlm_get_peek_if which is onnected to a uvm_tlm_fifo, I need do call wait(1, SC_NS) at the beginning.
Instead of calling wait I could also do a get() on the same port before calling peek().
Calling peek() right away using neither wait(1, SC_NS) nor get() causes an error:
UVM_FATAL /usr/local/uvmc-2.3.0/src/connect/sv/uvmc_tlm1.sv(121) @ 0: reporter [UVMC] Internal error (uvmc_pkg::C2SV_peek): port at id 0 is null
Has this something to do with the call to wait_connected()
which is present in function get() in line 216 of file /usr/local/uvmc-2.3.0/src/connect/sc/uvmc_channels.h
but is not present in function peek() at line 263 of the same file ?
Hi,
my question was cut hort after the first line because I used the “minor” symbol in the text,
before and after the word “tlm_get_peek_if”, as is needed in SystemC code.
Regards,
Elmar
I am not sure what you mean by “0-time call”, but I understand that peek() is a blocking call, just like get().
Yes, I am in fact peeking before the data actually got placed in the fifo and I want peek() to block until data got placed in the fifo.
Sorry, sometimes in my Mentor division use “0-time function call” as
a synonym for a non-blocking, i.e. “instantaneous” call. But looking at
IEEE 1666 I realize that you are correct that peek() itself is blocking.
I had not looked at this for awhile and was thinking that peek()'ing is
just an instantaneous non-blocking call.
OK, so reviewing the meaning of peek() in the LRM it must wait until
the next transaction on the fifo, then return its value without removing
it (as get() does).
And indeed it looks like ::get() itself does already call wait_connected()
as your fix suggests. So it appears that we need to do the same in
peek().
I think the issue is that, although peek() itself is already blocking
on the m_sem member, the problem is that semaphore is not is not created
in the first place until it is connected. So it stands to reason that we
need to call wait_connect() as ::get() does and as you suggest.
We will file a bug report on this and put this fix in for
the 2.3.1 release.
Yes, your solution has been incorporated into the source code for
the upcoming UVMC-2.3.2 release will be posted to the Verification Academy
as soon as we get it through the validation and legal process.