From c1cb1f2f936603b9b3efdb38b952c105b75b3650 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tiago=20M=C3=BCck?= Date: Tue, 29 Sep 2020 14:07:23 -0500 Subject: [PATCH] mem-ruby: fix functional reads in abstract ctrl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41153 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/slicc_interface/AbstractController.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index 1222631ca..b7da81e14 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -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 -- 2.30.2