gem5
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | 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 AlphaBackdoor::Access AlphaISA::TlbEntry ArchTimer 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 Globals IGbE::DescCache< T > iGbReg::Regs Kernel::Statistics MemState PhysicalMemory Pl390::BankedRegs PollEvent Random SimObject Sp804::Timer SystemCounter ThreadState Ticked VirtQueue X86ISA::TlbEntry

Classes

class  ScopedCheckpointSection
 Scoped checkpoint section helper class. More...
 

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 ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 

Static Public Attributes

static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Static Private Attributes

static std::stack< std::string > path
 

Detailed Description

Basic support for object serialization.

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

Constructor & Destructor Documentation

◆ Serializable()

Serializable::Serializable ( )

Definition at line 572 of file serialize.cc.

Referenced by Serializable::ScopedCheckpointSection::nameOut().

◆ ~Serializable()

Serializable::~Serializable ( )
virtual

Definition at line 576 of file serialize.cc.

Referenced by Serializable::ScopedCheckpointSection::nameOut().

Member Function Documentation

◆ currentSection()

const std::string & Serializable::currentSection ( )
static

◆ serialize()

virtual void Serializable::serialize ( CheckpointOut cp) const
pure virtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implemented in iGbReg::Regs, ArmISA::ISA, DistIface, VirtIODeviceBase, Cache, IGbE, System, IGbE::TxDescCache, Globals, DistIface::RecvScheduler, GenericISA::DelaySlotUPCState< MachInst >, Event, ArmISA::PMU::CounterState, IGbE::RxDescCache, HDLcd::DmaEngine, Pl111, Pl390, ArmISA::TLB, IdeDisk, NSGigE, DistIface::RecvScheduler::Desc, GenericISA::DelaySlotPCState< MachInst >, X86ISA::PCState, IGbE::DescCache< T >, IGbE::DescCache< iGbReg::TxDesc >, IGbE::DescCache< iGbReg::RxDesc >, VirtQueue, GenericTimerMem, DmaReadFifo, Sinic::Device, ArmISA::TlbEntry, DistIface::SyncSwitch, X86ISA::Interrupts, ArmISA::Interrupts, MultiLevelPageTable< EntryTypes >, BasePixelPump::PixelEvent, GenericISA::UPCState< MachInst >, X86ISA::GpuTLB, SparcISA::Interrupts, PhysicalMemory, TrafficGen, ClockedObject, SrcClockDomain, DistIface::SyncNode, GenericTimer, DistEtherLink, ArmSemihosting::File, VirtIO9PProxy, PciDevice, ArmSemihosting::FileFeatures, RealViewOsc, SimObject, DeviceFDEntry, VGic, CopyEngine, DistIface::Sync, CopyEngineReg::ChanRegs, ArchTimer, Pl390::BankedRegs, EtherSwitch, CpuLocalTimer, RealViewCtrl, SparcISA::TLB, UFSHostDevice, TickedObject, DVFSHandler, PowerISA::TLB, A9GlobalTimer, PipeFDEntry, SparcISA::ISA, EtherSwitch::Interface::PortFifo, ThermalModel, Sp804, SimpleThread, EmulationPageTable, EtherLink, IdeController, X86ISA::TLB, BasePixelPump, EtherTapStub, I2CBus, CpuLocalTimer::Timer, AlphaISA::TlbEntry, Iob, Ticked, TsunamiIO, X86ISA::I8042, A9GlobalTimer::Timer, Pl050, MaltaCChip, CowDiskImage, EnergyCtrl, TsunamiCChip, MaltaIO, ArmSemihosting::FileBase, X86ISA::ISA, Malta, ThermalReference, VoltageDomain, PL031, CopyEngineReg::Regs, FileFDEntry, AlphaISA::Interrupts, Sp804::Timer, AlphaBackdoor, AlphaISA::TLB, X86ISA::TlbEntry, EtherSwitch::Interface::PortFifoEntry, O3ThreadState< Impl >, GenericISA::PCStateBase, X86ISA::I82094AA, MipsISA::Interrupts, CopyEngine::CopyEngineChannel, X86ISA::I8254, X86ISA::I8259, MipsISA::TLB, Root, RiscvISA::TLB, ArmISA::PMU, Random, Uart8250, GpuDispatcher, HDLcd, ThermalDomain, DistEtherLink::Link, SystemCounter, AlphaISA::ISA, AlphaISA::Kernel::Statistics, ThermalCapacitor, LocalSimLoopExitEvent, MemState, EtherSwitch::Interface, Tsunami, X86ISA::Cmos, RubySystem, FrameBuffer, ArmSemihosting, AlphaBackdoor::Access, TsunamiPChip, X86ISA::Speaker, Sinic::Base, EtherTapBase, PS2Mouse, Process, FlashDevice, ThermalResistor, ThreadState, DisplayTimings, DumbTOD, PS2TouchKit, PS2Keyboard, MmDisk, FDEntry, PollEvent, Pl011, Kernel::Statistics, X86ISA::I8237, NoMaliGpu, and PS2Device.

Referenced by Serializable::ScopedCheckpointSection::nameOut().

◆ serializeAll()

void Serializable::serializeAll ( const std::string &  cpt_dir)
static

◆ serializeSection() [1/2]

void Serializable::serializeSection ( CheckpointOut cp,
const char *  name 
) const

Serialize an object into a new section.

This method creates a new section in a checkpoint and calls serialize() to serialize the current object into that section. The name of the section is appended to the current checkpoint path.

Parameters
cpCheckpoint state
nameName to append to the active path

Definition at line 581 of file serialize.cc.

References serialize().

