Go to the documentation of this file.
44 #include "debug/Drain.hh"
64 "Trying to drain a drained system\n");
67 "Drain counter must be zero at the start of a drain cycle\n");
76 DPRINTF(Drain,
"Failed to drain %s\n", temp->
name());
82 DPRINTF(Drain,
"Drain done.\n");
86 DPRINTF(Drain,
"Need another drain cycle. %u/%u objects not ready.\n",
96 "Trying to resume a system that is already running\n");
99 "Resuming a system that isn't fully drained, this is untested and "
100 "likely to break\n");
103 "Resuming a system that is already trying to resume. This should "
107 "Resume called in the middle of a drain cycle. %u objects "
108 "left to drain.\n",
_count);
123 obj->dmDrainResume();
135 "preCheckpointRestore() called on a system that isn't in the "
138 DPRINTF(Drain,
"Applying pre-restore fixes to %u objects.\n",
178 if (obj->drainState() !=
state)
196 _drainState(_drainManager.state())
222 "Trying to resume an object that hasn't been drained\n");
void registerDrainable(Drainable *obj)
void signalDrainDone()
Notify the DrainManager that a Drainable object has finished draining.
@ Running
Running normally.
bool tryDrain()
Try to drain the system.
DrainState dmDrain()
DrainManager interface to request a drain operation.
void resume()
Resume normal simulation in a Drained system.
@ Drained
Buffers drained, ready for serialization/handover.
static DrainManager _instance
Singleton instance of the drain manager.
DrainState
Object drain/handover states.
virtual void drainResume()
Resume execution after a successful drain.
DrainState _drainState
Current drain state of the object.
std::atomic_uint _count
Number of objects still draining.
void unregisterDrainable(Drainable *obj)
Interface for objects that might require draining before checkpointing.
virtual DrainState drain()=0
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
bool allInState(DrainState state) const
Helper function to check if all Drainable objects are in a specific state.
DrainState _state
Global simulator drain state.
virtual const std::string name() const
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
DrainState state() const
Get the simulators global drain state.
void dmDrainResume()
DrainManager interface to request a resume operation.
void preCheckpointRestore()
Run state fixups before a checkpoint restore operation.
DrainManager & _drainManager
Convenience reference to the drain manager.
std::vector< Drainable * > _allDrainable
Set of all drainable objects.
@ Resuming
Transient state while the simulator is resuming.
std::mutex globalLock
Lock protecting the set of drainable objects.
size_t drainableCount() const
Thread-safe helper function to get the number of Drainable objects in a system.
@ Draining
Draining buffers pending serialization/handover.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17