source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/src/Comparator.cpp @ 132

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

1) add constant method - compatibility with SystemC
2) add Script to test sensitive list
3) fix bug in sensitive list

  • Property svn:keywords set to Id
File size: 2.5 KB
Line 
1/*
2 * $Id: Comparator.cpp 132 2009-07-11 16:39:35Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Comparator/include/Comparator.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace comparator {
14
15
16#undef  FUNCTION
17#define FUNCTION "Comparator::Comparator"
18  Comparator::Comparator
19  (
20#ifdef SYSTEMC
21   sc_module_name name,
22#else
23   string name,
24#endif
25#ifdef STATISTICS
26   morpheo::behavioural::Parameters_Statistics * param_statistics,
27#endif
28   morpheo::behavioural::generic::comparator::Parameters * param,
29   morpheo::behavioural::Tusage_t usage
30   ):
31    _name              (name)
32    ,_param            (param)
33    ,_usage            (usage)
34  {
35    log_begin(Comparator,FUNCTION);
36
37    usage_environment(_usage);
38
39    log_printf(INFO,Comparator,FUNCTION,_("<%s> : Allocation"),_name.c_str());
40
41    allocation (
42#ifdef STATISTICS
43                param_statistics
44#endif
45                );
46
47#ifdef STATISTICS
48    if (usage_is_set(_usage,USE_STATISTICS))
49      { 
50        log_printf(INFO,Comparator,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
51
52        statistics_allocation(param_statistics);
53      }
54#endif
55
56#ifdef VHDL
57    if (usage_is_set(_usage,USE_VHDL))
58      {
59        // generate the vhdl
60        log_printf(INFO,Comparator,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
61       
62        vhdl();
63      }
64#endif
65
66#ifdef SYSTEMC
67    if (usage_is_set(_usage,USE_SYSTEMC))
68      {
69        log_printf(INFO,Comparator,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
70
71        SC_METHOD (transition);
72        dont_initialize ();
73        sensitive << (*(in_CLOCK)).pos();
74       
75# ifdef SYSTEMCASS_SPECIFIC
76        // List dependency information
77# endif   
78
79        log_printf(INFO,Comparator,FUNCTION,_("<%s> : Method - genMealy"),_name.c_str());
80
81        SC_METHOD (genMealy);
82        dont_initialize ();
83//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
84        sensitive << (*(in_NRESET))
85                  << (*(in_COMPARE_DATA_0))
86                  << (*(in_COMPARE_DATA_1));
87       
88# ifdef SYSTEMCASS_SPECIFIC
89        // List dependency information
90# endif   
91       
92#endif
93      }
94    log_end(Comparator,FUNCTION);
95  };
96   
97#undef  FUNCTION
98#define FUNCTION "Comparator::~Comparator"
99  Comparator::~Comparator (void)
100  {
101    log_begin(Comparator,FUNCTION);
102
103#ifdef STATISTICS
104    if (usage_is_set(_usage,USE_STATISTICS))
105      {
106        statistics_deallocation();
107      }
108#endif
109
110    log_printf(INFO,Comparator,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
111    deallocation ();
112
113    log_end(Comparator,FUNCTION);
114  };
115
116}; // end namespace comparator
117}; // end namespace generic
118
119}; // end namespace behavioural
120}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.