Last change
on this file since 12 was
3,
checked in by kane, 18 years ago
|
1) Ajout d'un "printer" XML pour la configuration de paramètres
2) Fin du composant "Two_Level_Branch_Predictor"
validation * systemc
|
File size:
2.9 KB
|
Rev | Line | |
---|
[2] | 1 | #ifndef DEBUG_H |
---|
| 2 | #define DEBUG_H |
---|
| 3 | |
---|
| 4 | #include "Behavioural/include/Debug_component.h" |
---|
| 5 | #include <stdio.h> |
---|
| 6 | #include <string.h> |
---|
| 7 | #include <iostream> |
---|
| 8 | #include <sstream> |
---|
| 9 | #include <string> |
---|
| 10 | using namespace std; |
---|
| 11 | |
---|
| 12 | enum _debug_verbosity |
---|
| 13 | { |
---|
| 14 | DEBUG_NONE , |
---|
| 15 | DEBUG_INFO , |
---|
| 16 | DEBUG_TRACE, |
---|
| 17 | DEBUG_FUNC , |
---|
| 18 | DEBUG_ALL |
---|
| 19 | }; |
---|
| 20 | |
---|
| 21 | #ifdef DEBUG |
---|
| 22 | //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__); \ |
---|
[3] | 45 | fprintf(stdout,"in function \"%s\" : ",func); \ |
---|
[2] | 46 | fprintf(stdout,str); \ |
---|
| 47 | fprintf(stdout,"\n"); \ |
---|
| 48 | } \ |
---|
| 49 | } while(0) |
---|
| 50 | |
---|
| 51 | #else |
---|
| 52 | // No debug |
---|
| 53 | /* |
---|
| 54 | # define log_printf(level, component, str... ) \ |
---|
| 55 | do \ |
---|
| 56 | { \ |
---|
| 57 | } while(0) |
---|
| 58 | */ |
---|
| 59 | # define log_printf(level, component, func, str... ) \ |
---|
| 60 | do \ |
---|
| 61 | { \ |
---|
| 62 | } while(0) |
---|
| 63 | |
---|
| 64 | #endif // DEBUG |
---|
| 65 | |
---|
| 66 | #endif // !DEBUG_H |
---|
Note: See
TracBrowser
for help on using the repository browser.