Update the Memtester, commit a config file/test for it.
[gem5.git] / src / sim / sim_events.hh
index 89bf83fc90702b4d48512717f3eb79cd2abf84fd..e1576b38cb71396c5b53c41a523550f3bccd5a12 100644 (file)
 //
 // Event to terminate simulation at a particular cycle/instruction
 //
-class SimExitEvent : public Event
+class SimLoopExitEvent : public Event
 {
   private:
     // string explaining why we're terminating
     std::string cause;
     int code;
+    Tick repeat;
 
   public:
-    SimExitEvent(const std::string &_cause, int c = 0)
-        : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
-          code(c)
-        { schedule(curTick); }
+    // Default constructor.  Only really used for derived classes.
+    SimLoopExitEvent()
+        : Event(&mainEventQueue, Sim_Exit_Pri)
+    { }
+
+    SimLoopExitEvent(EventQueue *q,
+                     Tick _when, Tick _repeat, const std::string &_cause,
+                     int c = 0)
+        : Event(q, Sim_Exit_Pri), cause(_cause),
+          code(c), repeat(_repeat)
+    { setFlags(IsExitEvent); schedule(_when); }
+
+//     SimLoopExitEvent(EventQueue *q,
+//                  Tick _when, const std::string &_cause,
+//                  Tick _repeat = 0, int c = 0)
+//     : Event(q, Sim_Exit_Pri), cause(_cause), code(c), repeat(_repeat)
+//     { setFlags(IsExitEvent); schedule(_when); }
+
+    std::string getCause() { return cause; }
+    int getCode() { return code; }
 
-    SimExitEvent(Tick _when, const std::string &_cause, int c = 0)
-        : Event(&mainEventQueue, Sim_Exit_Pri), cause(_cause),
-          code(c)
-        { schedule(_when); }
+    void process();    // process event
 
-    SimExitEvent(EventQueue *q, const std::string &_cause, int c = 0)
-        : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
-        { schedule(curTick); }
+    virtual const char *description();
+};
 
-    SimExitEvent(EventQueue *q, Tick _when, const std::string &_cause,
-                 int c = 0)
-        : Event(q, Sim_Exit_Pri), cause(_cause), code(c)
-        { schedule(_when); }
+class CountedDrainEvent : public SimLoopExitEvent
+{
+  private:
+    // Count of how many objects have not yet drained
+    int count;
+  public:
+    CountedDrainEvent()
+        : count(0)
+    { }
+    void process();
 
-    void process();    // process event
+    void setCount(int _count) { count = _count; }
 
-    virtual const char *description();
+    int getCount() { return count; }
 };
 
 //