33a34
> #include <bitset>
129,130c130,154
< /** Is the instruction in the IQ */
< bool iqEntry;
---
> enum Status {
> IqEntry, /// Instruction is in the IQ
> RobEntry, /// Instruction is in the ROB
> LsqEntry, /// Instruction is in the LSQ
> Completed, /// Instruction has completed
> ResultReady, /// Instruction has its result
> CanIssue, /// Instruction can issue and execute
> Issued, /// Instruction has issued
> Executed, /// Instruction has executed
> CanCommit, /// Instruction can commit
> AtCommit, /// Instruction has reached commit
> Committed, /// Instruction has committed
> Squashed, /// Instruction is squashed
> SquashedInIQ, /// Instruction is squashed in the IQ
> SquashedInLSQ, /// Instruction is squashed in the LSQ
> SquashedInROB, /// Instruction is squashed in the ROB
> RecoverInst, /// Is a recover instruction
> BlockingInst, /// Is a blocking instruction
> ThreadsyncWait, /// Is a thread synchronization instruction
> SerializeBefore, /// Needs to serialize on
> /// instructions ahead of it
> SerializeAfter, /// Needs to serialize instructions behind it
> SerializeHandled, /// Serialization has been handled
> NumStatus
> };
132,133c156,157
< /** Is the instruction in the ROB */
< bool robEntry;
---
> /** The status of this BaseDynInst. Several bits can be set. */
> std::bitset<NumStatus> status;
135,179d158
< /** Is the instruction in the LSQ */
< bool lsqEntry;
<
< /** Is the instruction completed. */
< bool completed;
<
< /** Is the instruction's result ready. */
< bool resultReady;
<
< /** Can this instruction issue. */
< bool canIssue;
<
< /** Has this instruction issued. */
< bool issued;
<
< /** Has this instruction executed (or made it through execute) yet. */
< bool executed;
<
< /** Can this instruction commit. */
< bool canCommit;
<
< /** Is this instruction committed. */
< bool committed;
<
< /** Is this instruction squashed. */
< bool squashed;
<
< /** Is this instruction squashed in the instruction queue. */
< bool squashedInIQ;
<
< /** Is this instruction squashed in the instruction queue. */
< bool squashedInLSQ;
<
< /** Is this instruction squashed in the instruction queue. */
< bool squashedInROB;
<
< /** Is this a recover instruction. */
< bool recoverInst;
<
< /** Is this a thread blocking instruction. */
< bool blockingInst; /* this inst has called thread_block() */
<
< /** Is this a thread syncrhonization instruction. */
< bool threadsyncWait;
<
219,224d197
< /** The size of the data to be stored. */
< int storeSize;
<
< /** The data to be stored. */
< IntReg storeData;
<
341c314
< { return staticInst->isSerializeBefore() || serializeBefore; }
---
> { return staticInst->isSerializeBefore() || status[SerializeBefore]; }
343c316
< { return staticInst->isSerializeAfter() || serializeAfter; }
---
> { return staticInst->isSerializeAfter() || status[SerializeAfter]; }
352c325
< void setSerializeBefore() { serializeBefore = true; }
---
> void setSerializeBefore() { status.set(SerializeBefore); }
355c328
< void clearSerializeBefore() { serializeBefore = false; }
---
> void clearSerializeBefore() { status.reset(SerializeBefore); }
358c331
< bool isTempSerializeBefore() { return serializeBefore; }
---
> bool isTempSerializeBefore() { return status[SerializeBefore]; }
360,362d332
< /** Tracks if instruction has been externally set as serializeBefore. */
< bool serializeBefore;
<
364c334
< void setSerializeAfter() { serializeAfter = true; }
---
> void setSerializeAfter() { status.set(SerializeAfter); }
367c337
< void clearSerializeAfter() { serializeAfter = false; }
---
> void clearSerializeAfter() { status.reset(SerializeAfter); }
370c340
< bool isTempSerializeAfter() { return serializeAfter; }
---
> bool isTempSerializeAfter() { return status[SerializeAfter]; }
372,373c342,343
< /** Tracks if instruction has been externally set as serializeAfter. */
< bool serializeAfter;
---
> /** Sets the serialization part of this instruction as handled. */
> void setSerializeHandled() { status.set(SerializeHandled); }
380c350
< bool isSerializeHandled() { return serializeHandled; }
---
> bool isSerializeHandled() { return status[SerializeHandled]; }
382,387d351
< /** Sets the serialization part of this instruction as handled. */
< void setSerializeHandled() { serializeHandled = true; }
<
< /** Whether or not the serialization of this instruction has been handled. */
< bool serializeHandled;
<
468c432
< void setCompleted() { completed = true; }
---
> void setCompleted() { status.set(Completed); }
471c435
< bool isCompleted() const { return completed; }
---
> bool isCompleted() const { return status[Completed]; }
473c437,438
< void setResultReady() { resultReady = true; }
---
> /** Marks the result as ready. */
> void setResultReady() { status.set(ResultReady); }
475c440,441
< bool isResultReady() const { return resultReady; }
---
> /** Returns whether or not the result is ready. */
> bool isResultReady() const { return status[ResultReady]; }
478c444
< void setCanIssue() { canIssue = true; }
---
> void setCanIssue() { status.set(CanIssue); }
481c447
< bool readyToIssue() const { return canIssue; }
---
> bool readyToIssue() const { return status[CanIssue]; }
484c450
< void setIssued() { issued = true; }
---
> void setIssued() { status.set(Issued); }
487c453
< bool isIssued() const { return issued; }
---
> bool isIssued() const { return status[Issued]; }
490c456
< void setExecuted() { executed = true; }
---
> void setExecuted() { status.set(Executed); }
493c459
< bool isExecuted() const { return executed; }
---
> bool isExecuted() const { return status[Executed]; }
496c462
< void setCanCommit() { canCommit = true; }
---
> void setCanCommit() { status.set(CanCommit); }
499c465
< void clearCanCommit() { canCommit = false; }
---
> void clearCanCommit() { status.reset(CanCommit); }
502c468
< bool readyToCommit() const { return canCommit; }
---
> bool readyToCommit() const { return status[CanCommit]; }
503a470,473
> void setAtCommit() { status.set(AtCommit); }
>
> bool isAtCommit() { return status[AtCommit]; }
>
505c475
< void setCommitted() { committed = true; }
---
> void setCommitted() { status.set(Committed); }
508c478
< bool isCommitted() const { return committed; }
---
> bool isCommitted() const { return status[Committed]; }
511c481
< void setSquashed() { squashed = true; }
---
> void setSquashed() { status.set(Squashed); }
514c484
< bool isSquashed() const { return squashed; }
---
> bool isSquashed() const { return status[Squashed]; }
519c489
< void setInIQ() { iqEntry = true; }
---
> void setInIQ() { status.set(IqEntry); }
522c492
< void removeInIQ() { iqEntry = false; }
---
> void clearInIQ() { status.reset(IqEntry); }
523a494,496
> /** Returns whether or not this instruction has issued. */
> bool isInIQ() const { return status[IqEntry]; }
>
525c498
< void setSquashedInIQ() { squashedInIQ = true; squashed = true;}
---
> void setSquashedInIQ() { status.set(SquashedInIQ); status.set(Squashed);}
528c501
< bool isSquashedInIQ() const { return squashedInIQ; }
---
> bool isSquashedInIQ() const { return status[SquashedInIQ]; }
530,531d502
< /** Returns whether or not this instruction has issued. */
< bool isInIQ() const { return iqEntry; }
533d503
<
537c507
< void setInLSQ() { lsqEntry = true; }
---
> void setInLSQ() { status.set(LsqEntry); }
540c510
< void removeInLSQ() { lsqEntry = false; }
---
> void removeInLSQ() { status.reset(LsqEntry); }
541a512,514
> /** Returns whether or not this instruction is in the LSQ. */
> bool isInLSQ() const { return status[LsqEntry]; }
>
543c516
< void setSquashedInLSQ() { squashedInLSQ = true;}
---
> void setSquashedInLSQ() { status.set(SquashedInLSQ);}
546c519
< bool isSquashedInLSQ() const { return squashedInLSQ; }
---
> bool isSquashedInLSQ() const { return status[SquashedInLSQ]; }
548,549d520
< /** Returns whether or not this instruction is in the LSQ. */
< bool isInLSQ() const { return lsqEntry; }
551d521
<
555c525
< void setInROB() { robEntry = true; }
---
> void setInROB() { status.set(RobEntry); }
558c528
< void removeInROB() { robEntry = false; }
---
> void clearInROB() { status.reset(RobEntry); }
559a530,532
> /** Returns whether or not this instruction is in the ROB. */
> bool isInROB() const { return status[RobEntry]; }
>
561c534
< void setSquashedInROB() { squashedInROB = true; }
---
> void setSquashedInROB() { status.set(SquashedInROB); }
564c537
< bool isSquashedInROB() const { return squashedInROB; }
---
> bool isSquashedInROB() const { return status[SquashedInROB]; }
566,568d538
< /** Returns whether or not this instruction is in the ROB. */
< bool isInROB() const { return robEntry; }
<
583a554
> /** Sets the pointer to the thread state. */
586,587c557
< /** Returns the thread context.
< */
---
> /** Returns the thread context. */
624,625d593
< bool reachedCommit;
<