34 #ifndef __GPU_DYN_INST_HH__ 35 #define __GPU_DYN_INST_HH__ 42 #include "enums/MemType.hh" 43 #include "enums/StorageClassType.hh" 59 : c(_c), s(_s), computeUnit(compute_unit) { }
92 int numSrcRegOperands();
93 int numDstRegOperands();
95 bool isVectorRegister(
int operandIdx);
96 bool isScalarRegister(
int operandIdx);
97 bool isCondRegister(
int operandIdx);
98 int getRegisterIndex(
int operandIdx,
GPUDynInstPtr gpuDynInst);
99 int getOperandSize(
int operandIdx);
100 bool isDstOperand(
int operandIdx);
101 bool isSrcOperand(
int operandIdx);
103 const std::string &disassemble()
const;
105 uint64_t seqNum()
const;
107 Enums::StorageClassType executedAs();
172 bool isBranch()
const;
174 bool isReturn()
const;
175 bool isUnconditionalJump()
const;
176 bool isSpecialOp()
const;
177 bool isWaitcnt()
const;
179 bool isBarrier()
const;
180 bool isMemFence()
const;
181 bool isMemRef()
const;
184 bool isStore()
const;
186 bool isAtomic()
const;
187 bool isAtomicNoRet()
const;
188 bool isAtomicRet()
const;
190 bool isScalar()
const;
191 bool readsSCC()
const;
192 bool writesSCC()
const;
193 bool readsVCC()
const;
194 bool writesVCC()
const;
196 bool isAtomicAnd()
const;
197 bool isAtomicOr()
const;
198 bool isAtomicXor()
const;
199 bool isAtomicCAS()
const;
200 bool isAtomicExch()
const;
201 bool isAtomicAdd()
const;
202 bool isAtomicSub()
const;
203 bool isAtomicInc()
const;
204 bool isAtomicDec()
const;
205 bool isAtomicMax()
const;
206 bool isAtomicMin()
const;
208 bool isArgLoad()
const;
209 bool isGlobalMem()
const;
210 bool isLocalMem()
const;
212 bool isArgSeg()
const;
213 bool isGlobalSeg()
const;
214 bool isGroupSeg()
const;
215 bool isKernArgSeg()
const;
216 bool isPrivateSeg()
const;
217 bool isReadOnlySeg()
const;
218 bool isSpillSeg()
const;
220 bool isWorkitemScope()
const;
221 bool isWavefrontScope()
const;
222 bool isWorkgroupScope()
const;
223 bool isDeviceScope()
const;
224 bool isSystemScope()
const;
225 bool isNoScope()
const;
227 bool isRelaxedOrder()
const;
228 bool isAcquire()
const;
229 bool isRelease()
const;
230 bool isAcquireRelease()
const;
231 bool isNoOrder()
const;
233 bool isGloballyCoherent()
const;
234 bool isSystemCoherent()
const;
258 return m5::make_unique<AtomicOpAnd<c0>>(*reg0);
259 }
else if (isAtomicOr()) {
260 return m5::make_unique<AtomicOpOr<c0>>(*reg0);
261 }
else if (isAtomicXor()) {
262 return m5::make_unique<AtomicOpXor<c0>>(*reg0);
263 }
else if (isAtomicCAS()) {
264 return m5::make_unique<AtomicOpCAS<c0>>(*reg0, *reg1, cu);
265 }
else if (isAtomicExch()) {
266 return m5::make_unique<AtomicOpExch<c0>>(*reg0);
267 }
else if (isAtomicAdd()) {
268 return m5::make_unique<AtomicOpAdd<c0>>(*reg0);
269 }
else if (isAtomicSub()) {
270 return m5::make_unique<AtomicOpSub<c0>>(*reg0);
271 }
else if (isAtomicInc()) {
272 return m5::make_unique<AtomicOpInc<c0>>();
273 }
else if (isAtomicDec()) {
274 return m5::make_unique<AtomicOpDec<c0>>();
275 }
else if (isAtomicMax()) {
276 return m5::make_unique<AtomicOpMax<c0>>(*reg0);
277 }
else if (isAtomicMin()) {
278 return m5::make_unique<AtomicOpMin<c0>>(*reg0);
280 fatal(
"Unrecognized atomic operation");
288 if (isPrivateSeg()) {
290 }
else if (isSpillSeg()) {
292 }
else if (isGlobalSeg()) {
294 }
else if (isReadOnlySeg()) {
296 }
else if (isGroupSeg()) {
298 }
else if (isFlat()) {
299 panic(
"TODO: translate to correct scope");
301 fatal(
"%s has bad segment type\n", disassemble());
304 if (isWavefrontScope()) {
307 }
else if (isWorkgroupScope()) {
310 }
else if (isDeviceScope()) {
313 }
else if (isSystemScope()) {
316 }
else if (!isNoScope() && !isWorkitemScope()) {
317 fatal(
"%s has bad scope type\n", disassemble());
324 }
else if (isRelease()) {
326 }
else if (isAcquireRelease()) {
328 }
else if (!isNoOrder()) {
329 fatal(
"%s has bad memory order\n", disassemble());
338 }
else if (isAtomicNoRet()) {
359 #endif // __GPU_DYN_INST_HH__
#define panic(...)
This implements a cprintf based panic() function.
Access has Workgroup scope visibility.
StatusVector memStatusVector
Access has Wavefront scope visibility.
#define fatal(...)
This implements a cprintf based fatal() function.
std::vector< int > tlbHitLevel
std::map< unsigned, waveQueue > xactCasLoadMap
std::function< void(GPUStaticInst *, GPUDynInstPtr)> execContinuation
std::shared_ptr< Request > RequestPtr
std::bitset< std::numeric_limits< unsigned long long >::digits > VectorMask
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
The request should be marked with RELEASE.
Access has System (e.g., CPU + GPU) scope visibility.
ComputeUnit * computeUnit
std::vector< int > statusVector
AtomicOpCAS(T _c, T _s, ComputeUnit *compute_unit)
std::shared_ptr< GPUDynInst > GPUDynInstPtr
void setRequestFlags(RequestPtr req, bool setMemOrder=true)
uint64_t Tick
Tick count type.
The request is an atomic that returns data.
The request is an atomic that does not return data.
GPUStaticInst * staticInstruction()
Has a synchronization scope been set?
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
AtomicOpFunctorPtr makeAtomicOpFunctor(c0 *reg0, c0 *reg1)
AtomicOpFunctor * clone()
GPUStaticInst * _staticInst
Stats::Scalar numFailedCASOps
VectorMask statusBitVector
std::unordered_map< Addr, std::vector< int > > StatusVector
Access has Device (e.g., GPU) scope visibility.
The request should be marked with ACQUIRE.