mem-cache: Make findVictim non-const
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Fri, 19 Oct 2018 10:28:25 +0000 (12:28 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 17 Jan 2020 16:31:03 +0000 (16:31 +0000)
In order to acquire stats when a victim is found,
findVictim must be made const.

Change-Id: I493c7849f07625c90b2b95fd220f50751f4d0f52
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22604
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/tags/base.hh
src/mem/cache/tags/base_set_assoc.hh
src/mem/cache/tags/compressed_tags.cc
src/mem/cache/tags/compressed_tags.hh
src/mem/cache/tags/fa_lru.cc
src/mem/cache/tags/fa_lru.hh
src/mem/cache/tags/sector_tags.cc
src/mem/cache/tags/sector_tags.hh

index 0a9f16bd336232c43b11bc33589f3c42e872b014..88d08ca8f07242ac2e2b72ca621e20635bbc7e52 100644 (file)
@@ -280,7 +280,7 @@ class BaseTags : public ClockedObject
      */
     virtual CacheBlk* findVictim(Addr addr, const bool is_secure,
                                  const std::size_t size,
-                                 std::vector<CacheBlk*>& evict_blks) const = 0;
+                                 std::vector<CacheBlk*>& evict_blks) = 0;
 
     /**
      * Access block and update replacement data. May not succeed, in which case
index efb08caa6e2abee4005f5d51ebb2e99fd78ce3ba..094999404eed2fb9822f5fc8e7dc75a59570720f 100644 (file)
@@ -167,7 +167,7 @@ class BaseSetAssoc : public BaseTags
      */
     CacheBlk* findVictim(Addr addr, const bool is_secure,
                          const std::size_t size,
-                         std::vector<CacheBlk*>& evict_blks) const override
+                         std::vector<CacheBlk*>& evict_blks) override
     {
         // Get possible entries to be victimized
         const std::vector<ReplaceableEntry*> entries =
index 1394be8554d99aa13589212816b5f38e094bbd0b..1871a7ad602e0dcf7f1ab67883f10a9c1479a5a4 100644 (file)
@@ -103,7 +103,7 @@ CompressedTags::tagsInit()
 CacheBlk*
 CompressedTags::findVictim(Addr addr, const bool is_secure,
                            const std::size_t compressed_size,
-                           std::vector<CacheBlk*>& evict_blks) const
+                           std::vector<CacheBlk*>& evict_blks)
 {
     // Get all possible locations of this superblock
     const std::vector<ReplaceableEntry*> superblock_entries =
index 2c2a69987ba2ed9d960e90334d76a56cf46d7a34..cce76fc7be7460659d0691796c76c8eb8c2ea087 100644 (file)
@@ -109,7 +109,7 @@ class CompressedTags : public SectorTags
      */
     CacheBlk* findVictim(Addr addr, const bool is_secure,
                          const std::size_t compressed_size,
-                         std::vector<CacheBlk*>& evict_blks) const override;
+                         std::vector<CacheBlk*>& evict_blks) override;
 
     /**
      * Insert the new block into the cache and update replacement data.
index 5738dcb50722a627d0cecb4068b5f34d7c44fe7a..2b3ef1b5cb28b220419806a260600ad884c009f9 100644 (file)
@@ -197,7 +197,7 @@ FALRU::findBlockBySetAndWay(int set, int way) const
 
 CacheBlk*
 FALRU::findVictim(Addr addr, const bool is_secure, const std::size_t size,
-                  std::vector<CacheBlk*>& evict_blks) const
+                  std::vector<CacheBlk*>& evict_blks)
 {
     // The victim is always stored on the tail for the FALRU
     FALRUBlk* victim = tail;
index 2ca9f4da4c485cddad09302405e86c924e6c39ee..199a82f5fb74a34a3899782eacb35b236e70a9f3 100644 (file)
@@ -225,7 +225,7 @@ class FALRU : public BaseTags
      */
     CacheBlk* findVictim(Addr addr, const bool is_secure,
                          const std::size_t size,
-                         std::vector<CacheBlk*>& evict_blks) const override;
+                         std::vector<CacheBlk*>& evict_blks) override;
 
     /**
      * Insert the new block into the cache and update replacement data.
index 77fb53cdabaa9d67215dde1149da2a1b849d6baa..610cba8ce9b9b5b646b39dda19da7703edfe856b 100644 (file)
@@ -222,7 +222,7 @@ SectorTags::findBlock(Addr addr, bool is_secure) const
 
 CacheBlk*
 SectorTags::findVictim(Addr addr, const bool is_secure, const std::size_t size,
-                       std::vector<CacheBlk*>& evict_blks) const
+                       std::vector<CacheBlk*>& evict_blks)
 {
     // Get possible entries to be victimized
     const std::vector<ReplaceableEntry*> sector_entries =
index 13638b4a5e7422f21393347603acfcc849ee7c3c..905a87aaf242ef7beff95d0a0d5fc77353de238e 100644 (file)
@@ -157,7 +157,7 @@ class SectorTags : public BaseTags
      */
     CacheBlk* findVictim(Addr addr, const bool is_secure,
                          const std::size_t size,
-                         std::vector<CacheBlk*>& evict_blks) const override;
+                         std::vector<CacheBlk*>& evict_blks) override;
 
     /**
      * Calculate a block's offset in a sector from the address.