The SystemC standard says:
5.10.8 Multiple event notifications
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 cancelled (or never be scheduled in the first place). An 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.
If I run the following example the simulation stops after 100000000 ps as intended, however, the memory usage of the program increases rapidly to 1GB and more.
uint64_t counter = 0;
sensitive << event;
if (counter == 100000000)
int sc_main(int argc, char **argv)
When both event notifications are swapped the memory leak is gone. When SC_MS is replaced by SC_US, the memory usage increases a lot slower.
The program was tested with the latest SystemC version from GitHub as well as SystemC 2.3.3 on the WSL with GCC 8 and GCC 6.