gem5  v20.1.0.0
Public Member Functions | Private Attributes | List of all members
GlobalMemPipeline Class Reference

#include <global_memory_pipeline.hh>

Public Member Functions

 GlobalMemPipeline (const ComputeUnitParams *p, ComputeUnit &cu)
 
void init ()
 
void exec ()
 
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 isGMReqFIFOWrRdy (uint32_t pendReqs=0) const
 
const std::string & name () const
 
void regStats ()
 
void incLoadVRFBankConflictCycles (int num_cycles)
 
bool coalescerReady (GPUDynInstPtr mp) const
 
bool outstandingReqsCheck (GPUDynInstPtr mp) const
 
void acqCoalescerToken (GPUDynInstPtr mp)
 

Private Attributes

ComputeUnitcomputeUnit
 
const std::string _name
 
int gmQueueSize
 
int maxWaveRequests
 
Stats::Scalar loadVrfBankConflictCycles
 
int inflightStores
 
int inflightLoads
 
int globalMemSize
 
std::map< uint64_t, std::pair< GPUDynInstPtr, bool > > gmOrderedRespBuffer
 
std::queue< GPUDynInstPtrgmIssuedRequests
 

Detailed Description

Definition at line 56 of file global_memory_pipeline.hh.

Constructor & Destructor Documentation

◆ GlobalMemPipeline()

GlobalMemPipeline::GlobalMemPipeline ( const ComputeUnitParams *  p,
ComputeUnit cu 
)

Definition at line 46 of file global_memory_pipeline.cc.

Member Function Documentation

◆ acqCoalescerToken()

void GlobalMemPipeline::acqCoalescerToken ( GPUDynInstPtr  mp)

Definition at line 81 of file global_memory_pipeline.cc.

References DPRINTF, and ArmISA::mp.

Referenced by ScheduleStage::fillDispatchList().

◆ coalescerReady()

bool GlobalMemPipeline::coalescerReady ( GPUDynInstPtr  mp) const

Definition at line 62 of file global_memory_pipeline.cc.

References DPRINTF, and ArmISA::mp.

Referenced by ScheduleStage::dispatchReady().

◆ completeRequest()

void GlobalMemPipeline::completeRequest ( GPUDynInstPtr  gpuDynInst)

once a memory request is finished we remove it from the buffer.

Definition at line 246 of file global_memory_pipeline.cc.

References gmOrderedRespBuffer, inflightLoads, and inflightStores.

Referenced by exec().

◆ 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.

Memory accesses instructions that do not generate any memory requests (such as out-of-bounds buffer acceses where all lanes are out of bounds) will not trigger a callback to complete the request, so we need to mark it as completed as soon as it is issued. Note this this will still insert an entry in the ordered return FIFO such that waitcnt is still resolved correctly.

Definition at line 106 of file global_memory_pipeline.cc.

References Shader::coissue_return, Complete, completeRequest(), computeUnit, ComputeUnit::cu_id, curTick(), DPRINTF, getNextReadyResp(), ComputeUnit::getTokenManager(), ComputeUnit::glbMemToVrfBus, gmIssuedRequests, gmOrderedRespBuffer, gmQueueSize, handleResponse(), inflightLoads, inflightStores, ArmISA::m, ArmISA::mp, WaitClass::rdy(), TokenManager::recvTokens(), Shader::sampleInstRoundTrip(), Shader::sampleLineRoundTrip(), Shader::sampleLoad(), Shader::sampleStore(), Shader::ScheduleAdd(), WaitClass::set(), ComputeUnit::shader, ComputeUnit::vectorGlobalMemUnit, and MipsISA::w.

Referenced by ComputeUnit::exec().

◆ getNextReadyResp()

GPUDynInstPtr GlobalMemPipeline::getNextReadyResp ( )

Find the next ready response to service.

In order to ensure that no waitcnts are violated, we pop the oldest (in program order) response, and only if it is marked as done. This is because waitcnt values expect memory operations to complete and decrement their counter values in program order.

Definition at line 232 of file global_memory_pipeline.cc.

References gmOrderedRespBuffer.

Referenced by exec().

◆ handleResponse()

