if (p->functionTraceStart == 0) {
functionTracingEnabled = true;
} else {
- Event *e =
- new EventWrapper<BaseCPU, &BaseCPU::enableFunctionTrace>(this,
- true);
- e->schedule(p->functionTraceStart);
+ new EventWrapper<BaseCPU, &BaseCPU::enableFunctionTrace>(this,
+ p->functionTraceStart,
+ true);
}
}
#if FULL_SYSTEM
delete fetchEvent;
}
- fetchEvent =
- new EventWrapper<TimingSimpleCPU, &TimingSimpleCPU::fetch>(this, false);
- fetchEvent->schedule(nextCycle());
+ fetchEvent = new FetchEvent(this, nextCycle());
}
changeState(SimObject::Running);
_status = Running;
// kick things off by initiating the fetch of the next instruction
- fetchEvent =
- new EventWrapper<TimingSimpleCPU, &TimingSimpleCPU::fetch>(this, false);
- fetchEvent->schedule(nextCycle(curTick + cycles(delay)));
+ fetchEvent = new FetchEvent(this, nextCycle(curTick + cycles(delay)));
}
Event *drainEvent;
- Event *fetchEvent;
-
private:
class CpuPort : public Port
void completeIfetch(PacketPtr );
void completeDataAccess(PacketPtr );
void advanceInst(Fault fault);
+
private:
+
+ typedef EventWrapper<TimingSimpleCPU, &TimingSimpleCPU::fetch> FetchEvent;
+ FetchEvent *fetchEvent;
+
void completeDrain();
};
if (intrEvent)
intrEvent->squash();
- intrEvent = new IntrEvent(this, true);
- intrEvent->schedule(intrTick);
+ intrEvent = new IntrEvent(this, intrTick, true);
}
void
Tick intrEventTick;
UNSERIALIZE_SCALAR(intrEventTick);
if (intrEventTick) {
- intrEvent = new IntrEvent(this, true);
- intrEvent->schedule(intrEventTick);
+ intrEvent = new IntrEvent(this, intrEventTick, true);
}
}
if (intrEvent)
intrEvent->squash();
- intrEvent = new IntrEvent(this, true);
- intrEvent->schedule(intrTick);
+ intrEvent = new IntrEvent(this, intrTick, true);
}
void
Tick intrEventTick;
UNSERIALIZE_SCALAR(intrEventTick);
if (intrEventTick) {
- intrEvent = new IntrEvent(this, true);
- intrEvent->schedule(intrEventTick);
+ intrEvent = new IntrEvent(this, intrEventTick, true);
}
}
T *object;
public:
- EventWrapper(T *obj, bool del = false, EventQueue *q = &mainEventQueue,
+ EventWrapper(T *obj, bool del = false,
+ EventQueue *q = &mainEventQueue,
Priority p = Default_Pri)
: Event(q, p), object(obj)
{
if (del)
setFlags(AutoDelete);
}
+
+ EventWrapper(T *obj, Tick t, bool del = false,
+ EventQueue *q = &mainEventQueue,
+ Priority p = Default_Pri)
+ : Event(q, p), object(obj)
+ {
+ if (del)
+ setFlags(AutoDelete);
+ schedule(t);
+ }
+
void process() { (object->*F)(); }
};