Go to the documentation of this file.
36 #include "debug/GPUExec.hh"
37 #include "debug/GPUSched.hh"
38 #include "debug/GPUSync.hh"
45 #include "params/ComputeUnit.hh"
51 : computeUnit(cu), toSchedule(to_schedule),
52 _name(cu.
name() +
".ScoreboardCheckStage")
64 "Instruction ready status %d is illegal!!!", rdyStatus);
75 int *exeResType,
int wfSlot)
89 if (!
w->waitCntsSatisfied()) {
99 assert(
w->hasBarrier());
100 int bar_id =
w->barrierId();
102 DPRINTF(GPUSync,
"CU[%d] WF[%d][%d] Wave[%d] - Stalled at "
103 "barrier Id%d. %d waves remain.\n",
w->computeUnit->cu_id,
104 w->simdId,
w->wfSlotId,
w->wfDynId, bar_id,
105 w->computeUnit->numYetToReachBarrier(bar_id));
110 DPRINTF(GPUSync,
"CU[%d] WF[%d][%d] Wave[%d] - All waves at barrier "
111 "Id%d. Resetting barrier resources.\n",
w->computeUnit->cu_id,
112 w->simdId,
w->wfSlotId,
w->wfDynId, bar_id);
126 if (
w->instructionBuffer.empty()) {
144 if (!(ii->isBarrier() || ii->isNop() || ii->isReturn() || ii->isBranch() ||
145 ii->isALU() || ii->isLoad() || ii->isStore() || ii->isAtomic() ||
146 ii->isEndOfKernel() || ii->isMemSync() || ii->isFlat())) {
147 panic(
"next instruction: %s is of unknown type\n", ii->disassemble());
150 DPRINTF(GPUExec,
"CU%d: WF[%d][%d]: Checking Ready for Inst : %s\n",
154 if (!ii->isScalar()) {
173 if (ii->isEndOfKernel()) {
175 if (
w->instructionBuffer.front()->seqNum() != ii->seqNum()) {
181 w->setWaitCnts(0, 0, 0);
182 if (!
w->waitCntsSatisfied()) {
188 w->simdId,
w->wfSlotId, ii->disassemble());
210 }
else if (ii->isLocalMem()) {
212 }
else if (ii->isGlobalMem()) {
213 if (!ii->isScalar()) {
218 }
else if (ii->isBranch() ||
220 (ii->isKernArgSeg() && ii->isLoad()) ||
223 ii->isEndOfKernel() ||
226 if (!ii->isScalar()) {
229 return w->scalarAluGlobalIdx;
232 panic(
"%s: unmapped to an execution resource", ii->disassemble());
254 if (
ready(curWave, &rdyStatus, &exeResType, wfSlot)) {
255 assert(curWave->
simdId == simdId);
257 "Adding to readyList[%d]: SIMD[%d] WV[%d]: %d: %s\n",
275 .
desc(
"number of cycles wave stalled in SCB")
void resetBarrier(int bar_id)
ScoreboardCheckStage(const ComputeUnitParams *p, ComputeUnit &cu, ScoreboardCheckToSchedule &to_schedule)
void reset() override
Reset the pipe stage interface.
ScoreboardCheckToSchedule & toSchedule
Interface between scoreboard check and schedule stages.
int mapWaveToExeUnit(Wavefront *w)
bool allAtBarrier(int bar_id)
@ S_BARRIER
WF is stalled at a barrier.
void markWFReady(Wavefront *wf, int func_unit_id)
Mark the WF as ready for execution on a particular functional unit.
std::vector< ScalarRegisterFile * > srf
std::vector< VectorRegisterFile * > vrf
@ S_WAITCNT
wavefront has unsatisfied wait counts
std::vector< std::vector< Wavefront * > > wfList
const std::string & name() const
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
bool ready(Wavefront *w, nonrdytype_e *rdyStatus, int *exeResType, int wfSlot)
const std::string & name()
Derived & init(size_type size)
Set this vector to have the given size.
GPUDynInstPtr nextInstr()
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Communication interface between ScoreboardCheck and Schedule stages.
Stats::Vector stallCycles
std::shared_ptr< GPUDynInst > GPUDynInstPtr
void collectStatistics(nonrdytype_e rdyStatus)
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.
ComputeUnit & computeUnit
void releaseWFsFromBarrier(int bar_id)
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
std::string csprintf(const char *format, const Args &...args)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17