O3 IEW: Make incrWb and decrWb clearer
[gem5.git] / src / cpu / activity.hh
index 2c0df5efb0797a02776c7b5023be978334c5dc96..7913bf5e7f4fa7b6e1454e3b8317ee7a2a8a7f71 100644 (file)
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Kevin Lim
  */
 
 #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();
@@ -90,6 +95,10 @@ class ActivityRecorder {
     void validate();
 
   private:
+    // provide name() for DPRINTF.
+    std::string _name;
+    const std::string &name() { return _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,