From 54d769308d0ccc5a70db8caa5bb494d2d7d08bd9 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Sat, 15 Feb 2020 08:27:55 +0100 Subject: [PATCH] arch-riscv: added (un)serialization of miscRegFile. Change-Id: I127dbf4a6bb4a144eaee05a87495830dce82eb58 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25650 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/arch/riscv/isa.cc | 15 +++++++++++++++ src/arch/riscv/isa.hh | 3 +++ 2 files changed, 18 insertions(+) diff --git a/src/arch/riscv/isa.cc b/src/arch/riscv/isa.cc index 3f1a7e1af..754ff85b7 100644 --- a/src/arch/riscv/isa.cc +++ b/src/arch/riscv/isa.cc @@ -39,6 +39,7 @@ #include "arch/riscv/registers.hh" #include "base/bitfield.hh" #include "cpu/base.hh" +#include "debug/Checkpoint.hh" #include "debug/RiscvMisc.hh" #include "params/RiscvISA.hh" #include "sim/core.hh" @@ -352,6 +353,20 @@ ISA::setMiscReg(int misc_reg, RegVal val, ThreadContext *tc) } } +void +ISA::serialize(CheckpointOut &cp) const +{ + DPRINTF(Checkpoint, "Serializing Riscv Misc Registers\n"); + SERIALIZE_CONTAINER(miscRegFile); +} + +void +ISA::unserialize(CheckpointIn &cp) +{ + DPRINTF(Checkpoint, "Unserializing Riscv Misc Registers\n"); + UNSERIALIZE_CONTAINER(miscRegFile); +} + } RiscvISA::ISA * diff --git a/src/arch/riscv/isa.hh b/src/arch/riscv/isa.hh index 9d342428c..c56c45ba7 100644 --- a/src/arch/riscv/isa.hh +++ b/src/arch/riscv/isa.hh @@ -92,6 +92,9 @@ class ISA : public BaseISA void startup(ThreadContext *tc) {} + void serialize(CheckpointOut &cp) const; + void unserialize(CheckpointIn &cp); + /// Explicitly import the otherwise hidden startup using BaseISA::startup; -- 2.30.2