Sequence and Do Action Macros

Summary
Sequence and Do Action Macros
Sequence Registration MacrosThe sequence-specific macros perform the same function as the set of `ovm_object_*_utils macros, except they also set the default sequencer type the sequence will run on.
`ovm_declare_p_sequencerThis macro is used to set up a specific sequencer type with the sequence type the macro is placed in.
`ovm_sequence_utils_begin
`ovm_sequence_utils_end
`ovm_sequence_utilsThe sequence macros can be used in non-parameterized <ovm_sequence> extensions to pre-register the sequence with a given <ovm_sequencer> type.
Sequencer Registration MacrosThe sequencer-specific macros perform the same function as the set of `ovm_componenent_*utils macros except that they also declare the plumbing necessary for creating the sequencer’s sequence library.
`ovm_update_sequence_libThis macro populates the instance-specific sequence library for a sequencer.
`ovm_update_sequence_lib_and_itemThis macro populates the instance specific sequence library for a sequencer, and it registers the given USER_ITEM as an instance override for the simple sequence’s item variable.
`ovm_sequencer_utils
`ovm_sequencer_utils_begin
`ovm_sequencer_param_utils
`ovm_sequencer_param_utils_begin
`ovm_sequencer_utils_endThe sequencer macros are used in ovm_sequencer-based class declarations in one of four ways.
Sequence Action MacrosThese macros are used to start sequences and sequence items that were either registered with a <`ovm-sequence_utils> macro or whose associated sequencer was already set using the <set_sequencer> method.
`ovm_createThis action creates the item or sequence using the factory.
`ovm_doThis macro takes as an argument a ovm_sequence_item variable or object.
`ovm_do_priThis is the same as `ovm_do except that the sequene item or sequence is executed with the priority specified in the argument
`ovm_do_withThis is the same as `ovm_do except that the constraint block in the 2nd argument is applied to the item or sequence in a randomize with statement before execution.
`ovm_do_pri_withThis is the same as `ovm_do_pri except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.
`ovm_sendThis macro processes the item or sequence that has been created using `ovm_create.
`ovm_send_priThis is the same as `ovm_send except that the sequene item or sequence is executed with the priority specified in the argument.
`ovm_rand_sendThis macro processes the item or sequence that has been already been allocated (possibly with `ovm_create).
`ovm_rand_send_priThis is the same as `ovm_rand_send except that the sequene item or sequence is executed with the priority specified in the argument.
`ovm_rand_send_withThis is the same as `ovm_rand_send except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.
`ovm_rand_send_pri_withThis is the same as `ovm_rand_send_pri except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.
Sequence on Sequencer Action MacrosThese macros are used to start sequences and sequence items on a specific sequencer, given in a macro argument.
`ovm_create_onThis is the same as `ovm_create 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 SEQUENCER_REF argument.
`ovm_do_onThis is the same as `ovm_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 SEQUENCER_REF argument.
`ovm_do_on_priThis is the same as `ovm_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 SEQUENCER_REF argument.
`ovm_do_on_withThis is the same as `ovm_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 SEQUENCER_REF argument.
`ovm_do_on_pri_withThis is the same as `ovm_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 SEQUENCER_REF argument.

Sequence Registration Macros

The sequence-specific macros perform the same function as the set of `ovm_object_*_utils macros, except they also set the default sequencer type the sequence will run on.

`ovm_declare_p_sequencer

This macro is used to set up a specific sequencer type with the sequence type the macro is placed in.  This macro is implicit in the <ovm_sequence_utils> macro, but may be used directly in cases when the sequence is not to be registered in the sequencer’s library.

The example below shows using the the ovm_declare_p_sequencer macro along with the ovm_object_utils macros to set up the sequence but not register the sequence in the sequencer’s library.

class mysequence extends ovm_sequence#(mydata);
  `ovm_object_utils(mysequence)
  `ovm_declare_p_sequencer(some_seqr_type)
  task body;
    //Access some variable in the user's custom sequencer
    if(p_sequencer.some_variable) begin
      ...
    end
  endtask
endclass

`ovm_sequence_utils

The sequence macros can be used in non-parameterized <ovm_sequence> extensions to pre-register the sequence with a given <ovm_sequencer> type.

For sequences that do not use any `ovm_field macros

`ovm_sequence_utils(TYPE_NAME,SQR_TYPE_NAME)

For sequences employing with field macros

`ovm_sequence_utils_begin(TYPE_NAME,SQR_TYPE_NAME)
  `ovm_field_* macro invocations here
`ovm_sequence_utils_end

The sequence-specific macros perform the same function as the set of `ovm_object_*_utils macros except that they also register the sequence’s type, TYPE_NAME, with the given sequencer type, SQR_TYPE_NAME, and define the p_sequencer variable and m_set_p_sequencer method.

Use `ovm_sequence_utils[_begin] for non-parameterized classes and `ovm_sequence_param_utils[_begin] for parameterized classes.

Sequencer Registration Macros

The sequencer-specific macros perform the same function as the set of `ovm_componenent_*utils macros except that they also declare the plumbing necessary for creating the sequencer’s sequence library.

`ovm_update_sequence_lib

This macro populates the instance-specific sequence library for a sequencer.  It should be invoked inside the sequencer¿s constructor.

`ovm_update_sequence_lib_and_item

This macro populates the instance specific sequence library for a sequencer, and it registers the given USER_ITEM as an instance override for the simple sequence’s item variable.

The macro should be invoked inside the sequencer’s constructor.

`ovm_sequencer_utils_end

The sequencer macros are used in ovm_sequencer-based class declarations in one of four ways.

For simple sequencers, no field macros

`ovm_sequencer_utils(SQR_TYPE_NAME)

For simple sequencers, with field macros

`ovm_sequencer_utils_begin(SQR_TYPE_NAME) `ovm_field_* macros here `ovm_sequencer_utils_end

For parameterized sequencers, no field macros

`ovm_sequencer_param_utils(SQR_TYPE_NAME)

For parameterized sequencers, with field macros

`ovm_sequencer_param_utils_begin(SQR_TYPE_NAME) `ovm_field_* macros here `ovm_sequencer_utils_end

The sequencer-specific macros perform the same function as the set of `ovm_componenent_*utils macros except that they also declare the plumbing necessary for creating the sequencer’s sequence library.  This includes:

1.  Declaring the type-based static queue of strings registered on the sequencer type.

2.  Declaring the static function to add strings to item #1 above.

3.  Declaring the static function to remove strings to item #1 above.

4.  Declaring the function to populate the instance specific sequence library for a sequencer.

Use `ovm_sequencer_utils[_begin] for non-parameterized classes and `ovm_sequencer_param_utils[_begin] for parameterized classes.

Sequence Action Macros

These macros are used to start sequences and sequence items that were either registered with a <`ovm-sequence_utils> macro or whose associated sequencer was already set using the <set_sequencer> method.

`ovm_create

This action creates the item or sequence using the factory.  It intentionally does zero processing.  After this action completes, the user can manually set values, manipulate rand_mode and constraint_mode, etc.

`ovm_do

This macro takes as an argument a ovm_sequence_item variable or object. ovm_sequence_item’s are randomized at the time the sequencer grants the do request.  This is called late-randomization or late-generation.  In the case of a sequence a sub-sequence is spawned.  In the case of an item, the item is sent to the driver through the associated sequencer.

`ovm_do_pri

This is the same as `ovm_do except that the sequene item or sequence is executed with the priority specified in the argument

`ovm_do_with

This is the same as `ovm_do except that the constraint block in the 2nd argument is applied to the item or sequence in a randomize with statement before execution.

`ovm_do_pri_with

This is the same as `ovm_do_pri except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.

`ovm_send

This macro processes the item or sequence that has been created using `ovm_create.  The processing is done without randomization.  Essentially, an `ovm_do without the create or randomization.

`ovm_send_pri

This is the same as `ovm_send except that the sequene item or sequence is executed with the priority specified in the argument.

`ovm_rand_send

This macro processes the item or sequence that has been already been allocated (possibly with `ovm_create).  The processing is done with randomization.  Essentially, an `ovm_do without the create.

`ovm_rand_send_pri

This is the same as `ovm_rand_send except that the sequene item or sequence is executed with the priority specified in the argument.

`ovm_rand_send_with

This is the same as `ovm_rand_send except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.

`ovm_rand_send_pri_with

This is the same as `ovm_rand_send_pri except that the given constraint block is applied to the item or sequence in a randomize with statement before execution.

Sequence on Sequencer Action Macros

These macros are used to start sequences and sequence items on a specific sequencer, given in a macro argument.

`ovm_create_on

This is the same as `ovm_create 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 SEQUENCER_REF argument.

`ovm_do_on

This is the same as `ovm_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 SEQUENCER_REF argument.

`ovm_do_on_pri

This is the same as `ovm_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 SEQUENCER_REF argument.

`ovm_do_on_with

This is the same as `ovm_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 SEQUENCER_REF argument.  The user must supply brackets around the constraints.

`ovm_do_on_pri_with

This is the same as `ovm_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 SEQUENCER_REF argument.

This action creates the item or sequence using the factory.
This macro takes as an argument a ovm_sequence_item variable or object.
This is the same as `ovm_do except that the sequene item or sequence is executed with the priority specified in the argument
This is the same as `ovm_do except that the constraint block in the 2nd argument is applied to the item or sequence in a randomize with statement before execution.