From 0a5ed3076a2022406a9bef7fa9677dc38c4155ca Mon Sep 17 00:00:00 2001 From: adarshpatil Date: Wed, 27 May 2020 21:43:08 +0100 Subject: [PATCH] mem-ruby: Fix for Invalid transition in MOESI_CMP_directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Send the correct sharer count from the memory directory to the requesting L2 cache in data message reply. Jira issue: https://gem5.atlassian.net/browse/GEM5-613 Change-Id: If76de630fd0001816e8836d9bf77961a94faaa7c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29552 Maintainer: Jason Lowe-Power Reviewed-by: Pouya Fotouhi Reviewed-by: Tiago Mück Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/protocol/MOESI_CMP_directory-dir.sm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/protocol/MOESI_CMP_directory-dir.sm b/src/mem/ruby/protocol/MOESI_CMP_directory-dir.sm index 3b09cbfa5..03010d53a 100644 --- a/src/mem/ruby/protocol/MOESI_CMP_directory-dir.sm +++ b/src/mem/ruby/protocol/MOESI_CMP_directory-dir.sm @@ -469,7 +469,11 @@ machine(MachineType:Directory, "Directory protocol") out_msg.Destination.add(in_msg.OriginalRequestorMachId); out_msg.DataBlk := in_msg.DataBlk; out_msg.Dirty := false; // By definition, the block is now clean - out_msg.Acks := in_msg.Acks; + if (getDirectoryEntry(in_msg.addr).Sharers.isElement(in_msg.OriginalRequestorMachId) == true) { + out_msg.Acks := (getDirectoryEntry(in_msg.addr).Sharers.count()) - 1; + } else { + out_msg.Acks := getDirectoryEntry(in_msg.addr).Sharers.count(); + } if (in_msg.ReadX) { out_msg.Type := CoherenceResponseType:DATA_EXCLUSIVE; } else { -- 2.30.2