Ignore:
Timestamp:
Apr 5, 2007, 4:17:30 PM (17 years ago)
Author:
rosiere
Message:

Interface normalisé
Début du banc de registres multi niveaux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Include/Debug.h

    r3 r15  
    99#include <string>
    1010using 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
    1118
    1219enum _debug_verbosity
     
    2128#ifdef DEBUG
    2229//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... )                   \
     32do                                                                      \
     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      }                                                                 \
    4961} while(0)
    5062
    5163#else
    5264// No debug
    53 /*
    54 #  define log_printf(level, component, str... )                                       \
    55 do                                                                                    \
    56 {                                                                                     \
    57 } while(0)                                                                           
    58 */                                                                           
     65
    5966#  define log_printf(level, component, func, str... )                                 \
    6067do                                                                                    \
Note: See TracChangeset for help on using the changeset viewer.