mem-ruby: Provide a fromSequencer helper function

Based on the CHIRequestType, it automatically tells if the
request has been originated from the sequencer
(CPU load/fetch/store)

Change-Id: I50fd116c8b1a995b1c37e948cd96db60c027fe66
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Giacomo Travaglini
2023-08-30 09:49:46 +01:00
parent 5dbc48432f
commit f032eeae93
2 changed files with 7 additions and 3 deletions

View File

@@ -3155,9 +3155,7 @@ action(Profile_OutgoingEnd_DatalessResp, desc="") {
action(TagArrayRead, desc="") {
assert(is_valid(tbe));
tbe.delayNextAction := curTick() + cyclesToTicks(
tagLatency((tbe.reqType == CHIRequestType:Load) ||
(tbe.reqType == CHIRequestType:Store) ||
(tbe.reqType == CHIRequestType:StoreLine)));
tagLatency(fromSequencer(tbe.reqType)));
}
action(TagArrayWrite, desc="") {

View File

@@ -299,6 +299,12 @@ Cycles dataLatency() {
return cache.getDataLatency();
}
bool fromSequencer(CHIRequestType reqType) {
return reqType == CHIRequestType:Load ||
reqType == CHIRequestType:Store ||
reqType == CHIRequestType:StoreLine;
}
bool inCache(Addr addr) {
CacheEntry entry := getCacheEntry(makeLineAddress(addr));
// NOTE: we consider data for the addr to be in cache if it exists in local,