gem5 v24.0.0.0
|
#include <fetch_unit.hh>
Classes | |
class | FetchBufDesc |
fetch buffer descriptor. More... | |
class | SystemHubEvent |
Public Member Functions | |
FetchUnit (const ComputeUnitParams &p, ComputeUnit &cu) | |
~FetchUnit () | |
void | init () |
void | exec () |
void | bindWaveList (std::vector< Wavefront * > *list) |
void | initiateFetch (Wavefront *wavefront) |
void | fetch (PacketPtr pkt, Wavefront *wavefront) |
void | processFetchReturn (PacketPtr pkt) |
void | flushBuf (int wfSlotId) |
Static Public Attributes | |
static uint32_t | globalFetchUnitID |
Private Attributes | |
bool | timingSim |
ComputeUnit & | computeUnit |
TheGpuISA::Decoder | decoder |
Scheduler | fetchScheduler |
std::vector< Wavefront * > | fetchQueue |
std::vector< std::pair< Wavefront *, bool > > | fetchStatusQueue |
std::vector< Wavefront * > * | waveList |
std::vector< FetchBufDesc > | fetchBuf |
int | fetchDepth |
number of cache lines we can fetch and buffer. | |
Definition at line 55 of file fetch_unit.hh.
gem5::FetchUnit::FetchUnit | ( | const ComputeUnitParams & | p, |
ComputeUnit & | cu ) |
Definition at line 52 of file fetch_unit.cc.
gem5::FetchUnit::~FetchUnit | ( | ) |
Definition at line 58 of file fetch_unit.cc.
References fetchQueue, and fetchStatusQueue.
void gem5::FetchUnit::bindWaveList | ( | std::vector< Wavefront * > * | list | ) |
Definition at line 339 of file fetch_unit.cc.
References waveList.
void gem5::FetchUnit::exec | ( | ) |
now we check if any of the fetch buffers have buffered instruction data that can be decoded and sent to its wavefront's instruction buffer. then we check if any of the fetch buffer entries can be released. we only check if we can release a buffer
Definition at line 84 of file fetch_unit.cc.
References gem5::Scheduler::chooseWave(), computeUnit, fetchBuf, fetchQueue, fetchScheduler, fetchStatusQueue, gem5::Wavefront::getStatus(), initiateFetch(), gem5::Shader::n_wf, gem5::Wavefront::pendingFetch, gem5::Wavefront::S_RUNNING, gem5::Wavefront::S_WAITCNT, gem5::ComputeUnit::shader, gem5::Wavefront::stopFetch(), and gem5::Wavefront::wfSlotId.
this is necessary because the GPU TLB receives packets instead of requests. when the translation is complete, all relevent fields in the request will be populated, but not in the packet. here we create the new packet so we can set the size, addr, and proper flags.
if we have not reserved an entry in the fetch buffer, stop fetching. this can happen due to a branch instruction flushing the fetch buffer while an ITLB or I-cache request is still pending, in the same cycle another instruction is trying to fetch.
For full system, if this is a device request we need to set the requestor ID of the packet to the GPU memory manager so it is routed through Ruby as a memory request and not a PIO request.
we should have reserved an entry in the fetch buffer for this cache line. here we get the pointer to the entry used to buffer this request's line data.
Definition at line 230 of file fetch_unit.cc.
References gem5::Packet::cmd, computeUnit, gem5::ComputeUnit::cu_id, gem5::Packet::dataStatic(), DPRINTF, gem5::Wavefront::dropFetch, fetchBuf, gem5::Wavefront::pendingFetch, processFetchReturn(), gem5::Packet::req, gem5::ComputeUnit::SQCPort::retries, gem5::Packet::senderState, gem5::RequestPort::sendFunctional(), gem5::AMDGPUSystemHub::sendRequest(), gem5::RequestPort::sendTimingReq(), gem5::ComputeUnit::shader, gem5::Wavefront::simdId, gem5::ComputeUnit::sqcPort, gem5::Shader::systemHub, timingSim, gem5::ComputeUnit::vramRequestorId(), and gem5::Wavefront::wfSlotId.
Referenced by initiateFetch().
void gem5::FetchUnit::flushBuf | ( | int | wfSlotId | ) |
Definition at line 333 of file fetch_unit.cc.
References fetchBuf.
Referenced by gem5::Wavefront::discardFetch(), gem5::VegaISA::Inst_SOPP__S_ENDPGM::execute(), and gem5::FetchUnit::FetchBufDesc::fetchDone().
void gem5::FetchUnit::init | ( | ) |
Definition at line 65 of file fetch_unit.cc.
References gem5::Scheduler::bindList(), gem5::ComputeUnit::cacheLineSize(), computeUnit, decoder, fetchBuf, fetchDepth, fetchQueue, fetchScheduler, fetchStatusQueue, gem5::ArmISA::i, gem5::Shader::n_wf, gem5::ComputeUnit::shader, timingSim, gem5::Shader::timingSim, waveList, and gem5::Wavefront::wfSlotId.
void gem5::FetchUnit::initiateFetch | ( | Wavefront * | wavefront | ) |
calculate the virtual address to fetch from the SQC. the fetch buffer holds a configurable number of cache lines. we start fetching at the address of the cache line immediately following the buffered line(s).
For full system, if this is a device request we need to set the requestor ID of the packet to the GPU memory manager so it is routed through Ruby as a memory request and not a PIO request.
Definition at line 136 of file fetch_unit.cc.
References gem5::ComputeUnit::cacheLineSize(), computeUnit, gem5::ComputeUnit::cu_id, DPRINTF, gem5::BaseMMU::Execute, fetch(), fetchBuf, gem5::ComputeUnit::getCacheLineBits(), gem5::Shader::gpuTc, gem5::Request::INST_FETCH, gem5::ComputeUnit::ITLBPort::isStalled(), gem5::ruby::makeLineAddress(), gem5::Wavefront::pc(), gem5::MemCmd::ReadReq, gem5::Packet::req, gem5::ComputeUnit::requestorId(), gem5::ComputeUnit::ITLBPort::retries, gem5::safe_cast(), gem5::Packet::senderState, gem5::RequestPort::sendFunctional(), gem5::RequestPort::sendTimingReq(), gem5::ComputeUnit::shader, gem5::Wavefront::simdId, gem5::ComputeUnit::sqcTLBPort, gem5::ComputeUnit::ITLBPort::stallPort(), timingSim, gem5::GpuTranslationState::tlbEntry, gem5::MipsISA::vaddr, gem5::ComputeUnit::vramRequestorId(), gem5::Wavefront::wfDynId, and gem5::Wavefront::wfSlotId.
Referenced by exec().
void gem5::FetchUnit::processFetchReturn | ( | PacketPtr | pkt | ) |
Definition at line 307 of file fetch_unit.cc.
References computeUnit, gem5::ComputeUnit::cu_id, DPRINTF, gem5::Wavefront::dropFetch, fetchBuf, gem5::Wavefront::instructionBuffer, gem5::Wavefront::pendingFetch, gem5::Packet::req, gem5::safe_cast(), gem5::Packet::senderState, gem5::Wavefront::simdId, gem5::ComputeUnit::SQCPort::SenderState::wavefront, and gem5::Wavefront::wfSlotId.
Referenced by fetch().
|
private |
Definition at line 258 of file fetch_unit.hh.
Referenced by exec(), fetch(), init(), initiateFetch(), and processFetchReturn().
|
private |
Definition at line 259 of file fetch_unit.hh.
Referenced by init().
|
private |
Definition at line 279 of file fetch_unit.hh.
Referenced by exec(), fetch(), flushBuf(), init(), initiateFetch(), and processFetchReturn().
|
private |
number of cache lines we can fetch and buffer.
this includes the currently fetched line (i.e., the line that corresponds to the WF's current PC), as well as any lines that may be prefetched.
Definition at line 286 of file fetch_unit.hh.
Referenced by gem5::FetchUnit::FetchBufDesc::flushBuf(), init(), and gem5::FetchUnit::FetchBufDesc::reserveBuf().
|
private |
Definition at line 269 of file fetch_unit.hh.
Referenced by exec(), init(), and ~FetchUnit().
|
private |
Definition at line 265 of file fetch_unit.hh.
|
private |
Definition at line 274 of file fetch_unit.hh.
Referenced by exec(), init(), and ~FetchUnit().
|
static |
Definition at line 67 of file fetch_unit.hh.
|
private |
Definition at line 257 of file fetch_unit.hh.
Referenced by fetch(), init(), and initiateFetch().
|
private |
Definition at line 277 of file fetch_unit.hh.
Referenced by bindWaveList(), and init().