gem5 v24.0.0.0
|
#include <drain.hh>
Public Member Functions | |
bool | tryDrain () |
Try to drain the system. | |
void | resume () |
Resume normal simulation in a Drained system. | |
void | preCheckpointRestore () |
Run state fixups before a checkpoint restore operation. | |
bool | isDrained () const |
Check if the system is drained. | |
DrainState | state () const |
Get the simulators global drain state. | |
void | signalDrainDone () |
Notify the DrainManager that a Drainable object has finished draining. | |
void | registerDrainable (Drainable *obj) |
void | unregisterDrainable (Drainable *obj) |
Static Public Member Functions | |
static DrainManager & | instance () |
Get the singleton DrainManager instance. | |
Private Member Functions | |
DrainManager () | |
DrainManager (DrainManager &)=delete | |
~DrainManager () | |
bool | allInState (DrainState state) const |
Helper function to check if all Drainable objects are in a specific state. | |
size_t | drainableCount () const |
Thread-safe helper function to get the number of Drainable objects in a system. | |
Private Attributes | |
std::mutex | globalLock |
Lock protecting the set of drainable objects. | |
std::vector< Drainable * > | _allDrainable |
Set of all drainable objects. | |
std::atomic_uint | _count |
Number of objects still draining. | |
DrainState | _state |
Global simulator drain state. | |
Static Private Attributes | |
static DrainManager | _instance |
Singleton instance of the drain manager. | |
|
privatedelete |
|
private |
|
private |
Thread-safe helper function to get the number of Drainable objects in a system.
Definition at line 189 of file drain.cc.
References _allDrainable, globalLock, and gem5::X86ISA::lock.
Referenced by preCheckpointRestore(), resume(), signalDrainDone(), and tryDrain().
|
inlinestatic |
Get the singleton DrainManager instance.
Definition at line 91 of file drain.hh.
References _instance.
Referenced by gem5::CxxConfigManager::drain(), gem5::CxxConfigManager::drainResume(), and gem5::init_drain().
void gem5::DrainManager::registerDrainable | ( | Drainable * | obj | ) |
Definition at line 160 of file drain.cc.
References _allDrainable, globalLock, and gem5::X86ISA::lock.
Referenced by gem5::Drainable::Drainable().
void gem5::DrainManager::unregisterDrainable | ( | Drainable * | obj | ) |
Definition at line 169 of file drain.cc.
References _allDrainable, globalLock, and gem5::X86ISA::lock.
Referenced by gem5::Drainable::~Drainable().
|
private |
Set of all drainable objects.
Definition at line 183 of file drain.hh.
Referenced by allInState(), drainableCount(), preCheckpointRestore(), registerDrainable(), resume(), tryDrain(), and unregisterDrainable().
|
private |
Number of objects still draining.
This is flagged atomic since it can be manipulated by SimObjects living in different threads.
Definition at line 190 of file drain.hh.
Referenced by resume(), signalDrainDone(), and tryDrain().
|
staticprivate |
Singleton instance of the drain manager.
Definition at line 196 of file drain.hh.
Referenced by instance().
|
private |
Global simulator drain state.
Definition at line 193 of file drain.hh.
Referenced by isDrained(), preCheckpointRestore(), resume(), state(), and tryDrain().
|
mutableprivate |
Lock protecting the set of drainable objects.
Definition at line 180 of file drain.hh.
Referenced by drainableCount(), registerDrainable(), and unregisterDrainable().