From af5277a6784ed6a8e4671dfa79b1346bed687ae1 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 29 Oct 2003 13:35:07 -0800 Subject: 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 --- arch/alpha/alpha_memory.cc | 93 +++------------------------------------------- 1 file changed, 6 insertions(+), 87 deletions(-) (limited to 'arch/alpha/alpha_memory.cc') 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 §ion) 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 } -- cgit v1.2.3