Starting a Sequence

Hi all,

I am going through the UVM cookbook and on Page 156 in Section that talks about how to start a sequence it says:

virtual task start (uvm_sequencer_base sequencer, // Pointer to sequencer
 uvm_sequence_base parent_sequencer = null, // Relevant if called within a sequence
 integer this_priority = 100, // Priority on the sequencer
 bit call_pre_post = 1); // pre_body and post_body methods called
// For instance - called from an uvm_component - usually the test:
apb_write_seq.start(env.m_apb_agent.m_sequencer);
// Or called from within a sequence:
apb_compare_seq.start(m_sequencer, this);

“It is possible to call the sequence start method without any arguments, and this will result in the sequence running without a direct means of being able to connect to a driver.”

I have couple of questions on this:

  1. If we don’t pass a sequencer to the sequence start method’s argument on what sequencer will it run? If it can run on some sequencer then why won’t there be means of being able to connect to a driver?
  2. If it run’s on parent then isn’t that null according to the second argument.
  3. Won’t we get a null handle error if we do this?

Any info on this is highly appreciated.

Thanks

In reply to yasaswi93:

You cannot always run a sequence without setting the sequencer. If a sequence sq_a is instantiated inside another sequencer sq_b, only then you can call sq_a.start(); inside body method of sq_b. sq_a will now run on the same sequencer on which sq_b is running.

experts of this forum please correct me if I am wrong.

In reply to mbhat:

Even if sq_a is inside sq_b would it need something like this? If not specified isn’t the default argument for parent sequencer null?

// Or called from within a sequence:
apb_compare_seq.start(m_sequencer, this);

In reply to mbhat:

In reply to yasaswi93:
You cannot always run a sequence without setting the sequencer. If a sequence sq_a is instantiated inside another sequencer sq_b, only then you can call sq_a.start(); inside body method of sq_b. sq_a will now run on the same sequencer on which sq_b is running.
experts of this forum please correct me if I am wrong.

I correct my above statement. It should still be sq_a.start(m_sequencer, this) where the built in m_sequencer points to the same sequencer on which sq_b (parent sequence) is started. “this” is optional parent sequence specifier and is not null.

Please go through this training video by Tom Fitzpatrick.
https://verificationacademy.com/sessions/proper-care-and-feeding-sequences/video/250?play=1

In reply to yasaswi93:

Hi all,
I am going through the UVM cookbook and on Page 156 in Section that talks about how to start a sequence it says:

virtual task start (uvm_sequencer_base sequencer, // Pointer to sequencer
uvm_sequence_base parent_sequencer = null, // Relevant if called within a sequence
integer this_priority = 100, // Priority on the sequencer
bit call_pre_post = 1); // pre_body and post_body methods called
// For instance - called from an uvm_component - usually the test:
apb_write_seq.start(env.m_apb_agent.m_sequencer);
// Or called from within a sequence:
apb_compare_seq.start(m_sequencer, this);

“It is possible to call the sequence start method without any arguments, and this will result in the sequence running without a direct means of being able to connect to a driver.”
I have couple of questions on this:

  1. If we don’t pass a sequencer to the sequence start method’s argument on what sequencer will it run? If it can run on some sequencer then why won’t there be means of being able to connect to a driver?
  2. If it run’s on parent then isn’t that null according to the second argument.
  3. Won’t we get a null handle error if we do this?
    Any info on this is highly appreciated.
    Thanks

You have 3 options to start a sequemce:
(1) start the sequence manually, like this

seq.start(sequencer);

(2) to start it from a parent sequence like this:

seq.start(sequencer, this, prio, arg);

this points to the parent sequence, prio defones the priority and ths last argument arg is indicating if pre_boddy and post_body will be executed:
(3) defining a sequence as ‘default_sequence’ using the config_db.

In reply to yasaswi93:

You can start a sequence without specifying a sequencer. When no sequencer is provided, a generic sequencer is created, hence no connection to a driver.

Using a null sequencer is how you should start virtual sequences.

In reply to cgales:

Thank you for the clarification.