summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/python/m5/stats/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py
index ab11a9d61..e2e1909f7 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -257,8 +257,11 @@ def _bindStatHierarchy(root):
if isNullPointer(obj):
return
if m5.SimObject.isSimObjectVector(obj):
- for idx, obj in enumerate(obj):
- _bind_obj("{}{}".format(name, idx), obj)
+ if len(obj) == 1:
+ _bind_obj(name, obj[0])
+ else:
+ for idx, obj in enumerate(obj):
+ _bind_obj("{}{}".format(name, idx), obj)
else:
# We need this check because not all obj.getCCObject() is an
# instance of Stat::Group. For example, sc_core::sc_module, the C++