changeset ed6e2905720b in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=ed6e2905720b
description:
        eventq: add a function for replacing head of the queue
        This patch adds a function for replacing the event at the head of the 
queue
        with another event. This helps in running a different set of events. 
Events
        already scheduled can processed by replacing the original head event 
back.
        This function has been specifically added to support cache warmup and
        cooldown required for creating and restoring checkpoints.

diffstat:

 src/sim/eventq.cc |   8 ++++++++
 src/sim/eventq.hh |  10 ++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r e59fe7c6cd57 -r ed6e2905720b src/sim/eventq.cc
--- a/src/sim/eventq.cc Thu Jan 05 11:00:45 2012 -0600
+++ b/src/sim/eventq.cc Thu Jan 05 11:02:56 2012 -0600
@@ -373,6 +373,14 @@
     return true;
 }
 
+Event*
+EventQueue::replaceHead(Event* s)
+{
+    Event* t = head;
+    head = s;
+    return t;
+}
+
 void
 dumpMainQueue()
 {
diff -r e59fe7c6cd57 -r ed6e2905720b src/sim/eventq.hh
--- a/src/sim/eventq.hh Thu Jan 05 11:00:45 2012 -0600
+++ b/src/sim/eventq.hh Thu Jan 05 11:02:56 2012 -0600
@@ -408,6 +408,16 @@
 
     bool debugVerify() const;
 
+    /**
+     *  function for replacing the head of the event queue, so that a
+     *  different set of events can run without disturbing events that have
+     *  already been scheduled. Already scheduled events can be processed
+     *  by replacing the original head back.
+     *  USING THIS FUNCTION CAN BE DANGEROUS TO THE HEALTH OF THE SIMULATOR.
+     *  NOT RECOMMENDED FOR USE.
+     */
+    Event* replaceHead(Event* s);
+
 #ifndef SWIG
     virtual void serialize(std::ostream &os);
     virtual void unserialize(Checkpoint *cp, const std::string &section);
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to