diff options
Diffstat (limited to 'src/cpu/inorder/cpu.hh')
-rw-r--r-- | src/cpu/inorder/cpu.hh | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh index 1c819638d..854f5167c 100644 --- a/src/cpu/inorder/cpu.hh +++ b/src/cpu/inorder/cpu.hh @@ -89,7 +89,7 @@ class InOrderCPU : public BaseCPU typedef TimeBuffer<InterStageStruct> StageQueue; friend class Resource; - + public: /** Constructs a CPU with the given parameters. */ InOrderCPU(Params *params); @@ -175,6 +175,8 @@ class InOrderCPU : public BaseCPU // pool event. enum CPUEventType { ActivateThread, + ActivateNextReadyThread, + DeactivateThread, DeallocateThread, SuspendThread, DisableThreads, @@ -361,6 +363,10 @@ class InOrderCPU : public BaseCPU void activateContext(ThreadID tid, int delay = 0); void activateThread(ThreadID tid); + /** Add Thread to Active Threads List. */ + void activateNextReadyContext(int delay = 0); + void activateNextReadyThread(); + /** Remove Thread from Active Threads List */ void suspendContext(ThreadID tid, int delay = 0); void suspendThread(ThreadID tid); @@ -612,6 +618,9 @@ class InOrderCPU : public BaseCPU /** Current Threads List */ std::list<ThreadID> currentThreads; + /** Ready Threads List */ + std::list<ThreadID> readyThreads; + /** Suspended Threads List */ std::list<ThreadID> suspendedThreads; @@ -633,6 +642,18 @@ class InOrderCPU : public BaseCPU /** Number of Active Threads in the CPU */ ThreadID numActiveThreads() { return activeThreads.size(); } + /** Thread id of active thread + * Only used for SwitchOnCacheMiss model. Assumes only 1 thread active + */ + ThreadID activeThreadId() + { + if (numActiveThreads() > 0) + return activeThreads.front(); + else + return -1; + } + + /** Records that there was time buffer activity this cycle. */ void activityThisCycle() { activityRec.activity(); } |