gem5 v24.0.0.0
Loading...
Searching...
No Matches
serialize.hh File Reference
#include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include "base/inifile.hh"
#include "base/logging.hh"
#include "sim/serialize_handlers.hh"

Go to the source code of this file.

Classes

class  gem5::CheckpointIn
 
class  gem5::Serializable
 Basic support for object serialization. More...
 
class  gem5::Serializable::ScopedCheckpointSection
 

Namespaces

namespace  gem5
 Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
 

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)    ::gem5::arrayParamOut(cp, #member, member, size)
 
#define UNSERIALIZE_ARRAY(member, size)    ::gem5::arrayParamIn(cp, #member, member, size)
 
#define SERIALIZE_CONTAINER(member)    ::gem5::arrayParamOut(cp, #member, member)
 
#define UNSERIALIZE_CONTAINER(member)    ::gem5::arrayParamIn(cp, #member, member)
 
#define SERIALIZE_OBJ(obj)   obj.serializeSection(cp, #obj)
 This macro serializes an object into its own section.
 
#define UNSERIALIZE_OBJ(obj)   obj.unserializeSection(cp, #obj)
 
#define SERIALIZE_MAPPING(member, names, size)    ::gem5::mappingParamOut(cp, #member, names, member, size)
 
#define UNSERIALIZE_MAPPING(member, names, size)    ::gem5::mappingParamIn(cp, #member, names, member, size)
 

Typedefs

typedef std::ostream gem5::CheckpointOut
 

Functions

template<class T >
void gem5::paramOut (CheckpointOut &os, const std::string &name, const T &param)
 This function is used for writing parameters to a checkpoint.
 
template<class T >
bool gem5::paramInImpl (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
bool gem5::optParamIn (CheckpointIn &cp, const std::string &name, T &param, bool do_warn=true)
 This function is used for restoring optional parameters from the checkpoint.
 
template<class T >
void gem5::paramIn (CheckpointIn &cp, const std::string &name, T &param)
 This function is used for restoring parameters from a checkpoint.
 
template<class InputIterator >
void gem5::arrayParamOut (CheckpointOut &os, const std::string &name, InputIterator start, InputIterator end)
 
template<class T >
decltype(std::begin(std::declval< const T & >()), std::end(std::declval< const T & >()), void()) gem5::arrayParamOut (CheckpointOut &os, const std::string &name, const T &param)
 
template<class T >
void gem5::arrayParamOut (CheckpointOut &os, const std::string &name, const T *param, unsigned size)
 
template<class T , class InsertIterator >
void gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, InsertIterator inserter, ssize_t fixed_size=-1)
 Extract values stored in the checkpoint, and assign them to the provided array container.
 
template<class T >
decltype(std::declval< T >().insert(std::declval< typename T::value_type >()), void()) gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
decltype(std::declval< T >().push_back(std::declval< typename T::value_type >()), void()) gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T &param)
 
template<class T >
void gem5::arrayParamIn (CheckpointIn &cp, const std::string &name, T *param, unsigned size)
 
template<class T >
void gem5::mappingParamOut (CheckpointOut &os, const char *sectionName, const char *const names[], const T *param, unsigned size)
 Serialize a mapping represented as two arrays: one containing names and the other containing values.
 
template<class T >
void gem5::mappingParamIn (CheckpointIn &cp, const char *sectionName, const char *const names[], T *param, unsigned size)
 Restore mappingParamOut.
 

Macro Definition Documentation

◆ SERIALIZE_MAPPING

