//| sub_seq.post_start() (task)//|`define uvm_do(SEQ_OR_ITEM) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, m_sequencer, -1, {})// MACRO: `uvm_do_pri////| `uvm_do_pri(SEQ_OR_ITEM, PRIORITY)//// This is the same as `uvm_do except that the sequence item or sequence is// executed with the priority specified in the argument`define uvm_do_pri(SEQ_OR_ITEM, PRIORITY) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, m_sequencer, PRIORITY, {})// MACRO: `uvm_do_with////| `uvm_do_with(SEQ_OR_ITEM, CONSTRAINTS)//// This is the same as `uvm_do except that the constraint block in the 2nd// argument is applied to the item or sequence in a randomize with statement// before execution.`define uvm_do_with(SEQ_OR_ITEM, CONSTRAINTS) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, m_sequencer, -1, CONSTRAINTS)
// to the sequence in which the macro is invoked, and it sets the sequencer to// the specified ~SEQR~ argument.`define uvm_create_on(SEQ_OR_ITEM, SEQR) \ begin \ uvm_object_wrapper w_; \ w_ = SEQ_OR_ITEM.get_type(); \ $cast(SEQ_OR_ITEM , create_item(w_, SEQR, `"SEQ_OR_ITEM`"));\ end// MACRO: `uvm_do_on////| `uvm_do_on(SEQ_OR_ITEM, SEQR)//// This is the same as <`uvm_do> except that it also sets the parent sequence to// the sequence in which the macro is invoked, and it sets the sequencer to the// specified ~SEQR~ argument.`define uvm_do_on(SEQ_OR_ITEM, SEQR) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, SEQR, -1, {})// MACRO: `uvm_do_on_pri////| `uvm_do_on_pri(SEQ_OR_ITEM, SEQR, PRIORITY)//// This is the same as <`uvm_do_pri> except that it also sets the parent sequence// to the sequence in which the macro is invoked, and it sets the sequencer to// the specified ~SEQR~ argument.`define uvm_do_on_pri(SEQ_OR_ITEM, SEQR, PRIORITY) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, SEQR, PRIORITY, {})// MACRO: `uvm_do_on_with////| `uvm_do_on_with(SEQ_OR_ITEM, SEQR, CONSTRAINTS)//// This is the same as <`uvm_do_with> except that it also sets the parent// sequence to the sequence in which the macro is invoked, and it sets the// sequencer to the specified ~SEQR~ argument.// The user must supply brackets around the constraints.`define uvm_do_on_with(SEQ_OR_ITEM, SEQR, CONSTRAINTS) \ `uvm_do_on_pri_with(SEQ_OR_ITEM, SEQR, -1, CONSTRAINTS)// MACRO: `uvm_do_on_pri_with////| `uvm_do_on_pri_with(SEQ_OR_ITEM, SEQR, PRIORITY, CONSTRAINTS)//// This is the same as `uvm_do_pri_with except that it also sets the parent// sequence to the sequence in which the macro is invoked, and it sets the// sequencer to the specified ~SEQR~ argument.`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//-----------------------------------------------------------------------------//// Group: Sequence Action Macros for Pre-Existing Sequences
// This is the same as `uvm_send except that the sequence item or sequence is// executed with the priority specified in the argument.`define uvm_send_pri(SEQ_OR_ITEM, PRIORITY) \ begin \ uvm_sequence_base __seq; \ if (!$cast(__seq,SEQ_OR_ITEM)) begin \ start_item(SEQ_OR_ITEM, PRIORITY);\ finish_item(SEQ_OR_ITEM, PRIORITY);\ end \ else __seq.start(__seq.get_sequencer(), this, PRIORITY, 0);\ end// MACRO: `uvm_rand_send////| `uvm_rand_send(SEQ_OR_ITEM)//// This macro processes the item or sequence that has been already been
// This is the same as `uvm_rand_send except that the sequence item or sequence// is executed with the priority specified in the argument.`define uvm_rand_send_pri(SEQ_OR_ITEM, PRIORITY) \ `uvm_rand_send_pri_with(SEQ_OR_ITEM, PRIORITY, {})// MACRO: `uvm_rand_send_with////| `uvm_rand_send_with(SEQ_OR_ITEM, CONSTRAINTS)//// This is the same as `uvm_rand_send except that the given constraint block is// applied to the item or sequence in a randomize with statement before// execution.`define uvm_rand_send_with(SEQ_OR_ITEM, CONSTRAINTS) \ `uvm_rand_send_pri_with(SEQ_OR_ITEM, -1, CONSTRAINTS)// MACRO: `uvm_rand_send_pri_with////| `uvm_rand_send_pri_with(SEQ_OR_ITEM, PRIORITY, CONSTRAINTS)//// This is the same as `uvm_rand_send_pri except that the given constraint block// is applied to the item or sequence in a randomize with statement before// execution.`define uvm_rand_send_pri_with(SEQ_OR_ITEM, PRIORITY, CONSTRAINTS) \ begin \ uvm_sequence_base __seq; \ if (!$cast(__seq,SEQ_OR_ITEM)) start_item(SEQ_OR_ITEM, PRIORITY);\ else __seq.set_item_context(this,SEQ_OR_ITEM.get_sequencer()); \ if ((__seq == null || !__seq.do_not_randomize) && !SEQ_OR_ITEM.randomize() with CONSTRAINTS ) begin \ `uvm_warning("RNDFLD", "Randomization failed in uvm_rand_send_with action") \ end\ if (!$cast(__seq,SEQ_OR_ITEM)) finish_item(SEQ_OR_ITEM, PRIORITY);\ else __seq.start(__seq.get_sequencer(), this, PRIORITY, 0);\ end`define uvm_create_seq(UVM_SEQ, SEQR_CONS_IF) \ `uvm_create_on(UVM_SEQ, SEQR_CONS_IF.consumer_seqr) \
// the user can manually set values, manipulate rand_mode and constraint_mode, etc.// @uvm-ieee 1800.2-2020 auto B.3.1.1`define uvm_create(SEQ_OR_ITEM, SEQR=get_sequencer()) \ begin \ uvm_object_wrapper w_; \ w_ = SEQ_OR_ITEM.get_type(); \ $cast(SEQ_OR_ITEM , create_item(w_, SEQR, `"SEQ_OR_ITEM`"));\ end// MACRO -- NODOCS -- `uvm_do////| `uvm_do(SEQ_OR_ITEM, SEQR=get_sequencer(), PRIORITY=-1, CONSTRAINTS={})//// This macro takes as an argument a uvm_sequence_item variable or object.// The argument is created using <`uvm_create>, which sets the sequencer to// the specified ~SEQR~ argument.// In the case of an item, it is randomized after the call to
//|// @uvm-ieee 1800.2-2020 auto B.3.1.4`define uvm_do(SEQ_OR_ITEM, SEQR=get_sequencer(), PRIORITY=-1, CONSTRAINTS={}) \ begin \ `uvm_create(SEQ_OR_ITEM, SEQR) \ `uvm_rand_send(SEQ_OR_ITEM, PRIORITY, CONSTRAINTS) \ end//-----------------------------------------------------------------------------//// Group -- NODOCS -- Sequence Action Macros for Pre-Existing Sequences//// These macros are used to start sequences and sequence items that do not// need to be created. //-----------------------------------------------------------------------------
// `uvm_do without the create or randomization.// @uvm-ieee 1800.2-2020 auto B.3.1.2`define uvm_send(SEQ_OR_ITEM, PRIORITY=-1) \ begin \ uvm_sequence_base __seq; \ if (!$cast(__seq,SEQ_OR_ITEM)) begin \ start_item(SEQ_OR_ITEM, PRIORITY);\ finish_item(SEQ_OR_ITEM, PRIORITY);\ end \ else __seq.start(__seq.get_sequencer(), this, PRIORITY, 0);\ end// MACRO -- NODOCS -- `uvm_rand_send////| `uvm_rand_send(SEQ_OR_ITEM, PRIORITY=-1, CONSTRAINTS={})//// This macro processes the item or sequence that has been already been
// randomization.// @uvm-ieee 1800.2-2020 auto B.3.1.3`define uvm_rand_send(SEQ_OR_ITEM, PRIORITY=-1, CONSTRAINTS={}) \ begin \ uvm_sequence_base __seq; \ if ( SEQ_OR_ITEM.is_item() ) begin \ start_item(SEQ_OR_ITEM, PRIORITY);\ if ( ! SEQ_OR_ITEM.randomize() with CONSTRAINTS ) begin \ `uvm_warning("RNDFLD", "Randomization failed in uvm_rand_send action") \ end\ finish_item(SEQ_OR_ITEM, PRIORITY);\ end \ else if ( $cast( __seq, SEQ_OR_ITEM ) ) begin \ __seq.set_item_context(this,SEQ_OR_ITEM.get_sequencer()); \ if ( __seq.get_randomize_enabled() ) begin \ if ( ! SEQ_OR_ITEM.randomize() with CONSTRAINTS ) begin \ `uvm_warning("RNDFLD", "Randomization failed in uvm_rand_send action") \ end \
// This is the same as `uvm_do except that the sequence item or sequence is// executed with the priority specified in the argument`define uvm_do_pri(SEQ_OR_ITEM, PRIORITY) \ `uvm_do(SEQ_OR_ITEM, get_sequencer(), PRIORITY, {})// MACRO -- NODOCS -- `uvm_do_with////| `uvm_do_with(SEQ_OR_ITEM, CONSTRAINTS)//// This is the same as `uvm_do except that the constraint block in the 2nd// argument is applied to the item or sequence in a randomize with statement// before execution.`define uvm_do_with(SEQ_OR_ITEM, CONSTRAINTS) \ `uvm_do(SEQ_OR_ITEM, get_sequencer(), -1, CONSTRAINTS)