gem5 v24.0.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. | |
virtual void | unserialize (CheckpointIn &cp)=0 |
Unserialize an object. | |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
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. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
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 169 of file serialize.hh.
|
virtual |
Definition at line 69 of file serialize.cc.
|
staticprivate |
Definition at line 315 of file serialize.hh.
Referenced by gem5::qemu::FwCfg::addItem(), gem5::BaseSemihosting::callTmpNam(), gem5::Process::checkPathRedirect(), gem5::Iris::CPU< TC >::CPU(), currentSection(), gem5::Serializable::ScopedCheckpointSection::pushName(), gem5::fastmodel::CortexA76::set_evs_param(), gem5::fastmodel::CortexR52::set_evs_param(), gem5::branch_prediction::MPP_TAGE::updatePathAndGlobalHistory(), gem5::branch_prediction::TAGE_SC_L_TAGE::updatePathAndGlobalHistory(), and gem5::Serializable::ScopedCheckpointSection::~ScopedCheckpointSection().