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

Change subject: mem-cache: Use findBlock in FALRU's block access
......................................................................

mem-cache: Use findBlock in FALRU's block access

An access must perform a block search, which is done by findBlock.

The tagHash is indexed by tags, so use extractTag instead of re-
implementing its functionality.

Change-Id: Ib5abacbc65cddf0f2d7e4440eb5355b56998a585
Reviewed-on: https://gem5-review.googlesource.com/10082
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/mem/cache/tags/fa_lru.cc
1 file changed, 6 insertions(+), 8 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved



diff --git a/src/mem/cache/tags/fa_lru.cc b/src/mem/cache/tags/fa_lru.cc
index f515c4d..6abae2b 100644
--- a/src/mem/cache/tags/fa_lru.cc
+++ b/src/mem/cache/tags/fa_lru.cc
@@ -139,10 +139,9 @@
                    CachesMask *in_caches_mask)
 {
     CachesMask mask = 0;
-    Addr blkAddr = blkAlign(addr);
-    FALRUBlk* blk = hashLookup(blkAddr);
+    FALRUBlk* blk = static_cast<FALRUBlk*>(findBlock(addr, is_secure));

-    if (blk && blk->isValid()) {
+    if (blk != nullptr) {
         // If a cache hit
         lat = accessLatency;
         // Check if the block to be accessed is available. If not,
@@ -153,13 +152,12 @@
             lat = cache->ticksToCycles(blk->whenReady - curTick()) +
             accessLatency;
         }
-        assert(blk->tag == blkAddr);
         mask = blk->inCachesMask;
+
         moveToHead(blk);
     } else {
         // If a cache miss
         lat = lookupLatency;
-        blk = nullptr;
     }
     if (in_caches_mask) {
         *in_caches_mask = mask;
@@ -174,11 +172,11 @@
 CacheBlk*
 FALRU::findBlock(Addr addr, bool is_secure) const
 {
-    Addr blkAddr = blkAlign(addr);
-    FALRUBlk* blk = hashLookup(blkAddr);
+    Addr tag = extractTag(addr);
+    FALRUBlk* blk = hashLookup(tag);

     if (blk && blk->isValid()) {
-        assert(blk->tag == blkAddr);
+        assert(blk->tag == tag);
         assert(blk->isSecure() == is_secure);
     } else {
         blk = nullptr;

--
To view, visit https://gem5-review.googlesource.com/10082
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: Ib5abacbc65cddf0f2d7e4440eb5355b56998a585
Gerrit-Change-Number: 10082
Gerrit-PatchSet: 3
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