gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Enumerations
drain.hh File Reference
#include <atomic>
#include <mutex>
#include <vector>

Go to the source code of this file.

Classes

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

Enumerations

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

Enumeration Type Documentation

enum DrainState
strong

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.

Note
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.
Enumerator
Running 
Draining 

Running normally.

Drained 

Draining buffers pending serialization/handover.

Resuming 

Buffers drained, ready for serialization/handover.

Definition at line 71 of file drain.hh.


Generated on Fri Jun 9 2017 13:03:59 for gem5 by doxygen 1.8.6