Hi,
I have two agents in my testbench. The first is driving its interface and its monitor is issueing analysis transactions and events. The events are used in another agents driver to synchonize bus transactions on the second interface based on the first one.
I can’t use the transactions of the first agent because they are issued after the bus transaction. I need to have the second agents sycnhronized a bit earlier. So I want to use the events for this.
Can I generate uvm_events in the first agents monitor and wait for those events in the second agents driver?
I assume I need to use the global event pool. But I can’t find any code examples. Can someone be of any help?
…
Ok, I found that the event pool is local to the component.
So I defined a global event pool in the env and put the reference in the config objects of the two agents.
It seems that agent2 is picking up the same uvm_event as agent1 alright. Agent2 arrives at the wait_ptrigger() before agent1 triggers the event. But agent2 still doesn’t see the trigger.
Am I still doing something wrong?
class env ....
...
function void build_phase ( ....
...
uvm_event_pool evt_pool = uvm_event_pool :: get_global_pool();
...
cfg_agent1.event_pool = evt_pool;
...
cfg_agent2.event_pool = evt_pool;
...
endfunction
...
endclass
class agent1_monitor ....
...
function void build_phase ( ....
...
// get the config object from the config_db
m_config = ....
...
endfunction
task run_phase ( ....
uvm_event some_event = m_config.event_pool.get("some_event");
...
some_event.trigger();
...
endtask
endclass
class agent2_driver ...
...
function void build_phase ( ....
...
// get the config object from the config_db
m_config = ....
...
endfunction
task run_phase ( ...
uvm_event some_event = m_config.event_pool.get("some_event");
...
some_event.wait_ptrigger();
...
endtask
endclass
Best regards,
Ronald