cpu: Add instruction opclass histogram to minor
authorMitch Hayenga <mitch.hayenga@arm.com>
Tue, 5 Apr 2016 13:08:12 +0000 (08:08 -0500)
committerMitch Hayenga <mitch.hayenga@arm.com>
Tue, 5 Apr 2016 13:08:12 +0000 (08:08 -0500)
src/cpu/minor/execute.cc
src/cpu/minor/stats.cc
src/cpu/minor/stats.hh

index 0a2c4b8c87929b5bc86469a10caaca3fcdc307a2..4298e1dcc69a2c2bf43e41f3d161dc786d993d34 100644 (file)
@@ -849,6 +849,8 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst)
     thread->numOp++;
     thread->numOps++;
     cpu.stats.numOps++;
+    cpu.stats.committedInstType[inst->id.threadId]
+                               [inst->staticInst->opClass()]++;
 
     /* Set the CP SeqNum to the numOps commit number */
     if (inst->traceData)
index baa0aa7f3a14ad84e25156100ec74700e372b663..7048737e097d26badd40d4eead3a4b0acba84652 100644 (file)
@@ -82,6 +82,13 @@ MinorStats::regStats(const std::string &name, BaseCPU &baseCpu)
         .desc("IPC: instructions per cycle")
         .precision(6);
     ipc = numInsts / baseCpu.numCycles;
+
+    committedInstType
+        .init(baseCpu.numThreads, Enums::Num_OpClass)
+        .name(name + ".op_class")
+        .desc("Class of committed instruction")
+        .flags(Stats::total | Stats::pdf | Stats::dist);
+    committedInstType.ysubnames(Enums::OpClassStrings);
 }
 
 };
index dc246304dd8720ada37ecc6f54d1fc9faab8a0b3..c2f7e5f6d6920b54c5b4b9af17c86dc02bce853c 100644 (file)
@@ -76,6 +76,9 @@ class MinorStats
     Stats::Formula cpi;
     Stats::Formula ipc;
 
+    /** Number of instructions by type (OpClass) */
+    Stats::Vector2d committedInstType;
+
   public:
     MinorStats();