void GlobalMemPipeline::handleResponse ( GPUDynInstPtr  gpuDynInst)

This method handles responses sent to this GM pipeline by the CU.

Simply marks the reqeust as done in the ordered buffer to indicate that the requst is finished.

Definition at line 275 of file global_memory_pipeline.cc.

References gmOrderedRespBuffer.

Referenced by exec(), ComputeUnit::DataPort::processMemRespEvent(), and ComputeUnit::DataPort::recvTimingResp().

◆ incLoadVRFBankConflictCycles()

void GlobalMemPipeline::incLoadVRFBankConflictCycles ( int  num_cycles)
inline

Definition at line 100 of file global_memory_pipeline.hh.

References loadVrfBankConflictCycles.

◆ init()

void GlobalMemPipeline::init ( )

◆ isGMReqFIFOWrRdy()

bool GlobalMemPipeline::isGMReqFIFOWrRdy ( uint32_t  pendReqs = 0) const
inline

Definition at line 92 of file global_memory_pipeline.hh.

References gmIssuedRequests, and gmQueueSize.

Referenced by ComputeUnit::isDone().

◆ issueRequest()

void GlobalMemPipeline::issueRequest ( GPUDynInstPtr  gpuDynInst)

Issues a request to the pipeline (i.e., enqueue it in the request buffer).

Definition at line 267 of file global_memory_pipeline.cc.

References curTick(), gmIssuedRequests, and Initiate.

◆ name()

const std::string& GlobalMemPipeline::name ( ) const
inline

Definition at line 97 of file global_memory_pipeline.hh.

References _name.

Referenced by regStats().

◆ outstandingReqsCheck()

bool GlobalMemPipeline::outstandingReqsCheck ( GPUDynInstPtr  mp) const

Definition at line 93 of file global_memory_pipeline.cc.

References maxWaveRequests, and ArmISA::mp.

Referenced by ScheduleStage::dispatchReady().

◆ regStats()

void GlobalMemPipeline::regStats ( )

Member Data Documentation

◆ _name

const std::string GlobalMemPipeline::_name
private

Definition at line 112 of file global_memory_pipeline.hh.

Referenced by name().

◆ computeUnit

ComputeUnit& GlobalMemPipeline::computeUnit
private

Definition at line 111 of file global_memory_pipeline.hh.

Referenced by exec(), and init().

◆ globalMemSize

int GlobalMemPipeline::globalMemSize
private

Definition at line 127 of file global_memory_pipeline.hh.

Referenced by init().

◆ gmIssuedRequests

std::queue<GPUDynInstPtr> GlobalMemPipeline::gmIssuedRequests
private

Definition at line 146 of file global_memory_pipeline.hh.

Referenced by exec(), isGMReqFIFOWrRdy(), and issueRequest().

◆ gmOrderedRespBuffer

std::map<uint64_t, std::pair<GPUDynInstPtr, bool> > GlobalMemPipeline::gmOrderedRespBuffer
private

Definition at line 142 of file global_memory_pipeline.hh.

Referenced by completeRequest(), exec(), getNextReadyResp(), and handleResponse().

◆ gmQueueSize

int GlobalMemPipeline::gmQueueSize
private

Definition at line 113 of file global_memory_pipeline.hh.

Referenced by exec(), and isGMReqFIFOWrRdy().

◆ inflightLoads

int GlobalMemPipeline::inflightLoads
private

Definition at line 124 of file global_memory_pipeline.hh.

Referenced by completeRequest(), and exec().

◆ inflightStores

int GlobalMemPipeline::inflightStores
private

Definition at line 123 of file global_memory_pipeline.hh.

Referenced by completeRequest(), and exec().

◆ loadVrfBankConflictCycles

Stats::Scalar GlobalMemPipeline::loadVrfBankConflictCycles
private

Definition at line 119 of file global_memory_pipeline.hh.

Referenced by incLoadVRFBankConflictCycles(), and regStats().

◆ maxWaveRequests

int GlobalMemPipeline::maxWaveRequests
private

Definition at line 114 of file global_memory_pipeline.hh.

Referenced by outstandingReqsCheck().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:25 for gem5 by doxygen 1.8.17