changeset d9560edaf0a9 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=d9560edaf0a9
description:
sim: Remove autoserialize support for exit events
This changeset removes the support for the autoserialize parameter in
GlobalSimLoopExitEvent (including exitSimLoop()) and
LocalSimLoopExitEvent.
Auto-serialization of the LocalSimLoopExitEvent was never used, so
this is not expected to affect anything. However, it was sometimes
used for GlobalSimLoopExitEvent. Unfortunately, serialization of
global events has never been supported, so checkpoints with such
events will currently cause simulation panics.
The serialize parameter to exitSimLoop() has been left in-place to
maintain API compatibility (removing it would affect m5ops). Instead
of just dropping it, we now print a warning if the parameter is set
and the exit event is scheduled in the future (i.e., not at the
current tick).
diffstat:
src/sim/sim_events.cc | 30 ++++++++----------------------
src/sim/sim_events.hh | 5 ++---
2 files changed, 10 insertions(+), 25 deletions(-)
diffs (87 lines):
diff -r c5388db11c76 -r d9560edaf0a9 src/sim/sim_events.cc
--- a/src/sim/sim_events.cc Tue Sep 01 13:40:28 2015 +0100
+++ b/src/sim/sim_events.cc Tue Sep 01 13:41:45 2015 +0100
@@ -55,9 +55,8 @@
GlobalSimLoopExitEvent::GlobalSimLoopExitEvent(Tick when,
const std::string &_cause,
- int c, Tick r, bool serialize)
- : GlobalEvent(when, Sim_Exit_Pri,
- IsExitEvent | (serialize ? AutoSerialize : 0)),
+ int c, Tick r)
+ : GlobalEvent(when, Sim_Exit_Pri, IsExitEvent),
cause(_cause), code(c), repeat(r)
{
}
@@ -83,19 +82,16 @@
exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat,
bool serialize)
{
- new GlobalSimLoopExitEvent(when + simQuantum, message, exit_code, repeat,
- serialize);
-}
+ warn_if(serialize && (when != curTick() || repeat),
+ "exitSimLoop called with a delay and auto serialization. This is "
+ "currently unsupported.");
-LocalSimLoopExitEvent::LocalSimLoopExitEvent()
- : Event(Sim_Exit_Pri, IsExitEvent | AutoSerialize),
- cause(""), code(0), repeat(0)
-{
+ new GlobalSimLoopExitEvent(when + simQuantum, message, exit_code, repeat);
}
LocalSimLoopExitEvent::LocalSimLoopExitEvent(const std::string &_cause, int c,
- Tick r, bool serialize)
- : Event(Sim_Exit_Pri, IsExitEvent | (serialize ? AutoSerialize : 0)),
+ Tick r)
+ : Event(Sim_Exit_Pri, IsExitEvent),
cause(_cause), code(c), repeat(r)
{
}
@@ -119,7 +115,6 @@
void
LocalSimLoopExitEvent::serialize(CheckpointOut &cp) const
{
- paramOut(cp, "type", string("SimLoopExitEvent"));
Event::serialize(cp);
SERIALIZE_SCALAR(cause);
@@ -137,15 +132,6 @@
UNSERIALIZE_SCALAR(repeat);
}
-Serializable *
-LocalSimLoopExitEvent::createForUnserialize(CheckpointIn &cp,
- const string §ion)
-{
- return new LocalSimLoopExitEvent();
-}
-
-REGISTER_SERIALIZEABLE("LocalSimLoopExitEvent", LocalSimLoopExitEvent)
-
//
// constructor: automatically schedules at specified time
//
diff -r c5388db11c76 -r d9560edaf0a9 src/sim/sim_events.hh
--- a/src/sim/sim_events.hh Tue Sep 01 13:40:28 2015 +0100
+++ b/src/sim/sim_events.hh Tue Sep 01 13:41:45 2015 +0100
@@ -63,7 +63,7 @@
// non-scheduling version for createForUnserialize()
GlobalSimLoopExitEvent();
GlobalSimLoopExitEvent(Tick when, const std::string &_cause, int c,
- Tick repeat = 0, bool serialize = false);
+ Tick repeat = 0);
const std::string getCause() const { return cause; }
const int getCode() const { return code; }
@@ -83,8 +83,7 @@
public:
LocalSimLoopExitEvent();
- LocalSimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0,
- bool serialize = false);
+ LocalSimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0);
const std::string getCause() const { return cause; }
const int getCode() const { return code; }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev