ruby: allocate a block in CacheMemory without updating LRU state
authorDavid Hashe <david.hashe@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
committerDavid Hashe <david.hashe@amd.com>
Mon, 20 Jul 2015 14:15:18 +0000 (09:15 -0500)
src/mem/protocol/RubySlicc_Types.sm
src/mem/ruby/structures/CacheMemory.cc
src/mem/ruby/structures/CacheMemory.hh

index 51f99b60383968f2c926b03674b60a5d4a1673fa..6c3c4168d181486df373fe9f18e55fc8de2a9155 100644 (file)
@@ -146,6 +146,7 @@ structure (CacheMemory, external = "yes") {
   bool cacheAvail(Address);
   Address cacheProbe(Address);
   AbstractCacheEntry allocate(Address, AbstractCacheEntry);
+  AbstractCacheEntry allocate(Address, AbstractCacheEntry, bool);
   void allocateVoid(Address, AbstractCacheEntry);
   void deallocate(Address);
   AbstractCacheEntry lookup(Address);
index 486b5ae97a6ef51b8bee0eb0b41ad34391873ad6..c802d8fb6ad0e0a5f15b77d8bf9a843a7b87df21 100644 (file)
@@ -251,7 +251,7 @@ CacheMemory::cacheAvail(const Address& address) const
 }
 
 AbstractCacheEntry*
-CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
+CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry, bool touch)
 {
     assert(address == line_address(address));
     assert(!isTagPresent(address));
@@ -271,7 +271,9 @@ CacheMemory::allocate(const Address& address, AbstractCacheEntry* entry)
             set[i]->m_locked = -1;
             m_tag_index[address] = i;
 
-            m_replacementPolicy_ptr->touch(cacheSet, i, curTick());
+            if (touch) {
+                m_replacementPolicy_ptr->touch(cacheSet, i, curTick());
+            }
 
             return entry;
         }
index 82bb65776e40c452dbcb881459c6f8749026829f..c9c20d8b8c6588fcfdb73a81a58eb64c59ccb56d 100644 (file)
@@ -74,10 +74,16 @@ class CacheMemory : public SimObject
     bool cacheAvail(const Address& address) const;
 
     // find an unused entry and sets the tag appropriate for the address
-    AbstractCacheEntry* allocate(const Address& address, AbstractCacheEntry* new_entry);
+    AbstractCacheEntry* allocate(const Address& address,
+                                 AbstractCacheEntry* new_entry, bool touch);
+    AbstractCacheEntry* allocate(const Address& address,
+                                 AbstractCacheEntry* new_entry)
+    {
+        return allocate(address, new_entry, true);
+    }
     void allocateVoid(const Address& address, AbstractCacheEntry* new_entry)
     {
-        allocate(address, new_entry);
+        allocate(address, new_entry, true);
     }
 
     // Explicitly free up this address