changeset c6254810bb6c in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=c6254810bb6c
description:
        slicc: made coherence profilers per-controller

diffstat:

1 file changed, 11 insertions(+), 6 deletions(-)
src/mem/slicc/symbols/StateMachine.cc |   17 +++++++++++------

diffs (69 lines):

diff -r 99ca47c2130b -r c6254810bb6c src/mem/slicc/symbols/StateMachine.cc
--- a/src/mem/slicc/symbols/StateMachine.cc     Mon Jul 13 14:49:51 2009 -0500
+++ b/src/mem/slicc/symbols/StateMachine.cc     Sat Jul 18 16:54:45 2009 -0500
@@ -311,7 +311,7 @@
   out << "  NodeID m_version;" << endl;
   out << "  Network* m_net_ptr;" << endl;
   out << "  MachineID m_machineID;" << endl;
-  out << "  static " << component << "_Profiler s_profiler;" << endl;
+  out << "  " << component << "_Profiler s_profiler;" << endl;
   out << "  static int m_num_controllers;" << endl;
 
   // internal function protypes
@@ -389,10 +389,6 @@
   out << "stringstream " << component << "_" << "transitionComment;" << endl;
   out << "#define APPEND_TRANSITION_COMMENT(str) (" << component << "_" << 
"transitionComment << str)" << endl;
 
-  out << "/** \\brief static profiler defn */" << endl;
-  out << component << "_Profiler " << component << "_Controller::s_profiler;" 
<< endl;
-  out << endl;
-
   out << "/** \\brief constructor */" << endl;
   out << component << "_Controller::" << component
     //      << "_Controller(int version, Network* net_ptr)" << endl;
@@ -471,6 +467,7 @@
 
   // initialize objects
   out << "  // Objects" << endl;
+  out << "  s_profiler.setVersion(m_version);" << endl;
   for(int i=0; i < numObjects(); i++) {
     const Var* var = m_objs[i];
     if (!var->existPair("network")) {
@@ -1006,6 +1003,7 @@
   out << "class " << component << "_Profiler {" << endl;
   out << "public:" << endl;
   out << "  " << component << "_Profiler();" << endl;
+  out << "  void setVersion(int version);" << endl;
   out << "  void countTransition(" << component << "_State state, " << 
component << "_Event event);" << endl;
   out << "  void possibleTransition(" << component << "_State state, " << 
component << "_Event event);" << endl;
   out << "  void dumpStats(ostream& out) const;" << endl;
@@ -1014,6 +1012,7 @@
   out << "  int m_counters[" << component << "_State_NUM][" << component << 
"_Event_NUM];" << endl;
   out << "  int m_event_counters[" << component << "_Event_NUM];" << endl;
   out << "  bool m_possible[" << component << "_State_NUM][" << component << 
"_Event_NUM];" << endl;
+  out << "  int m_version;" << endl;
   out << "};" << endl;
   out << "#endif // " << component << "_PROFILER_H" << endl;
 }
@@ -1040,6 +1039,12 @@
   out << "  }" << endl;
   out << "}" << endl;
 
+  // setVersion
+  out << "void " << component << "_Profiler::setVersion(int version)" << endl;
+  out << "{" << endl;
+  out << "  m_version = version;" << endl;
+  out << "}" << endl;
+
   // Clearstats
   out << "void " << component << "_Profiler::clearStats()" << endl;
   out << "{" << endl;
@@ -1070,7 +1075,7 @@
   // dumpStats
   out << "void " << component << "_Profiler::dumpStats(ostream& out) const" << 
endl;
   out << "{" << endl;
-  out << "  out << \" --- " << component << " ---\" << endl;" << endl;
+  out << "  out << \" --- " << component << " \" << m_version << \" ---\" << 
endl;" << endl;
   out << "  out << \" - Event Counts -\" << endl;" << endl;
   out << "  for (int event = 0; event < " << component << "_Event_NUM; 
event++) {" << endl;
   out << "    int count = m_event_counters[event];" << endl;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to