Jump to content

try_get with uvm_tlm_analysis_fifo


Recommended Posts

Hi,

I am having code like this

uvm_tlm_analysis_fifo#(an_item) before0_fifo

an_item before0_trans;

In a task I have the following code

before0_fifo.try_get(before0_trans);

`uvm_info(get_type_name(), $psprintf("Inside task comparer3: Transfer collected :\n%s", before0_trans.sprint()), UVM_FULL);

The execution is returning "NULL pointer dereference." when there are no objects in 'before0_fifo'. I was expecting try_get to be

1. Non-blocking

2. if there are no objects in before0_fifo, then before0_trans should have had previouly gotten value.

(As per the UVM Class Reference manual under section 'uvm_tlm_if_base #(T1,T2)', the try_get description reads "If a transaction is immediately available, then it is written to the output argument and 1 is returned. Otherwise, the output argument is not modified and 0 is returned" )

Please let me know what I'm missing.

Regards

Kal

Edited by chip_maker
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...