1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace 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 | // #ifdef STATISTICS |
---|
33 | // ,_param_statistics (param_statistics) |
---|
34 | // #endif |
---|
35 | { |
---|
36 | log_printf(FUNC,@COMPONENT,FUNCTION,"Begin"); |
---|
37 | |
---|
38 | log_printf(INFO,@COMPONENT,FUNCTION,"Allocation"); |
---|
39 | allocation (); |
---|
40 | |
---|
41 | #ifdef STATISTICS |
---|
42 | if (_usage & USE_STATISTICS) |
---|
43 | { |
---|
44 | log_printf(INFO,@COMPONENT,FUNCTION,"Allocation of statistics"); |
---|
45 | |
---|
46 | // Allocation of statistics |
---|
47 | _stat = new Statistics (static_cast<string>(_name), |
---|
48 | param_statistics , |
---|
49 | param); |
---|
50 | } |
---|
51 | #endif |
---|
52 | |
---|
53 | #ifdef VHDL |
---|
54 | if (_usage & USE_VHDL) |
---|
55 | { |
---|
56 | // generate the vhdl |
---|
57 | log_printf(INFO,@COMPONENT,FUNCTION,"Generate the vhdl"); |
---|
58 | |
---|
59 | vhdl(); |
---|
60 | } |
---|
61 | #endif |
---|
62 | |
---|
63 | #ifdef SYSTEMC |
---|
64 | if (_usage & USE_SYSTEMC) |
---|
65 | { |
---|
66 | log_printf(INFO,@COMPONENT,FUNCTION,"Method - transition"); |
---|
67 | |
---|
68 | SC_METHOD (transition); |
---|
69 | dont_initialize (); |
---|
70 | sensitive << (*(in_CLOCK)).pos(); |
---|
71 | |
---|
72 | # ifdef SYSTEMCASS_SPECIFIC |
---|
73 | // List dependency information |
---|
74 | # endif |
---|
75 | |
---|
76 | #endif |
---|
77 | } |
---|
78 | log_printf(FUNC,@COMPONENT,FUNCTION,"End"); |
---|
79 | }; |
---|
80 | |
---|
81 | #undef FUNCTION |
---|
82 | #define FUNCTION "@COMPONENT::~@COMPONENT" |
---|
83 | @COMPONENT::~@COMPONENT (void) |
---|
84 | { |
---|
85 | log_printf(FUNC,@COMPONENT,FUNCTION,"Begin"); |
---|
86 | |
---|
87 | #ifdef STATISTICS |
---|
88 | if (_usage & USE_STATISTICS) |
---|
89 | { |
---|
90 | log_printf(INFO,@COMPONENT,FUNCTION,"Generate Statistics file"); |
---|
91 | |
---|
92 | _stat->generate_file(statistics(0)); |
---|
93 | delete _stat; |
---|
94 | } |
---|
95 | #endif |
---|
96 | |
---|
97 | log_printf(INFO,@COMPONENT,FUNCTION,"Deallocation"); |
---|
98 | deallocation (); |
---|
99 | |
---|
100 | log_printf(FUNC,@COMPONENT,FUNCTION,"End"); |
---|
101 | }; |
---|
102 | |
---|
103 | @NAMESPACE_END |
---|
104 | }; // end namespace behavioural |
---|
105 | }; // end namespace morpheo |
---|