source: trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h @ 97

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

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#ifndef Morpheo_Message_h
2#define Morpheo_Message_h
3/*
4 * $Id: Message.h 97 2008-12-19 15:34:00Z rosiere $
5 *
6 * [ Description ]
7 *
8 * Routine of Test
9 */
10
11#include <stdio.h>
12#include <string.h>
13#include "Translation.h"
14
15namespace morpheo {
16
17  // Color
18  // 31 : rouge
19  // 32 : vert
20  // 33 : jaune
21  // 34 : bleu
22  // 35 : rose
23  // 36 : cyan
24  // 37 : blanc
25  // 38 : noir souligne
26  // 39 : noir
27
28#  define MSG_NONE          _("             ")
29#ifdef PRINT_COLOR
30#  define MSG_DEBUG         _("[1;34m[   DEBUG   ][0m")
31#  define MSG_ERROR         _("[1;31m[   ERROR   ][0m")
32#  define MSG_WARNING       _("[1;35m[  WARNING  ][0m")
33#  define MSG_INFORMATION   _("[1;32m[INFORMATION][0m")
34#  define MSG_BREAKPOINT    _("[1;38m[   BREAK   ][0m")
35#else
36#  define MSG_DEBUG         _("[   DEBUG   ]")
37#  define MSG_ERROR         _("[   ERROR   ]")
38#  define MSG_WARNING       _("[  WARNING  ]")
39#  define MSG_INFORMATION   _("[INFORMATION]")
40#  define MSG_BREAKPOINT    _("[   BREAK   ]")
41#endif
42
43extern FILE * log_stream;
44FILE * log      (FILE * stream);
45void   log_init (bool        have_file,
46                 std::string directory,
47                 std::string file="");
48
49#define fmsg(stream,arg...)                     \
50  do                                            \
51    {                                           \
52      FILE * _stream = log(stream);             \
53      fprintf(_stream,arg);                     \
54      fflush(_stream);                          \
55    } while (0)
56
57#define fmsgDebug(stream,arg...)                \
58  do                                            \
59    {                                           \
60      fmsg(stream,"%s ",MSG_DEBUG);             \
61      fmsg(stream,arg);                         \
62    } while (0)
63
64#define fmsgError(stream,arg...)                \
65  do                                            \
66    {                                           \
67      fmsg(stream,"%s ",MSG_ERROR);             \
68      fmsg(stream,arg);                         \
69    } while (0)
70
71#define fmsgWarning(stream,arg...)              \
72  do                                            \
73    {                                           \
74      fmsg(stream,"%s ",MSG_WARNING);           \
75      fmsg(stream,arg);                         \
76    } while (0)
77
78#define fmsgInformation(stream,arg...)          \
79  do                                            \
80    {                                           \
81      fmsg(stream,"%s ",MSG_INFORMATION);       \
82      fmsg(stream,arg);                         \
83    } while (0)
84
85#define msg(arg...)             fmsg(stdout,arg)
86#define msgDebug(arg...)        fmsgDebug(stdout,arg)
87#define msgError(arg...)        fmsgError(stdout,arg)
88#define msgWarning(arg...)      fmsgWarning(stdout,arg)
89#define msgInformation(arg...)  fmsgInformation(stdout,arg)
90#define err(arg...)             fmsgError(stderr,arg)
91
92}; // end namespace morpheo
93#endif
Note: See TracBrowser for help on using the repository browser.