Uvm_event trigger() and reset()

Hi,

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

Thanks,
Michael

In reply to Michael54:

_irq_ev.trigger();

sets the trigger to ‘on’, trigger_time = actual time, num_waiters to the actual waiting processes.

_irq_ev.reset();

resets the trigger, setting the trigger to ‘off’, num_waiters = 0, trigger_time = 0.

In reply to chr_sue:

In reply to Michael54:

_irq_ev.trigger();

sets the trigger to ‘on’, trigger_time = actual time, num_waiters to the actual waiting processes.

_irq_ev.reset();

resets the trigger, setting the trigger to ‘off’, num_waiters = 0, trigger_time = 0.

Thank you for the replay :)

Will these 2 lines of code as written one after the other:


_irq_ev.trigger();
_irq_ev.reset();

prevent from the other processes waiting for the event trigger keep waiting forever?

In reply to Michael54:

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