From: Korey Sewell Date: Fri, 7 Jul 2006 08:07:00 +0000 (-0400) Subject: Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/newmem X-Git-Tag: m5_2.0_beta1~36^2~5^2~5^2~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=161e8bf874aa14c17fcbb6d1fcad902be7d0ecb6;p=gem5.git Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/newmem into zizzer.eecs.umich.edu:/.automount/zooks/y/ksewell/research/m5-sim/newmem-o3 --HG-- extra : convert_revision : 90717b492139428e0c48be35a6bda45960c61086 --- 161e8bf874aa14c17fcbb6d1fcad902be7d0ecb6 diff --cc src/cpu/o3/cpu.cc index b182d5ca7,0a564169a..ec02a3929 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@@ -605,119 -750,16 +750,17 @@@ FullO3CPU::activateWhenReady(int } } - template - void - FullO3CPU::activateThread(unsigned int tid) - { - list::iterator isActive = find( - activeThreads.begin(), activeThreads.end(), tid); - - if (isActive == activeThreads.end()) { - DPRINTF(O3CPU, "[tid:%i]: Adding to active threads list\n", - tid); - - activeThreads.push_back(tid); - } - } - - - template - void - FullO3CPU::activateContext(int tid, int delay) - { - // Needs to set each stage to running as well. - if (delay){ - DPRINTF(O3CPU, "[tid:%i]: Scheduling thread context to activate " - "on cycle %d\n", tid, curTick + cycles(delay)); - scheduleActivateThreadEvent(tid, delay); - } else { - activateThread(tid); - } - - if(lastActivatedCycle < curTick) { - scheduleTickEvent(delay); - - // Be sure to signal that there's some activity so the CPU doesn't - // deschedule itself. - activityRec.activity(); - fetch.wakeFromQuiesce(); - - lastActivatedCycle = curTick; - - _status = Running; - } - } - - template - void - FullO3CPU::suspendContext(int tid) - { - DPRINTF(O3CPU,"[tid: %i]: Suspending Thread Context.\n", tid); - unscheduleTickEvent(); - _status = Idle; - /* - //Remove From Active List, if Active - list::iterator isActive = find( - activeThreads.begin(), activeThreads.end(), tid); - - if (isActive != activeThreads.end()) { - DPRINTF(O3CPU,"[tid:%i]: Removing from active threads list\n", - tid); - activeThreads.erase(isActive); - } - */ - } - - template - void - FullO3CPU::deallocateContext(int tid) - { - DPRINTF(O3CPU,"[tid:%i]: Deallocating Thread Context", tid); - - //Remove From Active List, if Active - list::iterator thread_it = - find(activeThreads.begin(), activeThreads.end(), tid); - - if (thread_it != activeThreads.end()) { - DPRINTF(O3CPU,"[tid:%i]: Removing from active threads list\n", - tid); - activeThreads.erase(thread_it); - - removeThread(tid); - } - } - - template - void - FullO3CPU::haltContext(int tid) - { - DPRINTF(O3CPU,"[tid:%i]: Halting Thread Context", tid); - /* - //Remove From Active List, if Active - list::iterator isActive = find( - activeThreads.begin(), activeThreads.end(), tid); - - if (isActive != activeThreads.end()) { - DPRINTF(O3CPU,"[tid:%i]: Removing from active threads list\n", - tid); - activeThreads.erase(isActive); - - removeThread(tid); - } - */ - } - template -void -FullO3CPU::switchOut() +bool +FullO3CPU::drain(Event *drain_event) { - switchCount = 0; - fetch.switchOut(); - decode.switchOut(); - rename.switchOut(); - iew.switchOut(); - commit.switchOut(); + drainCount = 0; + drainEvent = drain_event; + fetch.drain(); + decode.drain(); + rename.drain(); + iew.drain(); + commit.drain(); // Wake the CPU and record activity so everything can drain out if // the CPU is currently idle.