Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r83 r88 1 #ifndef DEBUG_H2 #define DEBUG_H1 #ifndef Morpheo_Debug_h 2 #define Morpheo_Debug_h 3 3 4 4 /* … … 13 13 * - log_begin 14 14 * - log_end 15 * - log_function 16 * - msg_print 15 17 * - breakpoint 16 18 * … … 25 27 #include "Common/include/Message.h" 26 28 #include "Behavioural/include/Debug_component.h" 27 #include "Behavioural/include/Environment.h"29 #include <systemc.h> 28 30 #include <stdio.h> 29 31 #include <string.h> … … 31 33 #include <sstream> 32 34 #include <string> 35 36 namespace morpheo { 33 37 34 38 enum _debug_verbosity … … 54 58 ( DEBUG_ ## component == true )) ) \ 55 59 { \ 60 if (DEBUG_ ## level <= DEBUG_INFO) \ 61 { \ 62 msg("%s ",MSG_INFORMATION); \ 63 } \ 64 else \ 65 { \ 66 msg("%s ",MSG_DEBUG); \ 67 } \ 68 \ 56 69 if (DEBUG >= DEBUG_FUNC) \ 57 70 { \ 58 msg( _("%s"),debug_tab().c_str());\71 msg("%s",debug_tab().c_str()); \ 59 72 } \ 60 73 if (DEBUG >= DEBUG_ALL ) \ … … 72 85 if (DEBUG >= DEBUG_FUNC) \ 73 86 { \ 74 msg(_("<%s> "),func); \ 75 msg(_("In file %s, "),__FILE__); \ 76 msg(_("at line %d " ),__LINE__); \ 77 msg(_(": ")); \ 78 } \ 79 msg(str); \ 80 msg(_("\n")); \ 81 fflush (stdout); \ 87 msg( "<%s> " ,func); \ 88 msg(_("In file %s, "),__FILE__); \ 89 msg(_("at line %d " ),__LINE__); \ 90 msg( ": " ); \ 91 } \ 92 msg(str); \ 93 msg("\n"); \ 82 94 } \ 83 95 } while(0) … … 87 99 { \ 88 100 debug_tab_inc (); \ 89 log_printf(FUNC,component,func, "Begin");\101 log_printf(FUNC,component,func,_("Begin")); \ 90 102 } while(0) 91 103 … … 93 105 do \ 94 106 { \ 95 log_printf(FUNC,component,func, "End"); \107 log_printf(FUNC,component,func,_("End")); \ 96 108 debug_tab_dec (); \ 97 109 } while(0) … … 115 127 #endif // DEBUG 116 128 129 # define log_function(component,func,name) \ 130 do \ 131 { \ 132 log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(sc_simulation_time()),name,func); \ 133 } while(0) 134 135 136 #define msg_printf(type,str...) \ 137 do \ 138 { \ 139 msg("%s ",MSG_ ## type); \ 140 msg(str); \ 141 msg("\n"); \ 142 } while(0) 143 144 117 145 #define breakpoint(str...) \ 118 146 do \ 119 147 { \ 120 msg(_("Breakpoint : file %s, line %d. Enter Any key to continue\n"),__FILE__,__LINE__); \ 121 msg(str); \ 148 fprintf(stdout,_("%s "),MSG_BREAKPOINT); \ 149 fprintf(stdout,_("Breakpoint in file %s, line %d.\n"),__FILE__,__LINE__); \ 150 fprintf(stdout,_("%s "),MSG_NONE); \ 151 fprintf(stdout,str); \ 152 fprintf(stdout,_("\n")); \ 153 fprintf(stdout,_("%s "),MSG_NONE); \ 154 fprintf(stdout,_("Enter any key to continue\n")); \ 122 155 getchar(); \ 123 156 } while(0) … … 128 161 { \ 129 162 if (x == NULL) \ 130 err(_(" %s File %s, Line %d, this pointeur is null\n"),MSG_ERROR,__FILE__,__LINE__); \163 err(_("File %s, Line %d, this pointeur is null\n"),__FILE__,__LINE__); \ 131 164 } \ 132 165 while (0) … … 139 172 #endif 140 173 141 174 }; // end namespace morpheo 142 175 #endif // !DEBUG_H
Note: See TracChangeset
for help on using the changeset viewer.