diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2018-10-18 15:31:51 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2018-11-14 21:02:08 +0000 |
commit | c6e0d8f54f1ce90933f95a7a3a875fed53b8ee3e (patch) | |
tree | 60bb086bf5b96e5c694eb662f0e34abeae26e6ad /src/mem/cache/tags/base.hh | |
parent | ea0f654923d13a2f81fe7c22eeca4c8cffae947a (diff) | |
download | gem5-c6e0d8f54f1ce90933f95a7a3a875fed53b8ee3e.tar.xz |
mem-cache: Move access latency calculation to Cache
Access latency was not being calculated properly, as it was
always assuming that for hits reads take as long as writes,
and that parallel accesses would produce the same latency
for read and write misses.
By moving the calculation to the Cache we can use the write/
read information, reduce latency variables duplication and
remove Cache dependency from Tags.
The tag lookup latency is still calculated by the Tags.
Change-Id: I71bc68fb5c3515b372c3bf002d61b6f048a45540
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/13697
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/tags/base.hh')
-rw-r--r-- | src/mem/cache/tags/base.hh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mem/cache/tags/base.hh b/src/mem/cache/tags/base.hh index a7a35ffbb..273abf5dc 100644 --- a/src/mem/cache/tags/base.hh +++ b/src/mem/cache/tags/base.hh @@ -79,12 +79,7 @@ class BaseTags : public ClockedObject const unsigned size; /** The tag lookup latency of the cache. */ const Cycles lookupLatency; - /** - * The total access latency of the cache. This latency - * is different depending on the cache access mode - * (parallel or sequential) - */ - const Cycles accessLatency; + /** Pointer to the parent cache. */ BaseCache *cache; @@ -293,6 +288,17 @@ class BaseTags : public ClockedObject virtual CacheBlk* findVictim(Addr addr, const bool is_secure, std::vector<CacheBlk*>& evict_blks) const = 0; + /** + * 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 tag lookup latency as a side + * effect. + * + * @param addr The address to find. + * @param is_secure True if the target memory space is secure. + * @param lat The latency of the tag lookup. + * @return Pointer to the cache block if found. + */ virtual CacheBlk* accessBlock(Addr addr, bool is_secure, Cycles &lat) = 0; /** |