gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Wavefront Class Reference

#include <wavefront.hh>

Inheritance diagram for Wavefront:
SimObject EventManager Serializable Drainable

Public Types

enum  itype_e {
  I_ALU, I_GLOBAL, I_SHARED, I_FLAT,
  I_PRIVATE
}
 
enum  status_e { S_STOPPED, S_RETURNING, S_RUNNING }
 
typedef WavefrontParams Params
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

uint32_t remap (uint32_t vgprIndex, uint32_t size, uint8_t mode=0)
 
void resizeRegFiles (int num_cregs, int num_sregs, int num_dregs)
 
bool isGmInstruction (GPUDynInstPtr ii)
 
bool isLmInstruction (GPUDynInstPtr ii)
 
bool isOldestInstGMem ()
 
bool isOldestInstLMem ()
 
bool isOldestInstPrivMem ()
 
bool isOldestInstFlatMem ()
 
bool isOldestInstALU ()
 
bool isOldestInstBarrier ()
 
void computeActualWgSz (NDRange *ndr)
 
void initCallArgMem (int func_args_size_per_item, int wf_size)
 
template<typename CType >
CType readCallArgMem (int lane, int addr)
 
template<typename CType >
void writeCallArgMem (int lane, int addr, CType val)
 
 Wavefront (const Params *p)
 
 ~Wavefront ()
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
void setParent (ComputeUnit *cu)
 
void start (uint64_t _wfDynId, uint64_t _base_ptr)
 
void exec ()
 
void updateResources ()
 
int ready (itype_e type)
 
bool instructionBufferHasBranch ()
 
void regStats ()
 Register statistics for this object. More...
 
VectorMask getPred ()
 
bool waitingAtBarrier (int lane)
 
void pushToReconvergenceStack (uint32_t pc, uint32_t rpc, const VectorMask &exec_mask)
 
void popFromReconvergenceStack ()
 
uint32_t pc () const
 
uint32_t rpc () const
 
VectorMask execMask () const
 
bool execMask (int lane) const
 
void pc (uint32_t new_pc)
 
void discardFetch ()
 
uint32_t getStaticContextSize () const
 Returns the size of the static hardware context of a particular wavefront This should be updated everytime the context is changed. More...
 
void getContext (const void *out)
 Returns the hardware context as a stream of bytes This method is designed for HSAIL execution. More...
 
void setContext (const void *in)
 Sets the hardware context fromt a stream of bytes This method is designed for HSAIL execution. More...
 
TheGpuISA::GPUISA & gpuISA ()
 
- Public Member Functions inherited from SimObject
const Paramsparams () const
 
 SimObject (const Params *_params)
 
virtual ~SimObject ()
 
virtual const std::string name () const
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint. More...
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint. More...
 
virtual void resetStats ()
 Reset statistics associated with this object. More...
 
virtual void regProbePoints ()
 Register probe points for this object. More...
 
virtual void regProbeListeners ()
 Register probe listeners for this object. More...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual void startup ()
 startup() is the final initialization call before simulation. More...
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining. More...
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes. More...
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers. More...
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from EventManager
 EventManager (EventManager &em)
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick)-1)
 
void setCurTick (Tick newVal)
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from Drainable
DrainState drainState () const
 Return the current drain state of an object. More...
 
virtual void notifyFork ()
 Notify a child process of a fork. More...
 

Public Attributes

uint64_t basePtr
 
uint32_t oldBarrierCnt
 
uint32_t barrierCnt
 
uint32_t barrierId
 
uint32_t barrierSlots
 
status_e status
 
int wfSlotId
 
int kernId
 
int simdId
 
ComputeUnitcomputeUnit
 
std::deque< GPUDynInstPtrinstructionBuffer
 
bool pendingFetch
 
bool dropFetch
 
class ConditionRegisterStatecondRegState
 
uint32_t maxSpVgprs
 
uint32_t maxDpVgprs
 
std::vector< AddrlastAddr
 
std::vector< uint32_t > workItemId [3]
 
std::vector< uint32_t > workItemFlatId
 
uint32_t workGroupId [3]
 
uint32_t workGroupSz [3]
 
uint32_t gridSz [3]
 
uint32_t wgId
 
uint32_t wgSz
 
uint32_t actualWgSz [3]
 
uint32_t actualWgSzTotal
 
uint32_t wfId
 
