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

#include <shader.hh>

Inheritance diagram for Shader:
ClockedObject SimObject Clocked EventManager Serializable Drainable

Classes

class  TickEvent
 

Public Types

enum  hsail_mode_e { SIMT, VECTOR_SCALAR }
 
typedef ShaderParams Params
 
- Public Types inherited from ClockedObject
typedef ClockedObjectParams Params
 Parameters of ClockedObject. More...
 
- Public Types inherited from SimObject
typedef SimObjectParams Params
 

Public Member Functions

Tick frequency () const
 
Tick ticks (int numCycles) const
 
Tick getClock () const
 
Tick curCycle () const
 
Tick tickToCycles (Tick val) const
 
 Shader (const Params *p)
 
 ~Shader ()
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected. More...
 
void exec ()
 
bool busy ()
 
void ScheduleAdd (uint32_t *val, Tick when, int x)
 
bool processTimingPacket (PacketPtr pkt)
 
void AccessMem (uint64_t address, void *ptr, uint32_t size, int cu_id, MemCmd cmd, bool suppress_func_errors)
 
void ReadMem (uint64_t address, void *ptr, uint32_t sz, int cu_id)
 
void ReadMem (uint64_t address, void *ptr, uint32_t sz, int cu_id, bool suppress_func_errors)
 
void WriteMem (uint64_t address, void *ptr, uint32_t sz, int cu_id)
 
void WriteMem (uint64_t address, void *ptr, uint32_t sz, int cu_id, bool suppress_func_errors)
 
void doFunctionalAccess (RequestPtr req, MemCmd cmd, void *data, bool suppress_func_errors, int cu_id)
 
void registerCU (int cu_id, ComputeUnit *compute_unit)
 
void handshake (GpuDispatcher *dispatcher)
 
bool dispatch_workgroups (NDRange *ndr)
 
Addr mmap (int length)
 
void functionalTLBAccess (PacketPtr pkt, int cu_id, BaseTLB::Mode mode)
 
void updateContext (int cid)
 
void hostWakeUp (BaseCPU *cpu)
 
- Public Member Functions inherited from ClockedObject
 ClockedObject (const ClockedObjectParams *p)
 
const Paramsparams () const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
Enums::PwrState pwrState () const
 
std::string pwrStateName () const
 
std::vector< double > pwrStateWeights () const
 Returns the percentage residency for each power state. More...
 
void computeStats ()
 Record stats values like state residency by computing the time difference from previous update. More...
 
void pwrState (Enums::PwrState)
 
void regStats () override
 Register statistics for this object. More...
 
- 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 Member Functions inherited from Clocked
void updateClockPeriod () const
 Update the tick to the current tick. More...
 
Tick clockEdge (Cycles cycles=Cycles(0)) const
 Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. More...
 
Cycles curCycle () const
 Determine the current cycle, corresponding to a tick aligned to a clock edge. More...
 
Tick nextCycle () const
 Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. More...
 
uint64_t frequency () const
 
Tick clockPeriod () const
 
double voltage () const
 
Cycles ticksToCycles (Tick t) const
 
Tick cyclesToTicks (Cycles c) const
 

Public Attributes

SimpleThreadcpuThread
 
ThreadContextgpuTc
 
BaseCPUcpuPointer
 
TickEvent tickEvent
 
bool timingSim
 
hsail_mode_e hsail_mode
 
int impl_kern_boundary_sync
 
int separate_acquire_release
 
int coissue_return
 
int trace_vgpr_all
 
int n_cu
 
int n_wf
 
int globalMemSize
 
int funcargs_size
 
int nextSchedCu
 
uint32_t sa_n
 
std::vector< uint32_t * > sa_val
 
std::vector< uint64_t > sa_when
 
std::vector< int32_t > sa_x
 
std::vector< ComputeUnit * > cuList
 
uint64_t tick_cnt
 
uint64_t box_tick_cnt
 
uint64_t start_tick_cnt
 
GpuDispatcherdispatcher
 

Protected Attributes

Tick clock
 
