diff options
author | Korey Sewell <ksewell@umich.edu> | 2010-01-31 18:27:02 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2010-01-31 18:27:02 -0500 |
commit | 4dbc2f17180d3d8c82d5414daa55b102de9755e5 (patch) | |
tree | d1e53342850f3e3889ba29659d9cf01a122f64aa /src/cpu/inorder/resource_pool.cc | |
parent | 4ea296e29686154656c380982f987d7b6e1774f0 (diff) | |
download | gem5-4dbc2f17180d3d8c82d5414daa55b102de9755e5.tar.xz |
inorder: suspend in respool
give resources their own specific
activity to do for a "suspend" event
instead of defaulting to deactivating the thread for a
suspend thread event. This really matters
for the fetch sequence unit which wants to remove the
thread from fetching while other units want to
ignore a thread suspension. If you deactivate a thread
in a resource then you may lose some of the allotted
bandwidth that the thread is taking up...
Diffstat (limited to 'src/cpu/inorder/resource_pool.cc')
-rw-r--r-- | src/cpu/inorder/resource_pool.cc | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/src/cpu/inorder/resource_pool.cc b/src/cpu/inorder/resource_pool.cc index 97ba4d087..45a4a9e60 100644 --- a/src/cpu/inorder/resource_pool.cc +++ b/src/cpu/inorder/resource_pool.cc @@ -226,7 +226,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst, } break; - case InOrderCPU::SuspendThread: + case InOrderCPU::DeactivateThread: case InOrderCPU::DeallocateThread: { @@ -246,6 +246,23 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst, } break; + case InOrderCPU::SuspendThread: + { + + DPRINTF(Resource, "Scheduling Suspend Thread Resource Pool Event for tick %i.\n", + curTick + delay); + ResPoolEvent *res_pool_event = new ResPoolEvent(this, + e_type, + inst, + inst->squashingStage, + inst->bdelaySeqNum, + tid); + + mainEventQueue.schedule(res_pool_event, curTick + cpu->ticks(delay)); + + } + break; + case ResourcePool::InstGraduated: { DPRINTF(Resource, "Scheduling Inst-Graduated Resource Pool " @@ -309,8 +326,9 @@ void ResourcePool::squashAll(DynInstPtr inst, int stage_num, InstSeqNum done_seq_num, ThreadID tid) { - DPRINTF(Resource, "[tid:%i] Stage %i squashing all instructions above " - "[sn:%i].\n", tid, stage_num, done_seq_num); + DPRINTF(Resource, "[tid:%i] Broadcasting Squash All Event " + " starting w/stage %i for all instructions above [sn:%i].\n", + tid, stage_num, done_seq_num); int num_resources = resources.size(); @@ -323,8 +341,9 @@ void ResourcePool::squashDueToMemStall(DynInstPtr inst, int stage_num, InstSeqNum done_seq_num, ThreadID tid) { - DPRINTF(Resource, "[tid:%i] Stage %i squashing all instructions above " - "[sn:%i].\n", stage_num, tid, done_seq_num); + DPRINTF(Resource, "[tid:%i] Broadcasting SquashDueToMemStall Event" + " starting w/stage %i for all instructions above [sn:%i].\n", + tid, stage_num, done_seq_num); int num_resources = resources.size(); @@ -371,6 +390,19 @@ ResourcePool::deactivateAll(ThreadID tid) } void +ResourcePool::suspendAll(ThreadID tid) +{ + DPRINTF(Resource, "[tid:%i] Broadcasting Thread Suspension to all resources.\n", + tid); + + int num_resources = resources.size(); + + for (int idx = 0; idx < num_resources; idx++) { + resources[idx]->suspendThread(tid); + } +} + +void ResourcePool::instGraduated(InstSeqNum seq_num, ThreadID tid) { DPRINTF(Resource, "[tid:%i] Broadcasting [sn:%i] graduation to all " @@ -409,11 +441,15 @@ ResourcePool::ResPoolEvent::process() resPool->activateAll(tid); break; - case InOrderCPU::SuspendThread: + case InOrderCPU::DeactivateThread: case InOrderCPU::DeallocateThread: resPool->deactivateAll(tid); break; + case InOrderCPU::SuspendThread: + resPool->suspendAll(tid); + break; + case ResourcePool::InstGraduated: resPool->instGraduated(seqNum, tid); break; |