changeset 34fe9bbc6705 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=34fe9bbc6705
description:
        o3cpu: give a name to the activity recorder for better tracing

diffstat:

3 files changed, 17 insertions(+), 8 deletions(-)
src/cpu/activity.cc |   13 ++++++++-----
src/cpu/activity.hh |   10 ++++++++--
src/cpu/o3/cpu.cc   |    2 +-

diffs (67 lines):

diff -r aae3d7089925 -r 34fe9bbc6705 src/cpu/activity.cc
--- a/src/cpu/activity.cc       Mon Jan 19 20:36:49 2009 -0800
+++ b/src/cpu/activity.cc       Wed Jan 21 14:56:18 2009 -0800
@@ -28,15 +28,18 @@
  * Authors: Kevin Lim
  */
 
-#include <cstring>
+#include <string>
 
 #include "base/timebuf.hh"
 #include "cpu/activity.hh"
 
-ActivityRecorder::ActivityRecorder(int num_stages, int longest_latency,
-                                   int activity)
-    : activityBuffer(longest_latency, 0), longestLatency(longest_latency),
-      activityCount(activity), numStages(num_stages)
+using namespace std;
+
+ActivityRecorder::ActivityRecorder(const string &name, int num_stages,
+    int longest_latency, int activity)
+    : _name(name), activityBuffer(longest_latency, 0),
+      longestLatency(longest_latency), activityCount(activity),
+      numStages(num_stages)
 {
     stageActive = new bool[numStages];
     std::memset(stageActive, 0, numStages);
diff -r aae3d7089925 -r 34fe9bbc6705 src/cpu/activity.hh
--- a/src/cpu/activity.hh       Mon Jan 19 20:36:49 2009 -0800
+++ b/src/cpu/activity.hh       Wed Jan 21 14:56:18 2009 -0800
@@ -49,9 +49,11 @@
  * 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);
 
     /** Records that there is activity this cycle. */
     void activity();
@@ -92,6 +94,10 @@
     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,
diff -r aae3d7089925 -r 34fe9bbc6705 src/cpu/o3/cpu.cc
--- a/src/cpu/o3/cpu.cc Mon Jan 19 20:36:49 2009 -0800
+++ b/src/cpu/o3/cpu.cc Wed Jan 21 14:56:18 2009 -0800
@@ -192,7 +192,7 @@
       decodeQueue(params->backComSize, params->forwardComSize),
       renameQueue(params->backComSize, params->forwardComSize),
       iewQueue(params->backComSize, params->forwardComSize),
-      activityRec(NumStages,
+      activityRec(name(), NumStages,
                   params->backComSize + params->forwardComSize,
                   params->activity),
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to