Classes | Enumerations
drain.hh File Reference
#include <atomic>
#include <mutex>
#include <vector>

Go to the source code of this file.


class  DrainManager
 This class coordinates draining of a System. More...
class  Drainable
 Interface for objects that might require draining before checkpointing. More...


enum  DrainState { DrainState::Running, DrainState::Draining, DrainState::Drained, DrainState::Resuming }
 Object drain/handover states. More...

Enumeration Type Documentation

◆ DrainState

enum DrainState

Object drain/handover states.

An object starts out in the Running state. When the simulator prepares to take a snapshot or prepares a CPU for handover, it calls the drain() method to transfer the object into the Draining or Drained state. If any object enters the Draining state (Drainable::drain() returning >0), simulation continues until it all objects have entered the Drained state.

Before resuming simulation, the simulator calls resume() to transfer the object to the Running state. This in turn results in a call to drainResume() for all Drainable objects in the simulator. New Drainable objects may be created while resuming. In such cases, the new objects will be created in the Resuming state and later resumed.

Even though the state of an object (visible to the rest of the world through Drainable::getState()) could be used to determine if all objects have entered the Drained state, the protocol is actually a bit more elaborate. See Drainable::drain() for details.

Running normally.


Draining buffers pending serialization/handover.


Buffers drained, ready for serialization/handover.

Definition at line 71 of file drain.hh.

Generated on Fri Apr 20 2018 09:05:04 for gem5 by doxygen 1.8.13