Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/14877

Change subject: mem-cache: Add lookup latency to access' whenReady
......................................................................

mem-cache: Add lookup latency to access' whenReady

When dealing with writebacks, as soon as the packet metadata arrives
there will be a tag lookup, done sequentially because a write can't
be done in parallel. While the tag lookup is being done, the payload
will arrive. When both the payload are present and the tag is correct
block entry is determined the fill happens.

Change-Id: If1a0085d742458b675bfc012b6d908d9d9a25e32
Signed-off-by: Daniel R. Carvalho <oda...@yahoo.com.br>
---
M src/mem/cache/base.cc
1 file changed, 11 insertions(+), 4 deletions(-)



diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 9cb87a4..7198754 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -1034,9 +1034,12 @@
         pkt->writeDataToBlock(blk->data, blkSize);
         DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print());
         incHitCount(pkt);
-        // populate the time when the block will be ready to access.
+
+ // When the packet metadata arrives, the tag lookup will be done while + // the payload is arriving. Then the block will be ready to access as
+        // soon as the fill is done
         blk->setWhenReady(clockEdge(fillLatency) + pkt->headerDelay +
-            pkt->payloadDelay);
+ std::max(cyclesToTicks(tag_latency), (uint64_t)pkt->payloadDelay));
         return true;
     } else if (pkt->cmd == MemCmd::CleanEvict) {
         if (blk) {
@@ -1091,9 +1094,13 @@
         DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print());

         incHitCount(pkt);
-        // populate the time when the block will be ready to access.
+
+ // When the packet metadata arrives, the tag lookup will be done while + // the payload is arriving. Then the block will be ready to access as
+        // soon as the fill is done
         blk->setWhenReady(clockEdge(fillLatency) + pkt->headerDelay +
-            pkt->payloadDelay);
+ std::max(cyclesToTicks(tag_latency), (uint64_t)pkt->payloadDelay));
+
         // if this a write-through packet it will be sent to cache
         // below
         return !pkt->writeThrough();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14877
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: If1a0085d742458b675bfc012b6d908d9d9a25e32
Gerrit-Change-Number: 14877
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to