summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 08:50:25 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-10-29 08:50:25 -0800
commit8da9fcdd751bcb74c17e72d7d0a6c7ccf259552c (patch)
tree0cf43c0d989be70e4dbf57eaa3c1083ae0b11f9a /cpu
parentaa12cac9fd423d75578c3657fe5fe6e664e63890 (diff)
downloadgem5-8da9fcdd751bcb74c17e72d7d0a6c7ccf259552c.tar.xz
Flesh out ExecContext serialize/unserialize (including RegFile).
Add support for serializing enums. arch/alpha/isa_traits.hh: Add serialize/unserialize functions for RegFile (defined in new isa_traits.cc). cpu/exec_context.cc: Flesh out serialize/unserialize. sim/serialize.hh: Add {UN}SERIALIZE_ENUM(). --HG-- extra : convert_revision : 9e30c7e7b3b290dc8ea0888ba3636fc93ee89052
Diffstat (limited to 'cpu')
-rw-r--r--cpu/exec_context.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc
index ed6360649..b869a8c4d 100644
--- a/cpu/exec_context.cc
+++ b/cpu/exec_context.cc
@@ -100,16 +100,20 @@ ExecContext::takeOverFrom(ExecContext *oldContext)
void
ExecContext::serialize(ostream &os)
{
- SERIALIZE_ARRAY(regs.intRegFile, NumIntRegs);
- SERIALIZE_ARRAY(regs.floatRegFile.q, NumFloatRegs);
+ SERIALIZE_ENUM(_status);
+ regs.serialize(os);
+ // thread_num and cpu_id are deterministic from the config
+ SERIALIZE_SCALAR(func_exe_insn);
}
void
ExecContext::unserialize(const IniFile *db, const std::string &section)
{
- UNSERIALIZE_ARRAY(regs.intRegFile, NumIntRegs);
- UNSERIALIZE_ARRAY(regs.floatRegFile.q, NumFloatRegs);
+ UNSERIALIZE_ENUM(_status);
+ regs.unserialize(db, section);
+ // thread_num and cpu_id are deterministic from the config
+ UNSERIALIZE_SCALAR(func_exe_insn);
}