Home > Community > Blogs > Functional Verification > tech tip determining when a sequence has finished
Login with a Cadence account.
Not a member yet?
Create a permanent login account to make interactions with Cadence more convenient.

Register | Membership benefits
Get email delivery of the Functional Verification blog (individual posts).


* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

Tech Tip: Determining When a Sequence Has Finished

Comments(0)Filed under: Functional Verification, eRM, e, Specman, IEEE 1647, OVM e, Aspect Oriented Programming, AOP

Imagine the complex scenario whereby you start the *same* sequence on multiple sub-drivers.  Naturally each started sequence has its own execution thread, so how do you refer to all the started sequences, and/or know when they have finished? 

Consider the following steps, followed by a code example that references the AXI UVC.

Step 1 - Add "has_started" and "has_ended" flags to "any_sequence", check why aren’t they there already?

Step 2 - Gen the child sequence, add it to a list of running seq’s, start the child sequence.

Step 3 - Wait to see a child sequence started using the "has_started" flag,

Step 4 - Wait for all child sequences to end

And now, the corresponding code example:

extend any_sequence {
   !has_started : bool;
   on_started() is also { has_started = TRUE; };
   !has_ended : bool;
   on_ended() is also { has_ended = TRUE; };

extend MAIN virtual_seq {
   !running_seqs : list of any_seq;
   !child_seq : my_seq vr_axi_master_seq;
   drivers : list of vr_axi_master_driver;
      keep drivers == get_sub_drivers().all(it is a vr_axi_master_driver);
   body()@driver.clock is only {
      foreach in drivers {
          gen child_seq keeping {.driver == it;};
      -- wait for a child sequence to start
      wait true(not running_seqs.is_empty() and running_seqs.has(it.has_started));
      -- allow the traffic to complete before dropping the TEST_DONE objection
      wait true(not running_seqs.has(it.has_ended == FALSE));

Make sense?  Don't be shy about commenting / improving upon this example ...

Happy Sequencing!

Team Specman



Leave a Comment

E-mail (will not be published)
 I have read and agree to the Terms of use and Community Guidelines.
Community Guidelines
The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.