[88] | 1 | /* |
---|
| 2 | * $Id: Core.cpp 145 2010-10-13 18:15:51Z 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 |
---|
[145] | 27 | Parameters * param, |
---|
| 28 | morpheo::behavioural::Tusage_t usage// , |
---|
| 29 | // morpheo::behavioural::Function_pointer * function_pointer |
---|
[88] | 30 | ): |
---|
| 31 | _name (name) |
---|
| 32 | ,_param (param) |
---|
| 33 | ,_usage (usage) |
---|
| 34 | { |
---|
| 35 | log_begin(Core,FUNCTION); |
---|
| 36 | |
---|
| 37 | usage_environment(_usage); |
---|
| 38 | |
---|
[123] | 39 | // #if DEBUG_Core == true |
---|
| 40 | // log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 41 | |
---|
[123] | 42 | // std::cout << *param << std::endl; |
---|
| 43 | // #endif |
---|
[88] | 44 | |
---|
| 45 | log_printf(INFO,Core,FUNCTION,_("<%s> Allocation"),_name.c_str()); |
---|
| 46 | |
---|
| 47 | allocation ( |
---|
| 48 | #ifdef STATISTICS |
---|
| 49 | param_statistics |
---|
| 50 | #endif |
---|
[145] | 51 | // function_pointer |
---|
[88] | 52 | ); |
---|
| 53 | |
---|
| 54 | #ifdef STATISTICS |
---|
| 55 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 56 | { |
---|
| 57 | log_printf(INFO,Core,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str()); |
---|
| 58 | |
---|
| 59 | statistics_allocation(param_statistics); |
---|
| 60 | } |
---|
| 61 | #endif |
---|
| 62 | |
---|
| 63 | #ifdef VHDL |
---|
| 64 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 65 | { |
---|
| 66 | // generate the vhdl |
---|
| 67 | log_printf(INFO,Core,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str()); |
---|
| 68 | |
---|
| 69 | vhdl(); |
---|
| 70 | } |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #ifdef SYSTEMC |
---|
| 74 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 75 | { |
---|
[145] | 76 | |
---|
| 77 | // if (function_pointer==NULL) |
---|
| 78 | // { |
---|
[88] | 79 | log_printf(INFO,Core,FUNCTION,_("<%s> Method - transition"),_name.c_str()); |
---|
| 80 | |
---|
| 81 | SC_METHOD (transition); |
---|
| 82 | dont_initialize (); |
---|
| 83 | sensitive << (*(in_CLOCK)).pos(); |
---|
[145] | 84 | |
---|
[88] | 85 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 86 | // List dependency information |
---|
| 87 | # endif |
---|
[145] | 88 | // } |
---|
| 89 | // else |
---|
| 90 | // { |
---|
| 91 | // function_pointer->transition_add(static_cast<f_t>(&morpheo::behavioural::core::Core::transition)); |
---|
| 92 | // } |
---|
| 93 | |
---|
[88] | 94 | } |
---|
| 95 | #endif |
---|
| 96 | log_end(Core,FUNCTION); |
---|
| 97 | }; |
---|
| 98 | |
---|
| 99 | #undef FUNCTION |
---|
| 100 | #define FUNCTION "Core::~Core" |
---|
| 101 | Core::~Core (void) |
---|
| 102 | { |
---|
| 103 | log_begin(Core,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,Core,FUNCTION,_("<%s> Deallocation"),_name.c_str()); |
---|
| 113 | deallocation (); |
---|
| 114 | |
---|
| 115 | log_end(Core,FUNCTION); |
---|
| 116 | }; |
---|
| 117 | |
---|
| 118 | }; // end namespace core |
---|
| 119 | }; // end namespace behavioural |
---|
| 120 | }; // end namespace morpheo |
---|