summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/CacheMemory.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2012-02-10 11:29:02 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2012-02-10 11:29:02 -0600
commitaa513a4a99cb8dfc6b605797acbbb64a5601ab6e (patch)
treeb0a7d8175aaffd5e3a58d5d88db8ad8bedd676c7 /src/mem/ruby/system/CacheMemory.cc
parent69d8600bf80ce065feccbac6d55e45db62f1654f (diff)
downloadgem5-aa513a4a99cb8dfc6b605797acbbb64a5601ab6e.tar.xz
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().
Diffstat (limited to 'src/mem/ruby/system/CacheMemory.cc')
-rw-r--r--src/mem/ruby/system/CacheMemory.cc10
1 files changed, 5 insertions, 5 deletions
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