mem-ruby: bug fix for stale WriteBack

Finish_CopyBack_Stale is scheduled only when the requestor is the last
sharer. This prevents the cacahe evicting the line which was already
evicted while the stale WriteBack transaction was stalled.
Wrong condition check in Finish_CopyBack_Stale for eviction is also
removed.

Change-Id: Ib66acc1b9e4a6f7cea373e1fb37375427897d48d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63611
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:
Daecheol You
2022-09-14 11:35:02 +09:00
parent db8641fd7b
commit e8ff8817e3

View File

@@ -891,7 +891,11 @@ action(Initiate_CopyBack_Stale, desc="") {
tbe.actions.pushNB(Event:SendCompDBIDRespStale);
tbe.actions.pushNB(Event:WriteFEPipe);
tbe.actions.push(Event:FinishCopyBack_Stale);
// eviction condition should be examined if it is the last sharer
if (tbe.dir_sharers.count() == 1) {
tbe.actions.push(Event:FinishCopyBack_Stale);
}
assert((tbe.dir_ownerExists == false) || (tbe.dir_owner != tbe.requestor));
}
@@ -900,7 +904,7 @@ action(Finish_CopyBack_Stale, desc="") {
// if it was the last known sharer and we don't have the data do the same
// the Initiate_Evict
if ((is_HN == false) && (tbe.dir_sharers.count() == 0) &&
tbe.dir_sharers.isElement(tbe.requestor) && (tbe.dataValid == false)) {
(tbe.dataValid == false)) {
tbe.actions.push(Event:SendEvict);
}
}