Is there any way to start a sequence without .start() method?

Hi All,

I would like to know if there is any way to start a sequence without .start() method?

Is `uvm_declare_p_sequencer macro helpful for this purpose?

You can register your sequence as default sequence on sequencer where you want to execute.


 uvm_config_db #(uvm_object_wrapper) :: set (this,"my_env_inst.my_vir_seqr_h.main_phase",
                                                 "default_sequence",my_seq:: get_type());

You require to use `uvm_declare_p_sequencer macro if you are accessing members/variables of sequencer from sequence itself. Either you use start method or register method , you would require this macro.

In reply to Karan:

UVM command_line processor with +uvm_set_default_sequence command line argument can be used for this purpose.

+uvm_set_default_sequence= [seqr],[phase],[type]

In reply to DigvijayS:

This simulation argument is only available in UVM-1.2 , not in below versions.

In reply to kerulmodi:

Hi Kerul,

It is good to know from you that latest UVM library adds such utilities to ease development efforts.

In reply to Karan:

Hi Karen, All of the above are correct, but I organize them in a way I found useful:
Your “test” class sets the uvm_config_db as “kerulmodi” correctly described. But take
note, here you setting a “Virtual Sequence” on a “Virtual SequencER”. Also, any parms that are
needed for the sequence are set here in your test class.

Then I like to code a Virtual sequence, which instantiates the sequence in question, and declares the virtual sequencer using the macro you mentioned : `uvm_declare_p_sequencer. You would need to have coded a virtual sequencer prior to this of course.

Then, finally, in this virtual sequence, you can use the various "do(..)" macros to call (start) the sequence on the sequencer in question. The sequencER in the do(…) macro is called as a component of the p_sequencer, as you would have needed to defined previously.

What’s nice about this approach is that the virtual sequence is completely extendable to calling other sequences and running them on any sequencer that’s part of your virtual sequencer.

Hope this helps!

In reply to Karan:

Just curious, why you want to start a sequence without using start?
What is the issue of using start method to start the sequence?

In reply to haykp:

Haykp: Take a look at the definition of the `do(…) type macros in the UVM LRM.
They encapsulate “start” and some other useful tasks. The base class library provides
these encapsulations as an effort to reduce the call burden on the user and allow for more readable and portable code. On the other side, it also allows the flexibility to individually call these component tasks if need be.

I wouldn’t characterize either choice of starting a sequence as an “issue” or not, I think
the choice depends on what you’re trying to accomplish and what environment you’re in. For example, if you’re just starting one sequence in a simple non-hierarchical stimulus situation, then “start” should be fine. But in my experience, in an environment (like SoC/NoC testing) where you must bring in and share sequences from other verification efforts (in Virtual Sequences), I found that using the `do(…) macros makes more “sense” than “start”.