How to transmit data from monitor to driver

In reply to shiva kumar:

Hello Shiva,

I think monitor is a passive component, and it is not ideal to use it to drive any logic.

But you can pull data from the monitor to a driver using TLM methods.

Define a “port” inside a driver and an “export” with same transaction type inside a monitor. Connect them in their top level (Agent).

You can implement any method (user defined) to get the data from monitor.

Eg:
class my_driver; //your driver
uvm_blocking_get_port #(trans_type) get_port;

task get_data;
trans_type t;
get_port.get(t); //call the task get() here
endtask
endclass

class my_monitor;
uvm_blocking_get_imp #(trans_type, my_monitor) get_export;
trans_type tmp; //local data
//Implement the get() here
task get(output trans_type t);
t = tmp;
endtask
endclass

As I shown above, you need to implement a task inside monitor which actually sends the data out to driver, where the task is called.

Hope this helps.

Thanks,
Kranthi