void process(); // process event
virtual const char *description() const;
-
- virtual ~GlobalSimLoopExitEvent() {
- // simulate()'s singleton GlobalSimLoopExitEvent is always scheduled
- deschedule();
- }
};
class LocalSimLoopExitEvent : public Event
}
}
-GlobalEvent*
-getLimitEvent(void) {
- static GlobalSimLoopExitEvent
- simulate_limit_event(mainEventQueue[0]->getCurTick(),
- "simulate() limit reached", 0);
- return &simulate_limit_event;
-}
+GlobalSimLoopExitEvent *simulate_limit_event = nullptr;
/** Simulate for num_cycles additional cycles. If num_cycles is -1
* (the default), do not limit simulation; some other event must
}
threads_initialized = true;
+ simulate_limit_event =
+ new GlobalSimLoopExitEvent(mainEventQueue[0]->getCurTick(),
+ "simulate() limit reached", 0);
}
inform("Entering event queue @ %d. Starting simulation...\n", curTick());
else // counter would roll over or be set to MaxTick anyhow
num_cycles = MaxTick;
- getLimitEvent()->reschedule(num_cycles);
+ simulate_limit_event->reschedule(num_cycles);
GlobalSyncEvent *quantum_event = NULL;
if (numMainEventQueues > 1) {
#include "sim/sim_events.hh"
GlobalSimLoopExitEvent *simulate(Tick num_cycles = MaxTick);
-GlobalEvent* getLimitEvent();
+extern GlobalSimLoopExitEvent *simulate_limit_event;