gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Functions | Variables
serialize.cc File Reference
#include "sim/serialize.hh"
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <cerrno>
#include <fstream>
#include <list>
#include <string>
#include <vector>
#include "base/framebuffer.hh"
#include "base/inifile.hh"
#include "base/misc.hh"
#include "base/output.hh"
#include "base/str.hh"
#include "base/trace.hh"
#include "debug/Checkpoint.hh"
#include "sim/eventq.hh"
#include "sim/sim_events.hh"
#include "sim/sim_exit.hh"
#include "sim/sim_object.hh"
#include "sim/stat_control.hh"

Go to the source code of this file.

Classes

class  Globals
 Container for serializing global variables (not associated with any serialized object). More...
 

Macros

#define INSTANTIATE_PARAM_TEMPLATES(type)
 

Functions

template<class T >
bool parseParam (const string &s, T &value)
 
template<class T >
void showParam (CheckpointOut &os, const T &value)
 
template<>
void showParam (CheckpointOut &os, const char &value)
 
template<>
void showParam (CheckpointOut &os, const signed char &value)
 
template<>
void showParam (CheckpointOut &os, const unsigned char &value)
 
template<>
bool parseParam (const string &s, float &value)
 
template<>
bool parseParam (const string &s, double &value)
 
template<>
bool parseParam (const string &s, bool &value)
 
template<>
void showParam (CheckpointOut &os, const bool &value)
 
template<>
bool parseParam (const string &s, string &value)
 
template<class T >
void paramOut (CheckpointOut &os, const string &name, const T &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const string &name, const vector< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const string &name, const list< T > &param)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const string &name, const set< T > &param)
 
template<class T >
void paramIn (CheckpointIn &cp, const string &name, T &param)
 
template<class T >
bool optParamIn (CheckpointIn &cp, const string &name, T &param, bool warn)
 
template<class T >
void arrayParamOut (CheckpointOut &os, const string &name, const T *param, unsigned size)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const string &name, T *param, unsigned size)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const string &name, vector< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const string &name, list< T > &param)
 
template<class T >
void arrayParamIn (CheckpointIn &cp, const string &name, set< T > &param)
 
void objParamIn (CheckpointIn &cp, const string &name, SimObject *&param)
 
template void arrayParamOut (CheckpointOut &, const string &, const set< string > &)
 
template void arrayParamIn (CheckpointIn &, const string &, set< string > &)
 
void debug_serialize (const string &cpt_dir)
 

Variables

Globals globals
 The one and only instance of the Globals class. More...
 
std::set< std::string > version_tags
 The version tags for this build of the simulator, to be stored in the Globals section during serialization and compared upon unserialization. More...
 

Macro Definition Documentation

#define INSTANTIATE_PARAM_TEMPLATES (   type)
Value:
template void \
paramOut(CheckpointOut &os, const string &name, type const &param); \
template void \
paramIn(CheckpointIn &cp, const string &name, type & param); \
template bool \
optParamIn(CheckpointIn &cp, const string &name, type & param, \
bool warn); \
template void \
arrayParamOut(CheckpointOut &os, const string &name, \
type const *param, unsigned size); \
template void \
arrayParamIn(CheckpointIn &cp, const string &name, \
type *param, unsigned size); \
template void \
arrayParamOut(CheckpointOut &os, const string &name, \
const vector<type> &param); \
template void \
arrayParamIn(CheckpointIn &cp, const string &name, \
vector<type> &param); \
template void \
arrayParamOut(CheckpointOut &os, const string &name, \
const list<type> &param); \
template void \
arrayParamIn(CheckpointIn &cp, const string &name, \
list<type> &param);
const std::string & name()
Definition: trace.cc:49
void arrayParamIn(CheckpointIn &cp, const string &name, T *param, unsigned size)
Definition: serialize.cc:276
void paramIn(CheckpointIn &cp, const string &name, T &param)
Definition: serialize.cc:234
bool optParamIn(CheckpointIn &cp, const string &name, T &param, bool warn)
Definition: serialize.cc:245
Bitfield< 17 > os
Definition: misc.hh:804
STL vector class.
Definition: stl.hh:40
#define warn(...)
Definition: misc.hh:219
STL list class.
Definition: stl.hh:54
void paramOut(CheckpointOut &os, const string &name, const T &param)
Definition: serialize.cc:174
type
Definition: misc.hh:728
int size()
Definition: pagetable.hh:146
std::ostream CheckpointOut
Definition: serialize.hh:67
void arrayParamOut(CheckpointOut &os, const string &name, const vector< T > &param)
Definition: serialize.cc:183

