InOrderCPU::CPUEvent::scheduleEvent(int delay)
{
if (squashed())
- mainEventQueue.reschedule(this,curTick + cpu->ticks(delay));
+ mainEventQueue.reschedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)));
else if (!scheduled())
- mainEventQueue.schedule(this,curTick + cpu->ticks(delay));
+ mainEventQueue.schedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)));
}
void
CPUEvent *cpu_event = new CPUEvent(this, c_event, fault, tid, inst,
event_pri_offset);
+ Tick sked_tick = nextCycle(curTick + ticks(delay));
if (delay >= 0) {
DPRINTF(InOrderCPU, "Scheduling CPU Event (%s) for cycle %i, [tid:%i].\n",
eventNames[c_event], curTick + delay, tid);
- mainEventQueue.schedule(cpu_event,curTick + delay);
+ mainEventQueue.schedule(cpu_event, sked_tick);
} else {
cpu_event->process();
cpuEventRemoveList.push(cpu_event);
while (!reqRemoveList.empty()) {
ResourceRequest *res_req = reqRemoveList.front();
- DPRINTF(Resource, "[tid:%i] [sn:%lli]: Removing Request "
+ DPRINTF(RefCount, "[tid:%i] [sn:%lli]: Removing Request "
"[stage_num:%i] [res:%s] [slot:%i] [completed:%i].\n",
res_req->inst->threadNumber,
res_req->inst->seqNum,
numCycles += extra_cycles;
- mainEventQueue.schedule(&tickEvent, curTick);
+ mainEventQueue.schedule(&tickEvent, nextCycle(curTick));
}
#if FULL_SYSTEM
inst->bdelaySeqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
tid);
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
{
DPRINTF(Resource, "Scheduling Suspend Thread Resource Pool Event for tick %i.\n",
- curTick + delay);
+ cpu->nextCycle(cpu->nextCycle(curTick + cpu->ticks(delay))));
ResPoolEvent *res_pool_event = new ResPoolEvent(this,
e_type,
inst,
inst->bdelaySeqNum,
tid);
- mainEventQueue.schedule(res_pool_event, curTick + cpu->ticks(delay));
+ mainEventQueue.schedule(res_pool_event, cpu->nextCycle(cpu->nextCycle(curTick + cpu->ticks(delay))));
}
break;
inst->seqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
inst->bdelaySeqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
inst->seqNum - 1,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
inst->squashingStage,
inst->seqNum,
inst->readTid());
- mainEventQueue.schedule(res_pool_event, curTick + cpu->ticks(delay));
+ mainEventQueue.schedule(res_pool_event, cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
ResourcePool::ResPoolEvent::scheduleEvent(int delay)
{
if (squashed())
- mainEventQueue.reschedule(this,curTick + resPool->cpu->ticks(delay));
+ mainEventQueue.reschedule(this,resPool->cpu->nextCycle(curTick + resPool->cpu->ticks(delay)));
else if (!scheduled())
- mainEventQueue.schedule(this,curTick + resPool->cpu->ticks(delay));
+ mainEventQueue.schedule(this, resPool->cpu->nextCycle(curTick + resPool->cpu->ticks(delay)));
}
/** Unschedule resource event, regardless of its current state. */