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