source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/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.1 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#endif
78      }
79    log_end(@COMPONENT,FUNCTION);
80  };
81   
82#undef  FUNCTION
83#define FUNCTION "@COMPONENT::~@COMPONENT"
84  @COMPONENT::~@COMPONENT (void)
85  {
86    log_begin(@COMPONENT,FUNCTION);
87
88#ifdef STATISTICS
89    if (usage_is_set(_usage,USE_STATISTICS))
90      {
91        statistics_deallocation();
92      }
93#endif
94
95    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
96    deallocation ();
97
98    log_end(@COMPONENT,FUNCTION);
99  };
100
101@NAMESPACE_END
102}; // end namespace behavioural
103}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.