summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols/StateMachine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/slicc/symbols/StateMachine.cc')
-rw-r--r--src/mem/slicc/symbols/StateMachine.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.cc b/src/mem/slicc/symbols/StateMachine.cc
index 64c7ae24a..e042f9aa0 100644
--- a/src/mem/slicc/symbols/StateMachine.cc
+++ b/src/mem/slicc/symbols/StateMachine.cc
@@ -314,7 +314,7 @@ void StateMachine::printControllerH(ostream& out, string component)
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
@@ -392,10 +392,6 @@ void StateMachine::printControllerC(ostream& out, string component)
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;
@@ -478,6 +474,7 @@ void StateMachine::printControllerC(ostream& out, string component)
// 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")) {
@@ -722,11 +719,12 @@ void StateMachine::printControllerC(ostream& out, string component)
out << "{" << endl;
out << " DEBUG_MSG(GENERATED_COMP, HighPrio,\"executing\");" << endl;
//added by SS
-//instead of rubyconfig:: --> it should point to m_latency...
+//it should point to m_latency...
//so I should change the string output of this lookup
- string c_code_string = action.lookupPair("c_code");
+ string c_code_string = action.lookupPair("c_code");
+/*
size_t found = c_code_string.find("RubyConfig::get");
if (found!=string::npos){ //found --> replace it with local access
@@ -744,7 +742,7 @@ void StateMachine::printControllerC(ostream& out, string component)
}
}
}
-
+*/
// add here:
if (strncmp(component.c_str(), "L1Cache", 7) == 0) {
if (c_code_string.find("writeCallback") != string::npos) {
@@ -1116,6 +1114,7 @@ void StateMachine::printProfilerH(ostream& out, string component)
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;
@@ -1124,6 +1123,7 @@ void StateMachine::printProfilerH(ostream& out, string component)
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;
}
@@ -1150,6 +1150,12 @@ void StateMachine::printProfilerC(ostream& out, string component)
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;
@@ -1180,7 +1186,7 @@ void StateMachine::printProfilerC(ostream& out, string component)
// 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;