gem5
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 T >
void paramOut (CheckpointOut &cp, const std::string &name, const BitUnionType< T > &p)
 
template<class T >
void paramIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<typename T >
void paramIn (CheckpointIn &cp, const std::string &name, BitUnionType< T > &p)
 
template<class T >
bool optParamIn (CheckpointIn &cp, const std::string &name, T &param, bool warn=true)
 
template<typename T >
bool optParamIn (CheckpointIn &cp, const std::string &name, BitUnionType< T > &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

◆ SERIALIZE_ARRAY

#define SERIALIZE_ARRAY (   member,
  size 
)    arrayParamOut(cp, #member, member, size)

◆ SERIALIZE_CONTAINER

#define SERIALIZE_CONTAINER (   member)    arrayParamOut(cp, #member, member)

◆ SERIALIZE_ENUM

#define SERIALIZE_ENUM (   scalar)    paramOut(cp, #scalar, (int)scalar)

◆ SERIALIZE_EVENT

#define SERIALIZE_EVENT (   event)    event.serializeSection(cp, #event);

Definition at line 178 of file serialize.hh.

◆ SERIALIZE_OBJ

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

Definition at line 186 of file serialize.hh.

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

◆ SERIALIZE_OBJPTR

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

Definition at line 189 of file serialize.hh.

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

◆ SERIALIZE_SCALAR

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

Definition at line 151 of file serialize.hh.

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

◆ UNSERIALIZE_ARRAY

#define UNSERIALIZE_ARRAY (   member,
  size 
)    arrayParamIn(cp, #member, member, size)

◆ UNSERIALIZE_CONTAINER

#define UNSERIALIZE_CONTAINER (   member)    arrayParamIn(cp, #member, member)

◆ UNSERIALIZE_ENUM

#define UNSERIALIZE_ENUM (   scalar)
Value:
do { \
int tmp; \
paramIn(cp, #scalar, tmp); \
scalar = static_cast<decltype(scalar)>(tmp); \
} while (0)
Definition: cprintf.cc:42

Definition at line 159 of file serialize.hh.

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

◆ UNSERIALIZE_EVENT

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

Definition at line 180 of file serialize.hh.

◆ UNSERIALIZE_OBJ

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

Definition at line 187 of file serialize.hh.

Referenced by BasePixelPump::unserialize().

◆ UNSERIALIZE_OBJPTR

#define UNSERIALIZE_OBJPTR (   objptr)
Value:
do { \
SimObject *sptr; \
objParamIn(cp, #objptr, sptr); \
objptr = dynamic_cast<decltype(objptr)>(sptr); \
} while (0)
Definition: cprintf.cc:42

Definition at line 191 of file serialize.hh.

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

◆ UNSERIALIZE_OPT_SCALAR

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

◆ UNSERIALIZE_SCALAR

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

Definition at line 153 of file serialize.hh.

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

Typedef Documentation

◆ CheckpointOut

typedef std::ostream CheckpointOut

Definition at line 67 of file serialize.hh.

Function Documentation

◆ arrayParamIn() [1/4]

template<class T >
void arrayParamIn ( CheckpointIn cp,
const std::string &  name,
T *  param,
unsigned  size 
)

Referenced by optParamIn().

◆ arrayParamIn() [2/4]

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

◆ arrayParamIn() [3/4]

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

◆ arrayParamIn() [4/4]

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

◆ arrayParamOut() [1/4]

template<class T >
void arrayParamOut ( CheckpointOut cp,
const std::string &  name,
const T *  param,
unsigned  size 
)

Referenced by optParamIn().

◆ arrayParamOut() [2/4]

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

◆ arrayParamOut() [3/4]

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

◆ arrayParamOut() [4/4]

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

◆ debug_serialize()

void debug_serialize ( const std::string &  cpt_dir)

◆ objParamIn()

void objParamIn ( CheckpointIn cp,
const std::string &  name,
SimObject *&  param 
)

Referenced by optParamIn().

◆ optParamIn() [1/2]

template<class T >
bool optParamIn ( CheckpointIn cp,
const std::string &  name,
T &  param,
bool  warn = true 
)

Referenced by optParamIn(), and paramIn().

◆ optParamIn() [2/2]

template<typename T >
bool optParamIn ( CheckpointIn cp,
const std::string &  name,
BitUnionType< T > &  p,
bool  warn = true 
)

Definition at line 100 of file serialize.hh.

References arrayParamIn(), arrayParamOut(), ArmISA::b, name(), objParamIn(), optParamIn(), and warn.

◆ paramIn() [1/2]

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

Referenced by paramIn(), and paramOut().

◆ paramIn() [2/2]

template<typename T >
void paramIn ( CheckpointIn cp,
const std::string &  name,
BitUnionType< T > &  p 
)

Definition at line 87 of file serialize.hh.

References ArmISA::b, name(), optParamIn(), paramIn(), and warn.

◆ paramOut() [1/2]

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

Referenced by paramOut().

◆ paramOut() [2/2]

template<typename T >
void paramOut ( CheckpointOut cp,
const std::string &  name,
const BitUnionType< T > &  p 
)

Definition at line 77 of file serialize.hh.

References name(), paramIn(), and paramOut().


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