Seq problem

Hi all
here is sudo code:


class test_seq extends uvm_sequence
seqA seqa;
task body;
seqa.start(m_sequencer,this)
endtask
endclass

I have some questions about start();
Q1: seqa.start(m_sequencer,this), why we don’t use seqa.start(agent.m_sequencer,this)? How does the simulator know which sequencer in env seqa run on if we do not write agent.m_sequencer.
Q2: what is different between seq.start(sequencer) and seq.start(sequencer,this)
Thanks!

In reply to peter:

Your code is correct. It should be like this:

class test_seq extends uvm_sequence #(seq_item);
  seqA seqa;
  task body;
    seqa.start(m_sequencer);
  endtask
endclass

In your case you do not need the 2nd argument of the start function. It is defaulted to ‘null’.
The 2nd argument points to the parent of the sequence. In most cases you do not have this relationship. An exception is whan you are using in a virtual sequence a lock or grab. When starting the sequence after executing the lock/grab you have to specify the 2nd argument as ‘this’. And the start method has 3rd argument. This is the priority.

In reply to chr_sue:

we call seqa.start(m_sequencer) in the sequence. In the verif env, there are lots of sequencer .How seqa knows which sequencer will run on if we don’t use sequencer’s path like env.agent.sequencer as argument?
thanks!

In reply to peter:
You have to specify in your (virtual) sequence the handle to the correct sequencer which is
m_sequencer = env.agent.sequencer;
Or you do a get_sequencer to find the correct one.
The factory knows which sequencer can generate seq_items of a specified type, like in the sequence.