37#include "debug/Checkpoint.hh"
81 DPRINTF(Checkpoint,
"unserializing\n");
86 DPRINTF(Checkpoint,
"no checkpoint section found\n");
125 fatal(
"%s does not have any port named %s\n",
name(), if_name);
140 for (;
ri != rend; ++
ri) {
154 for (;
i != end; ++
i) {
182 if (!cp.
find(section,
name, path)) {
183 fatal(
"Can't unserialize '%s:%s'\n", section,
name);
Interface for things with names.
virtual std::string name() const
Ports are used to interface objects to each other.
ProbeManager is a conduit class that lives on each SimObject, and is used to match up probe listeners...
Base class to wrap object resolving functionality.
Abstract superclass for simulation objects.
static SimObjectResolver * _objNameResolver
Helper to resolve an object given its name.
static void serializeAll(const std::string &cpt_dir)
Create a checkpoint by serializing all SimObjects in the system.
std::vector< SimObject * > SimObjectList
static void setSimObjectResolver(SimObjectResolver *resolver)
There is a single object name resolver, and it is only set when simulation is restoring from checkpoi...
ProbeManager * probeManager
Manager coordinates hooking up probe points with listeners.
static SimObjectResolver * getSimObjectResolver()
There is a single object name resolver, and it is only set when simulation is restoring from checkpoi...
static SimObjectList simObjectList
List of all instantiated simulation objects.
#define fatal(...)
This implements a cprintf based fatal() function.
void objParamIn(CheckpointIn &cp, const std::string &name, SimObject *¶m)
To avoid circular dependencies the unserialization of SimObjects must be implemented here.
bool find(const std::string §ion, const std::string &entry, std::string &value)
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
static const std::string & currentSection()
Gets the fully-qualified name of the active section.
virtual void loadState(CheckpointIn &cp)
loadState() is called on each SimObject when restoring from a checkpoint.
virtual SimObject * resolveSimObject(const std::string &name)=0
Find a SimObject given a full path name.
bool sectionExists(const std::string §ion)
virtual void initState()
initState() is called on each SimObject when not restoring from a checkpoint.
static void generateCheckpointOut(const std::string &cpt_dir, std::ofstream &outstream)
Generate a checkpoint file so that the serialization can be routed to it.
void unserializeSection(CheckpointIn &cp, const char *name)
Unserialize an a child object.
virtual void regProbeListeners()
Register probe listeners for this object.
SimObject(const Params &p)
virtual void startup()
startup() is the final initialization call before simulation.
ProbeManager * getProbeManager()
Get the probe manager for this object.
virtual void regProbePoints()
Register probe points for this object.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
static SimObject * find(const char *name)
Find the SimObject with the given name and return a pointer to it.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void debug_serialize(const std::string &cpt_dir)
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
const std::string & name()