uint32_t maxDynWaveId
 
uint32_t dispatchId
 
uint32_t outstandingReqs
 
uint32_t memReqsInPipe
 
uint32_t outstandingReqsWrGm
 
uint32_t outstandingReqsWrLm
 
uint32_t outstandingReqsRdGm
 
uint32_t outstandingReqsRdLm
 
uint32_t rdLmReqsInPipe
 
uint32_t rdGmReqsInPipe
 
uint32_t wrLmReqsInPipe
 
uint32_t wrGmReqsInPipe
 
int memTraceBusy
 
uint64_t lastTrace
 
int reservedVectorRegs
 
uint32_t startVgprIndex
 
std::vector< uint32_t > oldVgpr
 
uint32_t oldVgprId
 
uint64_t oldVgprTcnt
 
std::vector< uint64_t > oldDgpr
 
uint32_t oldDgprId
 
uint64_t oldDgprTcnt
 
VectorMask initMask
 
std::vector< int > barCnt
 
int maxBarCnt
 
bool stalledAtBarrier
 
LdsChunkldsChunk
 
Addr spillBase
 
uint32_t spillSizePerItem
 
uint32_t spillWidth
 
Addr privBase
 
uint32_t privSizePerItem
 
Addr roBase
 
uint32_t roSize
 
uint8_t * kernelArgs
 
uint64_t wfDynId
 
Stats::Scalar numTimesBlockedDueVrfPortAvail
 
Stats::Scalar numTimesBlockedDueWAXDependencies
 
Stats::Scalar numTimesBlockedDueRAWDependencies
 
Stats::Distribution srcRegOpDist
 
Stats::Distribution dstRegOpDist
 
CallArgMemcallArgMem
 

Private Attributes

TheGpuISA::GPUISA _gpuISA
 
std::deque< std::unique_ptr
< ReconvergenceStackEntry > > 
reconvergenceStack
 Stack containing Control Flow Graph nodes (i.e., kernel instructions) to be visited by the wavefront, and the associated execution masks. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static void serializeAll (CheckpointOut &cp)
 Serialize all SimObjects in the system. More...
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it. More...
 
- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 
- Protected Member Functions inherited from Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain. More...
 
void signalDrainDone () const
 Signal that an object is drained. More...
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

Definition at line 147 of file wavefront.hh.

Member Typedef Documentation

typedef WavefrontParams Wavefront::Params

Definition at line 321 of file wavefront.hh.

Member Enumeration Documentation

Enumerator
I_ALU 
I_GLOBAL 
I_SHARED 
I_FLAT 
I_PRIVATE 

Definition at line 150 of file wavefront.hh.

Enumerator
S_STOPPED 
S_RETURNING 
S_RUNNING 

Definition at line 151 of file wavefront.hh.

Constructor & Destructor Documentation

Wavefront::Wavefront ( const Params p)
Wavefront::~Wavefront ( )

Definition at line 149 of file wavefront.cc.

References callArgMem, and condRegState.

Member Function Documentation

void Wavefront::computeActualWgSz ( NDRange ndr)

Definition at line 982 of file wavefront.cc.

References actualWgSz, actualWgSzTotal, ArmISA::d, gridSz, NDRange::wgId, and workGroupSz.

Referenced by ComputeUnit::fillKernelState().

void Wavefront::discardFetch ( )

Definition at line 809 of file wavefront.cc.

References dropFetch, instructionBuffer, and pendingFetch.

Referenced by exec().

void Wavefront::exec ( )
VectorMask Wavefront::execMask ( ) const
bool Wavefront::execMask ( int  lane) const

Definition at line 834 of file wavefront.cc.

References reconvergenceStack.

void Wavefront::getContext ( const void *  out)
VectorMask Wavefront::getPred ( )
inline
uint32_t Wavefront::getStaticContextSize ( ) const

Returns the size of the static hardware context of a particular wavefront This should be updated everytime the context is changed.

Definition at line 847 of file wavefront.cc.

References barCnt, barrierCnt, barrierId, computeUnit, ComputeUnit::cu_id, initMask, ldsChunk, maxBarCnt, oldBarrierCnt, privBase, spillBase, wfId, ComputeUnit::wfSize(), and wgId.

TheGpuISA::GPUISA& Wavefront::gpuISA ( )
inline

Definition at line 378 of file wavefront.hh.

References _gpuISA.

