Reason for Separate Monitor and Driver

Saw it somewhere posted as an interview question. Why do we need separate classes/places for monitor and driver?
My guess is-

  1. Reusability, keeping two independent operations exclusive helps in reusability.
  2. Since the monitor and driver operate in different simulation regions, it is better to have them work separately.

Please share your views.

Thanks!

1 Like

In reply to possible:

The big reason is reuse of the given agent in different testing scenarios, especially when trying to use the given agent at various levels of a design hierarchy.

At the lowest level you may need your agent to drive a set of signals into your design as well as report what is going on with those signals, reporting activity to other components in your testbench (scoreboards, coverage collectors, etc).

When that block of design is integrated into a larger design, the signals that were getting driven by your agent and the testbench may now be driven by some other block of design RTL, so you can no longer use your agent to drive at the same time, but you may still need to sample values on the signals for scoreboarding/coverage/etc.

If you split your agent into a monitor and driver, you can configure the agent to operate in an active mode (driver exists) or a passive mode (driver not instantiated, only monitor exists) so that it can be used at any level of a testbench where that agent’s associated protocol is utilized.