gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Functions
serialize.hh File Reference
#include <iostream>
#include <list>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include "base/bitunion.hh"

Go to the source code of this file.

Classes

class  Serializable
 Basic support for object serialization. More...
 
class  Serializable::ScopedCheckpointSection
 Scoped checkpoint section helper class. More...
 
class  CheckpointIn
 

Macros

#define SERIALIZE_SCALAR(scalar)   paramOut(cp, #scalar, scalar)
 
#define UNSERIALIZE_SCALAR(scalar)   paramIn(cp, #scalar, scalar)
 
#define UNSERIALIZE_OPT_SCALAR(scalar)   optParamIn(cp, #scalar, scalar)
 
#define SERIALIZE_ENUM(scalar)   paramOut(cp, #scalar, (int)scalar)
 
#define UNSERIALIZE_ENUM(scalar)
 
#define SERIALIZE_ARRAY(member, size)   arrayParamOut(cp, #member, member, size)
 
#define UNSERIALIZE_ARRAY(member, size)   arrayParamIn(cp, #member, member, size)
 
#define SERIALIZE_CONTAINER(member)   arrayParamOut(cp, #member, member)
 
#define UNSERIALIZE_CONTAINER(member)   arrayParamIn(cp, #member, member)
 
#define SERIALIZE_EVENT(event)   event.serializeSection(cp, #event);
 
#define UNSERIALIZE_EVENT(event)
 
#define SERIALIZE_OBJ(obj)   obj.serializeSection(cp, #obj)
 
#define UNSERIALIZE_OBJ(obj)   obj.unserializeSection(cp, #obj)
 
#define SERIALIZE_OBJPTR(objptr)   paramOut(cp, #objptr, (objptr)->name())
 
#define UNSERIALIZE_OBJPTR(objptr)
 

Typedefs

typedef std::ostream CheckpointOut
 

Functions

template<class T >
void paramOut (CheckpointOut &cp, const std::string &name, const T &param)
 
template<typename DataType , typename BitUnion >
void paramOut (CheckpointOut &cp, const std::string &name, const BitfieldBackend::BitUnionOperators< DataType, BitUnion > &p)
 
template<class T >
void paramIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<typename DataType , typename BitUnion >
void paramIn (CheckpointIn &cp, const std::string &name, BitfieldBackend::BitUnionOperators< DataType, BitUnion > &p)
 
template<class T >
bool optParamIn (CheckpointIn &cp, const std::string &name, T &param, bool warn=true)
 
template<typename DataType , typename BitUnion >
bool optParamIn (CheckpointIn &cp, const std::string &name, BitfieldBackend::BitUnionOperators< DataType, BitUnion > &p, bool warn=true)
 
template<class T >
void arrayParamOut (CheckpointOut &cp, const std::string &name, const T *param, unsigned size)
 
template<class T >
void arrayParamOut (CheckpointOut &cp, const std::string &name, const std::vector< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &cp, const std::string &name, const std::list< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &cp, const std::string &name, const std::set< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, T *param, unsigned size)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::vector< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::list< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const std::string &name, std::set< T > &param)
 
void objParamIn (CheckpointIn &cp, const std::string &name, SimObject *&param)
 
void debug_serialize (const std::string &cpt_dir)
 

Macro Definition Documentation