Referenced by Serializable::ScopedCheckpointSection::nameOut(), EtherSwitch::Interface::serialize(), ArmISA::PMU::serialize(), AlphaISA::TLB::serialize(), Sp804::serialize(), CpuLocalTimer::serialize(), CopyEngine::serialize(), VGic::serialize(), DistEtherLink::serialize(), GenericTimer::serialize(), GenericTimerMem::serialize(), ArmISA::TLB::serialize(), System::serialize(), IGbE::serialize(), VirtIODeviceBase::serialize(), DistIface::serialize(), SimObject::serializeAll(), serializeAll(), and serializeSection().

◆ serializeSection() [2/2]

void Serializable::serializeSection ( CheckpointOut cp,
const std::string &  name 
) const
inline

Definition at line 312 of file serialize.hh.

References serializeSection(), and unserializeSection().

◆ unserialize()

virtual void Serializable::unserialize ( CheckpointIn cp)
pure virtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implemented in iGbReg::Regs, ArmISA::ISA, DistIface, VirtIODeviceBase, Cache, IGbE, System, IGbE::TxDescCache, Globals, GenericISA::DelaySlotUPCState< MachInst >, DistIface::RecvScheduler, Event, ArmISA::PMU::CounterState, IGbE::RxDescCache, HDLcd::DmaEngine, Pl111, Pl390, ArmISA::TLB, IdeDisk, NSGigE, DistIface::RecvScheduler::Desc, GenericISA::DelaySlotPCState< MachInst >, X86ISA::PCState, IGbE::DescCache< T >, IGbE::DescCache< iGbReg::TxDesc >, IGbE::DescCache< iGbReg::RxDesc >, VirtQueue, ArmISA::TlbEntry, GenericTimerMem, DmaReadFifo, Sinic::Device, MultiLevelPageTable< EntryTypes >, DistIface::SyncSwitch, ArmISA::Interrupts, X86ISA::Interrupts, GenericISA::UPCState< MachInst >, BasePixelPump::PixelEvent, PhysicalMemory, SparcISA::Interrupts, X86ISA::GpuTLB, TrafficGen, ClockedObject, SrcClockDomain, DistIface::SyncNode, GenericTimer, DistEtherLink, ArmSemihosting::File, PciDevice, VirtIO9PProxy, ArmSemihosting::FileFeatures, RealViewOsc, CopyEngineReg::ChanRegs, SimObject, DeviceFDEntry, VGic, CopyEngine, DistIface::Sync, ArchTimer, Pl390::BankedRegs, EtherSwitch, CpuLocalTimer, RealViewCtrl, SparcISA::TLB, UFSHostDevice, TickedObject, DVFSHandler, PowerISA::TLB, A9GlobalTimer, PipeFDEntry, SparcISA::ISA, EtherSwitch::Interface::PortFifo, ThermalModel, Sp804, SimpleThread, EmulationPageTable, EtherLink, IdeController, X86ISA::TLB, BasePixelPump, EtherTapStub, I2CBus, CpuLocalTimer::Timer, AlphaISA::TlbEntry, Iob, Ticked, TsunamiIO, X86ISA::I8042, A9GlobalTimer::Timer, Pl050, MaltaCChip, CowDiskImage, EnergyCtrl, CopyEngineReg::Regs, TsunamiCChip, MaltaIO, ArmSemihosting::FileBase, X86ISA::ISA, Malta, ThermalReference, VoltageDomain, AlphaISA::Interrupts, PL031, FileFDEntry, Sp804::Timer, O3ThreadState< Impl >, AlphaBackdoor, AlphaISA::TLB, GenericISA::PCStateBase, MipsISA::Interrupts, X86ISA::TlbEntry, EtherSwitch::Interface::PortFifoEntry, X86ISA::I82094AA, CopyEngine::CopyEngineChannel, X86ISA::I8254, X86ISA::I8259, MipsISA::TLB, RiscvISA::TLB, ArmISA::PMU, Random, Uart8250, GpuDispatcher, MemState, HDLcd, ThermalDomain, DistEtherLink::Link, SystemCounter, AlphaISA::ISA, AlphaISA::Kernel::Statistics, ThermalCapacitor, LocalSimLoopExitEvent, EtherSwitch::Interface, Tsunami, X86ISA::Cmos, RubySystem, FrameBuffer, ArmSemihosting, AlphaBackdoor::Access, TsunamiPChip, X86ISA::Speaker, Sinic::Base, EtherTapBase, PS2Mouse, Process, FlashDevice, ThreadState, ThermalResistor, DisplayTimings, DumbTOD, PS2TouchKit, PS2Keyboard, FDEntry, PollEvent, Pl011, Kernel::Statistics, X86ISA::I8237, NoMaliGpu, PS2Device, and AlphaProcess.

Referenced by Serializable::ScopedCheckpointSection::nameOut().

◆ unserializeGlobals()

void Serializable::unserializeGlobals ( CheckpointIn cp)
static

◆ unserializeSection() [1/2]

void Serializable::unserializeSection ( CheckpointIn cp,
const char *  name 
)

◆ unserializeSection() [2/2]

void Serializable::unserializeSection ( CheckpointIn cp,
const std::string &  name 
)
inline

Definition at line 328 of file serialize.hh.

References currentSection(), and unserializeSection().

Member Data Documentation

◆ ckptCount

int Serializable::ckptCount = 0
static

Definition at line 335 of file serialize.hh.

Referenced by parseParam().

◆ ckptMaxCount

int Serializable::ckptMaxCount = 0
static

Definition at line 336 of file serialize.hh.

Referenced by parseParam().

◆ ckptPrevCount

int Serializable::ckptPrevCount = -1
static

Definition at line 337 of file serialize.hh.

Referenced by parseParam().

◆ path

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

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

Generated on Fri Apr 20 2018 09:05:09 for gem5 by doxygen 1.8.13