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 <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>
This commit is contained in:
Tiago Mück
2020-09-29 14:07:23 -05:00
parent 0183c58492
commit c1cb1f2f93

View 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