From: Tiago Mück Date: Tue, 29 Sep 2020 19:07:23 +0000 (-0500) Subject: mem-ruby: fix functional reads in abstract ctrl X-Git-Tag: develop-gem5-snapshot~91 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1cb1f2f936603b9b3efdb38b952c105b75b3650;p=gem5.git mem-ruby: fix functional reads in abstract ctrl 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 --- 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