34 #include "debug/GPUExec.hh"
35 #include "debug/GPUSched.hh"
36 #include "debug/GPUSync.hh"
43 #include "params/ComputeUnit.hh"
52 : computeUnit(cu), toSchedule(to_schedule),
53 _name(cu.
name() +
".ScoreboardCheckStage"), stats(&cu)
65 "Instruction ready status %d is illegal!!!", rdyStatus);
76 int *exeResType,
int wfSlot)
90 if (!
w->waitCntsSatisfied()) {
99 if (!
w->sleepDone()) {
109 assert(
w->hasBarrier());
110 int bar_id =
w->barrierId();
112 DPRINTF(GPUSync,
"CU[%d] WF[%d][%d] Wave[%d] - Stalled at "
113 "barrier Id%d. %d waves remain.\n",
w->computeUnit->cu_id,
114 w->simdId,
w->wfSlotId,
w->wfDynId, bar_id,
115 w->computeUnit->numYetToReachBarrier(bar_id));
120 DPRINTF(GPUSync,
"CU[%d] WF[%d][%d] Wave[%d] - All waves at barrier "
121 "Id%d. Resetting barrier resources.\n",
w->computeUnit->cu_id,
122 w->simdId,
w->wfSlotId,
w->wfDynId, bar_id);
136 if (
w->instructionBuffer.empty()) {
154 if (!(ii->isBarrier() || ii->isNop() || ii->isReturn() || ii->isBranch() ||
155 ii->isALU() || ii->isLoad() || ii->isStore() || ii->isAtomic() ||
156 ii->isEndOfKernel() || ii->isMemSync() || ii->isFlat() ||
157 ii->isFlatGlobal() || ii->isSleep() || ii->isLocalMem())) {
158 panic(
"next instruction: %s is of unknown type\n", ii->disassemble());
161 DPRINTF(GPUExec,
"CU%d: WF[%d][%d]: Checking Ready for Inst : %s\n",
165 if (!ii->isScalar()) {
184 if (ii->isEndOfKernel()) {
186 if (
w->instructionBuffer.front()->seqNum() != ii->seqNum()) {
192 w->setWaitCnts(0, 0, 0);
193 if (!
w->waitCntsSatisfied()) {
199 w->simdId,
w->wfSlotId, ii->disassemble());
221 }
else if (ii->isLocalMem()) {
223 }
else if (ii->isGlobalMem()) {
224 if (!ii->isScalar()) {
229 }
else if (ii->isBranch() ||
231 (ii->isKernArgSeg() && ii->isLoad()) ||
234 ii->isEndOfKernel() ||
237 if (!ii->isScalar()) {
240 return w->scalarAluGlobalIdx;
243 panic(
"%s: unmapped to an execution resource", ii->disassemble());
265 if (
ready(curWave, &rdyStatus, &exeResType, wfSlot)) {
266 assert(curWave->
simdId == simdId);
268 "Adding to readyList[%d]: SIMD[%d] WV[%d]: %d: %s\n",
282 : statistics::
Group(parent,
"ScoreboardCheckStage"),
283 ADD_STAT(stallCycles,
"number of cycles wave stalled in SCB")
void releaseWFsFromBarrier(int bar_id)
void resetBarrier(int bar_id)
std::vector< ScalarRegisterFile * > srf
std::vector< std::vector< Wavefront * > > wfList
std::vector< VectorRegisterFile * > vrf
bool allAtBarrier(int bar_id)
bool ready(Wavefront *w, nonrdytype_e *rdyStatus, int *exeResType, int wfSlot)
ScoreboardCheckStage(const ComputeUnitParams &p, ComputeUnit &cu, ScoreboardCheckToSchedule &to_schedule)
gem5::ScoreboardCheckStage::ScoreboardCheckStageStats stats
void collectStatistics(nonrdytype_e rdyStatus)
ComputeUnit & computeUnit
ScoreboardCheckToSchedule & toSchedule
Interface between scoreboard check and schedule stages.
int mapWaveToExeUnit(Wavefront *w)
Communication interface between ScoreboardCheck and Schedule stages.
void reset() override
Reset the pipe stage interface.
void markWFReady(Wavefront *wf, int func_unit_id)
Mark the WF as ready for execution on a particular functional unit.
GPUDynInstPtr nextInstr()
@ S_BARRIER
WF is stalled at a barrier.
@ S_WAITCNT
wavefront has unsatisfied wait counts
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation.
Derived & init(size_type size)
Set this vector to have the given size.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
#define panic(...)
This implements a cprintf based panic() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< GPUDynInst > GPUDynInstPtr
std::string csprintf(const char *format, const Args &...args)
statistics::Vector stallCycles
ScoreboardCheckStageStats(statistics::Group *parent)
const std::string & name()