I have a code triggering an uvm_event and right after it resets this event, inside a function.
What is achieved by this trigger() + reset() right after?
Will the waiting process detect this event occurrence?
function void IRQReturn(input string a_irq_name, ref uvm_object a_obj);
uvm_event _irq_ev;
int _status;
_irq_ev = ev_pool.get(a_irq_name);
if (a_obj != null) begin
_status = isr_mbx[a_irq_name].try_put(a_obj);
end
_irq_ev.trigger();
_irq_ev.reset();
`uvm_info(get_type_name(), $sformatf("Trigger_event for IRQ_name: %s", a_irq_name), UVM_HIGH)
endfunction : IRQReturn
If you do not trigger again no trigger will happen and processes waiting for a triger are waiting forever. The reset is switching off the trigger and set the num_waiters = 0; There is nobody waiting even if additional processes are waiting.
In reply to Michael54:
I think what you are trying to answer is if two events _irq_ev.trigger(); followed by _irq_ev.reset(); would work, considering they are right after one another.
Answer is Yes. _irq_ev.trigger() will be detected by the event in waiting for this event to trigger and then the reset will happen