sim: Add a mechanism to exit the simulation loop immediately.

There are some cases, specifically when running systemc, that it's
necessary to exit the simulation loop immediately rather than finishing
running events scheduled for the current Tick. When running under
sc_main, sc_stop and sc_pause return control to sc_main which can
happen immediately. When running without sc_main, control needs to
return to the python config script which needs to happen through a
global exit event.

Since sc_pause and sc_stop are supposed to stop simulation without
necessarily letting all the events at the current time run, we need
a way to schedule an exit event with a very high priority (rather than
a very low priority).

This change adds a new exitSimLoopNow function which does that, and
adds a new constructor to the GlobalSimLoopExitEvent which uses that

Also, a couple of cruft functions from the sim events are removed.

Change-Id: Icfbec17fb10f98084a75740acd839dbf4096fbb3
Reviewed-by: Andreas Sandberg <>
Maintainer: Andreas Sandberg <>
3 files changed