The Sparta Modeling Framework
|
Single delta checkpoint object containing all simulator state which changed since some previous DeltaCheckpoint. Can contain all simulator state if it has no previous DeltaCheckpoint. The previous delta can be referenced by getPrev(). More...
#include <DeltaCheckpoint.hpp>
Public Member Functions | |
virtual std::string | stringize () const override |
Returns a string describing this object. | |
virtual void | dumpData (std::ostream &o) const override |
Writes all checkpoint raw data to an ostream. | |
void | dumpRestoreChain (std::ostream &o) const |
Dumps the restore chain for this checkpoint. | |
virtual uint64_t | getTotalMemoryUse () const noexcept override |
Returns memory usage by this checkpoint. | |
virtual uint64_t | getContentMemoryUse () const noexcept override |
Returns memory usage by the content of this checkpoint. | |
Checkpoint Actions | |
void | traceValue (std::ostream &o, const std::vector< ArchData * > &dats, const ArchData *container, uint32_t offset, uint32_t size) |
Implement trace of a value across the restore chain as described in Checkpointer::traceValue. | |
std::stack< DeltaCheckpoint * > | getHistoryChain () |
Returns a stack of checkpoints from this checkpoint as far back as possible until no previous link is found. This is a superset of getRestoreChain and contains checkpoints that do not actually need to be inspected for restoring this checkpoint's data. This may reach the head checkpoint if no gaps are encountered. | |
std::stack< DeltaCheckpoint * > | getRestoreChain () |
Returns a stack of checkpoints that must be restored from top-to-bottom to fully restore the state associated with this checkpoint. | |
std::stack< const DeltaCheckpoint * > | getRestoreChain () const |
Const-qualified version of getRestoreChain. | |
virtual void | load (const std::vector< ArchData * > &dats) override |
Attempts to restore this checkpoint including any previous deltas (dependencies). | |
bool | canDelete () const noexcept |
Can this checkpoint be deleted Cannot be deleted if: | |
void | flagDeleted () |
Allows this checkpoint to be deleted if it is no longer a previous delta of some other delta (i.e. getNexts() returns an empty vector). Sets the checkpoint ID to invalid. Calling multiple times has no effect. | |
bool | isFlaggedDeleted () const noexcept |
Indicates whether this checkpoint has been flagged deleted. | |
chkpt_id_t | getDeletedID () const noexcept |
Return the ID had by this checkpoint before it was deleted If this checkpoint has not been flagged for deletion, this will be UNIDENTIFIED_CHECKPOINT. | |
virtual std::string | getDeletedRepr () const override |
Gets the representation of this deleted checkpoint as part of a checkpoint chain (if that checkpointer supports deletion) | |
bool | isSnapshot () const noexcept |
Is this checkpoint a snapshot (contains ALL simulator state) | |
uint32_t | getDistanceToPrevSnapshot () const noexcept |
Determines how many checkpoints away the closest, earlier snapshot is. | |
Public Member Functions inherited from sparta::serialization::checkpoint::Checkpoint | |
tick_t | getTick () const noexcept |
Returns the tick number at which this checkpoint was taken. | |
chkpt_id_t | getID () const noexcept |
Returns the ID of this checkpoint. | |
Checkpoint * | getPrev () const noexcept |
Returns the previous checkpoint. If this checkpoint is a snapshot, it has no previous checkpoint. | |
void | setPrev (Checkpoint *prev) noexcept |
Sets the previous checkpoint of this checkpoint to prev. | |
void | addNext (Checkpoint *next) |
Adds another next checkpoint following *this. | |
void | removeNext (Checkpoint *next) |
Removes a checkpoint following *this because it was deleted. | |
const std::vector< Checkpoint * > & | getNexts () const noexcept |
Returns next checkpoint following *this. May be an empty vector if there are no later checkpoints following this Checkpoint. | |
Checkpoint ()=delete | |
Not default constructable. | |
Checkpoint (const Checkpoint &)=delete | |
Not copy constructable. | |
const Checkpoint & | operator= (const Checkpoint &)=delete |
Non-assignable. | |
virtual | ~Checkpoint () |
Destructor. | |
Protected Member Functions | |
void | loadState (const std::vector< ArchData * > &dats) |
Loads delta state of this checkpoint to root. Does not look at any other checkpoints checkpoints. | |
Protected Member Functions inherited from sparta::serialization::checkpoint::Checkpoint | |
void | setID_ (chkpt_id_t id) |
Sets the checkpoint ID. | |
Checkpoint (chkpt_id_t id, tick_t tick, Checkpoint *prev) | |
Construction & Initialization | |
class | FastCheckpointer |
DeltaCheckpoints can only be constructed by the FastCheckpointer. | |
DeltaCheckpoint ()=delete | |
Not default constructable. | |
DeltaCheckpoint (const DeltaCheckpoint &)=delete | |
Not copy constructable. | |
const DeltaCheckpoint & | operator= (const DeltaCheckpoint &)=delete |
Non-assignable. | |
virtual | ~DeltaCheckpoint () |
Destructor. | |
Additional Inherited Members | |
Public Types inherited from sparta::serialization::checkpoint::Checkpoint | |
typedef sparta::Scheduler::Tick | tick_t |
tick_t Tick type to which checkpoints will refer | |
typedef uint64_t | chkpt_id_t |
tick_t Tick type to which checkpoints will refer | |
Static Public Attributes inherited from sparta::serialization::checkpoint::Checkpoint | |
static const chkpt_id_t | MIN_CHECKPOINT = 0 |
Indicates the smallest valid checkpoint id. | |
static const chkpt_id_t | UNIDENTIFIED_CHECKPOINT = ~(chkpt_id_t)0 |
Indicates unidentified checkpoint (could mean 'invalid' or 'any') depending on context. | |
Single delta checkpoint object containing all simulator state which changed since some previous DeltaCheckpoint. Can contain all simulator state if it has no previous DeltaCheckpoint. The previous delta can be referenced by getPrev().
Allows timeline branching by having one DeltaCheckpoint be the previous checkpoint of multiple other checkpoints.
Once this checkpoint becomes another's previous checkpoint, that checkpoint can be referenced (among the rest) through getNextDeltas().
Intended to be constructed and manipulated only by a FastCheckpointer instance.
Definition at line 371 of file DeltaCheckpoint.hpp.
|
inlinevirtual |
Destructor.
Prints a warning if checkpoint was not allowed to be deleted
Definition at line 459 of file DeltaCheckpoint.hpp.
|
inlinenoexcept |
Can this checkpoint be deleted Cannot be deleted if:
Definition at line 707 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtual |
Writes all checkpoint raw data to an ostream.
o | ostream to which raw data will be written |
Implements sparta::serialization::checkpoint::Checkpoint.
Definition at line 494 of file DeltaCheckpoint.hpp.
|
inline |
Dumps the restore chain for this checkpoint.
o | ostream to which chain data will be dumped |
Definition at line 503 of file DeltaCheckpoint.hpp.
|
inline |
Allows this checkpoint to be deleted if it is no longer a previous delta of some other delta (i.e. getNexts() returns an empty vector). Sets the checkpoint ID to invalid. Calling multiple times has no effect.
Definition at line 731 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtualnoexcept |
Returns memory usage by the content of this checkpoint.
Implements sparta::serialization::checkpoint::Checkpoint.
Definition at line 539 of file DeltaCheckpoint.hpp.
|
inlinenoexcept |
Return the ID had by this checkpoint before it was deleted If this checkpoint has not been flagged for deletion, this will be UNIDENTIFIED_CHECKPOINT.
Definition at line 754 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtual |
Gets the representation of this deleted checkpoint as part of a checkpoint chain (if that checkpointer supports deletion)
Reimplemented from sparta::serialization::checkpoint::Checkpoint.
Definition at line 764 of file DeltaCheckpoint.hpp.
|
inlinenoexcept |
Determines how many checkpoints away the closest, earlier snapshot is.
Definition at line 789 of file DeltaCheckpoint.hpp.
|
inline |
Returns a stack of checkpoints from this checkpoint as far back as possible until no previous link is found. This is a superset of getRestoreChain and contains checkpoints that do not actually need to be inspected for restoring this checkpoint's data. This may reach the head checkpoint if no gaps are encountered.
Definition at line 633 of file DeltaCheckpoint.hpp.
|
inline |
Returns a stack of checkpoints that must be restored from top-to-bottom to fully restore the state associated with this checkpoint.
Definition at line 649 of file DeltaCheckpoint.hpp.
|
inline |
Const-qualified version of getRestoreChain.
Definition at line 666 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtualnoexcept |
Returns memory usage by this checkpoint.
Implements sparta::serialization::checkpoint::Checkpoint.
Definition at line 530 of file DeltaCheckpoint.hpp.
|
inlinenoexcept |
Indicates whether this checkpoint has been flagged deleted.
Definition at line 745 of file DeltaCheckpoint.hpp.
|
inlinenoexcept |
Is this checkpoint a snapshot (contains ALL simulator state)
Definition at line 777 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtual |
Attempts to restore this checkpoint including any previous deltas (dependencies).
Uses loadState to restore state from each checkpoint in the restore chain.
Implements sparta::serialization::checkpoint::Checkpoint.
Definition at line 687 of file DeltaCheckpoint.hpp.
|
inlineprotected |
Loads delta state of this checkpoint to root. Does not look at any other checkpoints checkpoints.
Definition at line 842 of file DeltaCheckpoint.hpp.
|
inlineoverridevirtual |
Returns a string describing this object.
Reimplemented from sparta::serialization::checkpoint::Checkpoint.
Definition at line 472 of file DeltaCheckpoint.hpp.
|
inline |
Implement trace of a value across the restore chain as described in Checkpointer::traceValue.
Definition at line 550 of file DeltaCheckpoint.hpp.
|
friend |
DeltaCheckpoints can only be constructed by the FastCheckpointer.
Definition at line 448 of file DeltaCheckpoint.hpp.