8#include "sparta/functional/ArchData.hpp"
15namespace sparta::serialization::checkpoint
92 template <
typename Archive>
102 std::stringstream ss;
103 ss <<
"<Checkpoint id=" << chkpt_id_ <<
" at t=" << tick_;
205#define SPARTA_CHECKPOINT_BODY \
206 namespace sparta{ namespace serialization { namespace checkpoint { \
207 const CheckpointBase::chkpt_id_t CheckpointBase::MIN_CHECKPOINT; \
208 const CheckpointBase::chkpt_id_t CheckpointBase::UNIDENTIFIED_CHECKPOINT; \
File that contains checkpoint exception types.
A simple time-based, event precedence based scheduler.
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
Contains a set of contiguous line of architectural data which can be referred to by any architected o...
uint64_t Tick
Typedef for our unit of time.
Single checkpoint object interface with a tick number and an ID unique to the owning Checkpointer ins...
virtual std::string stringize() const
Returns a string describing this object.
CheckpointBase & operator=(CheckpointBase &&)=delete
Not move assignable.
virtual std::vector< chkpt_id_t > getNextIDs() const =0
Returns next checkpoint following *this. May be an empty vector if there are no later checkpoints.
virtual uint64_t getTotalMemoryUse() const noexcept=0
Returns memory usage by this checkpoint including any framework data structures.
virtual uint64_t getContentMemoryUse() const noexcept=0
Returns memory usage by this checkpoint solely for the checkpointed content.
virtual chkpt_id_t getPrevID() const =0
Get the ID of our previous checkpoint. Returns UNIDENTIFIED_CHECKPOINT only for the head checkpoint.
CheckpointBase & operator=(const CheckpointBase &)=delete
Non-assignable.
static const chkpt_id_t MIN_CHECKPOINT
Indicates the smallest valid checkpoint id.
uint64_t chkpt_id_t
tick_t Checkpoint ID type to which checkpoints will refer
virtual std::string getDeletedRepr() const
Gets the representation of this deleted checkpoint as part of a checkpoint chain (if that checkpointe...
virtual ~CheckpointBase()=default
Destructor.
virtual void dumpData(std::ostream &o) const =0
Writes all checkpoint raw data to an ostream.
void serialize(Archive &ar, const unsigned int)
boost::serialization support
CheckpointBase(const CheckpointBase &)=delete
Not copy constructable.
void setID_(chkpt_id_t id)
Sets the checkpoint ID.
chkpt_id_t getID() const noexcept
Returns the ID of this checkpoint.
virtual void load(const std::vector< ArchData * > &dats)=0
Attempts to restore this checkpoint state to the simulation state (ArchData) objects given to this Ch...
CheckpointBase(chkpt_id_t id, tick_t tick)
CheckpointBase(CheckpointBase &&)=delete
Not move constructable.
tick_t getTick() const noexcept
Returns the tick number at which this checkpoint was taken.
static const chkpt_id_t UNIDENTIFIED_CHECKPOINT
Indicates unidentified checkpoint (could mean 'invalid' or 'any') depending on context.
sparta::Scheduler::Tick tick_t
tick_t Tick type to which checkpoints will refer
std::ostream & operator<<(std::ostream &o, const SimulationInfo &info)
ostream insertion operator for SimulationInfo