summaryrefslogtreecommitdiff
path: root/cpu
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 /cpu
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 'cpu')
-rw-r--r--cpu/exec_context.cc2
-rw-r--r--cpu/exec_context.hh2
-rw-r--r--cpu/simple_cpu/simple_cpu.cc17
-rw-r--r--cpu/simple_cpu/simple_cpu.hh2
4 files changed, 5 insertions, 18 deletions
diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc
index 8cfd0a0ea..ed6360649 100644
--- a/cpu/exec_context.cc
+++ b/cpu/exec_context.cc
@@ -106,7 +106,7 @@ ExecContext::serialize(ostream &os)
void
-ExecContext::unserialize(IniFile &db, const std::string &section)
+ExecContext::unserialize(const IniFile *db, const std::string &section)
{
UNSERIALIZE_ARRAY(regs.intRegFile, NumIntRegs);
UNSERIALIZE_ARRAY(regs.floatRegFile.q, NumFloatRegs);
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index 285154ed0..6938b369f 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -142,7 +142,7 @@ class ExecContext
void regStats(const std::string &name);
void serialize(std::ostream &os);
- void unserialize(IniFile &db, const std::string &section);
+ void unserialize(const IniFile *db, const std::string &section);
#ifdef FULL_SYSTEM
bool validInstAddr(Addr addr) { return true; }
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc
index 83e9e1fa2..27576d558 100644
--- a/cpu/simple_cpu/simple_cpu.cc
+++ b/cpu/simple_cpu/simple_cpu.cc
@@ -246,22 +246,9 @@ SimpleCPU::serialize(ostream &os)
}
void
-SimpleCPU::unserialize(IniFile &db, const string &category)
+SimpleCPU::unserialize(const IniFile *db, const string &category)
{
- string data;
-
- for (int i = 0; i < NumIntRegs; i++) {
- stringstream buf;
- ccprintf(buf, "R%02d", i);
- db.findDefault(category, buf.str(), data);
- to_number(data,xc->regs.intRegFile[i]);
- }
- for (int i = 0; i < NumFloatRegs; i++) {
- stringstream buf;
- ccprintf(buf, "F%02d", i);
- db.findDefault(category, buf.str(), data);
- to_number(data.c_str(), xc->regs.floatRegFile.q[i]);
- }
+ xc->unserialize(db, category);
// Read in Special registers
diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh
index fa7386106..aee8159ce 100644
--- a/cpu/simple_cpu/simple_cpu.hh
+++ b/cpu/simple_cpu/simple_cpu.hh
@@ -260,7 +260,7 @@ class SimpleCPU : public BaseCPU
void processCacheCompletion();
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);
template <class T>
Fault read(Addr addr, T& data, unsigned flags);