How to Use Callbacks with OVM


Contributor: Umer Yousafzai
Date: October 17, 2008  
Description:

How to Use Callbacks with OVM

Callbacks are useful to manipulate an object at pre-determine cut points in code from above, i.e., a test manipulating a transaction driver. They can also be used for notification.

In OVM examples, callbacks are not used extensively because ovm_factory is a more powerful and general solution for defining new behavior in a class for procedural code, i.e., redefining virtual function, task, to declarations like adding variables, constraints, and functional coverage to existing objects.
For monitoring, OVM defines TLM classes to provide richer and well-defined semantic for object communication

To illustrate the use of callbacks, I show a simple driver that gets a transaction and provides a callback hook by triggering an event before processing it. This callback hook can be used externally to manipulate the transaction procedurally For more information, see ovm_event in OVM Reference Manual



 
Download: callback_0.sv