summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 00:41:24 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 00:41:24 -0800
commit1511370d09a2dc93a9f7f6154440d28ed6309b49 (patch)
tree9d35d22a257bb64628e3b501beeaaa5b9977fd08 /sim
parenta0f3ee7e1770138edd4ee65a2ce6ba2a017d792e (diff)
downloadgem5-1511370d09a2dc93a9f7f6154440d28ed6309b49.tar.xz
More progress on checkpointing... we can now write out a checkpoint and read it back in,
though most objects don't actually serialize any data. arch/alpha/alpha_memory.cc: arch/alpha/alpha_memory.hh: arch/alpha/isa_traits.hh: cpu/exec_context.cc: cpu/exec_context.hh: cpu/simple_cpu/simple_cpu.hh: dev/alpha_access.h: dev/alpha_console.cc: dev/alpha_console.hh: dev/console.cc: dev/console.hh: Change unserialize param from IniFile& to const IniFile*. cpu/simple_cpu/simple_cpu.cc: Change unserialize param from IniFile& to const IniFile*. Make unserialize call ExecContext::unserialize. sim/eventq.cc: Rename MainEventQueue (no spaces) for easier parsing in checkpoints. Disable event serialization for now, so we can focus on the easy stuff. sim/serialize.cc: Change paramIn and arrayParamIn param from IniFile& to const IniFile*. sim/serialize.hh: Change unserialize, paramIn, and arrayParamIn params from IniFile& to const IniFile*. --HG-- extra : convert_revision : 6e8853ed375eddec0e140c95a01dd51bd225f7b9
Diffstat (limited to 'sim')
-rw-r--r--sim/eventq.cc6
-rw-r--r--sim/serialize.cc28
-rw-r--r--sim/serialize.hh6
3 files changed, 22 insertions, 18 deletions
diff --git a/sim/eventq.cc b/sim/eventq.cc
index da9e85eeb..7285f63e8 100644
--- a/sim/eventq.cc
+++ b/sim/eventq.cc
@@ -50,7 +50,7 @@ const string Event::defaultName("event");
// Events on this queue are processed at the *beginning* of each
// cycle, before the pipeline simulation is performed.
//
-EventQueue mainEventQueue("Main Event Queue");
+EventQueue mainEventQueue("MainEventQueue");
void
EventQueue::insert(Event *event)
@@ -121,6 +121,7 @@ EventQueue::serviceOne()
void
EventQueue::nameChildren()
{
+#if 0
int j = 0;
Event *event = head;
@@ -131,11 +132,13 @@ EventQueue::nameChildren()
event = event->next;
}
+#endif
}
void
EventQueue::serialize(ostream &os)
{
+#if 0
string objects = "";
Event *event = head;
@@ -148,6 +151,7 @@ EventQueue::serialize(ostream &os)
}
nameOut(os, "Serialized");
SERIALIZE_MEMBER(objects);
+#endif
}
void
diff --git a/sim/serialize.cc b/sim/serialize.cc
index b2a50154f..00321b932 100644
--- a/sim/serialize.cc
+++ b/sim/serialize.cc
@@ -88,11 +88,11 @@ paramOut(ostream &os, const std::string &name, const T& param)
template <class T>
void
-paramIn(IniFile &db, const std::string &section,
+paramIn(const IniFile *db, const std::string &section,
const std::string &name, T& param)
{
std::string str;
- if (!db.find(section, name, str) || !parseParam(str, param)) {
+ if (!db->find(section, name, str) || !parseParam(str, param)) {
fatal("Can't unserialize '%s:%s'\n", section, name);
}
}
@@ -116,11 +116,11 @@ arrayParamOut(ostream &os, const std::string &name,
template <class T>
void
-arrayParamIn(IniFile &db, const std::string &section,
+arrayParamIn(const IniFile *db, const std::string &section,
const std::string &name, T *param, int size)
{
std::string str;
- if (!db.find(section, name, str)) {
+ if (!db->find(section, name, str)) {
fatal("Can't unserialize '%s:%s'\n", section, name);
}
@@ -159,17 +159,17 @@ arrayParamIn(IniFile &db, const std::string &section,
}
-#define INSTANTIATE_PARAM_TEMPLATES(type) \
-template void \
+#define INSTANTIATE_PARAM_TEMPLATES(type) \
+template void \
paramOut(ostream &os, const std::string &name, const type &param); \
-template void \
-paramIn(IniFile &db, const std::string &section, \
- const std::string &name, type & param); \
-template void \
-arrayParamOut(ostream &os, const std::string &name, \
- const type *param, int size); \
-template void \
-arrayParamIn(IniFile &db, const std::string &section, \
+template void \
+paramIn(const IniFile *db, const std::string &section, \
+ const std::string &name, type & param); \
+template void \
+arrayParamOut(ostream &os, const std::string &name, \
+ const type *param, int size); \
+template void \
+arrayParamIn(const IniFile *db, const std::string &section, \
const std::string &name, type *param, int size);
diff --git a/sim/serialize.hh b/sim/serialize.hh
index 5ebbfaba5..668e654b7 100644
--- a/sim/serialize.hh
+++ b/sim/serialize.hh
@@ -47,7 +47,7 @@ template <class T>
void paramOut(std::ostream &os, const std::string &name, const T& param);
template <class T>
-void paramIn(IniFile &db, const std::string &section,
+void paramIn(const IniFile *db, const std::string &section,
const std::string &name, T& param);
template <class T>
@@ -55,7 +55,7 @@ void arrayParamOut(std::ostream &os, const std::string &name,
const T *param, int size);
template <class T>
-void arrayParamIn(IniFile &db, const std::string &section,
+void arrayParamIn(const IniFile *db, const std::string &section,
const std::string &name, T *param, int size);
//
@@ -103,7 +103,7 @@ class Serializeable
virtual void nameChildren() {}
virtual void serialize(std::ostream& os) {}
- virtual void unserialize(IniFile &db, const std::string &section) {}
+ virtual void unserialize(const IniFile *db, const std::string &section) {}
};
class Serializer