summaryrefslogtreecommitdiff
path: root/src/cpu/inorder/cpu.cc
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-01-31 18:27:38 -0500
committerKorey Sewell <ksewell@umich.edu>2010-01-31 18:27:38 -0500
commit90d3b45a566847fe15095b92238e32973ad9cc0e (patch)
tree9deb58c0889ec67a5aefdf66cf90c1cd9c311b04 /src/cpu/inorder/cpu.cc
parent3eb04b4ad73cb66e86d09ffd5989a93d9f62b299 (diff)
downloadgem5-90d3b45a566847fe15095b92238e32973ad9cc0e.tar.xz
inorder: ready thread wakeup
allow a thread to wakeup and be activated after it has been in suspended state and another thread is switched out. Need to give pipeline stages a "activateThread" function so that can get to their suspended instruction when the time is right.
Diffstat (limited to 'src/cpu/inorder/cpu.cc')
-rw-r--r--src/cpu/inorder/cpu.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index ec6bb21ee..501150386 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -674,6 +674,8 @@ InOrderCPU::activateNextReadyThread()
DPRINTF(InOrderCPU,
"Attempting to activate new thread, but No Ready Threads to"
"activate.\n");
+ DPRINTF(InOrderCPU,
+ "Unable to switch to next active thread.\n");
}
}
@@ -696,7 +698,7 @@ InOrderCPU::activateThread(ThreadID tid)
"Ignoring activation of [tid:%i], since [tid:%i] is "
"already running.\n", tid, activeThreadId());
- DPRINTF(InOrderCPU,"Placing [tid:%i] ready threads list\n",
+ DPRINTF(InOrderCPU,"Placing [tid:%i] on ready threads list\n",
tid);
readyThreads.push_back(tid);
@@ -706,11 +708,21 @@ InOrderCPU::activateThread(ThreadID tid)
"Adding [tid:%i] to active threads list.\n", tid);
activeThreads.push_back(tid);
+ activateThreadInPipeline(tid);
+
wakeCPU();
}
}
void
+InOrderCPU::activateThreadInPipeline(ThreadID tid)
+{
+ for (int stNum=0; stNum < NumStages; stNum++) {
+ pipelineStage[stNum]->activateThread(tid);
+ }
+}
+
+void
InOrderCPU::deactivateContext(ThreadID tid, int delay)
{
DPRINTF(InOrderCPU,"[tid:%i]: Deactivating ...\n", tid);