mem-ruby: fix functional reads in abstract ctrl
authorTiago Mück <tiago.muck@arm.com>
Tue, 29 Sep 2020 19:07:23 +0000 (14:07 -0500)
committerTiago Mück <tiago.muck@arm.com>
Thu, 11 Feb 2021 17:11:33 +0000 (17:11 +0000)
When calling functionalMemoryRead we need to check the mem req. queue
first as it may have write data not yet forwarded to the memory port.

Change-Id: Id37aa0837a3462d92ae9ac3b45ca756b2c4f7d97
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41153
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/slicc_interface/AbstractController.cc

index 1222631ca870b425c3b349932924510a6a9845f5..b7da81e147997c2373ba10322ee0bb2e193631ff 100644 (file)
@@ -317,7 +317,10 @@ AbstractController::getPort(const std::string &if_name, PortID idx)
 void
 AbstractController::functionalMemoryRead(PacketPtr pkt)
 {
-    memoryPort.sendFunctional(pkt);
+    // read from mem. req. queue if write data is pending there
+    MessageBuffer *req_queue = getMemReqQueue();
+    if (!req_queue || !req_queue->functionalRead(pkt))
+        memoryPort.sendFunctional(pkt);
 }
 
 int