Try_next_item: does this allow the sequence delta cycles to call start_item?

The cookbook says try_next_item is non-blocking which I interpret that calling it should not cause a thread switch, but I think to observe different behavior. I have the feeling that calling try_next_item will return successfully if either:

  • the corresponding sequence called start_item prior to the call to try_next_item,
  • the corresponding sequence calls start_item in the same time step as the call to try_next_item (so possibly start_item could be called any number of delta cycles post the call to try_next_item)

Is this correct? So the driver actually allows the sequence any number of delta cycles before deciding if it can return a sequence item?

In reply to NiLu:

try_next_item will always return whether the transaction is available or not. That is the definition of non-blocking You have to check if the sequence_item handle, req, is null or not. If it is null, do your idle cycle tasks and try again. The transaction may not always be ready. The seq_item_port.try_next_item(req) call should be in a do-while loop.

In reply to thlu@ageratech.com:

Yes I know, but this wasn’t really my question. My question was if try_next_item allows connected sequences to advance (delta cycles) during the try_next_item. I looked a bit in the UVM source code, and there are some wait_for_sequences() calls, which I believe are doing this.

Note: some books (OVM cookbook) call try_next_item ‘pseudo non-blocking’, presumably because of this.

In reply to NiLu:

OK, I see. Sorry, the details you are seeking is beyond my knowledge. But I think you are correct. The task try_next_item calls wait_for_sequences(), which in turn calls the task uvm_wait_for_nba_region(). The comments for uvm_wait_for_nba_region is:

// Callers of this task will not return until the NBA region, thus allowing
// other processes any number of delta cycles (#0) to settle out before
// continuing. See <uvm_sequencer_base::wait_for_sequences> for example usage.

So it allows the sequences to advance in the active and inactive regions, which makes sense to me and seems to match your understanding too.