void Wavefront::init ( )
virtual

init() is called after all C++ SimObjects have been created and all ports are connected.

Initializations that are independent of unserialization but rely on a fully instantiated and connected SimObject graph should be done here.

Reimplemented from SimObject.

Definition at line 135 of file wavefront.cc.

References reservedVectorRegs, and startVgprIndex.

void Wavefront::initCallArgMem ( int  func_args_size_per_item,
int  wf_size 
)
inline

Definition at line 302 of file wavefront.hh.

References callArgMem.

bool Wavefront::instructionBufferHasBranch ( )

Definition at line 266 of file wavefront.cc.

References instructionBuffer.

Referenced by FetchUnit::exec().

bool Wavefront::isGmInstruction ( GPUDynInstPtr  ii)

Definition at line 165 of file wavefront.cc.

Referenced by exec().

bool Wavefront::isLmInstruction ( GPUDynInstPtr  ii)

Definition at line 174 of file wavefront.cc.

Referenced by exec().

bool Wavefront::isOldestInstALU ( )

Definition at line 184 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

Referenced by ScoreboardCheckStage::collectStatistics().

bool Wavefront::isOldestInstBarrier ( )

Definition at line 199 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

bool Wavefront::isOldestInstFlatMem ( )

Definition at line 251 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

Referenced by ScoreboardCheckStage::collectStatistics().

bool Wavefront::isOldestInstGMem ( )

Definition at line 212 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

Referenced by ScoreboardCheckStage::collectStatistics().

bool Wavefront::isOldestInstLMem ( )

Definition at line 225 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

Referenced by ScoreboardCheckStage::collectStatistics().

bool Wavefront::isOldestInstPrivMem ( )

Definition at line 238 of file wavefront.cc.

References instructionBuffer, S_STOPPED, and status.

Referenced by ScoreboardCheckStage::collectStatistics().

uint32_t Wavefront::pc ( ) const
void Wavefront::pc ( uint32_t  new_pc)

Definition at line 841 of file wavefront.cc.

References reconvergenceStack.

void Wavefront::popFromReconvergenceStack ( )
void Wavefront::pushToReconvergenceStack ( uint32_t  pc,
uint32_t  rpc,
const VectorMask exec_mask 
)
template<typename CType >
CType Wavefront::readCallArgMem ( int  lane,
int  addr 
)
inline
int Wavefront::ready ( itype_e  type)
void Wavefront::regStats ( )
virtual
uint32_t Wavefront::remap ( uint32_t  vgprIndex,
uint32_t  size,
uint8_t  mode = 0 
)
void Wavefront::resizeRegFiles ( int  num_cregs,
int  num_sregs,
int  num_dregs 
)
uint32_t Wavefront::rpc ( ) const
void Wavefront::setContext ( const void *  in)
void Wavefront::setParent ( ComputeUnit cu)
inline

Definition at line 327 of file wavefront.hh.

References computeUnit.

void Wavefront::start ( uint64_t  _wfDynId,
uint64_t  _base_ptr 
)

Definition at line 157 of file wavefront.cc.

References basePtr, S_RUNNING, status, and wfDynId.

Referenced by ComputeUnit::startWavefront().

void Wavefront::updateResources ( )
bool Wavefront::waitingAtBarrier ( int  lane)

Definition at line 777 of file wavefront.cc.

References barCnt, and maxBarCnt.

template<typename CType >
void Wavefront::writeCallArgMem ( int  lane,
int  addr,
CType  val 
)
inline

Definition at line 316 of file wavefront.hh.

References addr, callArgMem, CallArgMem::setLaneAddr(), and X86ISA::val.

Referenced by ListOperand::set().

Member Data Documentation

TheGpuISA::GPUISA Wavefront::_gpuISA
private

Definition at line 384 of file wavefront.hh.

Referenced by exec(), and gpuISA().

uint32_t Wavefront::actualWgSz[3]

Definition at line 202 of file wavefront.hh.

Referenced by computeActualWgSz(), and ComputeUnit::startWavefront().

uint32_t Wavefront::actualWgSzTotal
std::vector<int> Wavefront::barCnt
uint32_t Wavefront::barrierCnt
uint32_t Wavefront::barrierId
uint32_t Wavefront::barrierSlots

Definition at line 159 of file wavefront.hh.

Referenced by ComputeUnit::startWavefront().

