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