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

Last change on this file since 113 was 113, checked in by rosiere, 15 years ago

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1#ifndef Morpheo_Message_h
2#define Morpheo_Message_h
3/*
4 * $Id: Message.h 113 2009-04-14 18:39:12Z 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#  define MSG_VHDL          _("[1;34m[   VHDL    ][0m")
36#else
37#  define MSG_DEBUG         _("[   DEBUG   ]")
38#  define MSG_ERROR         _("[   ERROR   ]")
39#  define MSG_WARNING       _("[  WARNING  ]")
40#  define MSG_INFORMATION   _("[INFORMATION]")
41#  define MSG_BREAKPOINT    _("[   BREAK   ]")
42#  define MSG_VHDL          _("[   VHDL    ]")
43#endif
44
45extern FILE * log_stream;
46FILE * log      (FILE * stream);
47void   log_init (bool        have_file,
48                 std::string directory,
49                 std::string file="");
50
51#define fmsg(stream,arg...)                     \
52  do                                            \
53    {                                           \
54      FILE * _stream = log(stream);             \
55      fprintf(_stream,arg);                     \
56      fflush(_stream);                          \
57    } while (0)
58
59#define fmsgDebug(stream,arg...)                \
60  do                                            \
61    {                                           \
62      fmsg(stream,"%s ",MSG_DEBUG);             \
63      fmsg(stream,arg);                         \
64    } while (0)
65
66#define fmsgError(stream,arg...)                \
67  do                                            \
68    {                                           \
69      fmsg(stream,"%s ",MSG_ERROR);             \
70      fmsg(stream,arg);                         \
71    } while (0)
72
73#define fmsgWarning(stream,arg...)              \
74  do                                            \
75    {                                           \
76      fmsg(stream,"%s ",MSG_WARNING);           \
77      fmsg(stream,arg);                         \
78    } while (0)
79
80#define fmsgInformation(stream,arg...)          \
81  do                                            \
82    {                                           \
83      fmsg(stream,"%s ",MSG_INFORMATION);       \
84      fmsg(stream,arg);                         \
85    } while (0)
86
87#define msg(arg...)             fmsg(stdout,arg)
88#define err(arg...)             fmsgError(stderr,arg)
89
90#define msgDebug(arg...)        fmsgDebug(stdout,arg)
91#define msgError(arg...)        fmsgError(stdout,arg)
92#define msgWarning(arg...)      fmsgWarning(stdout,arg)
93#define msgInformation(arg...)  fmsgInformation(stdout,arg)
94
95}; // end namespace morpheo
96#endif
Note: See TracBrowser for help on using the repository browser.