summaryrefslogtreecommitdiff
path: root/src/sim/sim_object.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-07-18 18:23:23 -0400
committerGabe Black <gblack@eecs.umich.edu>2006-07-18 18:23:23 -0400
commit44974a4462e019cfc5c65d20ad620faa9bc7f8cf (patch)
tree94f25a8a565021f97cbf6f28a37accdf157bbafc /src/sim/sim_object.cc
parent15a8f050605919579e81b6abb98a0b596334216d (diff)
parentfe9e851e8c0a52ee412350036c94cc61c9b8dc04 (diff)
downloadgem5-44974a4462e019cfc5c65d20ad620faa9bc7f8cf.tar.xz
Merge m5.eecs.umich.edu:/bk/newmem
into ewok.(none):/home/gblack/m5/newmem --HG-- extra : convert_revision : 516c357f98c7a571c70362babd3fa162fbc2ed5a
Diffstat (limited to 'src/sim/sim_object.cc')
-rw-r--r--src/sim/sim_object.cc52
1 files changed, 47 insertions, 5 deletions
diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc
index 117ca9325..d12b06b7a 100644
--- a/src/sim/sim_object.cc
+++ b/src/sim/sim_object.cc
@@ -37,8 +37,6 @@
#include "base/misc.hh"
#include "base/trace.hh"
#include "base/stats/events.hh"
-#include "base/serializer.hh"
-#include "sim/configfile.hh"
#include "sim/host.hh"
#include "sim/sim_object.hh"
#include "sim/stats.hh"
@@ -74,6 +72,7 @@ SimObject::SimObject(Params *p)
doRecordEvent = !Stats::event_ignore.match(name());
simObjectList.push_back(this);
+ state = Running;
}
//
@@ -89,6 +88,7 @@ SimObject::SimObject(const string &_name)
doRecordEvent = !Stats::event_ignore.match(name());
simObjectList.push_back(this);
+ state = Running;
}
void
@@ -220,6 +220,24 @@ SimObject::serializeAll(ostream &os)
}
}
+void
+SimObject::unserializeAll(Checkpoint *cp)
+{
+ SimObjectList::reverse_iterator ri = simObjectList.rbegin();
+ SimObjectList::reverse_iterator rend = simObjectList.rend();
+
+ for (; ri != rend; ++ri) {
+ SimObject *obj = *ri;
+ DPRINTFR(Config, "Unserializing '%s'\n",
+ obj->name());
+ if(cp->sectionExists(obj->name()))
+ obj->unserialize(cp, obj->name());
+ else
+ warn("Not unserializing '%s': no section found in checkpoint.\n",
+ obj->name());
+ }
+}
+
#ifdef DEBUG
//
// static function: flag which objects should have the debugger break
@@ -237,7 +255,6 @@ SimObject::debugObjectBreak(const string &objs)
}
}
-extern "C"
void
debugObjectBreak(const char *objs)
{
@@ -252,10 +269,35 @@ SimObject::recordEvent(const std::string &stat)
Stats::recordEvent(stat);
}
+unsigned int
+SimObject::drain(Event *drain_event)
+{
+ state = Drained;
+ return 0;
+}
+
+void
+SimObject::resume()
+{
+ state = Running;
+}
+
+void
+SimObject::setMemoryMode(State new_mode)
+{
+ panic("setMemoryMode() should only be called on systems");
+}
+
+void
+SimObject::switchOut()
+{
+ panic("Unimplemented!");
+}
+
void
-SimObject::drain(Serializer *serializer)
+SimObject::takeOverFrom(BaseCPU *cpu)
{
- serializer->signalDrained();
+ panic("Unimplemented!");
}
DEFINE_SIM_OBJECT_CLASS_NAME("SimObject", SimObject)