summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-02-21 10:46:31 -0500
committerNathan Binkert <binkertn@umich.edu>2004-02-21 10:46:31 -0500
commite067bc751bd13d73dfb0abe31f296140e3e29de9 (patch)
tree13a0ed04219e9f21e0a1a231da43bc9f33c238d8
parent610081079cd02a620794fa1ac693822c191223ec (diff)
downloadgem5-e067bc751bd13d73dfb0abe31f296140e3e29de9.tar.xz
Change order of serialization
sim/sim_object.cc: serialize objects in the reverse order of their creation. This causes a SimObject that is dependent on another to be serialized first. For example, the ethernet device writes back some data to physical memory while serializing, so this will cause the physical memory to be serialized after that, preserving the data written back. --HG-- extra : convert_revision : f9a37b63ce777df1cfecefa80f94f8fc69e42448
-rw-r--r--sim/sim_object.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sim/sim_object.cc b/sim/sim_object.cc
index b3ac2c7a4..c55021e41 100644
--- a/sim/sim_object.cc
+++ b/sim/sim_object.cc
@@ -182,11 +182,11 @@ SimObject::printAllExtraOutput(ostream &os)
void
SimObject::serializeAll(ostream &os)
{
- SimObjectList::iterator i = simObjectList.begin();
- SimObjectList::iterator end = simObjectList.end();
+ SimObjectList::reverse_iterator ri = simObjectList.rbegin();
+ SimObjectList::reverse_iterator rend = simObjectList.rend();
- for (; i != end; ++i) {
- SimObject *obj = *i;
+ for (; ri != rend; ++ri) {
+ SimObject *obj = *ri;
obj->nameOut(os);
obj->serialize(os);
}