- Protected Attributes inherited from ClockedObject
Enums::PwrState _currPwrState
 To keep track of the current power state. More...
 
Tick prvEvalTick
 
Stats::Scalar numPwrStateTransitions
 
Stats::Distribution pwrStateClkGateDist
 
Stats::Vector pwrStateResidencyTicks
 
- 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...
 

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 Member Functions inherited from Clocked
 Clocked (ClockDomain &clk_domain)
 Create a clocked object and set the clock domain based on the parameters. More...
 
 Clocked (Clocked &)=delete
 
Clockedoperator= (Clocked &)=delete
 
virtual ~Clocked ()
 Virtual destructor due to inheritance. More...
 
void resetClock () const
 Reset the object's clock using the current global tick value. More...
 

Detailed Description

Definition at line 76 of file shader.hh.

Member Typedef Documentation

typedef ShaderParams Shader::Params

Definition at line 84 of file shader.hh.

Member Enumeration Documentation

Enumerator
SIMT 
VECTOR_SCALAR 

Definition at line 85 of file shader.hh.

Constructor & Destructor Documentation

Shader::Shader ( const Params p)

Definition at line 53 of file shader.cc.

References cuList, ArmISA::i, and n_cu.

Shader::~Shader ( )

Definition at line 114 of file shader.cc.

References cuList, ArmISA::j, and n_cu.

Member Function Documentation

void Shader::AccessMem ( uint64_t  address,
void *  ptr,
uint32_t  size,
int  cu_id,
MemCmd  cmd,
bool  suppress_func_errors 
)

Definition at line 342 of file shader.cc.

References cuList, doFunctionalAccess(), and ChunkGenerator::done().

Referenced by GpuDispatcher::accessUserVar(), ReadMem(), and WriteMem().

bool Shader::busy ( )

Definition at line 300 of file shader.cc.

References cuList, and n_cu.

Tick Shader::curCycle ( ) const
inline

Definition at line 94 of file shader.hh.

References clock, and curTick().

bool Shader::dispatch_workgroups ( NDRange ndr)
void Shader::doFunctionalAccess ( RequestPtr  req,
MemCmd  cmd,
void *  data,
bool  suppress_func_errors,
int  cu_id 
)
void Shader::exec ( )

Definition at line 148 of file shader.cc.

References box_tick_cnt, cuList, curTick(), ArmISA::i, n_cu, sa_n, sa_val, sa_when, sa_x, start_tick_cnt, and tick_cnt.

Tick Shader::frequency ( ) const
inline

Definition at line 89 of file shader.hh.

References clock, and SimClock::Frequency.

void Shader::functionalTLBAccess ( PacketPtr  pkt,
int  cu_id,
BaseTLB::Mode  mode 
)
Tick Shader::getClock ( ) const
inline

Definition at line 93 of file shader.hh.

References clock.

void Shader::handshake ( GpuDispatcher dispatcher)

Definition at line 220 of file shader.cc.

References dispatcher.

Referenced by GpuDispatcher::GpuDispatcher().

void Shader::hostWakeUp ( BaseCPU cpu)
void Shader::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 106 of file shader.cc.

References cpuPointer, and gpuTc.

Addr Shader::mmap ( int  length)
bool Shader::processTimingPacket ( PacketPtr  pkt)
void Shader::ReadMem ( uint64_t  address,
void *  ptr,
uint32_t  sz,
int  cu_id 
)

Definition at line 359 of file shader.cc.

References AccessMem(), and MemCmd::ReadReq.

Referenced by GpuDispatcher::notifyWgCompl(), and GpuDispatcher::write().

void Shader::ReadMem ( uint64_t  address,
void *  ptr,
uint32_t  sz,
int  cu_id,
bool  suppress_func_errors 
)

Definition at line 365 of file shader.cc.

References AccessMem(), and MemCmd::ReadReq.

void Shader::registerCU ( int  cu_id,
ComputeUnit compute_unit 
)
inline

Definition at line 198 of file shader.hh.

References cuList.

void Shader::ScheduleAdd ( uint32_t *  val,
Tick  when,
int  x 
)

