From 9f5c0f2822fcd030e0c010d22002205b8b1b0ba3 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Mon, 5 Sep 2022 10:30:20 -0700 Subject: [PATCH] gpu-compute: dprint instruction requesting translation When debugging strange addresses, it is extremely useful to know *what* instruction calculated that address. This make it much easier to follow assembly code backwards to find the source of an incorrect address. This change adds a DPRINTF for GPUTLB that by default prints the disassembly when a virtual address translation is sent to the TLB. Change-Id: I5066c064a48c5c48696863eeccd8d011245ef7b2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63176 Reviewed-by: Matt Sinclair Maintainer: Matt Sinclair Tested-by: kokoro --- src/gpu-compute/compute_unit.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc index 1b20530a8a..8498ea475e 100644 --- a/src/gpu-compute/compute_unit.cc +++ b/src/gpu-compute/compute_unit.cc @@ -1183,9 +1183,10 @@ ComputeUnit::sendRequest(GPUDynInstPtr gpuDynInst, PortID index, PacketPtr pkt) tlbPort[tlbPort_index].retries.push_back(pkt); } else { - DPRINTF(GPUTLB, - "CU%d: WF[%d][%d]: Translation for addr %#x sent!\n", - cu_id, gpuDynInst->simdId, gpuDynInst->wfSlotId, tmp_vaddr); + DPRINTF(GPUTLB, "CU%d: WF[%d][%d]: Translation for addr %#x from " + "instruction %s sent!\n", cu_id, gpuDynInst->simdId, + gpuDynInst->wfSlotId, tmp_vaddr, + gpuDynInst->disassemble().c_str()); } } else { if (pkt->cmd == MemCmd::MemSyncReq) {