Jump to content

waiting in a sequence

Recommended Posts



 Is one of these ways to have a sequence wait on an event preferred?  If so, why?


 The following are code snippets from inside a sequence.


1) Create transaction and engage w/ driver, then wait for event.

      m_state.wait_on_smthg();   // <--- wait here


2) Wait for event, then proceed

      m_state.wait_on_smthg();  // <--- wait here

 In this case, the event being waited for is that data of a certain type is available.


Link to comment
Share on other sites

There are two premises you need to consider:

  1. Sequences are supposed to generate transactions in a manner that allows for late randomization. This allows randomization to use current state of the system to guide/constrain the randomization. When you return from start_item(), the driver wants it's transaction request to be honored ASAP.
  2. Drivers are typically slaved to hardware. If your sequence blocks (waits), then the driver needs to be written in a manner that doesn't block the way seq_item_port.get_next_item() does. In other words, sequences with waits have implications on the driver.

GIven the above, I would say #2 is preferable because the wait doesn't come after start_item() returns and cause delays in the randomization. In either case, since you have a wait in the sequence, you should be certain to design the driver to be tolerant of those waits. Often this means using seq_item_port.try_next_item().


Link to comment
Share on other sites

  • 1 month later...

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.

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...