Definition at line 431 of file serialize.cc.

Function Documentation

template<class T >
void arrayParamIn ( CheckpointIn cp,
const string &  name,
T *  param,
unsigned  size 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const string &  name,
vector< T > &  param 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const string &  name,
list< T > &  param 
)
template<class T >
void arrayParamIn ( CheckpointIn cp,
const string &  name,
set< T > &  param 
)
template void arrayParamIn ( CheckpointIn ,
const string &  ,
set< string > &   
)
template<class T >
void arrayParamOut ( CheckpointOut os,
const string &  name,
const vector< T > &  param 
)

Definition at line 183 of file serialize.cc.

References ArmISA::i, showParam(), and X86ISA::size().

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

Definition at line 198 of file serialize.cc.

References showParam().

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

Definition at line 216 of file serialize.cc.

References showParam().

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

Definition at line 260 of file serialize.cc.

References ArmISA::i, showParam(), and X86ISA::size().

template void arrayParamOut ( CheckpointOut ,
const string &  ,
const set< string > &   
)
void debug_serialize ( const string &  cpt_dir)

Definition at line 646 of file serialize.cc.

References Serializable::serializeAll().

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

Definition at line 422 of file serialize.cc.

References Serializable::currentSection(), fatal, and CheckpointIn::findObj().

template<class T >
bool optParamIn ( CheckpointIn cp,
const string &  name,
T &  param,
bool  warn 
)
template<class T >
void paramIn ( CheckpointIn cp,
const string &  name,
T &  param 
)

Definition at line 234 of file serialize.cc.

References Serializable::currentSection(), fatal, CheckpointIn::find(), and parseParam().

Referenced by Globals::unserialize().

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

Definition at line 174 of file serialize.cc.

References showParam().

Referenced by Globals::serialize().

template<class T >
bool parseParam ( const string &  s,
T &  value 
)

Definition at line 83 of file serialize.cc.

References to_number().

Referenced by arrayParamIn(), optParamIn(), and paramIn().

template<>
bool parseParam ( const string &  s,
float &  value 
)

Definition at line 130 of file serialize.cc.

References to_number().

template<>
bool parseParam ( const string &  s,
double &  value 
)

Definition at line 137 of file serialize.cc.

References to_number().

template<>
bool parseParam ( const string &  s,
bool &  value 
)

Definition at line 144 of file serialize.cc.

References to_bool().

template<>
bool parseParam ( const string &  s,
string &  value 
)

Definition at line 161 of file serialize.cc.

References ArmISA::s.

template<class T >
void showParam ( CheckpointOut os,
const T &  value 
)

Definition at line 90 of file serialize.cc.

Referenced by arrayParamOut(), and paramOut().

template<>
void showParam ( CheckpointOut os,
const char &  value 
)

Definition at line 106 of file serialize.cc.

template<>
void showParam ( CheckpointOut os,
const signed char &  value 
)

Definition at line 114 of file serialize.cc.

template<>
void showParam ( CheckpointOut os,
const unsigned char &  value 
)

Definition at line 122 of file serialize.cc.

template<>
void showParam ( CheckpointOut os,
const bool &  value 
)

Definition at line 152 of file serialize.cc.

Variable Documentation

Globals globals

The one and only instance of the Globals class.

Definition at line 498 of file serialize.cc.

Referenced by py_interact(), Serializable::serializeAll(), and Serializable::unserializeGlobals().

std::set<std::string> version_tags

The version tags for this build of the simulator, to be stored in the Globals section during serialization and compared upon unserialization.

Referenced by Globals::serialize(), and Globals::unserialize().


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