summaryrefslogtreecommitdiff
path: root/src/sim/system.hh
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:19 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:19 -0800
commitdfa8cbeb06b7556753c26b97978924c1f4a24699 (patch)
tree5c47168bd2d8794612d385cc12277c5212660e40 /src/sim/system.hh
parentc41fc138e78420c72d8dada805a16c96f74f631b (diff)
downloadgem5-dfa8cbeb06b7556753c26b97978924c1f4a24699.tar.xz
m5: added work completed monitoring support
Diffstat (limited to 'src/sim/system.hh')
-rw-r--r--src/sim/system.hh42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh
index 6c4f3e9ed..0be16247f 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -161,6 +161,48 @@ class System : public SimObject
protected:
Enums::MemoryMode memoryMode;
+ uint64_t workItemsBegin;
+ uint64_t workItemsEnd;
+ std::vector<bool> activeCpus;
+
+ public:
+ /**
+ * Called by pseudo_inst to track the number of work items started by this
+ * system.
+ */
+ uint64_t
+ incWorkItemsBegin()
+ {
+ return ++workItemsBegin;
+ }
+
+ /**
+ * Called by pseudo_inst to track the number of work items completed by
+ * this system.
+ */
+ uint64_t
+ incWorkItemsEnd()
+ {
+ return ++workItemsEnd;
+ }
+
+ /**
+ * Called by pseudo_inst to mark the cpus actively executing work items.
+ * Returns the total number of cpus that have executed work item begin or
+ * ends.
+ */
+ int
+ markWorkItem(int index)
+ {
+ int count = 0;
+ assert(index < activeCpus.size());
+ activeCpus[index] = true;
+ for (std::vector<bool>::iterator i = activeCpus.begin();
+ i < activeCpus.end(); i++) {
+ if (*i) count++;
+ }
+ return count;
+ }
#if FULL_SYSTEM
/**