A given event shall have no more than one pending notification. If function notify is called for an event that already has a notification pending, only the notification scheduled to occur at the earliest time shall survive. The notification scheduled to occur at the later time shall be canceled (or never be scheduled in the first place). Immediate notification is taken to occur earlier than a delta notification, and a delta notification earlier than a timed notification. This is irrespective of the order in which function notify is called. (IEEE Std 1666-2011).
Example
1 2 3 4 |
sc_event e; e.notify(SC_ZERO_TIME); // Delta notification e.notify(1, SC_NS); // Timed notification ignored due to pending delta notification e.notify(); // Immediate notification cancels pending delta notification. e is notified |
1 2 3 4 5 |
e.notify(2, SC_NS); // Timed notification e.notify(3, SC_NS); // Timed notification ignored due to earlier pending timed notification e.notify(1, SC_NS); // Timed notification cancels pending timed notification e.notify(SC_ZERO_TIME); // Delta notification cancels pending timed notification // e is notified in the next delta cycle |
1 2 |
e.notify(); // Immediate notification e.notify(SC_ZERO_TIME); // Delta notification, e added to kernel event queue ( It not ignored) and it will be triggered in 0 s |
1 2 |
e.notify(); // Immediate notification e.notify(5,SC_PS); // Timed notification, e added to kernel event queue ( It not ignored) and it will be triggered in 5 ps |