sim: Updated ClockedObject power state warning
authorJason Lowe-Power <jason@lowepower.com>
Tue, 20 Jun 2017 16:01:08 +0000 (11:01 -0500)
committerJason Lowe-Power <jason@lowepower.com>
Wed, 21 Jun 2017 13:57:21 +0000 (13:57 +0000)
To prevent this warning from printing for *every* simulation, this patch
adds a check to only print the warning if we are not at the beginning of
simulation.

Change-Id: I7f6154f0ca26bef6280f909f799aa1c7936b624a
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/3840
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/sim/clocked_object.cc

index f0b176509bda745aebf5db348a7b893af2258fbe..ddf9e0f4d1dc12143f89afb8104db455914f488a 100644 (file)
@@ -90,7 +90,7 @@ ClockedObject::pwrState(Enums::PwrState p)
     // same tick if other conditions are not met elsewhere.
     // Any state change related stats would have been recorded on previous call
     // to the pwrState() function.
-    if (prvEvalTick == curTick()) {
+    if (prvEvalTick == curTick() && curTick() != 0) {
         warn("ClockedObject: More than one power state change request "\
              "encountered within the same simulation tick");
         _currPwrState = p;