}
break;
- case InOrderCPU::SuspendThread:
+ case InOrderCPU::DeactivateThread:
case InOrderCPU::DeallocateThread:
{
}
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 "
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();
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();
}
}
+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)
{
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;
return new_slot;
} else {
DPRINTF(InOrderCachePort,
- "Denying request because there is an outstanding"
+ "[tid:%i] Denying request because there is an outstanding"
" request to/for addr. %08p. by [sn:%i] @ tick %i\n",
- req_addr, addrMap[req_addr], inst->memTime);
+ inst->readTid(), req_addr, addrMap[req_addr], inst->memTime);
return -1;
}
}
cache_req->setMemAccPending(false);
cache_req->setMemAccCompleted();
+ if (cache_req->isMemStall() &&
+ cpu->threadModel == InOrderCPU::SwitchOnCacheMiss) {
+ DPRINTF(InOrderCachePort, "[tid:%u] Waking up from Cache Miss.\n");
+
+ cpu->activateContext(tid);
+ }
+
// Wake up the CPU (if it went to sleep and was waiting on this
// completion event).
cpu->wakeCPU();
// thread then you need to reevaluate this code
// NOTE: squash should originate from
// pipeline_stage.cc:processInstSchedule
+ DPRINTF(InOrderCachePort, "Squashing above [sn:%u]\n",
+ squash_seq_num + 1);
+
squash(inst, stage_num, squash_seq_num + 1, tid);
}