gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
AlphaBackdoor::Access AlphaISA::TlbEntry ArchTimer ArmISA::PMU::CounterState ArmISA::TlbEntry 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 EtherSwitch::Interface EtherSwitch::Interface::PortFifo EtherSwitch::Interface::PortFifoEntry Event FDEntry FrameBuffer GenericISA::PCStateBase Globals IGbE::DescCache< T > iGbReg::Regs Kernel::Statistics PageTableBase PhysicalMemory Pl390::BankedRegs PollEvent Random SimObject Sp804::Timer SystemCounter ThreadState Ticked VirtQueue

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

Constructor & Destructor Documentation

Serializable::Serializable ( )

Definition at line 569 of file serialize.cc.

Serializable::~Serializable ( )
virtual

Definition at line 573 of file serialize.cc.

Member Function Documentation

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

Get the fully-qualified name of the active section.

Definition at line 652 of file serialize.cc.

Referenced by arrayParamIn(), Serializable::ScopedCheckpointSection::nameOut(), objParamIn(), optParamIn(), paramIn(), HDLcd::unserialize(), Pl390::unserialize(), and Globals::unserialize().

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

Referenced by Process::serialize().

void Serializable::serializeAll ( const std::string &  cpt_dir)
static
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 578 of file serialize.cc.

References X86ISA::serialize().

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

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

Definition at line 304 of file serialize.hh.

References serializeSection().

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

Referenced by Process::unserialize().

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

Unserialize an a child object.

This method loads a child object from a checkpoint. The object name is appended to the active path to form a fully qualified section name and unserialize() is called.

Parameters
cpCheckpoint state
nameName to append to the active path

Definition at line 585 of file serialize.cc.

References X86ISA::unserialize().

Referenced by SimObject::loadState(), ArmISA::PMU::unserialize(), Sp804::unserialize(), EtherSwitch::Interface::PortFifo::unserialize(), CpuLocalTimer::unserialize(), GenericTimer::unserialize(), CopyEngine::unserialize(), DistEtherLink::unserialize(), GenericTimerMem::unserialize(), ArmISA::TLB::unserialize(), DistIface::RecvScheduler::unserialize(), System::unserialize(), IGbE::unserialize(), VirtIODeviceBase::unserialize(), DistIface::unserialize(), unserializeGlobals(), and unserializeSection().

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

Definition at line 320 of file serialize.hh.

References unserializeSection().

Member Data Documentation

int Serializable::ckptCount = 0
static

Definition at line 327 of file serialize.hh.

int Serializable::ckptMaxCount = 0
static

Definition at line 328 of file serialize.hh.

int Serializable::ckptPrevCount = -1
static

Definition at line 329 of file serialize.hh.

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

Definition at line 334 of file serialize.hh.

Referenced by MathExprPowerModel::MathExprPowerModel().


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

Generated on Fri Jun 9 2017 13:04:19 for gem5 by doxygen 1.8.6