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.