From 2d6470936ca06310b213117159fa0010259708cd Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Fri, 16 Nov 2012 10:27:47 -0600 Subject: sim: have a curTick per eventq This patch adds a _curTick variable to an eventq. This variable is updated whenever an event is serviced in function serviceOne(), or all events upto a particular time are processed in function serviceEvents(). This change helps when there are eventqs that do not make use of curTick for scheduling events. --- src/sim/eventq.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/sim/eventq.cc') diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc index b32b330e7..d81937a86 100644 --- a/src/sim/eventq.cc +++ b/src/sim/eventq.cc @@ -42,7 +42,7 @@ #include "cpu/smt.hh" #include "debug/Config.hh" #include "sim/core.hh" -#include "sim/eventq.hh" +#include "sim/eventq_impl.hh" using namespace std; @@ -201,6 +201,9 @@ EventQueue::serviceOne() // handle action if (!event->squashed()) { + // forward current cycle to the time when this event occurs. + setCurTick(event->when()); + event->process(); if (event->isExitEvent()) { assert(!event->flags.isSet(Event::AutoDelete) || @@ -429,5 +432,5 @@ Event::dump() const } EventQueue::EventQueue(const string &n) - : objName(n), head(NULL) + : objName(n), head(NULL), _curTick(0) {} -- cgit v1.2.3