Communication between two agents in an env

In reply to mseyunni:

The uvm_event Can be passed to the config_db using the set Command and retrieved in any Other place from the config_db using the get command.

See below a simple example for the uvm_event_pool:

class driver1 extends uvm_driver #(my_tx);
  uvm_event_pool ev_pool = uvm_event_pool::get_global_pool();
  ...
  task run_phase(uvm_phase phase);
    uvm_event ev = ev_pool.get("driver1_ev"); //get retrieves the event 'driver1_ev'. If it does not exist it will be created
    ev.trigger(req); // triggers the event and a seq_item is passed to this event


class driver2 extends uvm_driver #(my_tx);
  uvm_event_pool ev_pool = uvm_event_pool::get_global_pool();
  ...
  task run_phase(uvm_phase phase);
    uvm_event ev = ev_pool.get("driver1_ev");  //retrieves this event
    ev.wait_trigger();                         // waits for this event to be triggered
    $cast(req, ev.get_trigger_data());         // retrieves the trigger data from driver1 and casts this to the right type