* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Nathan Binkert
- * Steve Reinhardt
*/
#ifndef __SIM_EXIT_HH__
#include <string>
#include "base/types.hh"
-#include "sim/core.hh"
-// forward declaration
-class Callback;
-class EventQueue;
-class SimLoopExitEvent;
+Tick curTick();
/// Register a callback to be called when Python exits. Defined in
/// sim/main.cc.
-void registerExitCallback(Callback *);
+void registerExitCallback(const std::function<void()> &);
/// Schedule an event to exit the simulation loop (returning to
/// Python) at the end of the current cycle (curTick()). The message
/// and exit_code parameters are saved in the SimLoopExitEvent to
/// indicate why the exit occurred.
void exitSimLoop(const std::string &message, int exit_code = 0,
- Tick when = curTick(), Tick repeat = 0);
+ Tick when = curTick(), Tick repeat = 0,
+ bool serialize = false);
+/// Schedule an event as above, but make it high priority so it runs before
+/// any normal events which are schedule at the current time.
+void exitSimLoopNow(const std::string &message, int exit_code = 0,
+ Tick repeat = 0, bool serialize = false);
#endif // __SIM_EXIT_HH__