Running sequences through start_item

I read this while going through UVM Cookbook -

Although sequences can also be started using start_item() and finish_item(), it is clearer to the user whether a sequence or a sequence item is being processed if this convention is followed.

If I were to implement this functionality(running sequence through start_item) how would I do that? Just curious

Although sequences can also be started using start_item() and finish_item(),

I believe this is incorrect

virtual task start_item (uvm_sequence_item item, // Accepts actual arg. of sequence type
                         int set_priority = -1,
                         uvm_sequencer_base sequencer=null);
    uvm_sequence_base seq;
     
    if(item == null) begin
      uvm_report_fatal("NULLITM",
         {"attempting to start a null item from sequence '",
          get_full_name(), "'"}, UVM_NONE);
      return;
    end
          
    if($cast(seq, item)) begin // True when actual arg. to 'item' is sequence type
      uvm_report_fatal("SEQNOTITM",
         {"attempting to start a sequence using start_item() from sequence '",
          get_full_name(), "'. Use seq.start() instead."}, UVM_NONE);
      return;
    end
    ....................

On calling a sequence type as argument to start_item() , one would observe UVM_FATAL message above

1 Like

HI, I was wondering if anyone can share a scenario the third argument "uvm_sequecer_base sequencer ) is used ?