Nikos Nikoleris has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/30097 )

Change subject: mem-cache: Add support for blocking on reads
......................................................................

mem-cache: Add support for blocking on reads

Change-Id: I1aab914956640e38e72df0da392cfaa9f95be0d6
Signed-off-by: Nikos Nikoleris <nikos.nikole...@arm.com>
---
M src/mem/cache/Cache.py
M src/mem/cache/base.cc
M src/mem/cache/base.hh
3 files changed, 13 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/Cache.py b/src/mem/cache/Cache.py
index a55ed2a..14668ea 100644
--- a/src/mem/cache/Cache.py
+++ b/src/mem/cache/Cache.py
@@ -79,6 +79,10 @@

     tag_latency = Param.Cycles("Tag lookup latency")
     data_latency = Param.Cycles("Data access latency")
+    block_on_reads = Param.Bool(False, "Block the cache for further "
+                                "read/writes until read completes")
+    data_read_latency = Param.Cycles(Self.data_latency,
+                                     "Data array read latency")
     block_on_fills = Param.Bool(False, "Block the cache for further "
                                 "read/writes until fill completes")
     fill_latency = Param.Cycles(Self.data_latency, "Fill latency")
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 6614d16..5a0075c 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -92,6 +92,8 @@
       lookupLatency(p->tag_latency),
       dataLatency(p->data_latency),
       forwardLatency(p->tag_latency),
+      blockOnReads(p->block_on_reads),
+      dataArrayReadLatency(p->data_read_latency),
       blockOnFills(p->block_on_fills),
       fillLatency(p->fill_latency),
       responseLatency(p->response_latency),
@@ -219,6 +221,10 @@
         assert(pkt->payloadDelay == 0);

         pkt->makeTimingResponse();
+        if (blockOnReads && pkt->isRead()) {
+            setBlocked(Blocked_DataArray);
+ schedule(dataArrayUnblockEvent, clockEdge(dataArrayReadLatency));
+        }

         // In this case we are considering request_time that takes
         // into account the delay of the xbar, if any, and just
diff --git a/src/mem/cache/base.hh b/src/mem/cache/base.hh
index 1f02c86..6d9b602 100644
--- a/src/mem/cache/base.hh
+++ b/src/mem/cache/base.hh
@@ -858,6 +858,9 @@
      */
     const Cycles forwardLatency;

+    const bool blockOnReads;
+    const Cycles dataArrayReadLatency;
+
     const bool blockOnFills;

     /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/30097
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1aab914956640e38e72df0da392cfaa9f95be0d6
Gerrit-Change-Number: 30097
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to