Daniel Carvalho has uploaded this change for review. (
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
---
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(+), 22 deletions(-)
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh
index 1c6e666..1b07387 100644
--- a/src/mem/cache/tags/base.hh
+++ b/src/mem/cache/tags/base.hh
@@ -281,8 +281,6 @@
*/
virtual Addr regenerateBlkAddr(const CacheBlk* blk) const = 0;
- virtual int extractSet(Addr addr) const = 0;
-
virtual void forEachBlk(CacheBlkVisitor &visitor) = 0;
};
diff --git a/src/mem/cache/tags/base_set_assoc.hh
b/src/mem/cache/tags/base_set_assoc.hh
index 653a629..68ddef7 100644
--- a/src/mem/cache/tags/base_set_assoc.hh
+++ b/src/mem/cache/tags/base_set_assoc.hh
@@ -265,16 +265,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.
@@ -322,6 +312,18 @@
return;
}
}
+
+ 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 e5edee0..12ee211 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -244,16 +244,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: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev