Create_item, start_item, finish_item not declared Issue in UVM

In reply to Arun_Rajha:

uvm_do_* Macros will not work in uvm_test. Here you can only use the start method. The reason is if you see below code of uvm_do_on_pri_with which is being ultimately called by all the `uvm_do_* macros.

define uvm_do_on_pri_with(SEQ_OR_ITEM, SEQR, PRIORITY, CONSTRAINTS) \ begin \ uvm_sequence_base __seq; \ uvm_create_on(SEQ_OR_ITEM, SEQR)
if (!$cast(__seq,SEQ_OR_ITEM)) start_item(SEQ_OR_ITEM, PRIORITY);
if ((__seq == null || !__seq.do_not_randomize) && !SEQ_OR_ITEM.randomize() with CONSTRAINTS ) begin
`uvm_warning(“RNDFLD”, “Randomization failed in uvm_do_with action”)
end
if (!$cast(__seq,SEQ_OR_ITEM)) finish_item(SEQ_OR_ITEM, PRIORITY);
else __seq.start(SEQR, this, PRIORITY, 0);
end

Here the start_item and finish_item and create_item function all defined in uvm_sequence_base class. So if you are trying to use this macro while executing sub-sequence or sequence_item in your sequence it will work fine. You may see the declaration of this function here.

Hope this answers your question.

1 Like