LSQ Unit: After deleting part of a split request, set it to NULL so that it
[gem5.git] / src / sim / sim_events.hh
index 94e2540b1abe345f3a56c94a3587bcb5cdf5b1c3..ffd31f385447dc017bdec55aa18dd983f1045f60 100644 (file)
 //
 class SimLoopExitEvent : public Event
 {
-  private:
+  protected:
     // string explaining why we're terminating
     std::string cause;
     int code;
     Tick repeat;
 
   public:
-    // 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); }
+    SimLoopExitEvent(const std::string &_cause, int c, Tick repeat = 0);
 
     std::string getCause() { return cause; }
     int getCode() { return code; }
 
-    void process();    // process event
+    void process();     // process event
 
-    virtual const char *description();
+    virtual const char *description() const;
 };
 
 class CountedDrainEvent : public SimLoopExitEvent
@@ -76,10 +60,10 @@ class CountedDrainEvent : public SimLoopExitEvent
   private:
     // Count of how many objects have not yet drained
     int count;
+
   public:
-    CountedDrainEvent()
-        : count(0)
-    { }
+    CountedDrainEvent();
+
     void process();
 
     void setCount(int _count) { count = _count; }
@@ -95,16 +79,15 @@ class CountedDrainEvent : public SimLoopExitEvent
 class CountedExitEvent : public Event
 {
   private:
-    std::string cause; // string explaining why we're terminating
-    int &downCounter;  // decrement & terminate if zero
+    std::string cause;  // string explaining why we're terminating
+    int &downCounter;   // decrement & terminate if zero
 
   public:
-    CountedExitEvent(EventQueue *q, const std::string &_cause,
-                     Tick _when, int &_downCounter);
+    CountedExitEvent(const std::string &_cause, int &_downCounter);
 
-    void process();    // process event
+    void process();     // process event
 
-    virtual const char *description();
+    virtual const char *description() const;
 };
 
 //
@@ -116,13 +99,10 @@ class CheckSwapEvent : public Event
     int interval;
 
   public:
-    CheckSwapEvent(EventQueue *q, int ival)
-        : Event(q), interval(ival)
-    { schedule(curTick + interval); }
-
-    void process();    // process event
+    CheckSwapEvent(int ival);
+    void process();     // process event
 
-    virtual const char *description();
+    virtual const char *description() const;
 };
 
 #endif  // __SIM_SIM_EVENTS_HH__