summaryrefslogtreecommitdiff
path: root/src/sim/sim_object.cc
diff options
context:
space:
mode:
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)