Changeset 15 for trunk/IPs/systemC/processor/Morpheo/Include
- Timestamp:
- Apr 5, 2007, 4:17:30 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Include
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Include/Debug.h
r3 r15 9 9 #include <string> 10 10 using namespace std; 11 12 // Debug's Level : 13 // * None : print elementary information 14 // * Info : print basic information 15 // * Trace : trace internal variable 16 // * Func : trace call and return function 17 // * All : print all information 11 18 12 19 enum _debug_verbosity … … 21 28 #ifdef DEBUG 22 29 //Debug 23 /* 24 # define log_printf(level, component, str... ) \ 25 do \ 26 { \ 27 if ( ( DEBUG_ ## level <= DEBUG) and \ 28 ( DEBUG_ ## component == true ) ) \ 29 { \ 30 fprintf(stdout,"<%s> line %d : ",__FILE__,__LINE__); \ 31 fprintf(stdout,str); \ 32 fprintf(stdout,"\n"); \ 33 } \ 34 } while(0) 35 */ 36 37 # define log_printf(level, component, func, str... ) \ 38 do \ 39 { \ 40 if ( ( DEBUG_ ## level <= DEBUG) and \ 41 ( DEBUG_ ## component == true ) ) \ 42 { \ 43 fprintf(stdout,"In file %s, ",__FILE__); \ 44 fprintf(stdout,"at line %d, ",__LINE__); \ 45 fprintf(stdout,"in function \"%s\" : ",func); \ 46 fprintf(stdout,str); \ 47 fprintf(stdout,"\n"); \ 48 } \ 30 31 # define log_printf(level, component, func, str... ) \ 32 do \ 33 { \ 34 if ( (DEBUG == DEBUG_ALL) or \ 35 (( DEBUG_ ## level <= DEBUG) and \ 36 ( DEBUG_ ## component == true )) ) \ 37 { \ 38 if (DEBUG >= DEBUG_ALL ) \ 39 { \ 40 switch (DEBUG_ ## level) \ 41 { \ 42 case DEBUG_NONE : fprintf(stdout,"(none ) "); break; \ 43 case DEBUG_INFO : fprintf(stdout,"(information) "); break; \ 44 case DEBUG_TRACE : fprintf(stdout,"(trace ) "); break; \ 45 case DEBUG_FUNC : fprintf(stdout,"(function ) "); break; \ 46 case DEBUG_ALL : fprintf(stdout,"(all ) "); break; \ 47 default : fprintf(stdout,"(undefine ) "); break; \ 48 } \ 49 } \ 50 fprintf(stdout,"In file %s, ",__FILE__); \ 51 fprintf(stdout,"at line %d, ",__LINE__); \ 52 if (DEBUG >= DEBUG_FUNC) \ 53 { \ 54 fprintf(stdout,"in function \"%s\" ",func); \ 55 } \ 56 fprintf(stdout,": "); \ 57 fprintf(stdout,str); \ 58 fprintf(stdout,"\n"); \ 59 fflush (stdout); \ 60 } \ 49 61 } while(0) 50 62 51 63 #else 52 64 // No debug 53 /* 54 # define log_printf(level, component, str... ) \ 55 do \ 56 { \ 57 } while(0) 58 */ 65 59 66 # define log_printf(level, component, func, str... ) \ 60 67 do \ -
trunk/IPs/systemC/processor/Morpheo/Include/Test.h
r3 r15 15 15 void test_ko (T exp1, T exp2, char * file, uint32_t line) 16 16 { 17 string msg = (" {"+toString(num_test)+"}: Test KO\n" +17 string msg = ("<"+toString(num_test)+"> : Test KO\n" + 18 18 " * Localisation\n" + 19 19 " - File : "+file+"\n" + -
trunk/IPs/systemC/processor/Morpheo/Include/ToString.h
r2 r15 1 #ifndef morpheo_ Tostring2 #define morpheo_ Tostring1 #ifndef morpheo_tostring 2 #define morpheo_tostring 3 3 4 4 /* … … 21 21 namespace morpheo { 22 22 23 template<typename T> inline std::string toString (const T& x)23 template<typename T> inline std::string toString (const T& x) 24 24 { 25 25 ostringstream out; … … 28 28 } 29 29 30 template<> inline std::string toString<bool> (const bool& x)30 template<> inline std::string toString<bool> (const bool& x) 31 31 { 32 32 ostringstream out; … … 36 36 } 37 37 38 template<> inline std::string toString<float> (const float& x)38 template<> inline std::string toString<float> (const float& x) 39 39 { 40 40 const int sigdigits = std::numeric_limits<float>::digits10; … … 44 44 } 45 45 46 template<> inline std::string toString<double> (const double& x)46 template<> inline std::string toString<double> (const double& x) 47 47 { 48 48 const int sigdigits = std::numeric_limits<double>::digits10; … … 52 52 } 53 53 54 template<> inline std::string toString<long double>(const long double& x)54 template<> inline std::string toString<long double>(const long double& x) 55 55 { 56 56 const int sigdigits = std::numeric_limits<long double>::digits10;
Note: See TracChangeset
for help on using the changeset viewer.