summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/main.cc13
-rw-r--r--src/sim/stat_control.cc2
2 files changed, 10 insertions, 5 deletions
diff --git a/src/sim/main.cc b/src/sim/main.cc
index 5725897f8..728b7b810 100644
--- a/src/sim/main.cc
+++ b/src/sim/main.cc
@@ -414,7 +414,12 @@ unserializeAll(const std::string &cpt_dir)
/**
* Queue of C++ callbacks to invoke on simulator exit.
*/
-CallbackQueue exitCallbacks;
+CallbackQueue&
+exitCallbacks()
+{
+ static CallbackQueue theQueue;
+ return theQueue;
+}
/**
* Register an exit callback.
@@ -422,7 +427,7 @@ CallbackQueue exitCallbacks;
void
registerExitCallback(Callback *callback)
{
- exitCallbacks.add(callback);
+ exitCallbacks().add(callback);
}
BaseCPU *
@@ -442,8 +447,8 @@ convertToBaseCPUPtr(SimObject *obj)
void
doExitCleanup()
{
- exitCallbacks.process();
- exitCallbacks.clear();
+ exitCallbacks().process();
+ exitCallbacks().clear();
cout.flush();
diff --git a/src/sim/stat_control.cc b/src/sim/stat_control.cc
index dfed2a0c8..3fad8beb5 100644
--- a/src/sim/stat_control.cc
+++ b/src/sim/stat_control.cc
@@ -186,7 +186,7 @@ StatEvent::process()
DumpNow();
if (flags & Stats::Reset) {
- cprintf("Resetting stats!\n");
+ cprintf("Resetting stats at cycle %d!\n", curTick);
reset();
}