mem-ruby: Fix RubySystem::functionalRead with partial data

Some protocol other than CHI require the read-write and/or read-only and/or
backing-store controller's buffers to be checked if the system is busy.

More details in issue GEM5-1000

Change-Id: I0ad6385ad5a88fc158e68e4c63c540504b817ccb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46561
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:
Gabriel Busnot
2021-06-07 14:47:21 +02:00
committed by Gabriel Busnot
parent 9c2aac17b9
commit 40715206f4

View File

@@ -651,13 +651,21 @@ RubySystem::functionalRead(PacketPtr pkt)
for (auto ctrl : ctrl_ro)
ctrl->functionalRead(line_address, pkt, bytes);
ctrl_bs->functionalRead(line_address, pkt, bytes);
if (ctrl_bs)
ctrl_bs->functionalRead(line_address, pkt, bytes);
// if there is any busy controller or bytes still not set, then a partial
// and/or dirty copy of the line might be in a message buffer or the
// network
if (!ctrl_busy.empty() || !bytes.isFull()) {
DPRINTF(RubySystem, "Reading from busy controllers and network\n");
DPRINTF(RubySystem, "Reading from remaining controllers, "
"buffers and networks\n");
if (ctrl_rw != nullptr)
ctrl_rw->functionalReadBuffers(pkt, bytes);
for (auto ctrl : ctrl_ro)
ctrl->functionalReadBuffers(pkt, bytes);
if (ctrl_bs != nullptr)
ctrl_bs->functionalReadBuffers(pkt, bytes);
for (auto ctrl : ctrl_busy) {
ctrl->functionalRead(line_address, pkt, bytes);
ctrl->functionalReadBuffers(pkt, bytes);