• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/mcopteron/Token.h

00001 
00002 #ifndef TOKEN_H
00003 #define TOKEN_H
00004 
00005 #include <InstructionInfo.h>
00006 
00007 class FunctionalUnit;
00008 
00009 /// @brief Simulated instruction class
00010 ///
00011 class Token
00012 {
00013  public:
00014    Token(InstructionInfo *type, InstructionCount number,
00015          CycleCount atCycle, bool isFake);
00016    ~Token();
00017    void dumpDebugInfo();
00018    void setMemoryLoadInfo(Address address, unsigned int numBytes);
00019    void setMemoryStoreInfo(Address address, unsigned int numBytes);
00020    void setInDependency(Dependency *dep);
00021    void setOutDependency(Dependency *dep);
00022    void setOptionalProb(double p) {optionalProb = p;}
00023    InstructionInfo* getType() {return type;}
00024    InstructionCount instructionNumber() {return number;}
00025    void fixupInstructionInfo();
00026    bool needsAddressGeneration();
00027    bool addressIsReady();
00028    bool needsFunctionalUnit(FunctionalUnit *fu);
00029    bool aguOperandsReady(CycleCount atCycle);
00030    bool allOperandsReady(CycleCount atCycle);
00031    bool isExecuting(CycleCount currentCycle);
00032    bool isCompleted(CycleCount currentCycle);
00033    bool isLoad() {return hasLoad;}
00034    bool isStore() {return hasStore;}
00035    bool isFake() {return fake;}
00036    bool wasRetired() {return retired;}
00037    bool wasCanceled() {return canceled;}
00038    CycleCount issuedAt() {return issueCycle;}
00039    void setBranchMispredict() {wasMispredicted = true;}
00040    void executionStart(CycleCount currentCycle);
00041    void executionContinue(CycleCount currentCycle);
00042    void loadSatisfiedAt(CycleCount atCycle);
00043    void storeSatisfiedAt(CycleCount atCycle);
00044    bool isMispredictedJump();
00045    void retireInstruction(CycleCount atCycle);
00046    void cancelInstruction(CycleCount atCycle);
00047  private:
00048    InstructionInfo *type;    ///< pointer to instruction info
00049    double optionalProb;      ///< option probability for sim to use
00050    InstructionCount number;  ///< issue number of this instruction
00051    CycleCount issueCycle;    ///< cycle at which issued
00052    CycleCount retiredCycle;  ///< cycle at which retired (will be computed)
00053    CycleCount currentCycle;  ///< current cycle in instruction's progress
00054    FunctionalUnit *atUnit;   ///< Ptr to unit this instruction is at
00055    CycleCount execStartCycle; ///< cycle of start of func unit use
00056    CycleCount execEndCycle;  ///< cycle of end of func unit use
00057    bool fake;
00058    bool canceled;         ///< True if was canceled
00059    bool retired;             ///< True if was retired
00060    bool loadSatisfied;
00061    bool hasAddressOperand;   ///< True if insn needs address generated
00062    bool addressGenerated;    ///< True if address has already been generated
00063    bool hasLoad;             ///< True if insn does a memory load
00064    bool hasStore;            ///< True if insn does a memory store
00065    bool completed;           ///< True if instruction has finished
00066    Dependency *inDependency;  ///< record for input dependencies
00067    Dependency *outDependency; ///< record for output dependency
00068    bool wasMispredicted;     ///< True if this is a branch and it was mispredicted
00069 };
00070 
00071 #endif

Generated on Fri Oct 22 2010 11:02:25 for SST by  doxygen 1.7.1