summaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 13:35:07 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 13:35:07 -0800
commitaf5277a6784ed6a8e4671dfa79b1346bed687ae1 (patch)
tree81d91d5bc7287b146a0b0ee796ae3b8acb7fbbcf /arch/alpha
parent8da9fcdd751bcb74c17e72d7d0a6c7ccf259552c (diff)
downloadgem5-af5277a6784ed6a8e4671dfa79b1346bed687ae1.tar.xz
Serialization support for Alpha TLBs, PhysicalMemory, and SimpleCPU.
arch/alpha/alpha_memory.cc: arch/alpha/alpha_memory.hh: Serialize TLB contents. cpu/simple_cpu/simple_cpu.cc: cpu/simple_cpu/simple_cpu.hh: Complete serialization of SimpleCPU (including owned events). sim/eventq.cc: sim/eventq.hh: Basic serialization for events. Still need to handle dynamic events (not owned by a SimObject). sim/serialize.cc: sim/serialize.hh: Export serialization filename so PhysicalMemory can derive its filename from that. --HG-- extra : convert_revision : 4db851c5880f73f576ca092d5e5ad4256048eb51
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/alpha_memory.cc93
-rw-r--r--arch/alpha/alpha_memory.hh1
2 files changed, 6 insertions, 88 deletions
diff --git a/arch/alpha/alpha_memory.cc b/arch/alpha/alpha_memory.cc
index b95916105..7c0b1120f 100644
--- a/arch/alpha/alpha_memory.cc
+++ b/arch/alpha/alpha_memory.cc
@@ -197,47 +197,10 @@ AlphaTlb::serialize(ostream &os)
SERIALIZE_SCALAR(size);
SERIALIZE_SCALAR(nlu);
- // should just add serialize/unserialize methods to AlphaPTE
-#if 0
- stringstream buf;
for (int i = 0; i < size; i++) {
- buf.str("");
- ccprintf(buf, "pte%02d.valid", i);
- paramOut(buf.str(), table[i].valid);
-
- buf.str("");
- ccprintf(buf, "pte%02d.tag", i);
- paramOut(buf.str(), table[i].tag);
-
- buf.str("");
- ccprintf(buf, "pte%02d.ppn", i);
- paramOut(buf.str(), table[i].ppn);
-
- buf.str("");
- ccprintf(buf, "pte%02d.xre", i);
- paramOut(buf.str(), table[i].xre);
-
- buf.str("");
- ccprintf(buf, "pte%02d.xwe", i);
- paramOut(buf.str(), table[i].xwe);
-
- buf.str("");
- ccprintf(buf, "pte%02d.fonr", i);
- paramOut(buf.str(), table[i].fonr);
-
- buf.str("");
- ccprintf(buf, "pte%02d.fonw", i);
- paramOut(buf.str(), table[i].fonw);
-
- buf.str("");
- ccprintf(buf, "pte%02d.asma", i);
- paramOut(buf.str(), table[i].asma);
-
- buf.str("");
- ccprintf(buf, "pte%02d.asn", i);
- paramOut(buf.str(), table[i].asn);
+ nameOut(os, csprintf("%s.PTE%d", name(), i));
+ table[i].serialize(os);
}
-#endif
}
void
@@ -246,56 +209,12 @@ AlphaTlb::unserialize(const IniFile *db, const string &section)
UNSERIALIZE_SCALAR(size);
UNSERIALIZE_SCALAR(nlu);
-#if 0
- string data;
- stringstream buf;
for (int i = 0; i < size; i++) {
- buf.str("");
- ccprintf(buf, "pte%02d.valid", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].valid);
-
- buf.str("");
- ccprintf(buf, "pte%02d.tag", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].tag);
-
- buf.str("");
- ccprintf(buf, "pte%02d.ppn", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].ppn);
-
- buf.str("");
- ccprintf(buf, "pte%02d.xre", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].xre);
-
- buf.str("");
- ccprintf(buf, "pte%02d.xwe", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].xwe);
-
- buf.str("");
- ccprintf(buf, "pte%02d.fonr", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].fonr);
-
- buf.str("");
- ccprintf(buf, "pte%02d.fonw", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].fonw);
-
- buf.str("");
- ccprintf(buf, "pte%02d.asma", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].asma);
-
- buf.str("");
- ccprintf(buf, "pte%02d.asn", i);
- db.findDefault(category, buf.str(), data);
- to_number(data, table[i].asn);
+ table[i].unserialize(db, csprintf("%s.PTE%d", section, i));
+ if (table[i].valid) {
+ lookupTable.insert(make_pair(table[i].tag, i));
+ }
}
-#endif
}
diff --git a/arch/alpha/alpha_memory.hh b/arch/alpha/alpha_memory.hh
index e6637893c..fc4d46191 100644
--- a/arch/alpha/alpha_memory.hh
+++ b/arch/alpha/alpha_memory.hh
@@ -75,7 +75,6 @@ class AlphaTlb : public SimObject
// Checkpointing
virtual void serialize(std::ostream &os);
virtual void unserialize(const IniFile *db, const std::string &section);
-
};
class AlphaItb : public AlphaTlb