ruby: Added Cache and MemCntrl profiler calls
authorBrad Beckmann <Brad.Beckmann@amd.com>
Sat, 30 Jan 2010 04:29:23 +0000 (20:29 -0800)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Sat, 30 Jan 2010 04:29:23 +0000 (20:29 -0800)
src/mem/slicc/symbols/StateMachine.py

index 4f25f68e9508a29b321eaa48b130f1571044cc26..cf53e839848175cd67e4459f515456b75a5b6a68 100644 (file)
@@ -233,8 +233,8 @@ public:
     void print(ostream& out) const;
     void printConfig(ostream& out) const;
     void wakeup();
-    void printStats(ostream& out) const { s_profiler.dumpStats(out); }
-    void clearStats() { s_profiler.clearStats(); }
+    void printStats(ostream& out) const;
+    void clearStats();
     void blockOnQueue(Address addr, MessageBuffer* port);
     void unblock(Address addr);
 private:
@@ -587,6 +587,38 @@ void $c_ident::printConfig(ostream& out) const {
     }
 }
 
+void $c_ident::printStats(ostream& out) const {
+''')
+        #
+        # Cache and Memory Controllers have specific profilers associated with
+        # them.  Print out these stats before dumping state transition stats.
+        #
+        for param in self.config_parameters:
+            if param.type_ast.type.ident == "CacheMemory" or \
+                   param.type_ast.type.ident == "MemoryControl":
+                assert(param.pointer)
+                code('    m_${{param.ident}}_ptr->printStats(out);')
+
+        code('''
+    s_profiler.dumpStats(out);
+}
+
+void $c_ident::clearStats() {
+''')
+        #
+        # Cache and Memory Controllers have specific profilers associated with
+        # them.  These stats must be cleared too.
+        #
+        for param in self.config_parameters:
+            if param.type_ast.type.ident == "CacheMemory" or \
+                   param.type_ast.type.ident == "MemoryControl":
+                assert(param.pointer)
+                code('    m_${{param.ident}}_ptr->clearStats();')
+
+        code('''
+    s_profiler.clearStats();
+}
+
 // Actions
 ''')