uint64_t Wavefront::basePtr

Definition at line 154 of file wavefront.hh.

Referenced by FetchUnit::initiateFetch(), and start().

CallArgMem* Wavefront::callArgMem

Definition at line 300 of file wavefront.hh.

Referenced by initCallArgMem(), readCallArgMem(), writeCallArgMem(), and ~Wavefront().

ComputeUnit* Wavefront::computeUnit

Definition at line 167 of file wavefront.hh.

Referenced by HsailISA::Call::calcAddr(), HsailISA::calcPrivAddr(), RegAddrOperand< RegOperandType >::calcVector(), NoRegAddrOperand::calcVector(), HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::completeAcc(), HsailISA::AtomicInst< MemDataType, AddrOperandType, NumSrcOperands, HasDst >::completeAcc(), LocalMemPipeline::exec(), GlobalMemPipeline::exec(), ConditionRegisterState::exec(), exec(), HsailISA::Call::execPseudoInst(), HsailISA::LdaInst< DestDataType, AddrOperandType >::execute(), HsailISA::CbrInstBase< TargetType >::execute(), HsailISA::LdInst< MemDataType, DestDataType, AddrOperandType >::execute(), HsailISA::Ret::execute(), HsailISA::MemFence::execute(), HsailISA::StInst< MemDataType, SrcDataType, AddrOperandType >::execute(), HsailISA::AtomicInst< MemDataType, AddrOperandType, NumSrcOperands, HasDst >::execute(), getContext(), getStaticContextSize(), HsailISA::MemFence::initiateAcc(), HsailISA::Call::MagicAtomicNRAddGlobalU32Reg(), HsailISA::Call::MagicAtomicNRAddGroupU32Reg(), HsailISA::Call::MagicJoinWFBar(), HsailISA::Call::MagicLoadGlobalU32Reg(), HsailISA::Call::MagicMaskLower(), HsailISA::Call::MagicMaskUpper(), HsailISA::Call::MagicMostSigBroadcast(), HsailISA::Call::MagicMostSigThread(), HsailISA::Call::MagicPanic(), HsailISA::Call::MagicPrefixSum(), HsailISA::Call::MagicPrintLane(), HsailISA::Call::MagicPrintLane64(), HsailISA::Call::MagicPrintWF32(), HsailISA::Call::MagicPrintWF32ID(), HsailISA::Call::MagicPrintWF64(), HsailISA::Call::MagicPrintWFFloat(), HsailISA::Call::MagicPrintWFID64(), HsailISA::Call::MagicReduction(), HsailISA::Call::MagicSimBreak(), HsailISA::Call::MagicWaitWFBar(), HsailISA::Call::MagicXactCasLd(), popFromReconvergenceStack(), ready(), remap(), SRegOperand::set(), DRegOperand::set(), CRegOperand::set(), ListOperand::set(), setContext(), setParent(), and updateResources().

class ConditionRegisterState* Wavefront::condRegState
uint32_t Wavefront::dispatchId

Definition at line 208 of file wavefront.hh.

Referenced by HsailISA::Ret::execute(), ready(), and ComputeUnit::startWavefront().

bool Wavefront::dropFetch
Stats::Distribution Wavefront::dstRegOpDist

Definition at line 296 of file wavefront.hh.

Referenced by exec(), and regStats().

uint32_t Wavefront::gridSz[3]

Definition at line 198 of file wavefront.hh.

Referenced by computeActualWgSz(), and ComputeUnit::fillKernelState().

VectorMask Wavefront::initMask
std::deque<GPUDynInstPtr> Wavefront::instructionBuffer
uint8_t* Wavefront::kernelArgs
int Wavefront::kernId
std::vector<Addr> Wavefront::lastAddr
uint64_t Wavefront::lastTrace

Definition at line 228 of file wavefront.hh.

Referenced by Wavefront().

LdsChunk* Wavefront::ldsChunk
int Wavefront::maxBarCnt
uint32_t Wavefront::maxDpVgprs

Definition at line 179 of file wavefront.hh.

Referenced by getContext(), resizeRegFiles(), setContext(), and Wavefront().

uint32_t Wavefront::maxDynWaveId

Definition at line 207 of file wavefront.hh.

uint32_t Wavefront::maxSpVgprs

Definition at line 177 of file wavefront.hh.

Referenced by getContext(), remap(), resizeRegFiles(), setContext(), and Wavefront().

