How uvm parent sequence class body method is called

Could you please provide clarification how parent sequence body method is called . everywhere in the examples USER_SEQ.start() method is called. and the start method is defined only in the uvm_sequence_base class. could you please clarify how body() method of user defined sequence is called, which has start item and finish item

In reply to srbeeram:

When call start() on a sequence, you have two choices.

You can provide a handle to a sequencer, and the sequence handle gets placed on the sequencer’s queue. When the sequencer is ready to run the sequence, it calls the body() method of the sequence.

If you provide no handle (or the null handle) to the sequence start() method, the sequence calls the body() method of the sequence directly. This is what’s sometimes called a virtual sequence. The body method can only start other sequences.

Only sequence body()s called by sequencers can call start_item()/finish_item()

In reply to dave_59:

Hi Dave,Thanks a lot for providing the clarifications.Could you please provide the snippet of the code or class names. I tried to see in the uvm_sequencer code. but not able to get it.ry

In reply to srbeeram:
https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.1d/html/files/seq/uvm_sequence_base-svh.html#uvm_sequence_base.start

You will see the start() task calling body().

I think I misspoke earlier. The sequence arbitration with the sequencer comes from [font-courier new]start_item(). It blocks calling [font-courier new]sequencer.wait_for_grant(this, set_priority);.

In reply to dave_59:

Hi Dave,
sorry for asking again.

my doubt is start method is not defined in the following example and it is defined in the uvm_base_sequence. mem_sequence_obj.start(sequencer) is called from test case. then this start is calling the uvm_sequence_base class start.but wait_for_grant is defined in the mem_sequence .could you please provide clarification how body method of mem_sequence is called.


   
class mem_sequence extends uvm_sequence#(mem_seq_item);
   
  `uvm_sequence_utils(mem_sequence,mem_sequencer)
   
  //Constructor
  function new(string name = "mem_sequence");
    super.new(name);
  endfunction
   
  virtual task body();
 
    req = mem_seq_item::type_id::create("req");
    wait_for_grant();
    req.randomize();
    send_request(req);
    wait_for_item_done();
 
  endtask
   
  endclass

  

In reply to srbeeram:

The start method is defined in your example - mem_sequence inherites it from uvm_sequence_base. body() is also defined in uvm_sequence_base as a virtual method. So when start() calls body(), it calls mem_sequence::body().

In reply to dave_59:

Thanks Dave for providing the clarifications