summaryrefslogtreecommitdiff
path: root/src/sim/sim_events.hh
diff options
context:
space:
mode:
authorDam Sunwoo <dam.sunwoo@arm.com>2013-10-31 13:41:13 -0500
committerDam Sunwoo <dam.sunwoo@arm.com>2013-10-31 13:41:13 -0500
commit6b4543184ea4203f44210f8061b888d8d683979a (patch)
treed9cba5515acc22363ffd7261e482e36e2f783d04 /src/sim/sim_events.hh
parent19c2a606fadbf04d1839eec738bbabccb218c7f3 (diff)
downloadgem5-6b4543184ea4203f44210f8061b888d8d683979a.tar.xz
sim: added option to serialize SimLoopExitEvent
SimLoopExitEvents weren't serialized by default. Some benchmarks utilize a delayed m5 exit pseudo op call to terminate the simulation and this event was lost when resuming from a checkpoint generated after the pseudo op call. This patch adds the capability to serialize the SimLoopExitEvents and enable serialization for m5_exit and m5_fail pseudo ops by default. Does not affect other generic SimLoopExitEvents.
Diffstat (limited to 'src/sim/sim_events.hh')
-rw-r--r--src/sim/sim_events.hh23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sim/sim_events.hh b/src/sim/sim_events.hh
index 6ea361a05..4abfb317c 100644
--- a/src/sim/sim_events.hh
+++ b/src/sim/sim_events.hh
@@ -1,4 +1,16 @@
/*
+ * Copyright (c) 2013 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
*
@@ -32,6 +44,7 @@
#define __SIM_SIM_EVENTS_HH__
#include "sim/eventq.hh"
+#include "sim/serialize.hh"
//
// Event to terminate simulation at a particular cycle/instruction
@@ -45,7 +58,10 @@ class SimLoopExitEvent : public Event
Tick repeat;
public:
- SimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0);
+ // non-scheduling version for createForUnserialize()
+ SimLoopExitEvent();
+ SimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0,
+ bool serialize = false);
std::string getCause() { return cause; }
int getCode() { return code; }
@@ -53,6 +69,11 @@ class SimLoopExitEvent : public Event
void process(); // process event
virtual const char *description() const;
+
+ virtual void serialize(std::ostream &os);
+ virtual void unserialize(Checkpoint *cp, const std::string &section);
+ static Serializable *createForUnserialize(Checkpoint *cp,
+ const std::string &section);
};
class CountedDrainEvent : public Event