summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-01-31 18:26:54 -0500
committerKorey Sewell <ksewell@umich.edu>2010-01-31 18:26:54 -0500
commit4ea296e29686154656c380982f987d7b6e1774f0 (patch)
tree824d63ed628af89a9380c5cab33020b994430edf /src
parent96b493d3159f7e94b8e53edbe562e28076f2af95 (diff)
downloadgem5-4ea296e29686154656c380982f987d7b6e1774f0.tar.xz
inorder: fetch thread bug
dont check total # of threads but instead all active threads
Diffstat (limited to 'src')
-rw-r--r--src/cpu/inorder/cpu.hh2
-rw-r--r--src/cpu/inorder/first_stage.cc14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh
index f4f7cb390..7ac433723 100644
--- a/src/cpu/inorder/cpu.hh
+++ b/src/cpu/inorder/cpu.hh
@@ -611,7 +611,7 @@ class InOrderCPU : public BaseCPU
if (numActiveThreads() > 0)
return activeThreads.front();
else
- return -1;
+ return InvalidThreadID;
}
diff --git a/src/cpu/inorder/first_stage.cc b/src/cpu/inorder/first_stage.cc
index 1427ca46a..75e13e559 100644
--- a/src/cpu/inorder/first_stage.cc
+++ b/src/cpu/inorder/first_stage.cc
@@ -205,11 +205,12 @@ FirstStage::processInsts(ThreadID tid)
ThreadID
FirstStage::getFetchingThread(FetchPriority &fetch_priority)
{
- if (numThreads > 1) {
- switch (fetch_priority) {
+ ThreadID num_active_threads = cpu->numActiveThreads();
+ if (num_active_threads > 1) {
+ switch (fetch_priority) {
case SingleThread:
- return 0;
+ return cpu->activeThreadId();
case RoundRobin:
return roundRobin();
@@ -217,7 +218,7 @@ FirstStage::getFetchingThread(FetchPriority &fetch_priority)
default:
return InvalidThreadID;
}
- } else {
+ } else if (num_active_threads == 1) {
ThreadID tid = *activeThreads->begin();
if (stageStatus[tid] == Running ||
@@ -226,8 +227,9 @@ FirstStage::getFetchingThread(FetchPriority &fetch_priority)
} else {
return InvalidThreadID;
}
- }
-
+ } else {
+ return InvalidThreadID;
+ }
}
ThreadID