summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index 1c4a79020..30ebcfe7d 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -138,9 +138,11 @@ def simulate(*args, **kwargs):
def curTick():
return internal.event.cvar.curTick
+# Python exit handlers happen in reverse order. We want to dump stats last.
+atexit.register(internal.stats.dump)
+
# register our C++ exit callback function with Python
atexit.register(internal.core.doExitCleanup)
-atexit.register(internal.stats.dump)
# This loops until all objects have been fully drained.
def doDrain(root):