summaryrefslogtreecommitdiff
path: root/src/python/m5/simulate.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/m5/simulate.py')
-rw-r--r--src/python/m5/simulate.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 322257139..cbd0fb0d4 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -147,6 +147,13 @@ def simulate(*args, **kwargs):
for obj in root.descendants(): obj.startup()
need_startup = False
+ # Python exit handlers happen in reverse order.
+ # We want to dump stats last.
+ atexit.register(stats.dump)
+
+ # register our C++ exit callback function with Python
+ atexit.register(internal.core.doExitCleanup)
+
for root in need_resume:
resume(root)
need_resume = []
@@ -157,12 +164,6 @@ def simulate(*args, **kwargs):
def curTick():
return internal.core.curTick()
-# Python exit handlers happen in reverse order. We want to dump stats last.
-atexit.register(stats.dump)
-
-# register our C++ exit callback function with Python
-atexit.register(internal.core.doExitCleanup)
-
# Drain the system in preparation of a checkpoint or memory mode
# switch.
def drain(root):