00001
00002 #ifndef TOKEN_H
00003 #define TOKEN_H
00004
00005 #include <InstructionInfo.h>
00006
00007 class FunctionalUnit;
00008
00009
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;
00049 double optionalProb;
00050 InstructionCount number;
00051 CycleCount issueCycle;
00052 CycleCount retiredCycle;
00053 CycleCount currentCycle;
00054 FunctionalUnit *atUnit;
00055 CycleCount execStartCycle;
00056 CycleCount execEndCycle;
00057 bool fake;
00058 bool canceled;
00059 bool retired;
00060 bool loadSatisfied;
00061 bool hasAddressOperand;
00062 bool addressGenerated;
00063 bool hasLoad;
00064 bool hasStore;
00065 bool completed;
00066 Dependency *inDependency;
00067 Dependency *outDependency;
00068 bool wasMispredicted;
00069 };
00070
00071 #endif