source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_signal.h @ 137

Last change on this file since 137 was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1#ifndef morpheo_behavioural_Debug_signal_h
2#define morpheo_behavioural_Debug_signal_h
3
4/*
5 * $Id: Debug_signal.h 137 2010-02-16 12:35:48Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11# ifdef DEBUG_SIGNAL
12
13#include <map>
14#include <list>
15#include <string>
16
17namespace morpheo {
18namespace behavioural {
19
20  class debug_signal
21  {
22  private : std::map <void *,std::string> _signal;
23  private : std::list<std::string>        _signal_access;
24
25  public  : void add       (void *      signal,
26                            std::string name);
27  public  : void write     (void *      signal);
28  public  : void end_cycle (void);
29  public  : void print     (void);
30  };
31 
32  extern debug_signal _debug_signal;
33 
34#  define DEBUG_SIGNAL_ADD(signal,name)                                 \
35  do                                                                    \
36    {                                                                   \
37      morpheo::behavioural::_debug_signal.add(signal,name);             \
38    } while(0)
39
40  // Test if signal is previously define 
41 
42#  define DEBUG_SIGNAL_WRITE(signal)                                    \
43  do                                                                    \
44    {                                                                   \
45      morpheo::behavioural::_debug_signal.write(signal);                \
46    } while(0)
47
48#  define DEBUG_SIGNAL_END_CYCLE()                      \
49  do                                                    \
50    {                                                   \
51      morpheo::behavioural::_debug_signal.end_cycle();  \
52    } while (0)
53
54#  define DEBUG_SIGNAL_PRINT()                          \
55  do                                                    \
56    {                                                   \
57      morpheo::behavioural::_debug_signal.print();      \
58    } while (0)
59 
60}; // end namespace behavioural         
61}; // end namespace morpheo             
62# else
63#  define DEBUG_SIGNAL_ADD(signal,name) do {} while (0)
64#  define DEBUG_SIGNAL_WRITE(signal)    do {} while (0)
65#  define DEBUG_SIGNAL_END_CYCLE()      do {} while (0)
66#  define DEBUG_SIGNAL_PRINT()          do {} while (0)
67# endif
68
69
70#endif
Note: See TracBrowser for help on using the repository browser.