Difference between get_next_item and get?

what is the differnce between get_next_item and get?

In reply to lalithjithan:

Both methods retrieving a seq_item from the sequencer. get_next_item needs an item_don() call after the seq_item has been processed. get does not Need this, but you can pass a rsp back to the sequencer by using put(rsp).

In reply to chr_sue:

So which is good to use get() or get_next_item()?
I mean what are advantages and disadvantages of using them?

In reply to chaitanya_i:

You can use both. There is no Limitation or disadvantage. But you should be consistent, not using both in your UVM environment.

In reply to chaitanya_i:

get_next_item() is a blocking call, where-as get() is a non-blocking call.
get() is used in cases, where the given protocol/interface supports pipe-lining.

Refer “Driver/Pipelined” section of UVM cookbook for an example of get()/put().

In reply to S.P.Rajkumar.V:

I have to correct you, get(9 and put() are always blocking!

In reply to chr_sue:

I meant blocking and non-blocking in the context of handshake mechanism between the sequence, seqeuncer and driver. May be the word “call” with blocking and non-blocking has created the confusion.

To clarify it:
In get_next_item()+item_done() case, the sequencer is blocked and the driver cannot request a new item until the current_item is processed and item_done is sent.
Where-as, in get()+put() way, the sequencer is unblocked with the get() call itself and the driver can always do another get() even before the first put() is completed.

1 Like

In reply to S.P.Rajkumar.V:

Thanks for the explanation. One more thing I want to clarify is that this response will happen only when we want the connection between the sequencer and driver to be bi-directional. Otherwise, get() is enough to insert into the code, right?