summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConscript1
-rw-r--r--sim/sim_object.cc7
-rw-r--r--sim/sim_object.hh9
3 files changed, 17 insertions, 0 deletions
diff --git a/SConscript b/SConscript
index d49bee5e4..a2d5de279 100644
--- a/SConscript
+++ b/SConscript
@@ -62,6 +62,7 @@ base_sources = Split('''
base/range.cc
base/random.cc
base/sat_counter.cc
+ base/serializer.cc
base/socket.cc
base/statistics.cc
base/str.cc
diff --git a/sim/sim_object.cc b/sim/sim_object.cc
index 151ba68a7..17d58ba4f 100644
--- a/sim/sim_object.cc
+++ b/sim/sim_object.cc
@@ -34,6 +34,7 @@
#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"
@@ -248,4 +249,10 @@ SimObject::recordEvent(const std::string &stat)
Stats::recordEvent(stat);
}
+void
+SimObject::drain(Serializer *serializer)
+{
+ serializer->signalDrained();
+}
+
DEFINE_SIM_OBJECT_CLASS_NAME("SimObject", SimObject)
diff --git a/sim/sim_object.hh b/sim/sim_object.hh
index 5db62dd51..76aba7ea1 100644
--- a/sim/sim_object.hh
+++ b/sim/sim_object.hh
@@ -41,6 +41,8 @@
#include "sim/serialize.hh"
#include "sim/startup.hh"
+class Serializer;
+
/*
* Abstract superclass for simulation objects. Represents things that
* correspond to physical components and can be specified via the
@@ -96,6 +98,13 @@ class SimObject : public Serializable, protected StartupCallback
// static: call nameOut() & serialize() on all SimObjects
static void serializeAll(std::ostream &);
+ // Methods to drain objects in order to take checkpoints
+ // Or switch from timing -> atomic memory model
+ virtual void drain(Serializer *serializer);
+ virtual void resume() { return;} ;
+ virtual void serializationComplete()
+ { assert(0 && "Unimplemented"); };
+
#ifdef DEBUG
public:
bool doDebugBreak;