gem5
v21.0.0.0
|
#include <algorithm>
#include <iostream>
#include <iterator>
#include <stack>
#include <set>
#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 | CheckpointIn |
class | Serializable |
Basic support for object serialization. More... | |
class | Serializable::ScopedCheckpointSection |
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) |
#define | SERIALIZE_MAPPING(member, names, size) mappingParamOut(cp, #member, names, member, size) |
#define | UNSERIALIZE_MAPPING(member, names, size) mappingParamIn(cp, #member, names, member, size) |
Typedefs | |
typedef std::ostream | CheckpointOut |
Functions | |
template<class T > | |
void | paramOut (CheckpointOut &os, const std::string &name, const T ¶m) |
This function is used for writing parameters to a checkpoint. More... | |
template<class T > | |
bool | paramInImpl (CheckpointIn &cp, const std::string &name, T ¶m) |
template<class T > | |
bool | optParamIn (CheckpointIn &cp, const std::string &name, T ¶m, bool do_warn=true) |
This function is used for restoring optional parameters from the checkpoint. More... | |
template<class T > | |
void | paramIn (CheckpointIn &cp, const std::string &name, T ¶m) |
This function is used for restoring parameters from a checkpoint. More... | |
template<class InputIterator > | |
void | arrayParamOut (CheckpointOut &os, const std::string &name, InputIterator start, InputIterator end) |
template<class T > | |
void | arrayParamOut (CheckpointOut &os, const std::string &name, const T *param, unsigned size) |
template<class T , class InsertIterator > | |
void | 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. More... | |
template<class T > | |
decltype(std::declval< T >().insert(std::declval< typename T::value_type >()), void()) | arrayParamIn (CheckpointIn &cp, const std::string &name, T ¶m) |
template<class T > | |
decltype(std::declval< T >().push_back(std::declval< typename T::value_type >()), void()) | arrayParamIn (CheckpointIn &cp, const std::string &name, T ¶m) |
template<class T > | |
void | arrayParamIn (CheckpointIn &cp, const std::string &name, T *param, unsigned size) |
void | debug_serialize (const std::string &cpt_dir) |
void | objParamIn (CheckpointIn &cp, const std::string &name, SimObject *¶m) |
template<class T > | |
void | 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. More... | |
template<class T > | |
void | mappingParamIn (CheckpointIn &cp, const char *sectionName, const char *const names[], T *param, unsigned size) |
Restore mappingParamOut. More... | |
Variables | |
template<class T > | |
decltype(std::begin(std::declval< const T & >()), std::end(std::declval< const T & >()), void()) | arrayParamOut (CheckpointOut &os, const std::string &name, const T ¶m) |
#define SERIALIZE_MAPPING | ( | member, | |
names, | |||
size | |||
) | mappingParamOut(cp, #member, names, member, size) |
Definition at line 707 of file serialize.hh.
#define SERIALIZE_SCALAR | ( | scalar | ) | paramOut(cp, #scalar, scalar) |
Definition at line 584 of file serialize.hh.
#define UNSERIALIZE_MAPPING | ( | member, | |
names, | |||
size | |||
) | mappingParamIn(cp, #member, names, member, size) |
Definition at line 713 of file serialize.hh.
#define UNSERIALIZE_SCALAR | ( | scalar | ) | paramIn(cp, #scalar, scalar) |
Definition at line 591 of file serialize.hh.
typedef std::ostream CheckpointOut |
Definition at line 64 of file serialize.hh.
decltype(std::declval<T>().push_back(std::declval<typename T::value_type>()), void()) arrayParamIn | ( | CheckpointIn & | cp, |
const std::string & | name, | ||
T & | param | ||
) |
Definition at line 489 of file serialize.hh.
References name().
void debug_serialize | ( | const std::string & | cpt_dir | ) |
Definition at line 357 of file serialize.cc.
References Serializable::serializeAll().
void mappingParamIn | ( | CheckpointIn & | cp, |
const char * | sectionName, | ||
const char *const | names[], | ||
T * | param, | ||
unsigned | size | ||
) |
Restore mappingParamOut.
Keys missing from the checkpoint are ignored.
Definition at line 546 of file serialize.hh.
References Serializable::currentSection(), ArmISA::i, optParamIn(), and X86ISA::val.
void 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.
names | array of keys |
param | array of values |
size | size of the names and param arrays |
Definition at line 532 of file serialize.hh.
References ArmISA::i, X86ISA::os, and paramOut().
bool paramInImpl | ( | CheckpointIn & | cp, |
const std::string & | name, | ||
T & | param | ||
) |
Definition at line 342 of file serialize.hh.
References Serializable::currentSection(), and name().
Referenced by optParamIn(), and paramIn().