Definition at line 312 of file shader.cc.

References sa_n, sa_val, sa_when, sa_x, and tick_cnt.

Referenced by LocalMemPipeline::exec(), and GlobalMemPipeline::exec().

Tick Shader::ticks ( int  numCycles) const
inline
Tick Shader::tickToCycles ( Tick  val) const
inline

Definition at line 95 of file shader.hh.

References clock.

void Shader::updateContext ( int  cid)

Definition at line 121 of file shader.cc.

References cpuPointer, and gpuTc.

Referenced by GpuDispatcher::exec().

void Shader::WriteMem ( uint64_t  address,
void *  ptr,
uint32_t  sz,
int  cu_id 
)

Definition at line 372 of file shader.cc.

References AccessMem(), and MemCmd::WriteReq.

Referenced by GpuDispatcher::notifyWgCompl(), and GpuDispatcher::write().

void Shader::WriteMem ( uint64_t  address,
void *  ptr,
uint32_t  sz,
int  cu_id,
bool  suppress_func_errors 
)

Definition at line 378 of file shader.cc.

References AccessMem(), and MemCmd::WriteReq.

Member Data Documentation

uint64_t Shader::box_tick_cnt

Definition at line 162 of file shader.hh.

Referenced by exec().

Tick Shader::clock
protected

Definition at line 81 of file shader.hh.

Referenced by curCycle(), frequency(), getClock(), ticks(), and tickToCycles().

int Shader::coissue_return

Definition at line 125 of file shader.hh.

Referenced by LocalMemPipeline::exec(), and GlobalMemPipeline::exec().

BaseCPU* Shader::cpuPointer

Definition at line 100 of file shader.hh.

Referenced by hostWakeUp(), init(), and updateContext().

SimpleThread* Shader::cpuThread

Definition at line 98 of file shader.hh.

std::vector<ComputeUnit*> Shader::cuList
GpuDispatcher* Shader::dispatcher
int Shader::funcargs_size

Definition at line 143 of file shader.hh.

Referenced by ComputeUnit::init(), and GpuDispatcher::setFuncargsSize().

int Shader::globalMemSize

Definition at line 133 of file shader.hh.

Referenced by GlobalMemPipeline::init().

ThreadContext* Shader::gpuTc
hsail_mode_e Shader::hsail_mode

Definition at line 117 of file shader.hh.

Referenced by Wavefront::exec().

int Shader::impl_kern_boundary_sync

Definition at line 120 of file shader.hh.

Referenced by ComputeUnit::StartWorkgroup().

int Shader::n_cu

Definition at line 129 of file shader.hh.

Referenced by busy(), dispatch_workgroups(), exec(), functionalTLBAccess(), Shader(), and ~Shader().

int Shader::n_wf
int Shader::nextSchedCu

Definition at line 146 of file shader.hh.

Referenced by dispatch_workgroups().

uint32_t Shader::sa_n

Definition at line 149 of file shader.hh.

Referenced by exec(), and ScheduleAdd().

std::vector<uint32_t*> Shader::sa_val

Definition at line 152 of file shader.hh.

Referenced by exec(), and ScheduleAdd().

std::vector<uint64_t> Shader::sa_when

Definition at line 154 of file shader.hh.

Referenced by exec(), and ScheduleAdd().

std::vector<int32_t> Shader::sa_x

Definition at line 156 of file shader.hh.

Referenced by exec(), and ScheduleAdd().

int Shader::separate_acquire_release

Definition at line 123 of file shader.hh.

uint64_t Shader::start_tick_cnt

Definition at line 163 of file shader.hh.

Referenced by exec().

uint64_t Shader::tick_cnt
TickEvent Shader::tickEvent

Definition at line 113 of file shader.hh.

Referenced by dispatch_workgroups().

bool Shader::timingSim

Definition at line 116 of file shader.hh.

Referenced by FetchUnit::init(), and ComputeUnit::sendRequest().

int Shader::trace_vgpr_all

Definition at line 127 of file shader.hh.


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

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