cpu: remove unnecessary data ptr from O3 internal read() funcs
[gem5.git] / src / cpu / activity.hh
index e99927339f4802bab9b72aa38fc50771820f8e0b..f8d57f1afc854f44ee9a80ff59556b2837383907 100644 (file)
@@ -31,8 +31,8 @@
 #ifndef __CPU_ACTIVITY_HH__
 #define __CPU_ACTIVITY_HH__
 
-#include "base/timebuf.hh"
 #include "base/trace.hh"
+#include "cpu/timebuf.hh"
 
 /**
  * ActivityRecorder helper class that informs the CPU if it can switch
  * idle.  If count is zero, then the CPU can safely idle as it has no
  * more outstanding work to do.
  */
-class ActivityRecorder {
+class ActivityRecorder
+{
   public:
-    ActivityRecorder(int num_stages, int longest_latency, int count);
+    ActivityRecorder(const std::string &name, int num_stages,
+                     int longest_latency, int count);
+    ~ActivityRecorder();
 
     /** Records that there is activity this cycle. */
     void activity();
@@ -68,8 +71,14 @@ class ActivityRecorder {
     /** Deactivates a stage. */
     void deactivateStage(const int idx);
 
+    /** Returns the activity status of a stage. */
+    bool getStageActive(const int idx) const { return stageActive[idx]; }
+
+    /** Returns the number of stages. */
+    int getNumStages() const { return numStages; }
+
     /** Returns how many things are active within the recorder. */
-    int getActivityCount() { return activityCount; }
+    int getActivityCount() const { return activityCount; }
 
     /** Sets the count to a starting value.  Can be used to disable
      * the idling option.
@@ -91,7 +100,12 @@ class ActivityRecorder {
      */
     void validate();
 
+    const std::string &name() const { return _name; }
+
   private:
+    // provide name() for DPRINTF.
+    std::string _name;
+
     /** Time buffer that tracks if any cycles has active communication
      *  in them.  It should be as long as the longest communication
      *  latency in the system.  Each time any time buffer is written,