fastmodel: Checkpoint the TCs when checkpointing a fast model CPU.
authorGabe Black <gabeblack@google.com>
Tue, 5 Nov 2019 23:53:02 +0000 (15:53 -0800)
committerGabe Black <gabeblack@google.com>
Fri, 27 Dec 2019 20:52:13 +0000 (20:52 +0000)
The generic thread context checkpointing code can be used which calls
into the ThreadContext methods to read the required state.

Change-Id: Ib5c318ff4d2e756274b4c90b56533b2689a837f2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23785
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

src/arch/arm/fastmodel/iris/cpu.cc
src/arch/arm/fastmodel/iris/cpu.hh

index e5d95ef65c97b889bacdcfc6c8d84491cc545f44..6c282b69ae662fe41b50d063bf6d63847c3d69b0 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "arch/arm/fastmodel/iris/thread_context.hh"
 #include "scx/scx.h"
+#include "sim/serialize.hh"
 
 namespace Iris
 {
@@ -93,4 +94,10 @@ BaseCPU::init()
         tc->initMemProxies(tc);
 }
 
+void
+BaseCPU::serializeThread(CheckpointOut &cp, ThreadID tid) const
+{
+    ::serialize(*threadContexts[tid], cp);
+}
+
 } // namespace Iris
index 0d15fc82a4f0f4855b2cd8fe50cc10b007ae2810..3b913b92da9fd31815cca0964eb29029921fd259 100644 (file)
@@ -118,6 +118,8 @@ class BaseCPU : public ::BaseCPU
     }
 
     void init() override;
+
+    void serializeThread(CheckpointOut &cp, ThreadID tid) const override;
 };
 
 // This class specializes the one above and sets up ThreadContexts based on