Policy Classes

Each of OVM’s policy classes perform a specific task for ovm_object-based objects: printing, comparing, recording, packing, and unpacking.  They are implemented separately from ovm_object so that users can plug in different ways to print, compare, etc. without modifying the object class being operated on.  The user can simply apply a different printer or compare “policy” to change how an object is printed or compared.

Each policy class includes several user-configurable parameters that control the operation.  Users may also customize operations by deriving new policy subtypes from these base types.  For example, the OVM provides four different ovm_printer-based policy classes, each of which print objects in a different format.

  • ovm_printer - performs deep printing of ovm_object-based objects.  The OVM provides several subtypes to ovm_printer that print objects in a specific format: ovm_table_printer, ovm_tree_printer, and ovm_line_printer.  Each such printer has many configuration options that goven what and how object members are printed.
  • ovm_comparer - performs deep comparison of ovm_object-based objects.  Users may configure what is compared and how miscompares are reported.
  • ovm_recorder - performs the task of recording ovm_object-based objects to a transaction data base.  The implementation is vendor-specific.
  • ovm_packer - used to pack (serialize) and unpack ovm_object-based properties into bit, byte, or int arrays and back again.
virtual class ovm_object extends ovm_void
The ovm_object class is the base class for all OVM data and hierarchical classes.
class ovm_printer
The ovm_printer class provides an interface for printing ovm_objects in various formats.
class ovm_table_printer extends ovm_printer
The table printer prints output in a tabular format.
class ovm_tree_printer extends ovm_printer
By overriding various methods of the ovm_printer super class, the tree printer prints output in a tree format.
class ovm_line_printer extends ovm_tree_printer
The line printer prints output in a line format.
class ovm_comparer
The ovm_comparer class provides a policy object for doing comparisons.
class ovm_recorder
The ovm_recorder class provides a policy object for recording ovm_objects.
The ovm_packer class provides a policy object for packing and unpacking ovm_objects.