From bd18ac82877072a87745aaf7a104e7bb036c6c66 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 10 Jan 2011 11:11:20 -0800 Subject: ruby: get rid of ruby's Debug.hh Get rid of the Debug class Get rid of ASSERT and use assert Use DPRINTFR for ProtocolTrace --- src/mem/slicc/symbols/StateMachine.py | 56 +++++++++++++++++++---------------- src/mem/slicc/symbols/Type.py | 1 + 2 files changed, 31 insertions(+), 26 deletions(-) (limited to 'src/mem/slicc') diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index da6bc681c..145284726 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -338,6 +338,7 @@ static int m_num_controllers; * Created by slicc definition of Module "${{self.short}}" */ +#include #include #include @@ -760,6 +761,8 @@ $c_ident::${{action.ident}}(const Address& addr) // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include + #include "base/misc.hh" #include "mem/ruby/common/Global.hh" #include "mem/ruby/slicc_interface/RubySlicc_includes.hh" @@ -829,7 +832,10 @@ ${ident}_Controller::wakeup() // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include + #include "base/misc.hh" +#include "base/trace.hh" #include "mem/ruby/common/Global.hh" #include "mem/protocol/${ident}_Controller.hh" #include "mem/protocol/${ident}_State.hh" @@ -863,36 +869,30 @@ ${ident}_Controller::doTransition(${ident}_Event event, DPRINTF(RubyGenerated, "next_state: %s\\n", ${ident}_State_to_string(next_state)); m_profiler.countTransition(state, event); - if (Debug::getProtocolTrace()) { - g_system_ptr->getProfiler()->profileTransition("${ident}", - m_version, addr, - ${ident}_State_to_string(state), - ${ident}_Event_to_string(event), - ${ident}_State_to_string(next_state), - GET_TRANSITION_COMMENT()); - } - CLEAR_TRANSITION_COMMENT(); - ${ident}_setState(addr, next_state); + DPRINTFR(ProtocolTrace, "%7d %3s %10s%20s %6s>%-6s %s %s\\n", + g_eventQueue_ptr->getTime(), m_version, "${ident}", + ${ident}_Event_to_string(event), + ${ident}_State_to_string(state), + ${ident}_State_to_string(next_state), + addr, GET_TRANSITION_COMMENT()); + CLEAR_TRANSITION_COMMENT(); + ${ident}_setState(addr, next_state); } else if (result == TransitionResult_ResourceStall) { - if (Debug::getProtocolTrace()) { - g_system_ptr->getProfiler()->profileTransition("${ident}", - m_version, addr, - ${ident}_State_to_string(state), - ${ident}_Event_to_string(event), - ${ident}_State_to_string(next_state), - "Resource Stall"); - } + DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n", + g_eventQueue_ptr->getTime(), m_version, "${ident}", + ${ident}_Event_to_string(event), + ${ident}_State_to_string(state), + ${ident}_State_to_string(next_state), + addr, "Resource Stall"); } else if (result == TransitionResult_ProtocolStall) { DPRINTF(RubyGenerated, "stalling\\n"); - if (Debug::getProtocolTrace()) { - g_system_ptr->getProfiler()->profileTransition("${ident}", - m_version, addr, - ${ident}_State_to_string(state), - ${ident}_Event_to_string(event), - ${ident}_State_to_string(next_state), - "Protocol Stall"); - } + DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n", + g_eventQueue_ptr->getTime(), m_version, "${ident}", + ${ident}_Event_to_string(event), + ${ident}_State_to_string(state), + ${ident}_State_to_string(next_state), + addr, "Protocol Stall"); } return result; @@ -993,6 +993,7 @@ if (!%s.areNSlotsAvailable(%s)) #ifndef __${ident}_PROFILE_DUMPER_HH__ #define __${ident}_PROFILE_DUMPER_HH__ +#include #include #include @@ -1088,6 +1089,7 @@ ${ident}_ProfileDumper::dumpStats(std::ostream& out) const #ifndef __${ident}_PROFILER_HH__ #define __${ident}_PROFILER_HH__ +#include #include #include "mem/ruby/common/Global.hh" @@ -1125,6 +1127,8 @@ class ${ident}_Profiler // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include + #include "mem/protocol/${ident}_Profiler.hh" ${ident}_Profiler::${ident}_Profiler() diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index d6e156908..e521d544f 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -508,6 +508,7 @@ std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj); * Auto generated C++ code started by $__file__:$__line__ */ +#include #include #include -- cgit v1.2.3