# Node ID 616c230e9722de9b34fc2a6288bef58501080aa2 # Parent d8171eb694cb402563d6ec83ada03182aab41905 diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -737,7 +737,7 @@ // Be sure to signal that there's some activity so the CPU doesn't // deschedule itself. activityRec.activity(); - fetch.wakeFromQuiesce(); + fetch.wakeFromQuiesce(tid); Cycles cycles(curCycle() - lastRunningCycle); // @todo: This is an oddity that is only here to match the stats diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh --- a/src/cpu/o3/fetch.hh +++ b/src/cpu/o3/fetch.hh @@ -253,7 +253,7 @@ void drainStall(ThreadID tid); /** Tells fetch to wake up from a quiesce instruction. */ - void wakeFromQuiesce(); + void wakeFromQuiesce(ThreadID tid); /** For priority-based fetch policies, need to keep update priorityList */ void deactivateThread(ThreadID tid); diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -326,20 +326,10 @@ void DefaultFetch::startupStage() { - assert(priorityList.empty()); - resetStage(); -} - -template -void -DefaultFetch::resetStage() -{ numInst = 0; interruptPending = false; cacheBlocked = false; - priorityList.clear(); - // Setup PC and nextPC with initial state. for (ThreadID tid = 0; tid < numThreads; ++tid) { fetchStatus[tid] = Running; @@ -357,8 +347,6 @@ fetchBufferValid[tid] = false; fetchQueue[tid].clear(); - - priorityList.push_back(tid); } wroteToTimeBuffer = false; @@ -367,6 +355,18 @@ template void +DefaultFetch::resetStage() +{ + startupStage(); + + priorityList.clear(); + for (ThreadID tid = 0; tid < numThreads; ++tid) { + priorityList.push_back(tid); + } +} + +template +void DefaultFetch::processCacheCompletion(PacketPtr pkt) { ThreadID tid = pkt->req->threadId(); @@ -489,12 +489,11 @@ template void -DefaultFetch::wakeFromQuiesce() +DefaultFetch::wakeFromQuiesce(ThreadID tid) { DPRINTF(Fetch, "Waking up from quiesce\n"); - // Hopefully this is safe - // @todo: Allow other threads to wake from quiesce. - fetchStatus[0] = Running; + fetchStatus[tid] = Running; + priorityList.push_back(tid); } template