uint32_t Wavefront::memReqsInPipe
int Wavefront::memTraceBusy

Definition at line 227 of file wavefront.hh.

Referenced by Wavefront().

Stats::Scalar Wavefront::numTimesBlockedDueRAWDependencies

Definition at line 292 of file wavefront.hh.

Referenced by VectorRegisterFile::operandsReady(), and regStats().

Stats::Scalar Wavefront::numTimesBlockedDueVrfPortAvail

Definition at line 286 of file wavefront.hh.

Referenced by regStats().

Stats::Scalar Wavefront::numTimesBlockedDueWAXDependencies

Definition at line 289 of file wavefront.hh.

Referenced by VectorRegisterFile::operandsReady(), and regStats().

uint32_t Wavefront::oldBarrierCnt
std::vector<uint64_t> Wavefront::oldDgpr

Definition at line 243 of file wavefront.hh.

Referenced by Wavefront().

uint32_t Wavefront::oldDgprId

Definition at line 245 of file wavefront.hh.

uint64_t Wavefront::oldDgprTcnt

Definition at line 247 of file wavefront.hh.

Referenced by Wavefront().

std::vector<uint32_t> Wavefront::oldVgpr

Definition at line 236 of file wavefront.hh.

Referenced by Wavefront().

uint32_t Wavefront::oldVgprId

Definition at line 238 of file wavefront.hh.

uint64_t Wavefront::oldVgprTcnt

Definition at line 240 of file wavefront.hh.

Referenced by Wavefront().

uint32_t Wavefront::outstandingReqs
uint32_t Wavefront::outstandingReqsRdGm
uint32_t Wavefront::outstandingReqsRdLm
uint32_t Wavefront::outstandingReqsWrGm
uint32_t Wavefront::outstandingReqsWrLm
bool Wavefront::pendingFetch
Addr Wavefront::privBase
uint32_t Wavefront::privSizePerItem
uint32_t Wavefront::rdGmReqsInPipe
uint32_t Wavefront::rdLmReqsInPipe
std::deque<std::unique_ptr<ReconvergenceStackEntry> > Wavefront::reconvergenceStack
private

Stack containing Control Flow Graph nodes (i.e., kernel instructions) to be visited by the wavefront, and the associated execution masks.

The reconvergence stack grows every time the wavefront reaches a divergence point (branch instruction), and shrinks every time the wavefront reaches a reconvergence point (immediate post-dominator instruction).

Definition at line 392 of file wavefront.hh.

Referenced by execMask(), getContext(), pc(), popFromReconvergenceStack(), pushToReconvergenceStack(), and rpc().

int Wavefront::reservedVectorRegs
Addr Wavefront::roBase
uint32_t Wavefront::roSize
int Wavefront::simdId
Addr Wavefront::spillBase
uint32_t Wavefront::spillSizePerItem
uint32_t Wavefront::spillWidth
Stats::Distribution Wavefront::srcRegOpDist

Definition at line 295 of file wavefront.hh.

Referenced by exec(), and regStats().

bool Wavefront::stalledAtBarrier
uint32_t Wavefront::startVgprIndex
status_e Wavefront::status
uint64_t Wavefront::wfDynId
uint32_t Wavefront::wfId
int Wavefront::wfSlotId
uint32_t Wavefront::wgId
uint32_t Wavefront::wgSz

Definition at line 200 of file wavefront.hh.

Referenced by ComputeUnit::fillKernelState().

uint32_t Wavefront::workGroupId[3]

Definition at line 196 of file wavefront.hh.

Referenced by ComputeUnit::startWavefront().

uint32_t Wavefront::workGroupSz[3]

Definition at line 197 of file wavefront.hh.

Referenced by computeActualWgSz(), and ComputeUnit::fillKernelState().

std::vector<uint32_t> Wavefront::workItemFlatId

Definition at line 194 of file wavefront.hh.

Referenced by ComputeUnit::startWavefront(), and Wavefront().

std::vector<uint32_t> Wavefront::workItemId[3]

Definition at line 193 of file wavefront.hh.

Referenced by getContext(), setContext(), ComputeUnit::startWavefront(), and Wavefront().

uint32_t Wavefront::wrGmReqsInPipe
uint32_t Wavefront::wrLmReqsInPipe

The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:23 for gem5 by doxygen 1.8.6