summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols/StateMachine.py
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
committerNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
commit140785d24c27f3afddbe95c9e504e27bf8274290 (patch)
treecc4d27a7d4e417a6cd0f0364cff3db67ca1825b7 /src/mem/slicc/symbols/StateMachine.py
parent1badec39a94397397a3c918bfcc75c71efc507ea (diff)
downloadgem5-140785d24c27f3afddbe95c9e504e27bf8274290.tar.xz
ruby: get rid of std-includes.hh
Do not use "using namespace std;" in headers Include header files as needed
Diffstat (limited to 'src/mem/slicc/symbols/StateMachine.py')
-rw-r--r--src/mem/slicc/symbols/StateMachine.py33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 5da42a6d5..e86b4245a 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -196,6 +196,10 @@ class $py_ident(RubyController):
#ifndef ${ident}_CONTROLLER_H
#define ${ident}_CONTROLLER_H
+#include <iostream>
+#include <sstream>
+#include <string>
+
#include "params/$c_ident.hh"
#include "mem/ruby/common/Global.hh"
@@ -214,7 +218,7 @@ class $py_ident(RubyController):
# for adding information to the protocol debug trace
code('''
-extern stringstream ${ident}_transitionComment;
+extern std::stringstream ${ident}_transitionComment;
class $c_ident : public AbstractController {
#ifdef CHECK_COHERENCE
@@ -226,14 +230,14 @@ public:
void init();
MessageBuffer* getMandatoryQueue() const;
const int & getVersion() const;
- const string toString() const;
- const string getName() const;
+ const std::string toString() const;
+ const std::string getName() const;
const MachineType getMachineType() const;
void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
- void print(ostream& out) const;
- void printConfig(ostream& out) const;
+ void print(std::ostream& out) const;
+ void printConfig(std::ostream& out) const;
void wakeup();
- void printStats(ostream& out) const;
+ void printStats(std::ostream& out) const;
void clearStats();
void blockOnQueue(Address addr, MessageBuffer* port);
void unblock(Address addr);
@@ -253,11 +257,11 @@ int m_number_of_TBEs;
TransitionResult doTransition(${ident}_Event event, ${ident}_State state, const Address& addr); // in ${ident}_Transitions.cc
TransitionResult doTransitionWorker(${ident}_Event event, ${ident}_State state, ${ident}_State& next_state, const Address& addr); // in ${ident}_Transitions.cc
-string m_name;
+std::string m_name;
int m_transitions_per_cycle;
int m_buffer_size;
int m_recycle_latency;
-map< string, string > m_cfg;
+map<std::string, std::string> m_cfg;
NodeID m_version;
Network* m_net_ptr;
MachineID m_machineID;
@@ -312,6 +316,9 @@ static int m_num_controllers;
* Created by slicc definition of Module "${{self.short}}"
*/
+#include <sstream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/RubySlicc_includes.hh"
#include "mem/protocol/${ident}_Controller.hh"
@@ -319,6 +326,8 @@ static int m_num_controllers;
#include "mem/protocol/${ident}_Event.hh"
#include "mem/protocol/Types.hh"
#include "mem/ruby/system/System.hh"
+
+using namespace std;
''')
# include object classes
@@ -863,6 +872,8 @@ if (!%s.areNSlotsAvailable(%s)) {
#ifndef ${ident}_PROFILER_H
#define ${ident}_PROFILER_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/protocol/${ident}_State.hh"
#include "mem/protocol/${ident}_Event.hh"
@@ -873,7 +884,7 @@ class ${ident}_Profiler {
void setVersion(int version);
void countTransition(${ident}_State state, ${ident}_Event event);
void possibleTransition(${ident}_State state, ${ident}_Event event);
- void dumpStats(ostream& out) const;
+ void dumpStats(std::ostream& out) const;
void clearStats();
private:
@@ -935,8 +946,10 @@ void ${ident}_Profiler::possibleTransition(${ident}_State state, ${ident}_Event
{
m_possible[state][event] = true;
}
-void ${ident}_Profiler::dumpStats(ostream& out) const
+void ${ident}_Profiler::dumpStats(std::ostream& out) const
{
+ using namespace std;
+
out << " --- ${ident} " << m_version << " ---" << endl;
out << " - Event Counts -" << endl;
for (int event = 0; event < ${ident}_Event_NUM; event++) {