#define SERIALIZE_MAPPING ( member,
names,
size )    ::gem5::mappingParamOut(cp, #member, names, member, size)

Definition at line 660 of file serialize.hh.

Referenced by gem5::ArmISA::ISA::serialize(), and TEST_F().

◆ SERIALIZE_SCALAR

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

Definition at line 568 of file serialize.hh.

Referenced by gem5::AMDGPUDevice::serialize(), gem5::AMDGPUInterruptHandler::serialize(), gem5::AMDGPUVM::serialize(), gem5::ArchTimer::serialize(), gem5::ArmInterruptPin::serialize(), gem5::ArmISA::Interrupts::serialize(), gem5::ArmISA::PMU::CounterState::serialize(), gem5::ArmISA::PMU::serialize(), gem5::ArmISA::TlbEntry::serialize(), gem5::BaseCache::serialize(), gem5::BaseCPU::serialize(), gem5::BaseISA::serialize(), gem5::BasePixelPump::PixelEvent::serialize(), gem5::BasePixelPump::serialize(), gem5::BaseSemihosting::File::serialize(), gem5::BaseSemihosting::FileBase::serialize(), gem5::BaseSemihosting::FileFeatures::serialize(), gem5::BaseSemihosting::serialize(), gem5::BaseTrafficGen::serialize(), gem5::copy_engine_reg::ChanRegs::serialize(), gem5::copy_engine_reg::Reg< T >::serialize(), gem5::copy_engine_reg::Regs::serialize(), gem5::CopyEngine::CopyEngineChannel::serialize(), gem5::CowDiskImage::serialize(), gem5::CpuLocalTimer::Timer::serialize(), gem5::DeviceFDEntry::serialize(), gem5::DisplayTimings::serialize(), gem5::DistEtherLink::Link::serialize(), gem5::DistIface::RecvScheduler::Desc::serialize(), gem5::DistIface::RecvScheduler::serialize(), gem5::DistIface::serialize(), gem5::DistIface::SyncNode::serialize(), gem5::DistIface::SyncSwitch::serialize(), gem5::DmaReadFifo::serialize(), gem5::DumbTOD::serialize(), gem5::DVFSHandler::serialize(), gem5::EnergyCtrl::serialize(), gem5::EtherSwitch::Interface::PortFifo::serialize(), gem5::EtherSwitch::Interface::PortFifoEntry::serialize(), gem5::EtherSwitch::Interface::serialize(), gem5::EtherTapBase::serialize(), gem5::EtherTapStub::serialize(), gem5::Event::serialize(), gem5::FDEntry::serialize(), gem5::FileFDEntry::serialize(), gem5::FlashDevice::serialize(), gem5::FrameBuffer::serialize(), gem5::GenericISA::DelaySlotPCState< InstWidth >::serialize(), gem5::GenericISA::PCStateWithNext::serialize(), gem5::GenericTimer::CoreTimers::serialize(), gem5::GenericTimerFrame::serialize(), gem5::GenericWatchdog::serialize(), gem5::GicV2::BankedRegs::serialize(), gem5::GicV2::serialize(), gem5::Gicv3CPUInterface::serialize(), gem5::Gicv3Distributor::serialize(), gem5::Gicv3Its::serialize(), gem5::Gicv3Redistributor::serialize(), gem5::GPUDispatcher::serialize(), gem5::HDLcd::DmaEngine::serialize(), gem5::HDLcd::serialize(), gem5::I2CBus::serialize(), gem5::IdeDisk::serialize(), gem5::IGbE::DescCache< T >::serialize(), gem5::IGbE::RxDescCache::serialize(), gem5::IGbE::serialize(), gem5::IGbE::TxDescCache::serialize(), gem5::igbreg::Regs::Reg< T >::serialize(), gem5::igbreg::Regs::serialize(), gem5::Iob::serialize(), gem5::Iris::Interrupts::serialize(), gem5::LocalSimLoopExitEvent::serialize(), gem5::MaltaIO::serialize(), gem5::MC146818::serialize(), gem5::memory::CfiMemory::ProgramBuffer::serialize(), gem5::memory::CfiMemory::serialize(), gem5::memory::PhysicalMemory::serialize(), gem5::MemPools::serialize(), gem5::MipsISA::PTE::serialize(), gem5::MipsISA::TlbEntry::serialize(), gem5::NSGigE::serialize(), gem5::PciDevice::serialize(), gem5::PCStateBase::serialize(), gem5::PipeFDEntry::serialize(), gem5::Pl011::serialize(), gem5::PL031::serialize(), gem5::Pl050::serialize(), gem5::Pl111::serialize(), gem5::Plic::serialize(), gem5::PM4PacketProcessor::serialize(), gem5::PollEvent::serialize(), gem5::PowerISA::PTE::serialize(), gem5::PowerISA::TlbEntry::serialize(), gem5::PowerState::serialize(), gem5::ps2::PS2Keyboard::serialize(), gem5::ps2::PS2Mouse::serialize(), gem5::ps2::TouchKit::serialize(), gem5::RealViewCtrl::serialize(), gem5::RealViewOsc::serialize(), gem5::RiscvISA::Interrupts::serialize(), gem5::RiscvISA::PCState::serialize(), gem5::RiscvISA::TlbEntry::serialize(), gem5::Root::serialize(), gem5::ruby::RubySystem::serialize(), gem5::SDMAEngine::serialize(), gem5::sinic::Base::serialize(), gem5::sinic::Device::serialize(), gem5::Sp804::Timer::serialize(), gem5::Sp805::serialize(), gem5::SparcISA::Interrupts::serialize(), gem5::SparcISA::ISA::serialize(), gem5::SparcISA::TLB::serialize(), gem5::SparcISA::TlbEntry::serialize(), gem5::SrcClockDomain::serialize(), gem5::SystemCounter::serialize(), gem5::TrafficGen::serialize(), gem5::Uart8250::serialize(), gem5::UFSHostDevice::serialize(), gem5::VGic::serialize(), gem5::VirtIO9PProxy::serialize(), gem5::VirtIODeviceBase::serialize(), gem5::VirtQueue::serialize(), gem5::VoltageDomain::serialize(), gem5::X86ISA::Cmos::serialize(), gem5::X86ISA::I8042::serialize(), gem5::X86ISA::I82094AA::serialize(), gem5::X86ISA::I8259::serialize(), gem5::X86ISA::Interrupts::serialize(), gem5::X86ISA::PCState::serialize(), gem5::X86ISA::Speaker::serialize(), gem5::X86ISA::TLB::serialize(), gem5::X86ISA::TlbEntry::serialize(), gem5::memory::PhysicalMemory::serializeStore(), TEST_F(), and TEST_F().

◆ UNSERIALIZE_MAPPING

#define UNSERIALIZE_MAPPING ( member,
names,
size )    ::gem5::mappingParamIn(cp, #member, names, member, size)

Definition at line 666 of file serialize.hh.

Referenced by TEST_F(), and gem5::ArmISA::ISA::unserialize().

◆ UNSERIALIZE_SCALAR

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

Definition at line 575 of file serialize.hh.

Referenced by TEST_F(), gem5::AMDGPUDevice::unserialize(), gem5::AMDGPUInterruptHandler::unserialize(), gem5::AMDGPUVM::unserialize(), gem5::ArmInterruptPin::unserialize(), gem5::ArmISA::Interrupts::unserialize(), gem5::ArmISA::PMU::CounterState::unserialize(), gem5::ArmISA::PMU::unserialize(), gem5::ArmISA::TlbEntry::unserialize(), gem5::BaseCache::unserialize(), gem5::BaseCPU::unserialize(), gem5::BasePixelPump::PixelEvent::unserialize(), gem5::BasePixelPump::unserialize(), gem5::BaseSemihosting::File::unserialize(), gem5::BaseSemihosting::FileFeatures::unserialize(), gem5::BaseSemihosting::unserialize(), gem5::BaseTrafficGen::unserialize(), gem5::copy_engine_reg::ChanRegs::unserialize(), gem5::copy_engine_reg::Reg< T >::unserialize(), gem5::copy_engine_reg::Regs::unserialize(), gem5::CopyEngine::CopyEngineChannel::unserialize(), gem5::CowDiskImage::unserialize(), gem5::CpuLocalTimer::Timer::unserialize(), gem5::DeviceFDEntry::unserialize(), gem5::DisplayTimings::unserialize(), gem5::DistEtherLink::Link::unserialize(), gem5::DistIface::RecvScheduler::Desc::unserialize(), gem5::DistIface::RecvScheduler::unserialize(), gem5::DistIface::SyncNode::unserialize(), gem5::DistIface::SyncSwitch::unserialize(), gem5::DistIface::unserialize(), gem5::DmaReadFifo::unserialize(), gem5::DumbTOD::unserialize(), gem5::DVFSHandler::unserialize(), gem5::EmulationPageTable::unserialize(), gem5::EnergyCtrl::unserialize(), gem5::EtherSwitch::Interface::PortFifo::unserialize(), gem5::EtherSwitch::Interface::PortFifoEntry::unserialize(), gem5::EtherSwitch::Interface::unserialize(), gem5::EtherTapBase::unserialize(), gem5::EtherTapStub::unserialize(), gem5::Event::unserialize(), gem5::FDEntry::unserialize(), gem5::FileFDEntry::unserialize(), gem5::FlashDevice::unserialize(), gem5::FrameBuffer::unserialize(), gem5::GenericISA::DelaySlotPCState< InstWidth >::unserialize(), gem5::GenericISA::PCStateWithNext::unserialize(), gem5::GenericTimer::CoreTimers::unserialize(), gem5::GenericTimerFrame::unserialize(), gem5::GenericWatchdog::unserialize(), gem5::GicV2::BankedRegs::unserialize(), gem5::GicV2::unserialize(), gem5::Gicv3CPUInterface::unserialize(), gem5::Gicv3Distributor::unserialize(), gem5::Gicv3Its::unserialize(), gem5::Gicv3Redistributor::unserialize(), gem5::GPUDispatcher::unserialize(), gem5::HDLcd::DmaEngine::unserialize(), gem5::HDLcd::unserialize(), gem5::I2CBus::unserialize(), gem5::IdeDisk::unserialize(), gem5::IGbE::DescCache< T >::unserialize(), gem5::IGbE::RxDescCache::unserialize(), gem5::IGbE::TxDescCache::unserialize(), gem5::IGbE::unserialize(), gem5::igbreg::Regs::Reg< T >::unserialize(), gem5::igbreg::Regs::unserialize(), gem5::Iob::unserialize(), gem5::LocalSimLoopExitEvent::unserialize(), gem5::MaltaIO::unserialize(), gem5::MC146818::unserialize(), gem5::memory::CfiMemory::ProgramBuffer::unserialize(), gem5::memory::CfiMemory::unserialize(), gem5::memory::PhysicalMemory::unserialize(), gem5::MemPools::unserialize(), gem5::MipsISA::PTE::unserialize(), gem5::MipsISA::TlbEntry::unserialize(), gem5::NSGigE::unserialize(), gem5::PciDevice::unserialize(), gem5::PCStateBase::unserialize(), gem5::PipeFDEntry::unserialize(), gem5::Pl011::unserialize(), gem5::PL031::unserialize(), gem5::Pl050::unserialize(), gem5::Pl111::unserialize(), gem5::Plic::unserialize(), gem5::PM4PacketProcessor::unserialize(), gem5::PollEvent::unserialize(), gem5::PowerISA::PTE::unserialize(), gem5::PowerISA::TlbEntry::unserialize(), gem5::PowerState::unserialize(), gem5::ps2::PS2Keyboard::unserialize(), gem5::ps2::PS2Mouse::unserialize(), gem5::ps2::TouchKit::unserialize(), gem5::RealViewCtrl::unserialize(), gem5::RealViewOsc::unserialize(), gem5::RiscvISA::Interrupts::unserialize(), gem5::RiscvISA::PCState::unserialize(), gem5::RiscvISA::TlbEntry::unserialize(), gem5::ruby::RubySystem::unserialize(), gem5::SDMAEngine::unserialize(), gem5::sinic::Base::unserialize(), gem5::sinic::Device::unserialize(), gem5::Sp804::Timer::unserialize(), gem5::Sp805::unserialize(), gem5::SparcISA::Interrupts::unserialize(), gem5::SparcISA::ISA::unserialize(), gem5::SparcISA::TLB::unserialize(), gem5::SparcISA::TlbEntry::unserialize(), gem5::SrcClockDomain::unserialize(), gem5::SystemCounter::unserialize(), gem5::TrafficGen::unserialize(), gem5::Uart8250::unserialize(), gem5::UFSHostDevice::unserialize(), gem5::VGic::unserialize(), gem5::VirtIO9PProxy::unserialize(), gem5::VirtIODeviceBase::unserialize(), gem5::VirtQueue::unserialize(), gem5::VoltageDomain::unserialize(), gem5::X86ISA::Cmos::unserialize(), gem5::X86ISA::I8042::unserialize(), gem5::X86ISA::I82094AA::unserialize(), gem5::X86ISA::I8259::unserialize(), gem5::X86ISA::Interrupts::unserialize(), gem5::X86ISA::PCState::unserialize(), gem5::X86ISA::Speaker::unserialize(), gem5::X86ISA::TLB::unserialize(), gem5::X86ISA::TlbEntry::unserialize(), and gem5::memory::PhysicalMemory::unserializeStore().


Generated on Tue Jun 18 2024 16:24:08 for gem5 by doxygen 1.11.0