"Do" hooks

Hi,

When do I need to implement “Do” hooks in my class. Do I need to implement these when I already have field macros in place?

Thanks,

In reply to shatrish:

Using field macros implements the do_* functions automatically. But the recommendation is to avoid field macros for several reason. Employing a UVM Framework Generator is doing the work for you to implement the do_functions by such a utility.

In reply to shatrish:

You need the do_ hooks for a number of situations:

  • overriding a class adding new members, or just want to override the field macro behavior of exiting members. Much of the UVM comes from methodologies prior to the adoption of OOP and parameterized types.
  • adding class members with data types the field macros do not support (structs, multi-D arrays)
  • need behavior beyond with the field macros provide, like conditional comparisons/packing/unpacking)
  • want to improve testbench performance if you do a lot of copying, packing, or unpacking.