diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2010-12-22 23:15:24 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2010-12-22 23:15:24 -0600 |
commit | 58fa2857e123a44b1633628b898847773153c047 (patch) | |
tree | abf6318d961c8bcb31d7a0f5c4aa9bbb4a0db0ed /src/mem/slicc | |
parent | 2c0e80f96bee8c2ad48cd3fb7a18af149bfe76bc (diff) | |
download | gem5-58fa2857e123a44b1633628b898847773153c047.tar.xz |
This patch removes the WARN_* and ERROR_* from src/mem/ruby/common/Debug.hh file. These statements have been replaced with warn(), panic() and fatal() defined in src/base/misc.hh
Diffstat (limited to 'src/mem/slicc')
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 10 | ||||
-rw-r--r-- | src/mem/slicc/symbols/Type.py | 19 |
2 files changed, 11 insertions, 18 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index a7ac556e1..da6bc681c 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -829,6 +829,7 @@ ${ident}_Controller::wakeup() // Auto generated C++ code started by $__file__:$__line__ // ${ident}: ${{self.short}} +#include "base/misc.hh" #include "mem/ruby/common/Global.hh" #include "mem/protocol/${ident}_Controller.hh" #include "mem/protocol/${ident}_State.hh" @@ -972,12 +973,9 @@ if (!%s.areNSlotsAvailable(%s)) code(''' default: - WARN_EXPR(m_version); - WARN_EXPR(g_eventQueue_ptr->getTime()); - WARN_EXPR(addr); - WARN_EXPR(event); - WARN_EXPR(state); - ERROR_MSG(\"Invalid transition\"); + fatal("Invalid transition\\n" + "version: %d time: %d addr: %s event: %s state: %s\\n", + m_version, g_eventQueue_ptr->getTime(), addr, event, state); } return TransitionResult_Valid; } diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index cefae16ae..d6e156908 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -511,6 +511,7 @@ std::ostream& operator<<(std::ostream& out, const ${{self.c_ident}}& obj); #include <iostream> #include <string> +#include "base/misc.hh" #include "mem/protocol/${{self.c_ident}}.hh" using namespace std; @@ -548,8 +549,7 @@ ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj) # Trailer code(''' default: - ERROR_MSG("Invalid range for type ${{self.c_ident}}"); - return ""; + panic("Invalid range for type ${{self.c_ident}}"); } } @@ -570,8 +570,7 @@ string_to_${{self.c_ident}}(const string& str) code(''' } else { - WARN_EXPR(str); - ERROR_MSG("Invalid string conversion for type ${{self.c_ident}}"); + panic("Invalid string conversion for %s, type ${{self.c_ident}}", str); } } @@ -613,8 +612,7 @@ ${{self.c_ident}}_base_level(const ${{self.c_ident}}& obj) return ${{len(self.enums)}}; default: - ERROR_MSG("Invalid range for type ${{self.c_ident}}"); - return -1; + panic("Invalid range for type ${{self.c_ident}}"); } } @@ -638,8 +636,7 @@ ${{self.c_ident}}_from_base_level(int type) # Trailer code(''' default: - ERROR_MSG("Invalid range for type ${{self.c_ident}}"); - return MachineType_NUM; + panic("Invalid range for type ${{self.c_ident}}"); } } @@ -666,8 +663,7 @@ ${{self.c_ident}}_base_number(const ${{self.c_ident}}& obj) code(''' default: - ERROR_MSG("Invalid range for type ${{self.c_ident}}"); - return -1; + panic("Invalid range for type ${{self.c_ident}}"); } return base; @@ -693,8 +689,7 @@ ${{self.c_ident}}_base_count(const ${{self.c_ident}}& obj) code(''' case ${{self.c_ident}}_NUM: default: - ERROR_MSG("Invalid range for type ${{self.c_ident}}"); - return -1; + panic("Invalid range for type ${{self.c_ident}}"); } } ''') |