projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cpu: remove unnecessary data ptr from O3 internal read() funcs
[gem5.git]
/
src
/
cpu
/
activity.hh
diff --git
a/src/cpu/activity.hh
b/src/cpu/activity.hh
index e99927339f4802bab9b72aa38fc50771820f8e0b..f8d57f1afc854f44ee9a80ff59556b2837383907 100644
(file)
--- a/
src/cpu/activity.hh
+++ b/
src/cpu/activity.hh
@@
-31,8
+31,8
@@
#ifndef __CPU_ACTIVITY_HH__
#define __CPU_ACTIVITY_HH__
#ifndef __CPU_ACTIVITY_HH__
#define __CPU_ACTIVITY_HH__
-#include "base/timebuf.hh"
#include "base/trace.hh"
#include "base/trace.hh"
+#include "cpu/timebuf.hh"
/**
* ActivityRecorder helper class that informs the CPU if it can switch
/**
* ActivityRecorder helper class that informs the CPU if it can switch
@@
-49,9
+49,12
@@
* idle. If count is zero, then the CPU can safely idle as it has no
* more outstanding work to do.
*/
* 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:
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();
/** Records that there is activity this cycle. */
void activity();
@@
-68,8
+71,14
@@
class ActivityRecorder {
/** Deactivates a stage. */
void deactivateStage(const int idx);
/** 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. */
/** 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.
/** Sets the count to a starting value. Can be used to disable
* the idling option.
@@
-91,7
+100,12
@@
class ActivityRecorder {
*/
void validate();
*/
void validate();
+ const std::string &name() const { return _name; }
+
private:
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,
/** 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,