gem5  v20.1.0.0
Classes | Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
Serializable Class Referenceabstract

Basic support for object serialization. More...

#include <serialize.hh>

Inheritance diagram for Serializable:
A9GlobalTimer::Timer ArmInterruptPin ArmISA::PMU::CounterState ArmISA::TlbEntry ArmSemihosting::FileBase BasePixelPump CopyEngine::CopyEngineChannel CopyEngineReg::ChanRegs CopyEngineReg::Regs CpuLocalTimer::Timer IGbE::DescCache< iGbReg::RxDesc > IGbE::DescCache< iGbReg::TxDesc > DisplayTimings DistEtherLink::Link DistIface DistIface::RecvScheduler DistIface::RecvScheduler::Desc DistIface::Sync DmaReadFifo EmulationPageTable EtherSwitch::Interface EtherSwitch::Interface::PortFifo EtherSwitch::Interface::PortFifoEntry Event FDEntry FrameBuffer GenericISA::PCStateBase GicV2::BankedRegs Gicv3CPUInterface Gicv3Distributor Gicv3Redistributor Globals IGbE::DescCache< T > iGbReg::Regs MemState PhysicalMemory PollEvent Random RiscvISA::TlbEntry SimObject Sp804::Timer SystemCounterListener ThreadState Ticked VirtQueue X86ISA::TlbEntry


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

Detailed Description

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.

Many objects that support serialization need to be put in a consistent state when serialization takes place. We refer to the action of forcing an object into a consistent state as 'draining'. Objects that need draining inherit from Drainable. See Drainable for more information.

Definition at line 172 of file serialize.hh.

Constructor & Destructor Documentation

◆ ~Serializable()

Serializable::~Serializable ( )

Definition at line 166 of file

Member Data Documentation

◆ path

std::stack< std::string > Serializable::path

The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:31 for gem5 by doxygen 1.8.17