How to transmit data from monitor to driver

From encoder output iam driving on interface,interface data is tapped on the monitor
From monitor i want to drive data to another driver of decoder,to compare decoder output with encoder input.
Any idea to do this

In reply to shiva kumar:

You can implement an port/export connection, sending out a transaction to another driver.

In reply to chr_sue:

how to implement driver logic,to get data from monitor(by using port connections)

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

In reply to kranthikiranufl:

can we use resource db,by setting in monitor and getting in driver.

In reply to shiva kumar:

you should have the following connection in your Environment to drive the data.

Monitor → sends data through analysis port to analysis export of sequencer
sequencer → analysis export connect to analysis fifo.
Sequence > will be running in forever loop . it will be unblocked by the get command of fifo.
Driver will driver the sequence data.

In reply to kddholak:

iam extending driver from UVM_Driver,so it is throwing a error if we change port connections for driver and monitor

In reply to chr_sue:

can i use resource db by setting in monitor and read in driver

In reply to shiva kumar:

In reply to kddholak:
iam extending driver from UVM_Driver,so it is throwing a error if we change port connections for driver and monitor

To avoid this error you have to implement explicitly an a uvm analysis port in the monitor and in the driver an uvm analysis export additionally to the port inherited from the base class.
It is not recommended to use the resource_db for any implementation. You could use the config_db, but you’ll not know when the data has been transmitted to the config_db.