summaryrefslogtreecommitdiff
path: root/src/sim/serialize.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-09-01 15:28:45 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-09-01 15:28:45 +0100
commit05852e698adf7bbf1a9512e27f76d7a7b6f0e0e2 (patch)
tree786c0167858bf95eb7356dfdd6650ed3d6a1b76b /src/sim/serialize.cc
parent53001e6e09d31063784c408f0f35caad45afeef1 (diff)
downloadgem5-05852e698adf7bbf1a9512e27f76d7a7b6f0e0e2.tar.xz
sim: Remove broken AutoSerialize support from the event queue
Event auto-serialization no longer in use and has been broken ever since the introduction of PDES support almost two years ago. Additionally, serializing the individual event queues is undesirable since it exposes the thread structure of the simulator. What this means in practice is that the number of threads in the simulator must be the same when taking a checkpoint and when loading the checkpoint. This changeset removes support for the AutoSerialize event flag and the associated serialization code.
Diffstat (limited to 'src/sim/serialize.cc')
-rw-r--r--src/sim/serialize.cc71
1 files changed, 1 insertions, 70 deletions
diff --git a/src/sim/serialize.cc b/src/sim/serialize.cc
index b74b4bc9d..3127d9a04 100644
--- a/src/sim/serialize.cc
+++ b/src/sim/serialize.cc
@@ -445,15 +445,12 @@ void
Globals::serialize(CheckpointOut &cp) const
{
paramOut(cp, "curTick", curTick());
- paramOut(cp, "numMainEventQueues", numMainEventQueues);
-
}
void
Globals::unserialize(CheckpointIn &cp)
{
paramIn(cp, "curTick", unserializedCurTick);
- paramIn(cp, "numMainEventQueues", numMainEventQueues);
}
Serializable::Serializable()
@@ -500,8 +497,6 @@ Serializable::serializeAll(const string &cpt_dir)
outstream << "## checkpoint generated: " << ctime(&t);
globals.serializeSection(outstream, "Globals");
- for (uint32_t i = 0; i < numMainEventQueues; ++i)
- mainEventQueue[i]->serializeSection(outstream, "MainEventQueue");
SimObject::serializeAll(outstream);
}
@@ -511,10 +506,8 @@ Serializable::unserializeGlobals(CheckpointIn &cp)
{
globals.unserializeSection(cp, "Globals");
- for (uint32_t i = 0; i < numMainEventQueues; ++i) {
+ for (uint32_t i = 0; i < numMainEventQueues; ++i)
mainEventQueue[i]->setCurTick(globals.unserializedCurTick);
- mainEventQueue[i]->unserializeSection(cp, "MainEventQueue");
- }
}
Serializable::ScopedCheckpointSection::~ScopedCheckpointSection()
@@ -549,59 +542,6 @@ debug_serialize(const string &cpt_dir)
Serializable::serializeAll(cpt_dir);
}
-
-////////////////////////////////////////////////////////////////////////
-//
-// SerializableClass member definitions
-//
-////////////////////////////////////////////////////////////////////////
-
-// Map of class names to SerializableBuilder creation functions.
-// Need to make this a pointer so we can force initialization on the
-// first reference; otherwise, some SerializableClass constructors
-// may be invoked before the classMap constructor.
-map<string, SerializableClass::CreateFunc> *SerializableClass::classMap = 0;
-
-// SerializableClass constructor: add mapping to classMap
-SerializableClass::SerializableClass(const string &className,
- CreateFunc createFunc)
-{
- if (classMap == NULL)
- classMap = new map<string, SerializableClass::CreateFunc>();
-
- if ((*classMap)[className])
- fatal("Error: simulation object class %s redefined\n", className);
-
- // add className --> createFunc to class map
- (*classMap)[className] = createFunc;
-}
-
-//
-//
-Serializable *
-SerializableClass::createObject(CheckpointIn &cp, const string &section)
-{
- string className;
-
- if (!cp.find(section, "type", className)) {
- fatal("Serializable::create: no 'type' entry in section '%s'.\n",
- section);
- }
-
- CreateFunc createFunc = (*classMap)[className];
-
- if (createFunc == NULL) {
- fatal("Serializable::create: no create function for class '%s'.\n",
- className);
- }
-
- Serializable *object = createFunc(cp, section);
-
- assert(object != NULL);
-
- return object;
-}
-
const std::string &
Serializable::currentSection()
{
@@ -610,15 +550,6 @@ Serializable::currentSection()
return path.top();
}
-Serializable *
-Serializable::create(CheckpointIn &cp, const string &section)
-{
- Serializable *object = SerializableClass::createObject(cp, section);
- object->unserializeSection(cp, section);
- return object;
-}
-
-
const char *CheckpointIn::baseFilename = "m5.cpt";
string CheckpointIn::currentDirectory;