00001
00002 #ifndef DEPENDENCY_H
00003 #define DEPENDENCY_H
00004
00005 #include <McSimDefs.h>
00006 #include <CycleTracker.h>
00007
00008
00009
00010
00011
00012 class DependencyTracker
00013 {
00014
00015 struct Dependency
00016 {
00017 InstructionNumber producer;
00018 InstructionNumber consumer;
00019 CycleCount availableCycle;
00020 CycleTracker::CycleReason reason;
00021 struct Dependency *next;
00022 };
00023
00024 public:
00025 DependencyTracker();
00026 ~DependencyTracker();
00027 int addDependency(InstructionNumber instructionNum, CycleCount whenSatisfied,
00028 CycleTracker::CycleReason reason);
00029 int adjustDependenceChain(CycleCount numCycles);
00030 CycleCount isDependent(InstructionNumber instructionNum, CycleTracker::CycleReason *reason);
00031 private:
00032 Dependency *DepQHead,
00033 *DepQTail;
00034 };
00035
00036 #endif