Hello all
I was on working uvm_event_pool, I was like confuse with it. As per LRM “it is used to store collection of the event”. But there is no method to add an event. Like the “add” method in uvm_pool.
My question is without add method, how the event is added.? There is a "get method" which is used to get the event. How this method is working.?
The easiest way to “imagine” this is to think about a pool of uvm_events available for your use. Whenever you need an event, you are allowed to pick one of the events and give it a name. You can do this with the get method. Once the event is available you can trigger it or wait for that event to trigger.
Here is an example
task sending_comp::run_phase(uvm_phase phase);
uvm_event ev = m_event_pool.get("my_favorite_event");
ev.trigger(req);
end_task
task receiving_comp::run_phase(uvm_phase phase);
uvm_event ev = m_event_pool.get("my_favorite_event");
ev.wait_trigger();
end_task
In the above example, two components are using events to synchronize the
execution. One triggers an event and the other is waiting for the trigger.
Notice both of these use the same name “my_favorite_event”. This ensures
that the two components are really using the same event between them