source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vst/src/New_Component.cpp @ 76

Last change on this file since 76 was 76, checked in by rosiere, 16 years ago

Add new component : Read_unit (no tested)
Change functionnal_unit : now use type and operation to execute the good function
Change New_Component's script

File size: 2.0 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_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
34
35    log_printf(INFO,@COMPONENT,FUNCTION,"Allocation");
36
37    allocation (
38#ifdef STATISTICS
39                param_statistics
40#endif
41                );
42
43#ifdef STATISTICS
44    if (_usage & USE_STATISTICS)
45      { 
46        log_printf(INFO,@COMPONENT,FUNCTION,"Allocation of statistics");
47
48        statistics_declaration(param_statistics);
49      }
50#endif
51
52#ifdef VHDL
53    if (_usage & USE_VHDL)
54      {
55        // generate the vhdl
56        log_printf(INFO,@COMPONENT,FUNCTION,"Generate the vhdl");
57       
58        vhdl();
59      }
60#endif
61
62#ifdef SYSTEMC
63    if (_usage & USE_SYSTEMC)
64      {
65        log_printf(INFO,@COMPONENT,FUNCTION,"Method - transition");
66
67        SC_METHOD (transition);
68        dont_initialize ();
69        sensitive << (*(in_CLOCK)).pos();
70       
71# ifdef SYSTEMCASS_SPECIFIC
72        // List dependency information
73# endif   
74       
75#endif
76      }
77    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
78  };
79   
80#undef  FUNCTION
81#define FUNCTION "@COMPONENT::~@COMPONENT"
82  @COMPONENT::~@COMPONENT (void)
83  {
84    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
85
86#ifdef STATISTICS
87    if (_usage & USE_STATISTICS)
88      {
89        log_printf(INFO,@COMPONENT,FUNCTION,"Generate Statistics file");
90       
91        delete _stat;
92      }
93#endif
94
95    log_printf(INFO,@COMPONENT,FUNCTION,"Deallocation");
96    deallocation ();
97
98    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
99  };
100
101@NAMESPACE_END
102}; // end namespace behavioural
103}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.