diff -r a5ede748a1d9 -r f576478175f1 src/mem/ruby/system/System.cc --- a/src/mem/ruby/system/System.cc Tue Oct 02 14:35:46 2012 -0500 +++ b/src/mem/ruby/system/System.cc Thu Oct 04 10:32:06 2012 -0500 @@ -354,8 +354,9 @@ Tick curtick_original = curTick(); // save the event queue head Event* eventq_head = eventq->replaceHead(NULL); - // set curTick to 0 + // set curTick to 0 and reset Ruby System's clock curTick(0); + resetClock(); // Schedule an event to start cache warmup enqueueRubyEvent(curTick()); @@ -369,8 +370,9 @@ m_memory_controller->reset(); // Restore eventq head eventq_head = eventq->replaceHead(eventq_head); - // Restore curTick + // Restore curTick and Ruby System's clock curTick(curtick_original); + resetClock(); } } diff -r a5ede748a1d9 -r f576478175f1 src/sim/clocked_object.hh --- a/src/sim/clocked_object.hh Tue Oct 02 14:35:46 2012 -0500 +++ b/src/sim/clocked_object.hh Thu Oct 04 10:32:06 2012 -0500 @@ -119,6 +119,18 @@ */ virtual ~ClockedObject() { } + /** + * Reset the object's clock using the current global tick value. Likely + * to be used only when the global clock is reset. Currently, this done + * only when Ruby is done warming up the memory system. + */ + void resetClock() const + { + Cycles elapsedCycles(divCeil(curTick(), clock)); + cycle = elapsedCycles; + tick = elapsedCycles * clock; + } + public: /**