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 | { |
---|
32 | log_begin(@COMPONENT,FUNCTION); |
---|
33 | |
---|
34 | _usage = usage_environment(usage); |
---|
35 | |
---|
36 | #ifdef MODELSIM_COSIMULATION |
---|
37 | if (_model.get_type(_param->_type) == MODEL_VHDL) |
---|
38 | { |
---|
39 | _usage = usage_cosimulation(_usage); |
---|
40 | } |
---|
41 | #endif |
---|
42 | |
---|
43 | log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
44 | |
---|
45 | allocation ( |
---|
46 | #ifdef STATISTICS |
---|
47 | param_statistics |
---|
48 | #endif |
---|
49 | ); |
---|
50 | |
---|
51 | #ifdef STATISTICS |
---|
52 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
53 | { |
---|
54 | log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
55 | |
---|
56 | statistics_allocation(param_statistics); |
---|
57 | } |
---|
58 | #endif |
---|
59 | |
---|
60 | #ifdef VHDL |
---|
61 | if (usage_is_set(_usage,USE_VHDL)) |
---|
62 | { |
---|
63 | // generate the vhdl |
---|
64 | log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
65 | |
---|
66 | vhdl(); |
---|
67 | } |
---|
68 | #endif |
---|
69 | |
---|
70 | #ifdef SYSTEMC |
---|
71 | if (usage_is_set(_usage,USE_SYSTEMC_BODY)) |
---|
72 | { |
---|
73 | log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
74 | |
---|
75 | SC_METHOD (transition); |
---|
76 | dont_initialize (); |
---|
77 | sensitive << (*(in_CLOCK)).pos(); |
---|
78 | |
---|
79 | # ifdef SYSTEMCASS_SPECIFIC |
---|
80 | // List dependency information |
---|
81 | # endif |
---|
82 | |
---|
83 | // log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str()); |
---|
84 | |
---|
85 | // SC_METHOD (genMoore); |
---|
86 | // dont_initialize (); |
---|
87 | // sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
88 | |
---|
89 | // # ifdef SYSTEMCASS_SPECIFIC |
---|
90 | // // List dependency information |
---|
91 | // # endif |
---|
92 | |
---|
93 | } |
---|
94 | #endif |
---|
95 | |
---|
96 | log_end(@COMPONENT,FUNCTION); |
---|
97 | }; |
---|
98 | |
---|
99 | #undef FUNCTION |
---|
100 | #define FUNCTION "@COMPONENT::~@COMPONENT" |
---|
101 | @COMPONENT::~@COMPONENT (void) |
---|
102 | { |
---|
103 | log_begin(@COMPONENT,FUNCTION); |
---|
104 | |
---|
105 | #ifdef STATISTICS |
---|
106 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
107 | { |
---|
108 | statistics_deallocation(); |
---|
109 | } |
---|
110 | #endif |
---|
111 | |
---|
112 | log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
113 | deallocation (); |
---|
114 | |
---|
115 | log_end(@COMPONENT,FUNCTION); |
---|
116 | }; |
---|
117 | |
---|
118 | @NAMESPACE_END |
---|
119 | }; // end namespace behavioural |
---|
120 | }; // end namespace morpheo |
---|