diff options
author | David Guillen-Fandos <david.guillen@arm.com> | 2015-07-30 03:41:42 -0400 |
---|---|---|
committer | David Guillen-Fandos <david.guillen@arm.com> | 2015-07-30 03:41:42 -0400 |
commit | 0c89c15b23d4db50eb08f8ebf2a40b569f41dd29 (patch) | |
tree | 9f5e2bcf48d88e940b9fea6b2fa9f37d05ea2741 /src/mem/cache/tags/fa_lru.hh | |
parent | 5a18e181ffb8fbef5f4aca8fb9a63ee6a7c9e0d6 (diff) | |
download | gem5-0c89c15b23d4db50eb08f8ebf2a40b569f41dd29.tar.xz |
mem: Make caches way aware
This patch makes cache sets aware of the way number. This enables
some nice features such as the ablity to restrict way allocation. The
implemented mechanism allows to set a maximum way number to be
allocated 'k' which must fulfill 0 < k <= N (where N is the number of
ways). In the future more sophisticated mechasims can be implemented.
Diffstat (limited to 'src/mem/cache/tags/fa_lru.hh')
-rw-r--r-- | src/mem/cache/tags/fa_lru.hh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index fd183ab03..1c6bd2431 100644 --- a/src/mem/cache/tags/fa_lru.hh +++ b/src/mem/cache/tags/fa_lru.hh @@ -236,6 +236,34 @@ public: } /** + * Return the number of sets this cache has + * @return The number of sets. + */ + unsigned + getNumSets() const + { + return 1; + } + + /** + * Return the number of ways this cache has + * @return The number of ways. + */ + unsigned + getNumWays() const + { + return numBlocks; + } + + /** + * 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; + + /** * Align an address to the block size. * @param addr the address to align. * @return The aligned address. |