Wednesday, 1 July 2015

uvm_do/ovm_do vs start_item/finish_item

uvm_do/ovm_do


// From `uvm_do
// For a sequence item, the following are called, in order
`uvm_create(item)
sequencer.wait_for_grant(prior) (task)
this.pre_do(1) (task)
item.randomize()
this.mid_do(item) (func)
sequencer.send_request(item) (func)
sequencer.wait_for_item_done() (task)
this.post_do(item) (func)
// For a sequence, the following are called, in order
`uvm_create(sub_seq)
sub_seq.randomize()
sub_seq.pre_start() (task)
this.pre_do(0) (task)
this.mid_do(sub_seq) (func)
sub_seq.body() (task)
this.post_do(sub_seq) (func)
sub_seq.post_start() (task)

start_item/finish_item

//The sequence-item execution flow looks like
//
//User code
//
// parent_seq.start_item(item, priority);
// item.randomize(...) [with {constraints}];
// parent_seq.finish_item(item);
sequencer.wait_for_grant(prior) (task) \ start_item \
parent_seq.pre_do(1) (task) / \
`uvm_do* macros
parent_seq.mid_do(item) (func) \ /
sequencer.send_request(item) (func) \ finish_item /
sequencer.wait_for_item_done() (task) /
parent_seq.post_do(item) (func) /
//Attempting to execute a sequence via <start_item>/<finish_item>
//will produce a run-time error.

Reference: 
1) uvm_sequence_defines.svh
2) uvm_sequence_base.svh