From d6bbccb60a656cc63a8ccb9800672aab411d723b Mon Sep 17 00:00:00 2001 From: Vishnu Ramadas Date: Mon, 9 Jan 2023 12:48:42 -0600 Subject: [PATCH] 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 Maintainer: Matt Sinclair Maintainer: Matthew Poremba Reviewed-by: Matthew Poremba Tested-by: kokoro --- src/gpu-compute/compute_unit.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc index 62cfbf94cf..06fe28f5b8 100644 --- a/src/gpu-compute/compute_unit.cc +++ b/src/gpu-compute/compute_unit.cc @@ -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;