diff --git a/src/mem/ruby/system/CacheMemory.cc b/src/mem/ruby/system/CacheMemory.cc --- a/src/mem/ruby/system/CacheMemory.cc +++ b/src/mem/ruby/system/CacheMemory.cc @@ -335,12 +335,12 @@ void CacheMemory::setMRU(const Address& address) { - Index cacheSet; + Index cacheSet = addressToCacheSet(address); + int loc = findTagInSet(cacheSet, address); - cacheSet = addressToCacheSet(address); - m_replacementPolicy_ptr-> - touch(cacheSet, findTagInSet(cacheSet, address), - g_eventQueue_ptr->getTime()); + if(loc != -1) + m_replacementPolicy_ptr-> + touch(cacheSet, loc, g_eventQueue_ptr->getTime()); } void diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -455,11 +455,9 @@ // Set this cache entry to the most recently used if (type == RubyRequestType_IFETCH) { - if (m_instCache_ptr->isTagPresent(request_line_address)) - m_instCache_ptr->setMRU(request_line_address); + m_instCache_ptr->setMRU(request_line_address); } else { - if (m_dataCache_ptr->isTagPresent(request_line_address)) - m_dataCache_ptr->setMRU(request_line_address); + m_dataCache_ptr->setMRU(request_line_address); } assert(g_eventQueue_ptr->getTime() >= issued_time);