diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2018-04-20 17:15:41 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2018-06-08 09:33:39 +0000 |
commit | 815b12fb4aa45bfe8b38f96f923c150880bf9200 (patch) | |
tree | 38695d2a170fbc1b7096fbe7296e4257423d0910 /src/mem/cache/tags/base_set_assoc.hh | |
parent | b2d3cc00e84a07ac209f8357cd9c64235ce6abd3 (diff) | |
download | gem5-815b12fb4aa45bfe8b38f96f923c150880bf9200.tar.xz |
mem-cache: Use ReplaceableEntry in findBlockBySetAndWay
With a sector cache you can't find a block using only its set
and way, as there is the sector offset to take into account. As
all of these blocks inherit from ReplaceableEntry, the return
type of this function has been updated.
This function has also been declared closer to findBlock() due
to their similar functionality.
Change-Id: I4730a2b4ebb5738f7fc118201e208a1b9c3ba8e8
Reviewed-on: https://gem5-review.googlesource.com/10141
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/tags/base_set_assoc.hh')
-rw-r--r-- | src/mem/cache/tags/base_set_assoc.hh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mem/cache/tags/base_set_assoc.hh b/src/mem/cache/tags/base_set_assoc.hh index 830af6f3d..475566268 100644 --- a/src/mem/cache/tags/base_set_assoc.hh +++ b/src/mem/cache/tags/base_set_assoc.hh @@ -130,14 +130,6 @@ class BaseSetAssoc : public BaseTags void invalidate(CacheBlk *blk) override; /** - * Find the cache block given set and way - * @param set The set of the block. - * @param way The way of the block. - * @return The cache block. - */ - CacheBlk *findBlockBySetAndWay(int set, int way) const override; - - /** * Access block and update replacement data. May not succeed, in which case * nullptr is returned. This has all the implications of a cache * access and should only be used as such. Returns the access latency as a @@ -199,6 +191,15 @@ class BaseSetAssoc : public BaseTags CacheBlk* findBlock(Addr addr, bool is_secure) const override; /** + * Find a block given set and way. + * + * @param set The set of the block. + * @param way The way of the block. + * @return The block. + */ + ReplaceableEntry* findBlockBySetAndWay(int set, int way) const override; + + /** * Find replacement victim based on address. * * @param addr Address to find a victim for. |