Help in uvm_do macro in UVM methodology?

Hello all,

Can someone plz give me brief about 'uvm_do and its subordinate macros? Whats exactly their purposes in writing sequences? Can someone plz put some light on it?

Also do sequence/sequencer registration macros are still used? Whats the use of `uvm_update_sequence_lib_and_item macro ?

Thanks,
Swapnil

All of the sequence registration macros are from the OVM and have been deprecated from the UVM. Although the `uvm_do macros are not deprecated, we prefer that you avoid them an instead use learn the underlying 5-step sequence API:

  1. create(…)
  2. start_item(…)
  3. Set values or randomize
  4. finish_item(…)
  5. get_response - optional

It’s much easier to learn than to have to remember all the different variation of macros.

This sequence action macros simplify sequence item and sequence execution. Following are the steps performed by this macro. This will be invoked within the body() method
Perform one or more of the following 7 steps

  1. Create – allocates and initializes the sequencer and parent sequence of the
    item or sequence
  2. Synchronize with sequencer
    – For items: the item waits until sequencer acknowledges it can continue
    – For sub-sequences: no synchronization with sequencer occurs
  3. pre_do – execute the pre_do() user hook
  4. Randomize
  5. mid_do – execute the mid_do() user hook
  6. Post synchronization
    – For items: the item is provided to sequencer and is now ready to be
    given to the consumer. It now waits until it is consumed
    – For sub-sequences: the sub-sequence’s body() method is executed
  7. post_do – Execute the post_do() user hook

In reply to vishnuprasanth:

Hi All,
I need a clarification on the above as suggested to use below 4/5 steps instead of 1 line macro uvm_do/uvm_do_with which is equivalent to the same 4 step functions.The below 4 steps increases the number of code lines where each macro will be replaced by 4 functions for every new sequence.So, what advantage are we getting in return to this.

  1. create(…)
  2. start_item(…)
  3. Set values or randomize
  4. finish_item(…)
  5. get_response - optional

Thanks All…

In reply to Kausar:

The advantages of using the 4-steps (non of the macros do the 5th step) instead of using the set of 15 macros are

  1. Easier to learn 4 steps than 15 macros
  2. Easier to read 4 steps than try to remember what the 15 macros do
  3. If you need to code something other than `uvm_do, you will need to learn the 4 steps any ways.

Hi Ver_tech,

When you use these steps instead of uvm_do macro, you will be having very fine grain control over the sequence item.

-Vishnu

In reply to dave_59:

All of the sequence registration macros are from the OVM and have been deprecated from the UVM. Although the `uvm_do macros are not deprecated, we prefer that you avoid them an instead use learn the underlying 5-step sequence API:

  1. create(…)
  2. start_item(…)
  3. Set values or randomize
  4. finish_item(…)
  5. get_response - optional

It’s much easier to learn than to have to remember all the different variation of macros.

what is deprecated? it means extends?

In reply to lalithjithan:

See this definition.

This UVM has similar flag, UVM_NO_DEPRECATED, you can turn on the will give you compiler errors if try to use deprecated UVM features.