[110] | 1 | /* |
---|
| 2 | * $Id: Meta_Predictor.cpp 138 2010-05-12 17:34:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace prediction_unit { |
---|
| 16 | namespace direction { |
---|
| 17 | namespace meta_predictor { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Meta_Predictor::Meta_Predictor" |
---|
| 22 | Meta_Predictor::Meta_Predictor |
---|
| 23 | ( |
---|
| 24 | #ifdef SYSTEMC |
---|
| 25 | sc_module_name name, |
---|
| 26 | #else |
---|
| 27 | string name, |
---|
| 28 | #endif |
---|
| 29 | #ifdef STATISTICS |
---|
| 30 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 31 | #endif |
---|
| 32 | morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters * param, |
---|
| 33 | morpheo::behavioural::Tusage_t usage |
---|
| 34 | ): |
---|
| 35 | _name (name) |
---|
| 36 | ,_param (param) |
---|
| 37 | ,_usage (usage) |
---|
| 38 | { |
---|
| 39 | log_begin(Meta_Predictor,FUNCTION); |
---|
| 40 | |
---|
| 41 | usage_environment(_usage); |
---|
| 42 | |
---|
| 43 | log_printf(INFO,Meta_Predictor,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,Meta_Predictor,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,Meta_Predictor,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
| 65 | |
---|
| 66 | vhdl(); |
---|
| 67 | } |
---|
| 68 | #endif |
---|
| 69 | |
---|
[138] | 70 | #if defined(SYSTEMC) and (defined(STATISTICS) or defined(VHDL_TESTBENCH)) |
---|
[110] | 71 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 72 | { |
---|
| 73 | log_printf(INFO,Meta_Predictor,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 |
---|
[138] | 82 | } |
---|
[110] | 83 | #endif |
---|
| 84 | log_end(Meta_Predictor,FUNCTION); |
---|
| 85 | }; |
---|
| 86 | |
---|
| 87 | #undef FUNCTION |
---|
| 88 | #define FUNCTION "Meta_Predictor::~Meta_Predictor" |
---|
| 89 | Meta_Predictor::~Meta_Predictor (void) |
---|
| 90 | { |
---|
| 91 | log_begin(Meta_Predictor,FUNCTION); |
---|
| 92 | |
---|
| 93 | #ifdef STATISTICS |
---|
| 94 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 95 | { |
---|
| 96 | statistics_deallocation(); |
---|
| 97 | } |
---|
| 98 | #endif |
---|
| 99 | |
---|
| 100 | log_printf(INFO,Meta_Predictor,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
| 101 | deallocation (); |
---|
| 102 | |
---|
| 103 | log_end(Meta_Predictor,FUNCTION); |
---|
| 104 | }; |
---|
| 105 | |
---|
| 106 | }; // end namespace meta_predictor |
---|
| 107 | }; // end namespace direction |
---|
| 108 | }; // end namespace prediction_unit |
---|
| 109 | }; // end namespace front_end |
---|
| 110 | }; // end namespace multi_front_end |
---|
| 111 | }; // end namespace core |
---|
| 112 | |
---|
| 113 | }; // end namespace behavioural |
---|
| 114 | }; // end namespace morpheo |
---|