numScalarALUs(p->num_scalar_cores),
vrfToCoalescerBusWidth(p->vrf_to_coalescer_bus_width),
coalescerToVrfBusWidth(p->coalescer_to_vrf_bus_width),
- registerManager(p->register_manager), fetchStage(p),
- scoreboardCheckStage(p), scheduleStage(p, this), execStage(p),
- globalMemoryPipe(p), localMemoryPipe(p), scalarMemoryPipe(p),
+ registerManager(p->register_manager),
+ fetchStage(p, this),
+ scoreboardCheckStage(p, this),
+ scheduleStage(p, this),
+ execStage(p, this),
+ globalMemoryPipe(p, this),
+ localMemoryPipe(p, this),
+ scalarMemoryPipe(p, this),
tickEvent([this]{ exec(); }, "Compute unit tick event",
false, Event::CPU_Tick_Pri),
cu_id(p->cu_id),
dispatchList.push_back(std::make_pair(nullptr, EMPTY));
}
- fetchStage.init(this);
- scoreboardCheckStage.init(this);
- scheduleStage.init(this);
- execStage.init(this);
- globalMemoryPipe.init(this);
- localMemoryPipe.init(this);
- scalarMemoryPipe.init(this);
+ fetchStage.init();
+ scoreboardCheckStage.init();
+ scheduleStage.init();
+ execStage.init();
+ globalMemoryPipe.init();
gmTokenPort.setTokenManager(memPortTokens);
}
#include "gpu-compute/vector_register_file.hh"
#include "gpu-compute/wavefront.hh"
-ExecStage::ExecStage(const ComputeUnitParams *p) : lastTimeInstExecuted(false),
- thisTimeInstExecuted(false), instrExecuted (false),
- executionResourcesUsed(0)
+ExecStage::ExecStage(const ComputeUnitParams *p, ComputeUnit *cu)
+ : computeUnit(cu), lastTimeInstExecuted(false),
+ thisTimeInstExecuted(false), instrExecuted (false),
+ executionResourcesUsed(0), _name(cu->name() + ".ExecStage")
+
{
numTransActiveIdle = 0;
idle_dur = 0;
}
void
-ExecStage::init(ComputeUnit *cu)
+ExecStage::init()
{
- computeUnit = cu;
- _name = computeUnit->name() + ".ExecStage";
dispatchList = &computeUnit->dispatchList;
idle_dur = 0;
}
class ExecStage
{
public:
- ExecStage(const ComputeUnitParams* params);
+ ExecStage(const ComputeUnitParams* p, ComputeUnit *cu);
~ExecStage() { }
- void init(ComputeUnit *cu);
+ void init();
void exec();
std::string dispStatusToStr(int j);
#include "gpu-compute/compute_unit.hh"
#include "gpu-compute/wavefront.hh"
-FetchStage::FetchStage(const ComputeUnitParams* p) :
- numVectorALUs(p->num_SIMDs), computeUnit(nullptr)
+FetchStage::FetchStage(const ComputeUnitParams* p, ComputeUnit *cu)
+ : numVectorALUs(p->num_SIMDs), computeUnit(cu),
+ _name(cu->name() + ".FetchStage")
{
for (int j = 0; j < numVectorALUs; ++j) {
- FetchUnit newFetchUnit(p);
+ FetchUnit newFetchUnit(p, cu);
_fetchUnit.push_back(newFetchUnit);
}
}
}
void
-FetchStage::init(ComputeUnit *cu)
+FetchStage::init()
{
- computeUnit = cu;
- _name = computeUnit->name() + ".FetchStage";
-
for (int j = 0; j < numVectorALUs; ++j) {
_fetchUnit[j].bindWaveList(&computeUnit->wfList[j]);
- _fetchUnit[j].init(computeUnit);
+ _fetchUnit[j].init();
}
}
class FetchStage
{
public:
- FetchStage(const ComputeUnitParams* params);
+ FetchStage(const ComputeUnitParams* p, ComputeUnit *cu);
~FetchStage();
- void init(ComputeUnit *cu);
+ void init();
void exec();
void processFetchReturn(PacketPtr pkt);
void fetch(PacketPtr pkt, Wavefront *wave);
uint32_t FetchUnit::globalFetchUnitID;
-FetchUnit::FetchUnit(const ComputeUnitParams* params)
- : timingSim(true), computeUnit(nullptr), fetchScheduler(params),
- waveList(nullptr), fetchDepth(params->fetch_depth)
+FetchUnit::FetchUnit(const ComputeUnitParams *p, ComputeUnit *cu)
+ : timingSim(true), computeUnit(cu), fetchScheduler(p),
+ waveList(nullptr), fetchDepth(p->fetch_depth)
{
}
}
void
-FetchUnit::init(ComputeUnit *cu)
+FetchUnit::init()
{
- computeUnit = cu;
timingSim = computeUnit->shader->timingSim;
fetchQueue.clear();
fetchStatusQueue.resize(computeUnit->shader->n_wf);
class FetchUnit
{
public:
- FetchUnit(const ComputeUnitParams* params);
+ FetchUnit(const ComputeUnitParams* p, ComputeUnit *cu);
~FetchUnit();
- void init(ComputeUnit *cu);
+ void init();
void exec();
void bindWaveList(std::vector<Wavefront*> *list);
void initiateFetch(Wavefront *wavefront);
#include "gpu-compute/vector_register_file.hh"
#include "gpu-compute/wavefront.hh"
-GlobalMemPipeline::GlobalMemPipeline(const ComputeUnitParams* p) :
- computeUnit(nullptr), gmQueueSize(p->global_mem_queue_size),
- maxWaveRequests(p->max_wave_requests), inflightStores(0),
- inflightLoads(0)
+GlobalMemPipeline::GlobalMemPipeline(const ComputeUnitParams* p,
+ ComputeUnit *cu)
+ : computeUnit(cu), _name(cu->name() + ".GlobalMemPipeline"),
+ gmQueueSize(p->global_mem_queue_size),
+ maxWaveRequests(p->max_wave_requests), inflightStores(0),
+ inflightLoads(0)
{
}
void
-GlobalMemPipeline::init(ComputeUnit *cu)
+GlobalMemPipeline::init()
{
- computeUnit = cu;
globalMemSize = computeUnit->shader->globalMemSize;
- _name = computeUnit->name() + ".GlobalMemPipeline";
}
bool
class GlobalMemPipeline
{
public:
- GlobalMemPipeline(const ComputeUnitParams *params);
- void init(ComputeUnit *cu);
+ GlobalMemPipeline(const ComputeUnitParams *p, ComputeUnit *cu);
+ void init();
void exec();
/**
#include "gpu-compute/vector_register_file.hh"
#include "gpu-compute/wavefront.hh"
-LocalMemPipeline::LocalMemPipeline(const ComputeUnitParams* p) :
- computeUnit(nullptr), lmQueueSize(p->local_mem_queue_size)
+LocalMemPipeline::LocalMemPipeline(const ComputeUnitParams* p, ComputeUnit *cu)
+ : computeUnit(cu), _name(cu->name() + ".LocalMemPipeline"),
+ lmQueueSize(p->local_mem_queue_size)
{
}
-void
-LocalMemPipeline::init(ComputeUnit *cu)
-{
- computeUnit = cu;
- _name = computeUnit->name() + ".LocalMemPipeline";
-}
-
void
LocalMemPipeline::exec()
{
class LocalMemPipeline
{
public:
- LocalMemPipeline(const ComputeUnitParams *params);
- void init(ComputeUnit *cu);
+ LocalMemPipeline(const ComputeUnitParams *p, ComputeUnit *cu);
void exec();
std::queue<GPUDynInstPtr> &getLMRespFIFO() { return lmReturnedRequests; }
#include "gpu-compute/shader.hh"
#include "gpu-compute/wavefront.hh"
-ScalarMemPipeline::ScalarMemPipeline(const ComputeUnitParams* p) :
- computeUnit(nullptr), queueSize(p->scalar_mem_queue_size),
- inflightStores(0), inflightLoads(0)
+ScalarMemPipeline::ScalarMemPipeline(const ComputeUnitParams* p,
+ ComputeUnit *cu)
+ : computeUnit(cu), _name(cu->name() + ".ScalarMemPipeline"),
+ queueSize(p->scalar_mem_queue_size),
+ inflightStores(0), inflightLoads(0)
{
}
-void
-ScalarMemPipeline::init(ComputeUnit *cu)
-{
- computeUnit = cu;
- _name = computeUnit->name() + ".ScalarMemPipeline";
-}
-
void
ScalarMemPipeline::exec()
{
class ScalarMemPipeline
{
public:
- ScalarMemPipeline(const ComputeUnitParams *params);
- void init(ComputeUnit *cu);
+ ScalarMemPipeline(const ComputeUnitParams *p, ComputeUnit *cu);
void exec();
std::queue<GPUDynInstPtr> &getGMReqFIFO() { return issuedRequests; }
#include "gpu-compute/wavefront.hh"
ScheduleStage::ScheduleStage(const ComputeUnitParams *p, ComputeUnit *cu)
- : vectorAluRdy(false), scalarAluRdy(false), scalarMemBusRdy(false),
+ : computeUnit(cu), _name(cu->name() + ".ScheduleStage"),
+ vectorAluRdy(false), scalarAluRdy(false), scalarMemBusRdy(false),
scalarMemIssueRdy(false), glbMemBusRdy(false), glbMemIssueRdy(false),
locMemBusRdy(false), locMemIssueRdy(false)
{
}
void
-ScheduleStage::init(ComputeUnit *cu)
+ScheduleStage::init()
{
- computeUnit = cu;
- _name = computeUnit->name() + ".ScheduleStage";
fatal_if(scheduler.size() != computeUnit->readyList.size(),
"Scheduler should have same number of entries as CU's readyList");
class ScheduleStage
{
public:
- ScheduleStage(const ComputeUnitParams *params, ComputeUnit *cu);
+ ScheduleStage(const ComputeUnitParams *p, ComputeUnit *cu);
~ScheduleStage();
- void init(ComputeUnit *cu);
+ void init();
void exec();
// Stats related variables and methods
#include "gpu-compute/wavefront.hh"
#include "params/ComputeUnit.hh"
-ScoreboardCheckStage::ScoreboardCheckStage(const ComputeUnitParams *p)
+ScoreboardCheckStage::ScoreboardCheckStage(const ComputeUnitParams *p,
+ ComputeUnit *cu)
+ : computeUnit(cu), _name(cu->name() + ".ScoreboardCheckStage")
{
}
}
void
-ScoreboardCheckStage::init(ComputeUnit *cu)
+ScoreboardCheckStage::init()
{
- computeUnit = cu;
- _name = computeUnit->name() + ".ScoreboardCheckStage";
-
for (int unitId = 0; unitId < computeUnit->numExeUnits(); ++unitId) {
readyList.push_back(&computeUnit->readyList[unitId]);
}
NRDY_CONDITIONS
};
- ScoreboardCheckStage(const ComputeUnitParams* params);
+ ScoreboardCheckStage(const ComputeUnitParams* p, ComputeUnit *cu);
~ScoreboardCheckStage();
- void init(ComputeUnit *cu);
+ void init();
void exec();
// Stats related variables and methods