From 833392e7b2cd32410405880909ccfb0004b65814 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Fri, 15 Mar 2024 17:38:23 -0500 Subject: [PATCH] mem-ruby,gpu-compute: Allow memory reqs without inst The GPUDynInst for sending memory requests through the CUs data port is required but only used for DPRINTFs. Relax this constraint so that the methods can be reused for requests such as probes generated by the GPU device. Change-Id: I16094e400968225596370b684d6471580888d98a --- src/gpu-compute/compute_unit.cc | 22 +++++++++++++--------- src/mem/ruby/system/GPUCoalescer.cc | 6 +++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc index e485aa6161..90090a9288 100644 --- a/src/gpu-compute/compute_unit.cc +++ b/src/gpu-compute/compute_unit.cc @@ -1701,16 +1701,20 @@ ComputeUnit::DataPort::processMemReqEvent(PacketPtr pkt) } else if (!(sendTimingReq(pkt))) { retries.push_back(std::make_pair(pkt, gpuDynInst)); - DPRINTF(GPUPort, - "CU%d: WF[%d][%d]: index %d, addr %#x data req failed!\n", - compute_unit->cu_id, gpuDynInst->simdId, gpuDynInst->wfSlotId, - id, pkt->req->getPaddr()); + if (gpuDynInst) { + DPRINTF(GPUPort, + "CU%d: WF[%d][%d]: index %d, addr %#x data req failed!\n", + compute_unit->cu_id, gpuDynInst->simdId, + gpuDynInst->wfSlotId, id, pkt->req->getPaddr()); + } } else { - DPRINTF(GPUPort, - "CU%d: WF[%d][%d]: gpuDynInst: %d, index %d, addr %#x data " - "req sent!\n", compute_unit->cu_id, gpuDynInst->simdId, - gpuDynInst->wfSlotId, gpuDynInst->seqNum(), id, - pkt->req->getPaddr()); + if (gpuDynInst) { + DPRINTF(GPUPort, + "CU%d: WF[%d][%d]: gpuDynInst: %d, index %d, addr %#x data" + " req sent!\n", compute_unit->cu_id, gpuDynInst->simdId, + gpuDynInst->wfSlotId, gpuDynInst->seqNum(), id, + pkt->req->getPaddr()); + } } } diff --git a/src/mem/ruby/system/GPUCoalescer.cc b/src/mem/ruby/system/GPUCoalescer.cc index 90d6031c6e..5ee4105597 100644 --- a/src/mem/ruby/system/GPUCoalescer.cc +++ b/src/mem/ruby/system/GPUCoalescer.cc @@ -669,14 +669,14 @@ GPUCoalescer::getRequestType(PacketPtr pkt) RequestStatus GPUCoalescer::makeRequest(PacketPtr pkt) { - // all packets must have valid instruction sequence numbers - assert(pkt->req->hasInstSeqNum()); - if (pkt->cmd == MemCmd::MemSyncReq) { // issue mem_sync requests immediately to the cache system without // going through uncoalescedTable like normal LD/ST/Atomic requests issueMemSyncRequest(pkt); } else { + // all packets must have valid instruction sequence numbers + assert(pkt->req->hasInstSeqNum()); + // otherwise, this must be either read or write command assert(pkt->isRead() || pkt->isWrite() || pkt->isFlush());