Does nested sequences need sequencer for all the sequences?

Hi Folks,

I have a very basic doubt.

One sequence calls another sequence which calls another sequence again.

The bottom most sequence randomizes the sequence_item and sends it over driver.

I agree that the bottom-most sequence needs a sequencer to run on (as it gets routed to driver through TLM port).

But for the other sequences mentioned here, do we need a sequencer?

If I have something like this.

class a extends uvm_sequence #(trans)

//object utils macro not shown

b  b_inst //note that b is a sequence)

task body 
`uvm_create(b) 

some code.....

`uvm_send(b)

endtask 


endclass




class b extends uvm_sequence #(trans)

//object utils macro not shown

c  c_inst //note that c is a sequence)

task body 
`uvm_create(c) 

some code.....

`uvm_send(c)

endtask 

endclass




class c extends uvm_sequence #(trans)

//object utils macro not shown

trans trans_inst; 

task body 
`uvm_create_on(trans_inst,some_seqr) 

some code.....

`uvm_send(trans_inst)

endtask 

endclass

In above code, only last sequence sends transaction item and also calls create_on and specifies a sequencer.
All others dont specify seqeuncer.Will this code work?

Thanks,
Suyog

In reply to uvm_user235:

The question is what is your objectice. I believe your code is useless, because all sequences are parameterized with the item. That mena it should generate seq_items.
But a sequence does not have to generate sequence items.
A virtual sequence is startring several other sequences, and it does not need a sequencer.
And any sequence can contain other sequences which are intended to run on the same sequencer.
Both cases are very useful,

In reply to chr_sue:
Hi Christoph,

Thanks for your reply. For layered protocols there are some examples where sequencers are chained. Can you please point to any use case or example where only sequences are nested in non virtual sequence

And any sequence can contain other sequences which are intended to run on the same sequencer.

Regards,

In reply to uvm_user235:

This is a code snipped for your behavior, I guess.

class low_level_seq extends uvm_sequence #(my_transaction);
  my_frame frame;
  `uvm_declare_p_sequencer(low_level_sequencer)
  
  task body;
    forever
    begin
      req = my_transaction::type_id::create("req");
      start_item(req);

      p_sequencer.seq_item_port.get_next_item(frame); 

      send(frame);

      p_sequencer.seq_item_port.item_done();
    end
  endtask