What methods we use to start seq in test?

Hi,

Normally we use two methods to start any sequence in test,

  1. // Substitute the default sequence.
    uvm_config_db#(uvm_object_wrapper)::set(this, “*.masters.sequencer.run_phase", “default_sequence”, read_modify_write_seq::type_id::get());

  2. //use start method
    read_modify_write_seq.start(env.agent.sequencer_h);

Is there any other methods to start seq in test ?
so please guide me at what time i should use 1st one and at what time 2nd one and why ?

For the first method u dont need to create the sequence, the uvm_object_wrapper will allocate the sequence object, while in 2nd u need to create the sequence using factory and then start it sung seq.start(seqr_handle);

“Is there any other methods to start seq in test ?”

Yes you can also use in-built macro like

`uvm_do,`uvm_create , `uvm_send

to start your sequence. if you use `uvm_do macro you does not need to create object.

Refer more Here

Its not good practice at all when you substitute your sequence with your default sequence when you want to start any sequence.

its always better to use seq.start(v_seqr.sequencer) method.

In reply to Vinay Jain:

The preferred method (pardon the pun) is to use

seq = my_seq_t::type_id::create("seq");
seq.start(sequencer);

Once you create the sequence, you can randomize/constrain/modify it before starting it, so you have more control than if you use the config_db to set the default sequence.
Incidentally, if you do want to use a “default sequence” you can have your environment create and start it in the run_phase. That way, the sequence will be started “automatically” without the test having to do it. A couple of caveats:

In general, you’re best off creating and starting all sequences explicitly from your test.