From 05d14cf3e258bc414695711e6d7303cf31e72fa3 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 20 May 2007 21:43:01 -0700 Subject: Add new EventWrapper constructor that takes a Tick value and schedules the event immediately. --HG-- extra : convert_revision : a84e729a5ef3632cbe6cff858c453c782707d983 --- src/cpu/simple/timing.cc | 8 ++------ src/cpu/simple/timing.hh | 7 +++++-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/cpu/simple') diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index fa7bb4f86..1c79fcf6b 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -168,9 +168,7 @@ TimingSimpleCPU::resume() delete fetchEvent; } - fetchEvent = - new EventWrapper(this, false); - fetchEvent->schedule(nextCycle()); + fetchEvent = new FetchEvent(this, nextCycle()); } changeState(SimObject::Running); @@ -224,9 +222,7 @@ TimingSimpleCPU::activateContext(int thread_num, int delay) _status = Running; // kick things off by initiating the fetch of the next instruction - fetchEvent = - new EventWrapper(this, false); - fetchEvent->schedule(nextCycle(curTick + cycles(delay))); + fetchEvent = new FetchEvent(this, nextCycle(curTick + cycles(delay))); } diff --git a/src/cpu/simple/timing.hh b/src/cpu/simple/timing.hh index ef062d24a..e65cbe46b 100644 --- a/src/cpu/simple/timing.hh +++ b/src/cpu/simple/timing.hh @@ -66,8 +66,6 @@ class TimingSimpleCPU : public BaseSimpleCPU Event *drainEvent; - Event *fetchEvent; - private: class CpuPort : public Port @@ -199,7 +197,12 @@ class TimingSimpleCPU : public BaseSimpleCPU void completeIfetch(PacketPtr ); void completeDataAccess(PacketPtr ); void advanceInst(Fault fault); + private: + + typedef EventWrapper FetchEvent; + FetchEvent *fetchEvent; + void completeDrain(); }; -- cgit v1.2.3