gem5  v21.1.0.2
Classes | Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
gem5::Serializable Class Referenceabstract

Basic support for object serialization. More...

#include <serialize.hh>

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

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 generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it. More...
 

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.

Note
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 169 of file serialize.hh.

Constructor & Destructor Documentation

◆ ~Serializable()

gem5::Serializable::~Serializable ( )
virtual

Definition at line 69 of file serialize.cc.

Member Data Documentation

◆ path

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

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

Generated on Tue Sep 21 2021 12:28:08 for gem5 by doxygen 1.8.17