Changeset 138 for trunk/IPs/systemC/processor/Morpheo/Common
- Timestamp:
- May 12, 2010, 7:34:01 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Common
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r129 r138 27 27 #include "Common/include/Systemc.h" 28 28 #include "Common/include/Message.h" 29 #include "Common/include/FromString.h"30 29 #include "Common/include/ChangeCase.h" 31 30 #include "Behavioural/include/Debug_component.h" … … 68 67 #define debug_test_simulation_time \ 69 68 (not debug_cycle_test or \ 70 ( (simulation_cycle() >= debug_cycle_start) and\71 ((simulation_cycle() <= debug_cycle_stop) or\72 69 ((simulation_cycle() >= debug_cycle_start) and \ 70 ((simulation_cycle() <= debug_cycle_stop) or \ 71 (debug_cycle_stop == -1)))) 73 72 #else 74 73 #define debug_test_simulation_time true … … 82 81 \ 83 82 if (debug_test_simulation_time and \ 84 ((debug == DEBUG_ALL ) or \ 85 (( DEBUG_ ## level <= debug) and \ 86 ( morpheo::behavioural::_model.get_debug(NAME_ ## component))))) \ 83 (( DEBUG_ ## level <= debug) and \ 84 ( morpheo::behavioural::_model.get_debug(NAME_ ## component)))) \ 87 85 { \ 88 86 if (DEBUG_ ## level <= DEBUG_INFO) \ … … 156 154 do \ 157 155 { \ 158 f printf(stdout,_("%s "),MSG_BREAKPOINT);\159 f printf(stdout,_("Breakpoint in file %s, line %d.\n"),__FILE__,__LINE__);\160 f printf(stdout,_("%s "),MSG_NONE);\161 f printf(stdout,str);\162 f printf(stdout,_("\n"));\163 f printf(stdout,_("%s "),MSG_NONE);\164 f printf(stdout,_("Enter any key to continue\n"));\156 fmsg(_("%s "),MSG_BREAKPOINT); \ 157 fmsg(_("Breakpoint in file %s, line %d.\n"),__FILE__,__LINE__); \ 158 fmsg(_("%s "),MSG_NONE); \ 159 fmsg(str); \ 160 fmsg(_("\n")); \ 161 fmsg(_("%s "),MSG_NONE); \ 162 fmsg(_("Enter any key to continue\n")); \ 165 163 getchar(); \ 166 164 } while(0) … … 182 180 #endif 183 181 184 185 template<> inline debug_verbosity_t fromString<debug_verbosity_t> (const std::string& x)186 {187 std::string y=x;188 LowerCase(y);189 190 if ( (y.compare("0") == 0) or191 (y.compare("none") == 0))192 return DEBUG_NONE ;193 if ( (y.compare("1") == 0) or194 (y.compare("info") == 0))195 return DEBUG_INFO ;196 if ( (y.compare("2") == 0) or197 (y.compare("trace") == 0))198 return DEBUG_TRACE;199 if ( (y.compare("3") == 0) or200 (y.compare("func") == 0))201 return DEBUG_FUNC ;202 if ( (y.compare("4") == 0) or203 (y.compare("all") == 0))204 return DEBUG_ALL ;205 206 #ifdef DEBUG207 return DEBUG;208 #else209 return DEBUG_NONE ;210 #endif211 }212 213 182 }; // end namespace morpheo 214 183 #endif // !DEBUG_H -
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug_type.h
r118 r138 15 15 */ 16 16 17 #include "Common/include/ToString.h" 18 #include "Common/include/FromString.h" 19 17 20 18 21 namespace morpheo { … … 27 30 } debug_verbosity_t; 28 31 32 template<> inline std::string toString<debug_verbosity_t>(const debug_verbosity_t& x) 33 { 34 switch (x) 35 { 36 case DEBUG_NONE : return "debug_none" ; break; 37 case DEBUG_INFO : return "debug_info" ; break; 38 case DEBUG_TRACE : return "debug_trace"; break; 39 case DEBUG_FUNC : return "debug_func" ; break; 40 case DEBUG_ALL : return "debug_all" ; break; 41 default : return "" ; break; 42 } 43 }; 44 45 template<> inline debug_verbosity_t fromString<debug_verbosity_t>(const std::string& x) 46 { 47 if ((x.compare(toString(static_cast<uint32_t>(DEBUG_NONE ))) == 0) or 48 (x.compare(toString( DEBUG_NONE )) == 0)) 49 return DEBUG_NONE; 50 51 if ((x.compare(toString(static_cast<uint32_t>(DEBUG_INFO ))) == 0) or 52 (x.compare(toString( DEBUG_INFO )) == 0)) 53 return DEBUG_INFO; 54 55 if ((x.compare(toString(static_cast<uint32_t>(DEBUG_TRACE))) == 0) or 56 (x.compare(toString( DEBUG_TRACE )) == 0)) 57 return DEBUG_TRACE; 58 59 if ((x.compare(toString(static_cast<uint32_t>(DEBUG_FUNC ))) == 0) or 60 (x.compare(toString( DEBUG_FUNC )) == 0)) 61 return DEBUG_FUNC; 62 63 if ((x.compare(toString(static_cast<uint32_t>(DEBUG_ALL ))) == 0) or 64 (x.compare(toString( DEBUG_ALL )) == 0)) 65 return DEBUG_ALL; 66 67 #ifdef DEBUG 68 return DEBUG; 69 #else 70 return DEBUG_NONE ; 71 #endif 72 }; 73 29 74 }; // end namespace morpheo 30 75 #endif -
trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h
r136 r138 39 39 _msg = toString(_("%s %s"),MSG_ERROR,msg.c_str()); 40 40 #endif 41 41 // msg("%s",_msg.c_str()); 42 42 } 43 43 public : ~ErrorMorpheo (void) throw() {} -
trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h
r113 r138 10 10 #include <sys/time.h> 11 11 #include "Common/include/Systemc.h" 12 #include "Common/include/Message.h" 12 13 13 14 namespace morpheo { -
trunk/IPs/systemC/processor/Morpheo/Common/src/Debug.cpp
r110 r138 45 45 #ifdef DEBUG 46 46 // Take min 47 debug = (level < DEBUG)?level:DEBUG;47 debug = (level < DEBUG)?level:DEBUG; 48 48 49 49 # ifdef SYSTEMC 50 debug_cycle_test = (cycle_stop > cycle_start) or (cycle_stop == -1); 51 debug_cycle_start= cycle_start; 52 debug_cycle_stop = cycle_stop; 50 debug_cycle_test = (not (cycle_start == -1) and 51 ((cycle_stop > cycle_start) or 52 (cycle_stop == -1))); 53 debug_cycle_start = cycle_start; 54 debug_cycle_stop = cycle_stop; 53 55 # else 54 debug_cycle_test = false;56 debug_cycle_test = false; 55 57 # endif 58 # else 59 debug = DEBUG_NONE; 60 debug_cycle_test = false; 61 debug_cycle_start = 0; 62 debug_cycle_stop = 0; 56 63 #endif 57 debug_idle_cycle = idle_cycle; 58 debug_idle_time = idle_time ; 64 65 debug_idle_cycle = idle_cycle; 66 debug_idle_time = idle_time ; 67 68 msgInformation(_("Debug level : %s\n"),toString(debug).c_str()); 69 // msgDebug(_("Cycle test : %d\n"),debug_cycle_test); 70 // msgDebug(_("Cycle start : %f\n"),cycle_start); 71 // msgDebug(_("Cycle stop : %f\n"),cycle_stop); 59 72 60 73 debug_initialized = true;
Note: See TracChangeset
for help on using the changeset viewer.