summaryrefslogtreecommitdiff
path: root/src/cpu/inorder
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-06-23 18:14:59 -0400
committerKorey Sewell <ksewell@umich.edu>2010-06-23 18:14:59 -0400
commit7695d4c63fb702ae9d53285f8e544c6c7c13fa74 (patch)
treea3477a4d32942edbc771ed86be4670737f149f87 /src/cpu/inorder
parentde2321de81506a81f64641babe0bce17ab946b9c (diff)
downloadgem5-7695d4c63fb702ae9d53285f8e544c6c7c13fa74.tar.xz
inorder: tick scheduling
use nextCycle to calculate ticks after addition
Diffstat (limited to 'src/cpu/inorder')
-rw-r--r--src/cpu/inorder/cpu.cc11
-rw-r--r--src/cpu/inorder/resource_pool.cc20
2 files changed, 16 insertions, 15 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index 0744686e1..c0159bc29 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -158,9 +158,9 @@ void
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
@@ -671,10 +671,11 @@ InOrderCPU::scheduleCpuEvent(CPUEventType c_event, Fault fault,
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);
@@ -1335,7 +1336,7 @@ InOrderCPU::cleanUpRemovedReqs()
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,
@@ -1400,7 +1401,7 @@ InOrderCPU::wakeCPU()
numCycles += extra_cycles;
- mainEventQueue.schedule(&tickEvent, curTick);
+ mainEventQueue.schedule(&tickEvent, nextCycle(curTick));
}
#if FULL_SYSTEM
diff --git a/src/cpu/inorder/resource_pool.cc b/src/cpu/inorder/resource_pool.cc
index 74bf4f03b..811ef3e99 100644
--- a/src/cpu/inorder/resource_pool.cc
+++ b/src/cpu/inorder/resource_pool.cc
@@ -259,7 +259,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
inst->bdelaySeqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
@@ -278,7 +278,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
tid);
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
@@ -287,7 +287,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
{
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,
@@ -295,7 +295,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr 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;
@@ -311,7 +311,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
inst->seqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
@@ -327,7 +327,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
inst->bdelaySeqNum,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
@@ -343,7 +343,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
inst->seqNum - 1,
inst->readTid());
mainEventQueue.schedule(res_pool_event,
- curTick + cpu->ticks(delay));
+ cpu->nextCycle(curTick + cpu->ticks(delay)));
}
break;
@@ -356,7 +356,7 @@ ResourcePool::scheduleEvent(InOrderCPU::CPUEventType e_type, DynInstPtr inst,
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;
@@ -544,9 +544,9 @@ void
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. */