summaryrefslogtreecommitdiff
path: root/src/mem/slicc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/slicc')
-rw-r--r--src/mem/slicc/ast/EnqueueStatementAST.cc2
-rw-r--r--src/mem/slicc/symbols/StateMachine.cc24
-rw-r--r--src/mem/slicc/symbols/Type.cc26
3 files changed, 17 insertions, 35 deletions
diff --git a/src/mem/slicc/ast/EnqueueStatementAST.cc b/src/mem/slicc/ast/EnqueueStatementAST.cc
index 744dfe1eb..8be0378c9 100644
--- a/src/mem/slicc/ast/EnqueueStatementAST.cc
+++ b/src/mem/slicc/ast/EnqueueStatementAST.cc
@@ -77,7 +77,7 @@ void EnqueueStatementAST::generate(string& code, Type* return_type_ptr) const
code += ".enqueue(out_msg";
if (getPairs().exist("latency")) {
- code += ", RubyConfig::get" + getPairs().lookup("latency") + "()";
+ code += ", m_LATENCY_" + getPairs().lookup("latency");
}
code += ");\n";
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;
diff --git a/src/mem/slicc/symbols/Type.cc b/src/mem/slicc/symbols/Type.cc
index 75f72af02..eb53cc7b9 100644
--- a/src/mem/slicc/symbols/Type.cc
+++ b/src/mem/slicc/symbols/Type.cc
@@ -583,7 +583,6 @@ void Type::printEnumC(string path) const
out << endl;
out << "#include \"mem/protocol/" << type_name << ".hh\"" << endl;
if (m_isMachineType) {
- out << "#include \"mem/ruby/config/RubyConfig.hh\"" << endl;
out << "#include \"mem/protocol/ControllerFactory.hh\"" << endl;
for( int i = 0; i<size; i++ ) {
out << "#include \"mem/protocol/" << m_enum_vec[i] << "_Controller.hh\"" << endl;
@@ -675,7 +674,7 @@ void Type::printEnumC(string path) const
out << " }" << endl;
out << "}" << endl;
- out << "/** \\brief returns the machine type for each base vector index used by NetDest and RubyConfig" << endl;
+ out << "/** \\brief returns the machine type for each base vector index used by NetDest" << endl;
out << " * " << endl;
out << " * \\return the MachineTYpe" << endl;
out << " */" << endl;
@@ -762,29 +761,6 @@ void Type::printEnumC(string path) const
out << endl;
-// out << "/** \\brief returns the total number of components for each machine" << endl;
-// out << " * \\return the total number of components for each machine" << endl;
-// out << " */" << endl;
-// out << "int " << type_name << "_chip_count(const " << type_name << "& obj, int chip_id)" << endl;
-// out << "{" << endl;
-// out << " switch(obj) {" << endl;
-
-// // For each field
-// for( int i = 0; i<size; i++ ) {
-// out << " case " << type_name << "_" << m_enum_vec[i] << ":" << endl;
-// out << " return RubyConfig::getNumberOfControllersPerTypePerChip(MachineType_base_level(MachineType_" << m_enum_vec[i] << "), chip_id);" << endl;
-// }
-
-// // total num
-// out << " case " << type_name << "_NUM:" << endl;
-// // Trailer
-// out << " default:" << endl;
-// out << " ERROR_MSG(\"Invalid range for type " << type_name << "\");" << endl;
-// out << " return -1;" << endl;
-// out << " }" << endl;
-// out << "}" << endl;
-
-
}
// Write the file