diff -r 68c00593de9f -r 17c5d6d4f124 src/mem/ruby/system/System.cc --- a/src/mem/ruby/system/System.cc Wed Jul 08 21:06:16 2015 +0100 +++ b/src/mem/ruby/system/System.cc Wed Jul 08 21:29:59 2015 +0100 @@ -161,7 +161,12 @@ list > original_events; while (!eventq->empty()) { Event *curr_head = eventq->getHead(); - original_events.push_back(make_pair(curr_head, curr_head->when())); + if (curr_head->isAutoDelete()) { + DPRINTF(RubyCacheTrace, "Event %s auto-deletes when descheduled," + " not recording\n", curr_head->name()); + } else { + original_events.push_back(make_pair(curr_head, curr_head->when())); + } eventq->deschedule(curr_head); } @@ -191,6 +196,17 @@ // No longer flushing back to memory. m_cooldown_enabled = false; + // There are several issues with continuing simulation after calling + // memWriteback() at the moment, that stem from taking events off the + // queue, simulating again, and then putting them back on, whilst + // pretending that no time has passed. One is that some events will have + // been deleted, so can't be put back. Another is that any object + // recording the tick something happens may end up storing a tick in the + // future. A simple warning here alerts the user that things may not work + // as expected. + warn_once("Ruby memory writeback is experimental. Continuing simulation " + "afterwards may not always work as intended."); + // Keep the cache recorder around so that we can dump the trace if a // checkpoint is immediately taken. } diff -r 68c00593de9f -r 17c5d6d4f124 src/sim/eventq.hh --- a/src/sim/eventq.hh Wed Jul 08 21:06:16 2015 +0100 +++ b/src/sim/eventq.hh Wed Jul 08 21:29:59 2015 +0100 @@ -338,6 +338,9 @@ /// See if this is a SimExitEvent (without resorting to RTTI) bool isExitEvent() const { return flags.isSet(IsExitEvent); } + /// Check whether this event will auto-delete + bool isAutoDelete() const { return flags.isSet(AutoDelete); } + /// Get the time that the event is scheduled Tick when() const { return _when; }