mem-ruby: fix functionalRead on pending CU

Normally we don't check the TBE data if there are outstanding response
messages for the transaction because that means the latest valid data is
either in another cache or within an inflight message.
However this is not the case when we have either a pending CleanUnique
or we are handling CleanUnique. So bypass the pending message check in
this case.

Change-Id: I5f31039ca2a01a6a68fee8e0f3cf02c7e437b43e
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57395
Reviewed-by: Daecheol You <daecheol.you@samsung.com>
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
2022-03-02 17:43:00 -06:00
committed by Tiago Muck
parent 23888df8a9
commit dc33a16993

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 ARM Limited
* Copyright (c) 2021-2022 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -163,8 +163,15 @@ AccessPermission getAccessPermission(Addr addr) {
TBE tbe := getCurrentActiveTBE(addr);
if(is_valid(tbe)) {
assert(Cache_State_to_permission(tbe.state) == AccessPermission:Busy);
if (tbe.expected_req_resp.hasExpected() ||
tbe.expected_snp_resp.hasExpected()) {
// It's assumed that if all caches are in transient state, the latest data
// is 1) within an inflight message, then 2 ) in memory. But with
// CleanUnique there may be no inflight messages with data, so it needs
// special handling.
bool cu_requester_or_responder :=
(tbe.reqType == CHIRequestType:CleanUnique) ||
(tbe.pendReqType == CHIRequestType:CleanUnique);
if ((tbe.expected_req_resp.hasExpected() ||
tbe.expected_snp_resp.hasExpected()) && !cu_requester_or_responder) {
DPRINTF(RubySlicc, "%x %s,%s\n", addr, tbe.state, AccessPermission:Busy);
return AccessPermission:Busy;
}