source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component.cpp @ 88

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

Almost complete design
with Test and test platform

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