gem5
v20.0.0.2
|
#include <global_memory_pipeline.hh>
Public Member Functions | |
GlobalMemPipeline (const ComputeUnitParams *params) | |
void | init (ComputeUnit *cu) |
void | exec () |
std::queue< GPUDynInstPtr > & | getGMStRespFIFO () |
std::queue< GPUDynInstPtr > & | getGMLdRespFIFO () |
GPUDynInstPtr | getNextReadyResp () |
find the next ready response to service. More... | |
void | completeRequest (GPUDynInstPtr gpuDynInst) |
once a memory request is finished we remove it from the buffer. More... | |
void | issueRequest (GPUDynInstPtr gpuDynInst) |
issues a request to the pipeline - i.e., enqueue it in the request buffer. More... | |
void | handleResponse (GPUDynInstPtr gpuDynInst) |
this method handles responses sent to this GM pipeline by the CU. More... | |
bool | isGMLdRespFIFOWrRdy () const |
bool | isGMStRespFIFOWrRdy () const |
bool | isGMReqFIFOWrRdy (uint32_t pendReqs=0) const |
const std::string & | name () const |
void | regStats () |
void | incLoadVRFBankConflictCycles (int num_cycles) |
bool | coalescerReady (GPUDynInstPtr mp) const |
Private Attributes | |
ComputeUnit * | computeUnit |
std::string | _name |
int | gmQueueSize |
bool | outOfOrderDataDelivery |
Stats::Scalar | loadVrfBankConflictCycles |
int | inflightStores |
int | inflightLoads |
int | globalMemSize |
std::map< uint64_t, std::pair< GPUDynInstPtr, bool > > | gmOrderedRespBuffer |
std::queue< GPUDynInstPtr > | gmIssuedRequests |
std::queue< GPUDynInstPtr > | gmReturnedStores |
std::queue< GPUDynInstPtr > | gmReturnedLoads |
Definition at line 56 of file global_memory_pipeline.hh.
GlobalMemPipeline::GlobalMemPipeline | ( | const ComputeUnitParams * | params | ) |
Definition at line 45 of file global_memory_pipeline.cc.
bool GlobalMemPipeline::coalescerReady | ( | GPUDynInstPtr | mp | ) | const |
Definition at line 61 of file global_memory_pipeline.cc.
References DPRINTF.
Referenced by incLoadVRFBankConflictCycles(), and Wavefront::ready().
void GlobalMemPipeline::completeRequest | ( | GPUDynInstPtr | gpuDynInst | ) |
once a memory request is finished we remove it from the buffer.
this method determines which response buffer we're using based on the mode (in-order vs. OoO).
Definition at line 201 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, inflightLoads, inflightStores, and outOfOrderDataDelivery.
Referenced by exec(), and getGMLdRespFIFO().
void GlobalMemPipeline::exec | ( | ) |
if we are not in out-of-order data delivery mode then we keep the responses sorted in program order. in order to do so we must reserve an entry in the resp buffer before we issue the request to the mem system. mem fence requests will not be stored here because once they are issued from the GM pipeline, they do not send any response back to it.
Definition at line 80 of file global_memory_pipeline.cc.
References Shader::coissue_return, completeRequest(), computeUnit, Wavefront::computeUnit, ComputeUnit::cu_id, DPRINTF, getNextReadyResp(), ComputeUnit::glbMemToVrfBus, gmIssuedRequests, gmOrderedRespBuffer, gmQueueSize, inflightLoads, inflightStores, ArmISA::m, X86ISA::mp, outOfOrderDataDelivery, Wavefront::outstandingReqs, Wavefront::outstandingReqsRdGm, Wavefront::outstandingReqsWrGm, WaitClass::rdy(), Shader::ScheduleAdd(), WaitClass::set(), ComputeUnit::shader, Wavefront::simdId, ComputeUnit::vrf, MipsISA::w, ComputeUnit::wfWait, and WRITE.
Referenced by ComputeUnit::exec().
|
inline |
Definition at line 64 of file global_memory_pipeline.hh.
References completeRequest(), getNextReadyResp(), gmReturnedLoads, handleResponse(), and issueRequest().
|
inline |
Definition at line 63 of file global_memory_pipeline.hh.
References gmReturnedStores.
GPUDynInstPtr GlobalMemPipeline::getNextReadyResp | ( | ) |
find the next ready response to service.
for OoO mode we simply pop the oldest (based on when the response was received) response in the response FIFOs. for in-order mode we pop the oldest (in program order) response, and only if it is marked as done.
Definition at line 179 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, and outOfOrderDataDelivery.
Referenced by exec(), and getGMLdRespFIFO().
void GlobalMemPipeline::handleResponse | ( | GPUDynInstPtr | gpuDynInst | ) |
this method handles responses sent to this GM pipeline by the CU.
in the case of in-order delivery it simply marks the reqeust as done in the ordered buffer to indicate that the requst is finished. for out-of-order data delivery, the requests are enqueued (in the order in which they are received) in the response FIFOs.
Definition at line 238 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, isGMLdRespFIFOWrRdy(), isGMStRespFIFOWrRdy(), and outOfOrderDataDelivery.
Referenced by getGMLdRespFIFO(), and ComputeUnit::DataPort::processMemRespEvent().
|
inline |
Definition at line 119 of file global_memory_pipeline.hh.
References coalescerReady(), loadVrfBankConflictCycles, and X86ISA::mp.
void GlobalMemPipeline::init | ( | ComputeUnit * | cu | ) |
Definition at line 53 of file global_memory_pipeline.cc.
References _name, computeUnit, Shader::globalMemSize, globalMemSize, SimObject::name(), and ComputeUnit::shader.
Referenced by ComputeUnit::init().
|
inline |
Definition at line 98 of file global_memory_pipeline.hh.
References gmQueueSize, and gmReturnedLoads.
Referenced by handleResponse(), and ComputeUnit::isDone().
|
inline |
Definition at line 110 of file global_memory_pipeline.hh.
References gmIssuedRequests, and gmQueueSize.
Referenced by ComputeUnit::isDone().
|
inline |
Definition at line 104 of file global_memory_pipeline.hh.
References gmQueueSize, and gmReturnedStores.
Referenced by handleResponse(), and ComputeUnit::isDone().
void GlobalMemPipeline::issueRequest | ( | GPUDynInstPtr | gpuDynInst | ) |
issues a request to the pipeline - i.e., enqueue it in the request buffer.
Definition at line 232 of file global_memory_pipeline.cc.
References gmIssuedRequests.
Referenced by HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::execute(), HsailISA::MemFence::execute(), HsailISA::StInst< MemDataType, SrcDataType, AddrOperandType >::execute(), HsailISA::AtomicInst< MemDataType, AddrOperandType, NumSrcOperands, HasDst >::execute(), getGMLdRespFIFO(), HsailISA::Call::MagicAtomicNRAddGlobalU32Reg(), HsailISA::Call::MagicAtomicNRAddGroupU32Reg(), and HsailISA::Call::MagicLoadGlobalU32Reg().
|
inline |
Definition at line 115 of file global_memory_pipeline.hh.
References _name, and regStats().
Referenced by regStats().
void GlobalMemPipeline::regStats | ( | ) |
Definition at line 259 of file global_memory_pipeline.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), loadVrfBankConflictCycles, name(), and Stats::DataWrap< Derived, InfoProxyType >::name().
Referenced by name(), and ComputeUnit::regStats().
|
private |
Definition at line 128 of file global_memory_pipeline.hh.
|
private |
Definition at line 127 of file global_memory_pipeline.hh.
|
private |
Definition at line 143 of file global_memory_pipeline.hh.
Referenced by init().
|
private |
Definition at line 163 of file global_memory_pipeline.hh.
Referenced by exec(), isGMReqFIFOWrRdy(), and issueRequest().
|
private |
Definition at line 159 of file global_memory_pipeline.hh.
Referenced by completeRequest(), exec(), getNextReadyResp(), and handleResponse().
|
private |
Definition at line 129 of file global_memory_pipeline.hh.
Referenced by exec(), isGMLdRespFIFOWrRdy(), isGMReqFIFOWrRdy(), and isGMStRespFIFOWrRdy().
|
private |
Definition at line 171 of file global_memory_pipeline.hh.
Referenced by completeRequest(), getGMLdRespFIFO(), getNextReadyResp(), handleResponse(), and isGMLdRespFIFOWrRdy().
|
private |
Definition at line 167 of file global_memory_pipeline.hh.
Referenced by completeRequest(), getGMStRespFIFO(), getNextReadyResp(), handleResponse(), and isGMStRespFIFOWrRdy().
|
private |
Definition at line 140 of file global_memory_pipeline.hh.
Referenced by completeRequest(), and exec().
|
private |
Definition at line 139 of file global_memory_pipeline.hh.
Referenced by completeRequest(), and exec().
|
private |
Definition at line 135 of file global_memory_pipeline.hh.
Referenced by incLoadVRFBankConflictCycles(), and regStats().
|
private |
Definition at line 130 of file global_memory_pipeline.hh.
Referenced by completeRequest(), exec(), getNextReadyResp(), and handleResponse().