X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsim%2Fsim_events.cc;h=aac844429767ccc18e30e102baf3350cd6ad96a4;hb=a368fba7d4fa01b58d5c2d9b3cafd56e1102287c;hp=a6e3f0af3bdf8f5ff7a32b4b9c100d802fd91d6d;hpb=e06321091d4e931ff1a4d753e56d76f9746c3cd2;p=gem5.git diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc index a6e3f0af3..aac844429 100644 --- a/src/sim/sim_events.cc +++ b/src/sim/sim_events.cc @@ -35,7 +35,6 @@ #include "sim/eventq.hh" #include "sim/sim_events.hh" #include "sim/sim_exit.hh" -#include "sim/startup.hh" #include "sim/stats.hh" using namespace std; @@ -67,7 +66,7 @@ SimLoopExitEvent::process() // but if you are doing this on intervals, don't forget to make another if (repeat) { assert(getFlags(IsMainQueue)); - mainEventQueue.schedule(this, curTick + repeat); + mainEventQueue.schedule(this, curTick() + repeat); } } @@ -79,21 +78,21 @@ SimLoopExitEvent::description() const } void -exitSimLoop(const std::string &message, int exit_code) +exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat) { - Event *event = new SimLoopExitEvent(message, exit_code); - mainEventQueue.schedule(event, curTick); + Event *event = new SimLoopExitEvent(message, exit_code, repeat); + mainEventQueue.schedule(event, when); } CountedDrainEvent::CountedDrainEvent() - : SimLoopExitEvent("Finished drain", 0), count(0) + : count(0) { } void CountedDrainEvent::process() { if (--count == 0) - exitSimLoop(cause, code); + exitSimLoop("Finished drain", 0); } // @@ -124,36 +123,3 @@ CountedExitEvent::description() const { return "counted exit"; } - -CheckSwapEvent::CheckSwapEvent(int ival) - : interval(ival) -{ - mainEventQueue.schedule(this, curTick + interval); -} - -void -CheckSwapEvent::process() -{ - /* Check the amount of free swap space */ - long swap; - - /* returns free swap in KBytes */ - swap = procInfo("/proc/meminfo", "SwapFree:"); - - if (swap < 1000) - ccprintf(cerr, "\a\a\aWarning! Swap space is low (%d)\n", swap); - - if (swap < 100) { - cerr << "\a\aAborting Simulation! Inadequate swap space!\n\n"; - exitSimLoop("Lack of swap space"); - } - - assert(getFlags(IsMainQueue)); - mainEventQueue.schedule(this, curTick + interval); -} - -const char * -CheckSwapEvent::description() const -{ - return "check swap"; -}