From: Nilay Vaish Date: Fri, 10 Feb 2012 17:29:02 +0000 (-0600) Subject: Ruby: Remove isTagPresent() calls from Sequencer.cc X-Git-Tag: stable_2012_06_28~245 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa513a4a99cb8dfc6b605797acbbb64a5601ab6e;p=gem5.git Ruby: Remove isTagPresent() calls from Sequencer.cc This patch removes the calls to isTagPresent() from Sequencer.cc. These calls are made just for setting the cache block to have been most recently used. The calls have been folded in to the function setMRU(). --- diff --git a/src/mem/ruby/system/CacheMemory.cc b/src/mem/ruby/system/CacheMemory.cc index 9f1fe6320..393612355 100644 --- a/src/mem/ruby/system/CacheMemory.cc +++ b/src/mem/ruby/system/CacheMemory.cc @@ -339,12 +339,12 @@ CacheMemory::lookup(const Address& address) const 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 index 1cd54d45c..5f64a1ba4 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -482,11 +482,9 @@ Sequencer::hitCallback(SequencerRequest* srequest, // 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);