Daniel Carvalho has submitted this change and it was merged. ( https://gem5-review.googlesource.com/9962 )

Change subject: mem-cache: Privatize extractSet
......................................................................

mem-cache: Privatize extractSet

Only BaseSetAssoc uses extractSet(). Besides, skewed caches need
the way information to know which set an address is located at.

Change-Id: Id222e907dc550d053018561bb2683cfc415471ec
Reviewed-on: https://gem5-review.googlesource.com/9962
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
---
M src/mem/cache/tags/base.hh
M src/mem/cache/tags/base_set_assoc.hh
M src/mem/cache/tags/fa_lru.hh
3 files changed, 12 insertions(+), 23 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved



diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 90469cd..358ad10 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -288,9 +288,6 @@
      */
     virtual Addr regenerateBlkAddr(const CacheBlk* blk) const = 0;

-    virtual int extractSet(Addr addr) const = 0;
-
-
     /**
      * Visit each block in the tags and apply a visitor
      *
diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh
index 33b2d39..830af6f 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -279,16 +279,6 @@
     }

     /**
-     * Calculate the set index from the address.
-     * @param addr The address to get the set from.
-     * @return The set index of the address.
-     */
-    int extractSet(Addr addr) const override
-    {
-        return ((addr >> setShift) & setMask);
-    }
-
-    /**
      * Regenerate the block address from the tag and set.
      *
      * @param block The block.
@@ -313,6 +303,18 @@
         }
         return false;
     }
+
+  private:
+    /**
+     * Calculate the set index from the address.
+     *
+     * @param addr The address to get the set from.
+     * @return The set index of the address.
+     */
+    int extractSet(Addr addr) const
+    {
+        return ((addr >> setShift) & setMask);
+    }
 };

 #endif //__MEM_CACHE_TAGS_BASE_SET_ASSOC_HH__
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index e063a6c..dbb39b7 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -221,16 +221,6 @@
     }

     /**
- * Return the set of an address. Only one set in a fully associative cache.
-     * @param addr The address to get the set from.
-     * @return 0.
-     */
-    int extractSet(Addr addr) const override
-    {
-        return 0;
-    }
-
-    /**
      * Regenerate the block address from the tag.
      *
      * @param block The block.

--
To view, visit https://gem5-review.googlesource.com/9962
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Id222e907dc550d053018561bb2683cfc415471ec
Gerrit-Change-Number: 9962
Gerrit-PatchSet: 4
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to