gpu-compute : Fix incorrect TLB stats when FunctionalTLB is used

When FunctionalTLB is used in SE mode, the stats tlbLatency and
tlbCycles report negative values. This patch fixes it by disabling the
updates that result in negative values when FunctionalTLB is set to true

Change-Id: I6962785fc1730b166b6d5b879e9c7618a8d6d4b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67202
Reviewed-by: Matt Sinclair <mattdsinclair.wisc@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Vishnu Ramadas
2023-01-09 12:48:42 -06:00
committed by VISHNU RAMADAS
parent 4e61a98336
commit d6bbccb60a

View File

@@ -1078,7 +1078,9 @@ ComputeUnit::sendRequest(GPUDynInstPtr gpuDynInst, PortID index, PacketPtr pkt)
fatal("pkt is not a read nor a write\n");
}
stats.tlbCycles -= curTick();
if (!functionalTLB) {
stats.tlbCycles -= curTick();
}
++stats.tlbRequests;
PortID tlbPort_index = perLaneTLB ? index : 0;