Changeset 100 for trunk/IPs/systemC/processor/Morpheo/Common
- Timestamp:
- Jan 8, 2009, 2:06:27 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:ignore
set to
Makefile.flags
Makefile.tools
Makefile.tools_path
-
Property
svn:ignore
set to
-
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r97 r100 47 47 48 48 extern debug_verbosity_t debug; 49 50 void debug_init (void); 51 void debug_init (debug_verbosity_t level); 49 extern bool debug_cycle_test; 50 extern double debug_cycle_start; 51 extern double debug_cycle_stop ; 52 53 void debug_init (void); 54 void debug_init (debug_verbosity_t level, 55 double cycle_start, 56 double cycle_stop ); 57 58 #ifdef SYSTEMC 59 #define debug_test_simulation_time \ 60 (not debug_cycle_test or \ 61 ( (sc_simulation_time() >= debug_cycle_start) and \ 62 ((sc_simulation_time() <= debug_cycle_stop) or \ 63 (debug_cycle_stop == -1)))) 64 #else 65 #define debug_test_simulation_time true 66 #endif 67 52 68 #ifdef DEBUG 53 54 69 # define log_printf(level, component, func, str... ) \ 55 70 do \ … … 57 72 debug_init(); \ 58 73 \ 59 if ((debug == DEBUG_ALL ) or \ 60 (DEBUG_ ## level == DEBUG_NONE) or \ 61 (( DEBUG_ ## level <= debug) and \ 62 ( DEBUG_ ## component == true )) ) \ 63 { \ 64 if (DEBUG_ ## level <= DEBUG_INFO) \ 65 { \ 66 msg("%s ",MSG_INFORMATION); \ 67 } \ 68 else \ 69 { \ 70 msg("%s ",MSG_DEBUG); \ 71 } \ 74 if (debug_test_simulation_time) \ 75 if ((debug == DEBUG_ALL ) or \ 76 (DEBUG_ ## level == DEBUG_NONE) or \ 77 (( DEBUG_ ## level <= debug) and \ 78 ( DEBUG_ ## component == true )) ) \ 79 { \ 80 if (DEBUG_ ## level <= DEBUG_INFO) \ 81 { \ 82 msg("%s ",MSG_INFORMATION); \ 83 } \ 84 else \ 85 { \ 86 msg("%s ",MSG_DEBUG); \ 87 } \ 72 88 \ 73 74 {\75 switch (DEBUG_ ## level)\76 77 78 79 80 81 82 83 84 }\85 86 {\87 88 msg(_("In file %s, "),__FILE__);\89 msg(_("at line %d " ),__LINE__);\90 91 }\92 93 msg("\n");\94 89 if (debug >= DEBUG_ALL ) \ 90 { \ 91 switch (DEBUG_ ## level) \ 92 { \ 93 case DEBUG_NONE : msg(_("(none ) ")); break; \ 94 case DEBUG_INFO : msg(_("(information) ")); break; \ 95 case DEBUG_TRACE : msg(_("(trace ) ")); break; \ 96 case DEBUG_FUNC : msg(_("(function ) ")); break; \ 97 case DEBUG_ALL : msg(_("(all ) ")); break; \ 98 default : msg(_("(undefine ) ")); break; \ 99 } \ 100 } \ 101 if (debug >= DEBUG_FUNC) \ 102 { \ 103 msg( "<%s> " ,func); \ 104 msg(_("In file %s, "),__FILE__); \ 105 msg(_("at line %d " ),__LINE__); \ 106 msg( ": " ); \ 107 } \ 108 msg(str); \ 109 msg("\n"); \ 110 } \ 95 111 } while(0) 96 112 -
trunk/IPs/systemC/processor/Morpheo/Common/src/Debug.cpp
r97 r100 15 15 #endif 16 16 debug_verbosity_t debug; 17 bool debug_cycle_test; 18 double debug_cycle_start; 19 double debug_cycle_stop ; 17 20 18 21 #undef FUNCTION … … 24 27 { 25 28 debug = DEBUG; 26 27 // 29 debug_cycle_test = false; 30 // debug_initialized = true; 28 31 } 29 32 #endif … … 32 35 #undef FUNCTION 33 36 #define FUNCTION "debug_init" 34 void debug_init (debug_verbosity_t level) 37 void debug_init (debug_verbosity_t level, 38 double cycle_start, 39 double cycle_stop ) 35 40 { 36 41 #ifdef DEBUG … … 39 44 // Take min 40 45 debug = (level < DEBUG)?level:DEBUG; 41 46 47 #ifdef SYSTEMC 48 debug_cycle_test = (cycle_stop > cycle_start) or (cycle_stop == -1); 49 debug_cycle_start = cycle_start; 50 debug_cycle_stop = cycle_stop; 51 #else 52 debug_cycle_test = false; 53 #endif 54 42 55 debug_initialized = true; 43 56 } -
trunk/IPs/systemC/processor/Morpheo/Common/src/Message.cpp
r97 r100 8 8 #include "Common/include/Debug.h" 9 9 #include "Common/include/Environment.h" 10 #include "Common/include/ToString.h"11 10 #include "Common/include/ErrorMorpheo.h" 11 #include "Common/include/Filename.h" 12 12 #include <sys/types.h> 13 #include <unistd.h>14 13 15 14 namespace morpheo { … … 39 38 { 40 39 // if the file is not define, take pid. 41 std::string filename = directory+"/Morpheo_"+((file!="")?file:toString<pid_t>(getpid()))+".log"; 40 std::string filename = morpheo::filename(directory, 41 "Morpheo", 42 "", 43 "log", 44 (file==""), 45 (file==""), 46 true); 42 47 43 48 log_stream = fopen (filename.c_str(), "w");
Note: See TracChangeset
for help on using the changeset viewer.