gem5
v20.1.0.0
|
Basic support for object serialization. More...
#include <serialize.hh>
Classes | |
class | ScopedCheckpointSection |
Public Member Functions | |
Serializable () | |
virtual | ~Serializable () |
virtual void | serialize (CheckpointOut &cp) const =0 |
Serialize an object. More... | |
virtual void | unserialize (CheckpointIn &cp)=0 |
Unserialize an object. More... | |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Static Public Member Functions | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Private Attributes | |
static std::stack< std::string > | path |
Basic support for object serialization.
The Serailizable interface is used to create checkpoints. Any object that implements this interface can be included in gem5's checkpointing system.
Objects that support serialization should derive from this class. Such objects can largely be divided into two categories: 1) True SimObjects (deriving from SimObject), and 2) child objects (non-SimObjects).
SimObjects are serialized automatically into their own sections automatically by the SimObject base class (see SimObject::serializeAll().
SimObjects can contain other serializable objects that are not SimObjects. Much like normal serialized members are not serialized automatically, these objects will not be serialized automatically and it is expected that the objects owning such serializable objects call the required serialization/unserialization methods on child objects. The preferred method to serialize a child object is to call serializeSection() on the child, which serializes the object into a new subsection in the current section. Another option is to call serialize() directly, which serializes the object into the current section. The latter is not recommended as it can lead to naming clashes between objects.
Definition at line 172 of file serialize.hh.
|
virtual |
Definition at line 166 of file serialize.cc.
|
staticprivate |
Definition at line 319 of file serialize.hh.
Referenced by ArmSemihosting::callTmpNam(), Process::checkPathRedirect(), MPP_TAGE::updatePathAndGlobalHistory(), and TAGE_SC_L_TAGE::updatePathAndGlobalHistory().