summaryrefslogtreecommitdiff
path: root/src/python/m5/simulate.py
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:11:00 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2010-08-17 05:11:00 -0700
commitc2e1458746278b761917f62eb890eefbf4bbc938 (patch)
tree1600ed2d0e625c6de5f28ea59931a3c5007add39 /src/python/m5/simulate.py
parent5ea906ba1625266ee80968d70e0c218adedcce9f (diff)
downloadgem5-c2e1458746278b761917f62eb890eefbf4bbc938.tar.xz
sim: clean up child handling
The old code for handling SimObject children was kind of messy, with children stored both in _values and _children, and inconsistent and potentially buggy handling of SimObject vectors. Now children are always stored in _children, and SimObject vectors are consistently handled using the SimObjectVector class. Also, by deferring the parenting of SimObject-valued parameters until the end (instead of doing it at assignment), we eliminate the hole where one could assign a vector of SimObjects to a parameter then append to that vector, with the appended objects never getting parented properly. This patch induces small stats changes in tests with data races due to changes in the object creation & initialization order. The new code does object vectors in order and so should be more stable.
Diffstat (limited to 'src/python/m5/simulate.py')
-rw-r--r--src/python/m5/simulate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index 54c6a0a2d..28ba10c0d 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -55,6 +55,10 @@ def instantiate():
# we need to fix the global frequency
ticks.fixGlobalFrequency()
+ # Make sure SimObject-valued params are in the configuration
+ # hierarchy so we catch them with future descendants() walks
+ for obj in root.descendants(): obj.adoptOrphanParams()
+
# Unproxy in sorted order for determinism
for obj in root.descendants(): obj.unproxyParams()