38 #include "debug/GPUFetch.hh"
39 #include "debug/GPUPort.hh"
40 #include "debug/GPUTLB.hh"
53 fetchScheduler(params),
130 DPRINTF(GPUTLB,
"CU%d: WF[%d][%d]: Initiating fetch translation: %#x\n",
137 Addr split_addr =
roundDown(vaddr + block_size - 1, block_size);
138 int size = block_size;
140 if (split_addr > vaddr) {
142 size = split_addr -
vaddr;
153 pkt->dataStatic(&fetchBlock);
163 false, pkt->senderState);
168 DPRINTF(GPUTLB,
"Failed to send TLB req for FETCH addr %#x\n",
179 DPRINTF(GPUTLB,
"Failed to send TLB req for FETCH addr %#x\n",
184 DPRINTF(GPUTLB,
"sent FETCH translation request for %#x\n", vaddr);
193 TheISA::GpuTLB::TranslationState *sender_state =
194 safe_cast<TheISA::GpuTLB::TranslationState*>(pkt->senderState);
196 delete sender_state->tlbEntry;
200 fetch(pkt, wavefront);
210 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: Fetch Access: %#x\n",
219 pkt =
new Packet(oldPkt->req, oldPkt->cmd);
238 DPRINTF(GPUPort,
"CU%d: WF[%d][%d]: Fetch addr %#x failed!\n",
242 DPRINTF(GPUPort,
"CU%d: WF[%d][%d]: Fetch addr %#x sent!\n",
260 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: Fetch addr %#x returned "
262 wavefront->simdId, wavefront->wfSlotId, pkt->
req->
getPaddr(),
266 if (wavefront->dropFetch) {
267 assert(wavefront->instructionBuffer.empty());
268 wavefront->dropFetch =
false;
273 assert(wavefront->instructionBuffer.size() <= 4);
292 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: added %s\n",
297 std::make_shared<GPUDynInst>(
computeUnit, wavefront, inst_ptr,
298 computeUnit->getAndIncSeqNum());
300 wavefront->instructionBuffer.push_back(gpuDynInst);
304 wavefront->pendingFetch =
false;
RubyTester::SenderState SenderState
std::deque< PacketPtr > retries
here we queue all the translation requests that were not successfully sent.
void init(ComputeUnit *cu)
virtual int instSize() const =0
static uint32_t globalFetchUnitID
ComputeUnit * computeUnit
bool hasSize() const
Accessor for size.
void processFetchReturn(PacketPtr pkt)
int cacheLineSize() const
TheGpuISA::Decoder decoder
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
T * getPtr()
get a pointer to the data ptr.
std::vector< std::pair< Wavefront *, bool > > fetchStatusQueue
FetchUnit(const ComputeUnitParams *params)
bool instructionBufferHasBranch()
std::deque< std::pair< PacketPtr, Wavefront * > > retries
std::shared_ptr< GPUDynInst > GPUDynInstPtr
std::deque< GPUDynInstPtr > instructionBuffer
void bindList(std::vector< Wavefront * > *list)
void bindWaveList(std::vector< Wavefront * > *list)
const RequestPtr req
A pointer to the original request.
T roundDown(const T &val, const U &align)
void initiateFetch(Wavefront *wavefront)
std::vector< Wavefront * > * waveList
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
SenderState * senderState
This packet's sender state.
The request was an instruction fetch.
const std::string & disassemble()
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
void fetch(PacketPtr pkt, Wavefront *wavefront)
std::vector< Wavefront * > fetchQueue
bool hasPaddr() const
Accessor for paddr.
void sendFunctional(PacketPtr pkt)
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
ProbePointArg< PacketInfo > Packet
Packet probe point.