1#ifndef SRC_WARP_WARP_HH_
2#define SRC_WARP_WARP_HH_
9#include "../thread/thread.hh"
12#define WARP_THREAD_COUNT 32
Represents a GPU warpThe Warp class encapsulates the state and behavior of a GPU warp,...
Definition warp.hh:90
int getId() const
Definition warp.cc:14
void setPc(int pc_)
Definition warp.cc:22
size_t getReconvergenceStackSize() const
Definition warp.cc:129
Warp()
Definition warp.cc:3
bool isBranchDivergent
Definition warp.hh:105
int id
Definition warp.hh:91
std::bitset< WARP_THREAD_COUNT > getActiveMaskFromReconvergenceStack() const
Get the active mask from the top reconvergence point on the stack.
Definition warp.cc:133
void peekReconvergencePoint() const
Peek the top reconvergence point on the stack This method is used for debugging purposes to check the...
Definition warp.cc:112
int pc
Definition warp.hh:92
ThreadGroup threads
Definition warp.hh:93
PipelineStage getPipelineStage() const
Definition warp.hh:117
void setActiveMask(const ActiveMask &mask)
Definition warp.hh:119
const ActiveMask & getActiveMask() const
Definition warp.cc:26
std::vector< reconvergencePoint > reconvergenceStack
Reconvergence stack for handling divergent control flow.
Definition warp.hh:101
int getPc() const
Definition warp.cc:18
void popReconvergencePoint()
Pop the top reconvergence point from the stack This method is called when a reconvergence point is re...
Definition warp.cc:121
void setPipelineStage(PipelineStage stage)
Definition warp.hh:118
void setDivergent()
Definition warp.hh:124
PipelineStage pipelineStage
Definition warp.hh:104
std::string getPipelineStageString() const
Definition warp.cc:38
void addReconvergencePoint(int pc, const ActiveMask &mask)
Add a reconvergence point to the stack.
Definition warp.cc:108
ActiveMask activeMask
Definition warp.hh:94
void setCurrentInstruction(const Instruction &instr)
Definition warp.cc:30
Instruction currentInstruction
Definition warp.hh:95
Instruction getCurrentInstruction() const
Definition warp.cc:34
WarpState getState() const
Definition warp.hh:122
bool isDivergent() const
Definition warp.hh:123
std::string getInstructionTypeString(Instruction inst) const
Definition warp.cc:50
void execute()
Definition warp.cc:60
WarpState state
Definition warp.hh:103
Instruction structure.
Definition warp.hh:28
int dest
Definition warp.hh:30
int src2
Definition warp.hh:32
bool isBranch
Definition warp.hh:33
Instruction(InstructionType t, int d, int s1, int s2, bool isBranch=false)
Definition warp.hh:35
int src1
Definition warp.hh:31
InstructionType type
Definition warp.hh:29
Instruction()
Definition warp.hh:37
Represents a reconvergence point in a warp It has PC value and active mask to indicate which threads ...
Definition warp.hh:47
int pc
Definition warp.hh:48
reconvergencePoint()
Definition warp.hh:53
ActiveMask mask
Definition warp.hh:49
reconvergencePoint(int pc_, const ActiveMask &mask_)
Definition warp.hh:51
std::array< Thread, WARP_THREAD_COUNT > ThreadGroup
Definition warp.hh:80
InstructionType
Instruction types enumeration.
Definition warp.hh:19
@ SUB
Definition warp.hh:21
@ LOAD
Definition warp.hh:22
@ ADD
Definition warp.hh:20
@ BRANCH
Definition warp.hh:24
@ STORE
Definition warp.hh:23
PipelineStage
Pipeline stages for a warp.
Definition warp.hh:70
@ STAGE_1
Definition warp.hh:73
@ STAGE_3
Definition warp.hh:75
@ DONE
Definition warp.hh:76
@ STAGE_2
Definition warp.hh:74
@ NOT_STARTED
Definition warp.hh:71
@ STAGE_0
Definition warp.hh:72
WarpState
Warp states Not using this yet but can be useful in future iterations to manage the state of warps mo...
Definition warp.hh:60
@ RUNNING
Definition warp.hh:62
@ READY
Definition warp.hh:61
@ STALLED
Definition warp.hh:63
std::bitset< WARP_THREAD_COUNT > ActiveMask
Definition warp.hh:15