inorder: fetch thread bug
dont check total # of threads but instead all active threads
This commit is contained in:
parent
96b493d315
commit
4ea296e296
2 changed files with 9 additions and 7 deletions
|
@ -611,7 +611,7 @@ class InOrderCPU : public BaseCPU
|
||||||
if (numActiveThreads() > 0)
|
if (numActiveThreads() > 0)
|
||||||
return activeThreads.front();
|
return activeThreads.front();
|
||||||
else
|
else
|
||||||
return -1;
|
return InvalidThreadID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -205,11 +205,12 @@ FirstStage::processInsts(ThreadID tid)
|
||||||
ThreadID
|
ThreadID
|
||||||
FirstStage::getFetchingThread(FetchPriority &fetch_priority)
|
FirstStage::getFetchingThread(FetchPriority &fetch_priority)
|
||||||
{
|
{
|
||||||
if (numThreads > 1) {
|
ThreadID num_active_threads = cpu->numActiveThreads();
|
||||||
switch (fetch_priority) {
|
|
||||||
|
|
||||||
|
if (num_active_threads > 1) {
|
||||||
|
switch (fetch_priority) {
|
||||||
case SingleThread:
|
case SingleThread:
|
||||||
return 0;
|
return cpu->activeThreadId();
|
||||||
|
|
||||||
case RoundRobin:
|
case RoundRobin:
|
||||||
return roundRobin();
|
return roundRobin();
|
||||||
|
@ -217,7 +218,7 @@ FirstStage::getFetchingThread(FetchPriority &fetch_priority)
|
||||||
default:
|
default:
|
||||||
return InvalidThreadID;
|
return InvalidThreadID;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (num_active_threads == 1) {
|
||||||
ThreadID tid = *activeThreads->begin();
|
ThreadID tid = *activeThreads->begin();
|
||||||
|
|
||||||
if (stageStatus[tid] == Running ||
|
if (stageStatus[tid] == Running ||
|
||||||
|
@ -226,8 +227,9 @@ FirstStage::getFetchingThread(FetchPriority &fetch_priority)
|
||||||
} else {
|
} else {
|
||||||
return InvalidThreadID;
|
return InvalidThreadID;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
return InvalidThreadID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadID
|
ThreadID
|
||||||
|
|
Loading…
Reference in a new issue