40 #include "debug/GPUFetch.hh" 41 #include "debug/GPUPort.hh" 42 #include "debug/GPUTLB.hh" 55 fetchScheduler(params),
132 DPRINTF(GPUTLB,
"CU%d: WF[%d][%d]: Initiating fetch translation: %#x\n",
139 Addr split_addr =
roundDown(vaddr + block_size - 1, block_size);
140 int size = block_size;
142 if (split_addr > vaddr) {
144 size = split_addr -
vaddr;
156 pkt->dataStatic(&fetchBlock);
166 false, pkt->senderState);
171 DPRINTF(GPUTLB,
"Failed to send TLB req for FETCH addr %#x\n",
182 DPRINTF(GPUTLB,
"Failed to send TLB req for FETCH addr %#x\n",
187 DPRINTF(GPUTLB,
"sent FETCH translation request for %#x\n", vaddr);
196 TheISA::GpuTLB::TranslationState *sender_state =
197 safe_cast<TheISA::GpuTLB::TranslationState*>(pkt->senderState);
199 delete sender_state->tlbEntry;
203 fetch(pkt, wavefront);
210 assert(pkt->
req->hasPaddr());
211 assert(pkt->
req->hasSize());
213 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: Fetch Access: %#x\n",
215 pkt->
req->getPaddr());
222 pkt =
new Packet(oldPkt->req, oldPkt->cmd);
241 DPRINTF(GPUPort,
"CU%d: WF[%d][%d]: Fetch addr %#x failed!\n",
243 pkt->
req->getPaddr());
245 DPRINTF(GPUPort,
"CU%d: WF[%d][%d]: Fetch addr %#x sent!\n",
247 pkt->
req->getPaddr());
263 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: Fetch addr %#x returned " 265 wavefront->simdId, wavefront->wfSlotId, pkt->
req->getPaddr(),
266 pkt->
req->getSize(), pkt->
req->getSize() /
269 if (wavefront->dropFetch) {
270 assert(wavefront->instructionBuffer.empty());
271 wavefront->dropFetch =
false;
276 assert(wavefront->instructionBuffer.size() <= 4);
278 for (
int i = 0;
i < pkt->
req->getSize() /
295 DPRINTF(GPUFetch,
"CU%d: WF[%d][%d]: added %s\n",
300 std::make_shared<GPUDynInst>(
computeUnit, wavefront, inst_ptr,
301 computeUnit->getAndIncSeqNum());
303 wavefront->instructionBuffer.push_back(gpuDynInst);
307 wavefront->pendingFetch =
false;
RubyTester::SenderState SenderState
std::deque< PacketPtr > retries
here we queue all the translation requests that were not successfully sent.
void bindList(std::vector< Wavefront *> *sched_list)
void init(ComputeUnit *cu)
virtual int instSize() const =0
std::shared_ptr< Request > RequestPtr
static uint32_t globalFetchUnitID
ComputeUnit * computeUnit
void processFetchReturn(PacketPtr pkt)
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)
RequestPtr req
A pointer to the original request.
bool instructionBufferHasBranch()
std::deque< std::pair< PacketPtr, Wavefront * > > retries
std::shared_ptr< GPUDynInst > GPUDynInstPtr
std::deque< GPUDynInstPtr > instructionBuffer
void bindWaveList(std::vector< Wavefront *> *list)
T roundDown(const T &val, const U &align)
This function is used to align addresses in memory.
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...
The request was an instruction fetch.
SenderState * senderState
This packet's sender state.
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)
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
std::vector< Wavefront * > fetchQueue
int cacheLineSize() const
ProbePointArg< PacketInfo > Packet
Packet probe point.