inorder: register file stats
authorKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:34 +0000 (21:43 -0400)
committerKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:34 +0000 (21:43 -0400)
keep stats for int/float reg file usage instead
of aggregating across reg file types

src/cpu/inorder/resources/use_def.cc
src/cpu/inorder/resources/use_def.hh

index b23a3c3444f72f8a1da5299889d3ba1c172a1beb..d8bf8790bd6108e1fb902432d371d0c1ec5cc9e6 100644 (file)
@@ -66,22 +66,35 @@ UseDefUnit::regStats()
         .desc("Number of Unique Registers Needed Per Context Switch")
         .prereq(uniqueRegsPerSwitch);
 
-    regFileReads
-        .name(name() + ".regFileReads")
-        .desc("Number of Reads from Register File");
+    intRegFileReads
+        .name(name() + ".intRegFileReads")
+        .desc("Number of Reads from Int. Register File");
+
+    intRegFileWrites
+        .name(name() + ".intRegFileWrites")
+        .desc("Number of Writes to Int. Register File");
+
+    intRegFileAccs
+        .name(name() + ".intRegFileAccesses")
+        .desc("Total Accesses (Read+Write) to the Int. Register File");
+    intRegFileAccs = intRegFileReads + intRegFileWrites;
+
+    floatRegFileReads
+        .name(name() + ".floatRegFileReads")
+        .desc("Number of Reads from FP Register File");
+
+    floatRegFileWrites
+        .name(name() + ".floatRegFileWrites")
+        .desc("Number of Writes to FP Register File");
+
+    floatRegFileAccs
+        .name(name() + ".floatRegFileAccesses")
+        .desc("Total Accesses (Read+Write) to the FP Register File");
+    floatRegFileAccs = floatRegFileReads + floatRegFileWrites;
 
     regForwards
         .name(name() + ".regForwards")
         .desc("Number of Registers Read Through Forwarding Logic");
-
-    regFileWrites
-        .name(name() + ".regFileWrites")
-        .desc("Number of Writes to Register File");
-
-    regFileAccs
-        .name(name() + ".regFileAccesses")
-        .desc("Number of Total Accesses (Read+Write) to the Register File");
-    regFileAccs = regFileReads + regFileWrites;
     
     Resource::regStats();
 }
@@ -192,6 +205,7 @@ UseDefUnit::execute(int slot_idx)
                         inst->setIntSrc(ud_idx,
                                         cpu->readIntReg(flat_idx,
                                                         inst->readTid()));
+                        intRegFileReads++;
                     }
                     break;
 
@@ -210,6 +224,7 @@ UseDefUnit::execute(int slot_idx)
                         inst->setFloatSrc(ud_idx,
                                           cpu->readFloatReg(flat_idx,
                                                             inst->readTid()));
+                        floatRegFileReads++;
                     }
                     break;
 
@@ -232,7 +247,6 @@ UseDefUnit::execute(int slot_idx)
                     panic("Invalid Register Type: %i", reg_type);
                 }
 
-                regFileReads++;
                 ud_req->done();
             } else {
                 // Look for forwarding opportunities
@@ -338,6 +352,7 @@ UseDefUnit::execute(int slot_idx)
                         cpu->setIntReg(flat_idx,
                                        inst->readIntResult(ud_idx),
                                        inst->readTid());
+                        intRegFileWrites++;
                     }
                     break;
 
@@ -393,6 +408,7 @@ UseDefUnit::execute(int slot_idx)
                                   inst->seqNum, inst->instName());
                         }
 
+                        floatRegFileWrites++;
                     }
                     break;
 
@@ -417,7 +433,6 @@ UseDefUnit::execute(int slot_idx)
                     panic("Invalid Register Type: %i", reg_type);
                 }
 
-                regFileWrites++;
                 ud_req->done();
             } else {
                 DPRINTF(InOrderUseDef, "[tid:%i]: [sn:%i]: Dest. register idx: %i is "
index ef33395a0d0d1701792a7335e857dcc1020a4805..4c3eceef8a972cfe1e4071cdda6a617089605ab9 100644 (file)
@@ -106,17 +106,26 @@ class UseDefUnit : public Resource {
     };
 
   protected:
-    /** Register File Reads */
-    Stats::Scalar regFileReads;
+    /** Int. Register File Reads */
+    Stats::Scalar intRegFileReads;
 
-    /** Register File Writes */
-    Stats::Scalar regFileWrites;
+    /** Int. Register File Writes */
+    Stats::Scalar intRegFileWrites;
+
+    /** Int. Register File Total Accesses (Read+Write) */
+    Stats::Formula intRegFileAccs;
+
+    /** Float Register File Reads */
+    Stats::Scalar floatRegFileReads;
+
+    /** Float Register File Writes */
+    Stats::Scalar floatRegFileWrites;
+
+    /** Float Register File Total Accesses (Read+Write) */
+    Stats::Formula floatRegFileAccs;
 
     /** Source Register Forwarding */
     Stats::Scalar regForwards;
-
-    /** Register File Total Accesses (Read+Write) */
-    Stats::Formula regFileAccs;
 };
 
 #endif //__CPU_INORDER_USE_DEF_UNIT_HH__