#define SERIALIZE_ARRAY (   member,
  size 
)    arrayParamOut(cp, #member, member, size)
#define SERIALIZE_CONTAINER (   member)    arrayParamOut(cp, #member, member)
#define SERIALIZE_ENUM (   scalar)    paramOut(cp, #scalar, (int)scalar)
#define SERIALIZE_EVENT (   event)    event.serializeSection(cp, #event);

Definition at line 170 of file serialize.hh.

#define SERIALIZE_OBJ (   obj)    obj.serializeSection(cp, #obj)

Definition at line 178 of file serialize.hh.

Referenced by HDLcd::serialize(), and BasePixelPump::serialize().

#define SERIALIZE_OBJPTR (   objptr)    paramOut(cp, #objptr, (objptr)->name())

Definition at line 181 of file serialize.hh.

Referenced by SparcISA::ISA::serialize().

#define SERIALIZE_SCALAR (   scalar)    paramOut(cp, #scalar, scalar)

Definition at line 143 of file serialize.hh.

Referenced by ArmISA::EndBitUnion(), X86ISA::I8237::serialize(), PollEvent::serialize(), Pl011::serialize(), FDEntry::serialize(), ThreadState::serialize(), DisplayTimings::serialize(), DumbTOD::serialize(), ThermalResistor::serialize(), FlashDevice::serialize(), EtherTapBase::serialize(), Sinic::Base::serialize(), TsunamiPChip::serialize(), X86ISA::Speaker::serialize(), MipsISA::PTE::serialize(), RiscvISA::PTE::serialize(), Kernel::Statistics::serialize(), AlphaBackdoor::Access::serialize(), X86ISA::Cmos::serialize(), PowerISA::TlbEntry::serialize(), AlphaISA::Kernel::Statistics::serialize(), EtherSwitch::Interface::serialize(), AlphaISA::ISA::serialize(), LocalSimLoopExitEvent::serialize(), SystemCounter::serialize(), ThermalCapacitor::serialize(), DistEtherLink::Link::serialize(), ArmISA::PMU::serialize(), ThermalDomain::serialize(), RubySystem::serialize(), HDLcd::serialize(), MipsISA::TlbEntry::serialize(), RiscvISA::TlbEntry::serialize(), CopyEngineReg::Reg< uint64_t >::serialize(), GenericISA::PCStateBase::serialize(), RiscvISA::TLB::serialize(), MipsISA::TLB::serialize(), CopyEngine::CopyEngineChannel::serialize(), X86ISA::I8259::serialize(), X86ISA::I82094AA::serialize(), GpuDispatcher::serialize(), Root::serialize(), Uart8250::serialize(), EtherSwitch::Interface::PortFifoEntry::serialize(), AlphaISA::TLB::serialize(), AlphaISA::Interrupts::serialize(), Sp804::Timer::serialize(), CopyEngineReg::Regs::serialize(), PL031::serialize(), FileFDEntry::serialize(), VoltageDomain::serialize(), ThermalReference::serialize(), MaltaIO::serialize(), TsunamiCChip::serialize(), EnergyCtrl::serialize(), CowDiskImage::serialize(), TsunamiIO::serialize(), Iob::serialize(), AlphaISA::TlbEntry::serialize(), X86ISA::TLB::serialize(), CpuLocalTimer::Timer::serialize(), PowerISA::PTE::serialize(), I2CBus::serialize(), BasePixelPump::serialize(), IdeController::serialize(), Pl050::serialize(), EtherTapStub::serialize(), ThermalModel::serialize(), EtherSwitch::Interface::PortFifo::serialize(), SparcISA::ISA::serialize(), PipeFDEntry::serialize(), MC146818::serialize(), PowerISA::TLB::serialize(), DVFSHandler::serialize(), UFSHostDevice::serialize(), SparcISA::TLB::serialize(), Pl390::BankedRegs::serialize(), RealViewCtrl::serialize(), ArchTimer::serialize(), VGic::serialize(), CopyEngineReg::ChanRegs::serialize(), DeviceFDEntry::serialize(), RealViewOsc::serialize(), PciDevice::serialize(), VirtIO9PProxy::serialize(), DistIface::SyncNode::serialize(), TrafficGen::serialize(), SrcClockDomain::serialize(), ClockedObject::serialize(), SparcISA::Interrupts::serialize(), PhysicalMemory::serialize(), X86ISA::I8042::serialize(), GenericISA::UPCState< MachInst >::serialize(), FrameBuffer::serialize(), BasePixelPump::PixelEvent::serialize(), ArmISA::Interrupts::serialize(), SparcISA::TlbEntry::serialize(), DistIface::SyncSwitch::serialize(), ArmISA::TlbEntry::serialize(), X86ISA::Interrupts::serialize(), Sinic::Device::serialize(), iGbReg::Regs::Reg< uint64_t >::serialize(), VirtQueue::serialize(), DmaReadFifo::serialize(), ArmISA::PMU::CounterState::serialize(), IGbE::DescCache< T >::serialize(), X86ISA::PCState::serialize(), GenericISA::DelaySlotPCState< MachInst >::serialize(), ArmISA::TLB::serialize(), DistIface::RecvScheduler::Desc::serialize(), ArmISA::ISA::serialize(), IdeDisk::serialize(), NSGigE::serialize(), Pl390::serialize(), Pl111::serialize(), HDLcd::DmaEngine::serialize(), IGbE::RxDescCache::serialize(), Event::serialize(), GenericISA::DelaySlotUPCState< MachInst >::serialize(), DistIface::RecvScheduler::serialize(), IGbE::TxDescCache::serialize(), System::serialize(), IGbE::serialize(), Cache::serialize(), VirtIODeviceBase::serialize(), DistIface::serialize(), iGbReg::Regs::serialize(), and PhysicalMemory::serializeStore().

#define UNSERIALIZE_ARRAY (   member,
  size 
)    arrayParamIn(cp, #member, member, size)
#define UNSERIALIZE_CONTAINER (   member)    arrayParamIn(cp, #member, member)
#define UNSERIALIZE_ENUM (   scalar)
Value:
do { \
int tmp; \
paramIn(cp, #scalar, tmp); \
scalar = static_cast<decltype(scalar)>(tmp); \
} while (0)
void paramIn(CheckpointIn &cp, const std::string &name, T &param)

Definition at line 151 of file serialize.hh.

Referenced by ThreadState::unserialize(), X86ISA::I8259::unserialize(), I2CBus::unserialize(), ArmISA::TlbEntry::unserialize(), and IdeDisk::unserialize().

#define UNSERIALIZE_EVENT (   event)
Value:
do { \
event.unserializeSection(cp, #event); \
eventQueue()->checkpointReschedule(&event); \
} while (0)
Bitfield< 10, 5 > event

Definition at line 172 of file serialize.hh.

#define UNSERIALIZE_OBJ (   obj)    obj.unserializeSection(cp, #obj)

Definition at line 179 of file serialize.hh.

Referenced by BasePixelPump::unserialize().

#define UNSERIALIZE_OBJPTR (   objptr)
Value:
do { \
SimObject *sptr; \
objParamIn(cp, #objptr, sptr); \
objptr = dynamic_cast<decltype(objptr)>(sptr); \
} while (0)
void objParamIn(CheckpointIn &cp, const std::string &name, SimObject *&param)

Definition at line 183 of file serialize.hh.

Referenced by SparcISA::ISA::unserialize().

#define UNSERIALIZE_OPT_SCALAR (   scalar)    optParamIn(cp, #scalar, scalar)
#define UNSERIALIZE_SCALAR (   scalar)    paramIn(cp, #scalar, scalar)

Definition at line 145 of file serialize.hh.

Referenced by ArmISA::EndBitUnion(), X86ISA::I8237::unserialize(), PollEvent::unserialize(), Pl011::unserialize(), FDEntry::unserialize(), DisplayTimings::unserialize(), DumbTOD::unserialize(), ThreadState::unserialize(), ThermalResistor::unserialize(), FlashDevice::unserialize(), EtherTapBase::unserialize(), Sinic::Base::unserialize(), TsunamiPChip::unserialize(), X86ISA::Speaker::unserialize(), RiscvISA::PTE::unserialize(), MipsISA::PTE::unserialize(), Kernel::Statistics::unserialize(), AlphaBackdoor::Access::unserialize(), X86ISA::Cmos::unserialize(), AlphaISA::Kernel::Statistics::unserialize(), EtherSwitch::Interface::unserialize(), PowerISA::TlbEntry::unserialize(), AlphaISA::ISA::unserialize(), LocalSimLoopExitEvent::unserialize(), SystemCounter::unserialize(), ThermalCapacitor::unserialize(), DistEtherLink::Link::unserialize(), ArmISA::PMU::unserialize(), ThermalDomain::unserialize(), RubySystem::unserialize(), HDLcd::unserialize(), CopyEngineReg::Reg< uint64_t >::unserialize(), MipsISA::TlbEntry::unserialize(), RiscvISA::TlbEntry::unserialize(), RiscvISA::TLB::unserialize(), MipsISA::TLB::unserialize(), CopyEngine::CopyEngineChannel::unserialize(), X86ISA::I8259::unserialize(), X86ISA::I82094AA::unserialize(), GpuDispatcher::unserialize(), GenericISA::PCStateBase::unserialize(), Uart8250::unserialize(), EtherSwitch::Interface::PortFifoEntry::unserialize(), AlphaISA::TLB::unserialize(), Sp804::Timer::unserialize(), PL031::unserialize(), FileFDEntry::unserialize(), AlphaISA::Interrupts::unserialize(), VoltageDomain::unserialize(), ThermalReference::unserialize(), MaltaIO::unserialize(), TsunamiCChip::unserialize(), CopyEngineReg::Regs::unserialize(), EnergyCtrl::unserialize(), CowDiskImage::unserialize(), TsunamiIO::unserialize(), Iob::unserialize(), AlphaISA::TlbEntry::unserialize(), X86ISA::TLB::unserialize(), CpuLocalTimer::Timer::unserialize(), PowerISA::PTE::unserialize(), I2CBus::unserialize(), BasePixelPump::unserialize(), IdeController::unserialize(), Pl050::unserialize(), ThermalModel::unserialize(), EtherTapStub::unserialize(), EtherSwitch::Interface::PortFifo::unserialize(), SparcISA::ISA::unserialize(), PipeFDEntry::unserialize(), PowerISA::TLB::unserialize(), DVFSHandler::unserialize(), UFSHostDevice::unserialize(), SparcISA::TLB::unserialize(), Pl390::BankedRegs::unserialize(), MC146818::unserialize(), RealViewCtrl::unserialize(), ArchTimer::unserialize(), VGic::unserialize(), DeviceFDEntry::unserialize(), CopyEngineReg::ChanRegs::unserialize(), RealViewOsc::unserialize(), VirtIO9PProxy::unserialize(), PciDevice::unserialize(), DistIface::SyncNode::unserialize(), TrafficGen::unserialize(), SrcClockDomain::unserialize(), ClockedObject::unserialize(), X86ISA::I8042::unserialize(), SparcISA::Interrupts::unserialize(), FrameBuffer::unserialize(), PhysicalMemory::unserialize(), GenericISA::UPCState< MachInst >::unserialize(), BasePixelPump::PixelEvent::unserialize(), ArmISA::Interrupts::unserialize(), SparcISA::TlbEntry::unserialize(), DistIface::SyncSwitch::unserialize(), GenericTimerMem::unserialize(), X86ISA::Interrupts::unserialize(), Sinic::Device::unserialize(), iGbReg::Regs::Reg< uint64_t >::unserialize(), ArmISA::TlbEntry::unserialize(), VirtQueue::unserialize(), DmaReadFifo::unserialize(), IGbE::DescCache< T >::unserialize(), ArmISA::PMU::CounterState::unserialize(), X86ISA::PCState::unserialize(), GenericISA::DelaySlotPCState< MachInst >::unserialize(), ArmISA::TLB::unserialize(), DistIface::RecvScheduler::Desc::unserialize(), IdeDisk::unserialize(), NSGigE::unserialize(), Pl390::unserialize(), ArmISA::ISA::unserialize(), Pl111::unserialize(), HDLcd::DmaEngine::unserialize(), IGbE::RxDescCache::unserialize(), Event::unserialize(), GenericISA::DelaySlotUPCState< MachInst >::unserialize(), DistIface::RecvScheduler::unserialize(), IGbE::TxDescCache::unserialize(), System::unserialize(), IGbE::unserialize(), Cache::unserialize(), VirtIODeviceBase::unserialize(), DistIface::unserialize(), iGbReg::Regs::unserialize(), and PhysicalMemory::unserializeStore().

Typedef Documentation

typedef std::ostream CheckpointOut

Definition at line 67 of file serialize.hh.

Function Documentation

template<class T >
void arrayParamIn ( CheckpointIn cp,
const std::string &  name,
T *  param,
unsigned  size 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const std::string &  name,
std::vector< T > &  param 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const std::string &  name,
std::list< T > &  param 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const std::string &  name,
std::set< T > &  param 
)
template<class T >
void arrayParamOut ( CheckpointOut cp,
const std::string &  name,
const T *  param,
unsigned  size 
)
template<class T >
void arrayParamOut ( CheckpointOut cp,
const std::string &  name,
const std::vector< T > &  param 
)
template<class T >
void arrayParamOut ( CheckpointOut cp,
const std::string &  name,
const std::list< T > &  param 
)
template<class T >
void arrayParamOut ( CheckpointOut cp,
const std::string &  name,
const std::set< T > &  param 
)
void debug_serialize ( const std::string &  cpt_dir)
void objParamIn ( CheckpointIn cp,
const std::string &  name,
SimObject *&  param 
)
template<class T >
bool optParamIn ( CheckpointIn cp,
const std::string &  name,
T &  param,
bool  warn = true 
)

Referenced by optParamIn().

template<typename DataType , typename BitUnion >
bool optParamIn ( CheckpointIn cp,
const std::string &  name,
BitfieldBackend::BitUnionOperators< DataType, BitUnion > &  p,
bool  warn = true 
)

Definition at line 97 of file serialize.hh.

References optParamIn(), and warn.

template<class T >
void paramIn ( CheckpointIn cp,
const std::string &  name,
T &  param 
)

Referenced by paramIn().

template<typename DataType , typename BitUnion >
void paramIn ( CheckpointIn cp,
const std::string &  name,
BitfieldBackend::BitUnionOperators< DataType, BitUnion > &  p 
)

Definition at line 86 of file serialize.hh.

References paramIn().

template<class T >
void paramOut ( CheckpointOut cp,
const std::string &  name,
const T &  param 
)

Referenced by paramOut().

template<typename DataType , typename BitUnion >
void paramOut ( CheckpointOut cp,
const std::string &  name,
const BitfieldBackend::BitUnionOperators< DataType, BitUnion > &  p 
)

Definition at line 76 of file serialize.hh.

References paramOut().


Generated on Fri Jun 9 2017 13:03:59 for gem5 by doxygen 1.8.6