gpu-compute: Check for WAX dependences

This adds checking if the destination registers are free or busy
in the operandsReady() function for both scalar and vector
registers. This allows us to catch WAX dependences between instructions.

Change-Id: I0fb0b29e9608fca0d90c059422d4d9500d5b2a7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47539
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Kyle Roarty
2021-07-02 11:36:04 -05:00
committed by Matt Sinclair
parent 02dd6b77ff
commit ebb6c4b99b
2 changed files with 22 additions and 0 deletions

View File

@@ -64,6 +64,17 @@ ScalarRegisterFile::operandsReady(Wavefront *w, GPUDynInstPtr ii) const
}
}
for (const auto& dstScalarOp : ii->dstScalarRegOperands()) {
for (const auto& physIdx : dstScalarOp.physIndices()) {
if (regBusy(physIdx)) {
DPRINTF(GPUSRF, "WAX stall: WV[%d]: %s: physReg[%d]\n",
w->wfDynId, ii->disassemble(), physIdx);
w->stats.numTimesBlockedDueWAXDependencies++;
return false;
}
}
}
return true;
}

View File

@@ -71,6 +71,17 @@ VectorRegisterFile::operandsReady(Wavefront *w, GPUDynInstPtr ii) const
}
}
for (const auto& dstVecOp : ii->dstVecRegOperands()) {
for (const auto& physIdx : dstVecOp.physIndices()) {
if (regBusy(physIdx)) {
DPRINTF(GPUVRF, "WAX stall: WV[%d]: %s: physReg[%d]\n",
w->wfDynId, ii->disassemble(), physIdx);
w->stats.numTimesBlockedDueWAXDependencies++;
return false;
}
}
}
return true;
}