gpu-compute: Remove unused and redundant functions
In ComputeUnit, a previous commit added a SystemHubEvent event class to the SQCPort. This was found to be unnecessary during the review process and is removed in this commit. Similarly, invBuf() which was added in FetchUnit as part of an earlier commit was found to be redundant. This commit removes it Change-Id: I6ee8d344d29e7bfade49fb9549654b71e3c4b96f
This commit is contained in:
@@ -1085,11 +1085,9 @@ ComputeUnit::SQCPort::MemReqEvent::process()
|
||||
SenderState *sender_state = safe_cast<SenderState*>(pkt->senderState);
|
||||
[[maybe_unused]] ComputeUnit *compute_unit = sqcPort.computeUnit;
|
||||
|
||||
if (pkt->req->systemReq()) {
|
||||
assert(compute_unit->shader->systemHub);
|
||||
SystemHubEvent *resp_event = new SystemHubEvent(pkt, &sqcPort);
|
||||
compute_unit->shader->systemHub->sendRequest(pkt, resp_event);
|
||||
} else if (!(sqcPort.sendTimingReq(pkt))) {
|
||||
assert(!pkt->req->systemReq());
|
||||
|
||||
if (!(sqcPort.sendTimingReq(pkt))) {
|
||||
sqcPort.retries.push_back(std::pair<PacketPtr, Wavefront*>
|
||||
(pkt, sender_state->wavefront));
|
||||
}
|
||||
|
||||
@@ -698,24 +698,6 @@ class ComputeUnit : public ClockedObject
|
||||
const char *description() const;
|
||||
};
|
||||
|
||||
class SystemHubEvent : public Event
|
||||
{
|
||||
SQCPort *sqcPort;
|
||||
PacketPtr reqPkt;
|
||||
|
||||
public:
|
||||
SystemHubEvent(PacketPtr pkt, SQCPort *_sqcPort)
|
||||
: sqcPort(_sqcPort), reqPkt(pkt)
|
||||
{
|
||||
setFlags(Event::AutoDelete);
|
||||
}
|
||||
|
||||
void
|
||||
process()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
std::deque<std::pair<PacketPtr, Wavefront*>> retries;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -320,7 +320,7 @@ FetchUnit::processFetchReturn(PacketPtr pkt)
|
||||
assert(!fetchBuf.at(wavefront->wfSlotId).hasFetchDataToProcess());
|
||||
wavefront->dropFetch = false;
|
||||
} else {
|
||||
fetchBuf.at(wavefront->wfSlotId).fetchDone(pkt->req->getVaddr());
|
||||
fetchBuf.at(wavefront->wfSlotId).fetchDone(pkt);
|
||||
}
|
||||
|
||||
wavefront->pendingFetch = false;
|
||||
@@ -388,28 +388,6 @@ FetchUnit::FetchBufDesc::flushBuf()
|
||||
wavefront->wfDynId);
|
||||
}
|
||||
|
||||
void
|
||||
FetchUnit::FetchBufDesc::invBuf()
|
||||
{
|
||||
restartFromBranch = false;
|
||||
/**
|
||||
* free list may have some entries
|
||||
* so we clear it here to avoid duplicates
|
||||
*/
|
||||
freeList.clear();
|
||||
bufferedPCs.clear();
|
||||
reservedPCs.clear();
|
||||
readPtr = bufStart;
|
||||
|
||||
for (int i = 0; i < fetchDepth; ++i) {
|
||||
freeList.push_back(bufStart + i * cacheLineSize);
|
||||
}
|
||||
|
||||
DPRINTF(GPUFetch, "WF[%d][%d]: Id%d Fetch dropped, flushing fetch "
|
||||
"buffer\n", wavefront->simdId, wavefront->wfSlotId,
|
||||
wavefront->wfDynId);
|
||||
}
|
||||
|
||||
Addr
|
||||
FetchUnit::FetchBufDesc::nextFetchAddr()
|
||||
{
|
||||
@@ -491,20 +469,23 @@ FetchUnit::FetchBufDesc::reserveBuf(Addr vaddr)
|
||||
}
|
||||
|
||||
void
|
||||
FetchUnit::FetchBufDesc::fetchDone(Addr vaddr)
|
||||
FetchUnit::FetchBufDesc::fetchDone(PacketPtr pkt)
|
||||
{
|
||||
// If the return vaddr is 0, then it belongs to an SQC invalidation
|
||||
// request. This request calls incLGKMInstsIssued() function in its
|
||||
// execution path. Since there is no valid memory return response
|
||||
// associated with this instruction, decLGKMInstsIssued() is not
|
||||
// executed. Do this here to decrement the counter and invalidate
|
||||
// all buffers
|
||||
if (vaddr == 0) {
|
||||
// If the return command is MemSyncResp, then it belongs to
|
||||
// an SQC invalidation request. This request calls
|
||||
// incLGKMInstsIssued() function in its execution path.
|
||||
// Since there is no valid memory return response associated with
|
||||
// this instruction, decLGKMInstsIssued() is not executed. Do this
|
||||
// here to decrement the counter and invalidate all buffers
|
||||
if (pkt->cmd == MemCmd::MemSyncResp) {
|
||||
wavefront->decLGKMInstsIssued();
|
||||
invBuf();
|
||||
flushBuf();
|
||||
restartFromBranch = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Addr vaddr = pkt->req->getVaddr();
|
||||
|
||||
assert(bufferedPCs.find(vaddr) == bufferedPCs.end());
|
||||
DPRINTF(GPUFetch, "WF[%d][%d]: Id%d done fetching for addr %#x\n",
|
||||
wavefront->simdId, wavefront->wfSlotId,
|
||||
|
||||
@@ -104,7 +104,6 @@ class FetchUnit
|
||||
int reservedLines() const { return reservedPCs.size(); }
|
||||
bool hasFreeSpace() const { return !freeList.empty(); }
|
||||
void flushBuf();
|
||||
void invBuf();
|
||||
Addr nextFetchAddr();
|
||||
|
||||
/**
|
||||
@@ -139,7 +138,7 @@ class FetchUnit
|
||||
return is_reserved;
|
||||
}
|
||||
|
||||
void fetchDone(Addr vaddr);
|
||||
void fetchDone(PacketPtr ptr);
|
||||
|
||||
/**
|
||||
* checks if the buffer contains valid data. this essentially
|
||||
|
||||
Reference in New Issue
Block a user