source: trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 2.0 KB
Line 
1#ifndef DEBUG_H
2#define DEBUG_H
3
4#include "Common/include/Message.h"
5#include "Behavioural/include/Debug_component.h"
6#include <stdio.h>
7#include <string.h>
8#include <iostream>
9#include <sstream>
10#include <string>
11
12std::string debug_tab            (void);
13void        debug_function_begin (std::string component, std::string function);
14void        debug_function_end   (std::string component, std::string function);
15
16// Debug's Level :
17//  * None    : print elementary information
18//  * Info    : print basic information
19//  * Trace   : trace internal variable
20//  * Func    : trace call and return function
21//  * All     : print all information
22
23enum _debug_verbosity
24  {
25    DEBUG_NONE ,
26    DEBUG_INFO ,
27    DEBUG_TRACE,
28    DEBUG_FUNC ,
29    DEBUG_ALL
30  };
31
32#ifdef DEBUG
33# define log_printf(level, component, func, str... )                    \
34  do                                                                    \
35    {                                                                   \
36      if ((DEBUG == DEBUG_ALL ) or                                      \
37          (DEBUG_ ## level == DEBUG_NONE) or                            \
38          (( DEBUG_ ## level     <= DEBUG) and                          \
39           ( DEBUG_ ## component == true )) )                           \
40        {                                                               \
41          msg(_("%s"),debug_tab().c_str());                             \
42          if (DEBUG >= DEBUG_ALL )                                      \
43            {                                                           \
44              switch (DEBUG_ ## level)                                  \
45                {                                                       \
46                case DEBUG_NONE  : msg(_("(none       ) ")); break;     \
47                case DEBUG_INFO  : msg(_("(information) ")); break;     \
48                case DEBUG_TRACE : msg(_("(trace      ) ")); break;     \
49                case DEBUG_FUNC  : msg(_("(function   ) ")); break;     \
50                case DEBUG_ALL   : msg(_("(all        ) ")); break;     \
51                default          : msg(_("(undefine   ) ")); break;     \
52                }                                                       \
53            }                                                           \
54          if (DEBUG >= DEBUG_FUNC)                                      \
55            {                                                           \
56              msg(_("<%s> "),func);                                     \
57              msg(_("In file %s, "),__FILE__);                          \
58              msg(_("at line %d " ),__LINE__);                          \
59              msg(_(": "));                                             \
60            }                                                           \
61          msg(str);                                                     \
62          msg(_("\n"));                                                 \
63          fflush (stdout);                                              \
64        }                                                               \
65    } while(0)
66#else
67# define log_printf(level, component, func, str... )                    \
68  do                                                                    \
69    {                                                                   \
70    } while(0)
71#endif // DEBUG
72#endif // !DEBUG_H
Note: See TracBrowser for help on using the repository browser.