Currently using the event_pool, and in one my environments I do this:
e_some_event = uvm_event_pool::get_global(“some_event_name”);
if (e_some_event == null) `uvm_fatal(“my_env“, “could not find some_event_name”)
With the expectation that if the event did not exist, it would return null. But after some digging, the get_global() method also calls the get() method in uvm_pool such that it will automatically create this event anyway - so it’ll always create a uvm_event object when I don’t want it to.
The documentation for get() explicitly says it will create a new object for you, but not get_global() so this was a surprise.
I know I can just do a uvm_event_pool::exists() call first and check there - but I would have to do that call and then the get() / get_global() anyway and I wanted to avoid that.
Is there a reason for this functionality? What is goal of having get_global() vs get() ?