changeset cd22d66592bf in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=cd22d66592bf
description:
        sim: Initialize Drainable::_drainState to the system's state

        It is sometimes desirable to be able to instantiate Drainable objects
        when the simulator isn't in the Running state. Currently, we always
        initialize Drainable objects to the Running state. However, this
        confuses many of the sanity checks in the base class since objects
        aren't expected to be in the Running state if the system is in the
        Draining or Drained state.

        Instead of always initializing the state variable in Drainable to
        DrainState::Running, initialize it to the state the DrainManager is
        in.

        Note: This means an object can be created in the Draining/Drained
        state without first calling drain().

diffstat:

 src/sim/drain.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 32a40cc147ef -r cd22d66592bf src/sim/drain.cc
--- a/src/sim/drain.cc  Tue Aug 04 10:29:13 2015 +0100
+++ b/src/sim/drain.cc  Tue Aug 04 10:31:37 2015 +0100
@@ -150,7 +150,7 @@
 
 Drainable::Drainable()
     : _drainManager(DrainManager::instance()),
-      _drainState(DrainState::Running)
+      _drainState(_drainManager.state())
 {
     _drainManager.registerDrainable(this);
 }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to