Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2a7c1dec authored by Bobby R. Bruce's avatar Bobby R. Bruce
Browse files

misc: Tagged API methods in sim/drain.hh

Change-Id: Id584d0be027048064d5f650ae0f2ea5a7f075a47
Issue-on: https://gem5.atlassian.net/browse/GEM5-172
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27988


Reviewed-by: default avatarBobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: default avatarkokoro <noreply+kokoro@google.com>
parent 6a54bb72
Branches main
No related tags found
No related merge requests found
/**
* @defgroup api_drain The Drain API.
*
* These methods relate to the "Drainable" interface.
*/
...@@ -65,6 +65,8 @@ class Drainable; ...@@ -65,6 +65,8 @@ class Drainable;
* the world through Drainable::getState()) could be used to determine * the world through Drainable::getState()) could be used to determine
* if all objects have entered the Drained state, the protocol is * if all objects have entered the Drained state, the protocol is
* actually a bit more elaborate. See Drainable::drain() for details. * actually a bit more elaborate. See Drainable::drain() for details.
*
* @ingroup api_drain
*/ */
enum class DrainState { enum class DrainState {
Running, /** Running normally */ Running, /** Running normally */
...@@ -113,11 +115,15 @@ class DrainManager ...@@ -113,11 +115,15 @@ class DrainManager
* *
* @return true if all objects were drained successfully, false if * @return true if all objects were drained successfully, false if
* more simulation is needed. * more simulation is needed.
*
* @ingroup api_drain
*/ */
bool tryDrain(); bool tryDrain();
/** /**
* Resume normal simulation in a Drained system. * Resume normal simulation in a Drained system.
*
* @ingroup api_drain
*/ */
void resume(); void resume();
...@@ -131,18 +137,30 @@ class DrainManager ...@@ -131,18 +137,30 @@ class DrainManager
* state since the state isn't stored in checkpoints. This method * state since the state isn't stored in checkpoints. This method
* performs state fixups on all Drainable objects and the * performs state fixups on all Drainable objects and the
* DrainManager itself. * DrainManager itself.
*
* @ingroup api_drain
*/ */
void preCheckpointRestore(); void preCheckpointRestore();
/** Check if the system is drained */ /**
* Check if the system is drained
*
* @ingroup api_drain
*/
bool isDrained() const { return _state == DrainState::Drained; } bool isDrained() const { return _state == DrainState::Drained; }
/** Get the simulators global drain state */ /**
* Get the simulators global drain state
*
* @ingroup api_drain
*/
DrainState state() const { return _state; } DrainState state() const { return _state; }
/** /**
* Notify the DrainManager that a Drainable object has finished * Notify the DrainManager that a Drainable object has finished
* draining. * draining.
*
* @ingroup api_drain
*/ */
void signalDrainDone(); void signalDrainDone();
...@@ -246,11 +264,15 @@ class Drainable ...@@ -246,11 +264,15 @@ class Drainable
* @return DrainState::Drained if the object is drained at this * @return DrainState::Drained if the object is drained at this
* point in time, DrainState::Draining if it needs further * point in time, DrainState::Draining if it needs further
* simulation. * simulation.
*
* @ingroup api_drain
*/ */
virtual DrainState drain() = 0; virtual DrainState drain() = 0;
/** /**
* Resume execution after a successful drain. * Resume execution after a successful drain.
*
* @ingroup api_drain
*/ */
virtual void drainResume() {}; virtual void drainResume() {};
...@@ -261,6 +283,8 @@ class Drainable ...@@ -261,6 +283,8 @@ class Drainable
* into a state where it is ready to be drained. The method is * into a state where it is ready to be drained. The method is
* safe to call multiple times and there is no need to check that * safe to call multiple times and there is no need to check that
* draining has been requested before calling this method. * draining has been requested before calling this method.
*
* @ingroup api_drain
*/ */
void signalDrainDone() const { void signalDrainDone() const {
switch (_drainState) { switch (_drainState) {
...@@ -276,7 +300,11 @@ class Drainable ...@@ -276,7 +300,11 @@ class Drainable
} }
public: public:
/** Return the current drain state of an object. */ /**
* Return the current drain state of an object.
*
* @ingroup api_drain
*/
DrainState drainState() const { return _drainState; } DrainState drainState() const { return _drainState; }
/** /**
...@@ -290,6 +318,8 @@ class Drainable ...@@ -290,6 +318,8 @@ class Drainable
* *
* This method is only called in the child of the fork. The call * This method is only called in the child of the fork. The call
* takes place in a drained system. * takes place in a drained system.
*
* @ingroup api_drain
*/ */
virtual void notifyFork() {}; virtual void notifyFork() {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment