37#include "debug/GPUSched.hh"
47 : computeUnit(cu), fromSchedule(from_schedule),
48 lastTimeInstExecuted(false),
49 thisTimeInstExecuted(false), instrExecuted (false),
50 executionResourcesUsed(0), _name(cu.
name() +
".ExecStage"),
113 std::string
s(
"INVALID");
131 std::stringstream
ss;
139 Wavefront *wf = gpu_dyn_inst->wavefront();
147 DPRINTF(GPUSched,
"Dispatch List:\n%s",
ss.str());
155 if (debug::GPUSched) {
170 assert(gpu_dyn_inst);
171 Wavefront *wf = gpu_dyn_inst->wavefront();
172 DPRINTF(GPUSched,
"Exec[%d]: SIMD[%d] WV[%d]: %s\n",
174 gpu_dyn_inst->disassemble());
175 DPRINTF(GPUSched,
"dispatchList[%d] EXREADY->EMPTY\n", unitId);
186 assert(gpu_dyn_inst);
187 Wavefront *wf = gpu_dyn_inst->wavefront();
188 DPRINTF(GPUSched,
"dispatchList[%d] SKIP->EMPTY\n", unitId);
194 panic(
"Unknown dispatch status in exec()\n");
202 : statistics::
Group(parent,
"ExecStage"),
204 "number of CU transitions from active to idle"),
205 ADD_STAT(numCyclesWithNoIssue,
"number of cycles the CU issues nothing"),
207 "number of cycles the CU issued at least one instruction"),
209 "Execution units active per cycle (Exec unit=SIMD,MemPipe)"),
210 ADD_STAT(idleDur,
"duration of idle periods in cycles"),
211 ADD_STAT(numCyclesWithInstrTypeIssued,
"Number of cycles at least one "
212 "instruction issued to execution resource type"),
213 ADD_STAT(numCyclesWithNoInstrTypeIssued,
"Number of clks no instructions"
214 " issued to execution resource type")
225 std::string
s =
"VectorALU" + std::to_string(
i);
230 std::string
s =
"ScalarALU" + std::to_string(
i);
ScheduleStage scheduleStage
bool thisTimeInstExecuted
ScheduleToExecute & fromSchedule
ComputeUnit & computeUnit
int executionResourcesUsed
bool lastTimeInstExecuted
void collectStatistics(enum STAT_STATUS stage, int unitId)
gem5::ExecStage::ExecStageStats stats
std::string dispStatusToStr(int j)
ExecStage(const ComputeUnitParams &p, ComputeUnit &cu, ScheduleToExecute &from_schedule)
Communication interface between Schedule and Execute stages.
DISPATCH_STATUS dispatchStatus(int func_unit_id) const
GPUDynInstPtr & readyInst(int func_unit_id)
void dispatchTransition(const GPUDynInstPtr &gpu_dyn_inst, int func_unit_id, DISPATCH_STATUS disp_status)
Once the scheduler has chosen a winning WF for execution, and after the WF's oldest instruction's ope...
std::deque< GPUDynInstPtr > instructionBuffer
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.
void sample(const U &v, int n=1)
Add a value to the distribtion n times.
Distribution & init(Counter min, Counter max, Counter bkt)
Set the parameters of this distribution.
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.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::shared_ptr< GPUDynInst > GPUDynInstPtr
statistics::Distribution idleDur
statistics::Scalar numCyclesWithInstrIssued
statistics::Distribution spc
statistics::Scalar numCyclesWithNoIssue
statistics::Scalar numTransActiveIdle
statistics::Vector numCyclesWithNoInstrTypeIssued
statistics::Vector numCyclesWithInstrTypeIssued
ExecStageStats(statistics::Group *parent)
const std::string & name()