Jump to content
Sign in to follow this  
chip_maker

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×