summaryrefslogtreecommitdiff
path: root/src/cpu/inorder
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/inorder')
-rw-r--r--src/cpu/inorder/cpu.cc8
-rw-r--r--src/cpu/inorder/cpu.hh8
-rw-r--r--src/cpu/inorder/resource.cc10
-rw-r--r--src/cpu/inorder/resource_pool.cc9
4 files changed, 9 insertions, 26 deletions
diff --git a/src/cpu/inorder/cpu.cc b/src/cpu/inorder/cpu.cc
index bb324ce64..5b5f524f2 100644
--- a/src/cpu/inorder/cpu.cc
+++ b/src/cpu/inorder/cpu.cc
@@ -157,12 +157,8 @@ InOrderCPU::CPUEvent::description()
void
InOrderCPU::CPUEvent::scheduleEvent(int delay)
{
- Tick when = cpu->nextCycle(curTick + cpu->ticks(delay));
-
- if (squashed())
- cpu->reschedule(this, when);
- else if (!scheduled())
- cpu->schedule(this, when);
+ assert(!scheduled() || squashed());
+ cpu->reschedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)), true);
}
void
diff --git a/src/cpu/inorder/cpu.hh b/src/cpu/inorder/cpu.hh
index 42bae0d31..38978dbd7 100644
--- a/src/cpu/inorder/cpu.hh
+++ b/src/cpu/inorder/cpu.hh
@@ -156,12 +156,8 @@ class InOrderCPU : public BaseCPU
/** Schedule tick event, regardless of its current state. */
void scheduleTickEvent(int delay)
{
- Tick when = nextCycle(curTick + ticks(delay));
-
- if (tickEvent.squashed())
- reschedule(&tickEvent, when);
- else if (!tickEvent.scheduled())
- schedule(&tickEvent, when);
+ assert(!tickEvent.scheduled() || tickEvent.squashed());
+ reschedule(&tickEvent, nextCycle(curTick + ticks(delay)), true);
}
/** Unschedule tick event, regardless of its current state. */
diff --git a/src/cpu/inorder/resource.cc b/src/cpu/inorder/resource.cc
index 4eab89687..0d8dbb3e4 100644
--- a/src/cpu/inorder/resource.cc
+++ b/src/cpu/inorder/resource.cc
@@ -502,11 +502,7 @@ ResourceEvent::description()
void
ResourceEvent::scheduleEvent(int delay)
{
- InOrderCPU *cpu = resource->cpu;
- Tick when = curTick + resource->ticks(delay);
-
- if (squashed())
- cpu->reschedule(this, when);
- else if (!scheduled())
- cpu->schedule(this, when);
+ assert(!scheduled() || squashed());
+ resource->cpu->reschedule(this,
+ curTick + resource->ticks(delay), true);
}
diff --git a/src/cpu/inorder/resource_pool.cc b/src/cpu/inorder/resource_pool.cc
index 97ea889fd..e199d2bc2 100644
--- a/src/cpu/inorder/resource_pool.cc
+++ b/src/cpu/inorder/resource_pool.cc
@@ -541,13 +541,8 @@ void
ResourcePool::ResPoolEvent::scheduleEvent(int delay)
{
InOrderCPU *cpu = resPool->cpu;
- Tick when = cpu->nextCycle(curTick + cpu->ticks(delay));
-
- if (squashed()) {
- cpu->reschedule(this, when);
- } else if (!scheduled()) {
- cpu->schedule(this, when);
- }
+ assert(!scheduled() || squashed());
+ cpu->reschedule(this, cpu->nextCycle(curTick + cpu->ticks(delay)), true);
}
/** Unschedule resource event, regardless of its current state. */