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