- std::queue<GPUDynInstPtr> &getGMReqFIFO() { return gmIssuedRequests; }
- std::queue<GPUDynInstPtr> &getGMStRespFIFO() { return gmReturnedStores; }
- std::queue<GPUDynInstPtr> &getGMLdRespFIFO() { return gmReturnedLoads; }
-
- bool
- isGMLdRespFIFOWrRdy() const
- {
- return gmReturnedLoads.size() < gmQueueSize;
- }
-
- bool
- isGMStRespFIFOWrRdy() const
- {
- return gmReturnedStores.size() < gmQueueSize;
- }
+ /**
+ * 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.
+ */
+ GPUDynInstPtr getNextReadyResp();
+
+ /**
+ * once a memory request is finished we remove it from the
+ * buffer.
+ */
+ void completeRequest(GPUDynInstPtr gpuDynInst);
+
+ /**
+ * Issues a request to the pipeline (i.e., enqueue it
+ * in the request buffer).
+ */
+ void issueRequest(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.
+ */
+ void handleResponse(GPUDynInstPtr gpuDynInst);