I read that start_item() can be called on a sequence as well not just sequence_item. Does the body() method gets called if start_item(sequence) is used?
Thanks
In reply to anjujoseph:
Can you post a link to where you read start_item() can be called on a sequence? This information is incorrect and start_item() can only be called on a sequence_item. To start a sequence, you use ‘sequence.start()’.
In reply to anjujoseph:
In reply to cgales:
Your text to link here…
I read it in the above page in the cook book.
"Use start for sequences, start_item, finish_item for sequence_items
Sequence_items should be sent to the driver using the start_item() and finish_item() calls. Sequences should be started using the start() call.
Justification:
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.
"
In reply to anjujoseph:
Thanks for the link. I think this is no longer the case, but I will take a closer look at it and update if necessary.
In any case, only use start() for a sequence.
In reply to anjujoseph:
Finally you can call start_item(9 also on a sequence, because it is an extension of the uvm_seq_item. In practice it is a theoretical question because start_item/finish_item does not allow to specify a sequencer the sequence should run on. Then you can apply this only in a 1 interface testbench.
But it is possible to use the macro `uvm_do_on, because this allows you to specify a sequencer.
I tried this on a simple example and it is working fine. But I do not believe it is good coding style. Better is to start a sequence by calling its start method.
Although this is an old post , I would like to raise a point here .
From Source Code of uvm_sequence_base Class ::
virtual task start_item (uvm_sequence_item item,
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 // Check if user has passed extended type of uvm_sequence
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
...............
So it would be a Fatal error if start_item() is called on a sequence