source: trunk/IPs/systemC/Environment/Common/include/Debug.h @ 127

Last change on this file since 127 was 127, checked in by rosiere, 15 years ago
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1#ifndef ENVIRONMENT_COMMON_DEBUG_H
2#define ENVIRONMENT_COMMON_DEBUG_H
3
4#define DEBUG_true        true
5#define DEBUG_ENVIRONMENT false
6#define DEBUG_CACHE       false
7#define DEBUG_DATA        false
8#define DEBUG_ENDIANNESS  false
9#define DEBUG_QUEUE       false
10#define DEBUG_RAMLOCK     false
11#define DEBUG_SIM2OS      false
12#define DEBUG_TTY         false
13
14#define MSG_ENVIRONMENT "[ENVIRONMENT]"
15
16#define __cout(component,str...)                                        \
17  do                                                                    \
18    {                                                                   \
19      if (DEBUG_ ## component == true )                                 \
20        {                                                               \
21          fprintf(stdout,str);                                          \
22        }                                                               \
23    }                                                                   \
24  while(0)
25
26#define __cerr(str...)                                                  \
27  do                                                                    \
28    {                                                                   \
29      fprintf(stderr,str);                                              \
30    }                                                                   \
31  while(0)
32
33#define cout(str...)                                                    \
34  do                                                                    \
35    {                                                                   \
36      fprintf(stdout,"%s ",MSG_ENVIRONMENT);                            \
37      __cout(true,str);                                                 \
38      fflush (stdout);                                                  \
39    }                                                                   \
40  while(0)
41
42#define cerr(str...)                                                    \
43  do                                                                    \
44    {                                                                   \
45      fprintf(stderr,"%s ",MSG_ENVIRONMENT);                            \
46      __cerr(str);                                                      \
47      fflush (stderr);                                                  \
48    }                                                                   \
49  while(0)
50
51#define _cout(component, str...)                                        \
52  do                                                                    \
53    {                                                                   \
54      if (DEBUG_ ## component == true )                                 \
55        {                                                               \
56          cout(str);                                                    \
57        }                                                               \
58    }                                                                   \
59  while(0)
60
61#define _cerr(str...) cerr(str)
62
63#endif
Note: See TracBrowser for help on using the repository browser.