gem5
|
#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) |
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 58 of file global_memory_pipeline.hh.
GlobalMemPipeline::GlobalMemPipeline | ( | const ComputeUnitParams * | params | ) |
Definition at line 46 of file global_memory_pipeline.cc.
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 175 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, inflightLoads, inflightStores, and outOfOrderDataDelivery.
Referenced by exec().
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 62 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 66 of file global_memory_pipeline.hh.
References gmReturnedLoads.
|
inline |
Definition at line 65 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 153 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, and outOfOrderDataDelivery.
Referenced by exec().
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 212 of file global_memory_pipeline.cc.
References gmOrderedRespBuffer, gmReturnedLoads, gmReturnedStores, isGMLdRespFIFOWrRdy(), isGMStRespFIFOWrRdy(), and outOfOrderDataDelivery.
Referenced by ComputeUnit::DataPort::MemRespEvent::process().
|
inline |
Definition at line 121 of file global_memory_pipeline.hh.
References loadVrfBankConflictCycles.
void GlobalMemPipeline::init | ( | ComputeUnit * | cu | ) |
Definition at line 54 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 100 of file global_memory_pipeline.hh.
References gmQueueSize, and gmReturnedLoads.
Referenced by handleResponse(), and ComputeUnit::isDone().
|
inline |
Definition at line 112 of file global_memory_pipeline.hh.
References gmIssuedRequests, and gmQueueSize.
Referenced by ComputeUnit::isDone().
|
inline |
Definition at line 106 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 206 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(), HsailISA::Call::MagicAtomicNRAddGlobalU32Reg(), HsailISA::Call::MagicAtomicNRAddGroupU32Reg(), and HsailISA::Call::MagicLoadGlobalU32Reg().
|
inline |
Definition at line 117 of file global_memory_pipeline.hh.
References _name.
Referenced by regStats().
void GlobalMemPipeline::regStats | ( | ) |
Definition at line 233 of file global_memory_pipeline.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), loadVrfBankConflictCycles, name(), and Stats::DataWrap< Derived, InfoProxyType >::name().
Referenced by 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().