[110] | 1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_Meta_Predictor_h |
---|
| 2 | #define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_Meta_Predictor_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Meta_Predictor.h 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
[111] | 15 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h" |
---|
| 16 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" |
---|
| 17 | |
---|
[110] | 18 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" |
---|
| 19 | #include "Behavioural/include/Types.h" |
---|
| 20 | |
---|
| 21 | #ifdef STATISTICS |
---|
| 22 | #include "Behavioural/include/Stat.h" |
---|
| 23 | #endif |
---|
| 24 | #include "Behavioural/include/Component.h" |
---|
| 25 | #ifdef VHDL |
---|
| 26 | #include "Behavioural/include/Vhdl.h" |
---|
| 27 | #endif |
---|
| 28 | #include "Behavioural/include/Usage.h" |
---|
| 29 | |
---|
| 30 | #include "Common/include/ToString.h" |
---|
| 31 | #include "Common/include/Debug.h" |
---|
| 32 | |
---|
| 33 | #include <iostream> |
---|
| 34 | |
---|
| 35 | namespace morpheo { |
---|
| 36 | namespace behavioural { |
---|
| 37 | |
---|
| 38 | namespace core { |
---|
| 39 | namespace multi_front_end { |
---|
| 40 | namespace front_end { |
---|
| 41 | namespace prediction_unit { |
---|
| 42 | namespace direction { |
---|
| 43 | namespace meta_predictor { |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | class Meta_Predictor |
---|
| 47 | #if SYSTEMC |
---|
| 48 | : public sc_module |
---|
| 49 | #endif |
---|
| 50 | { |
---|
| 51 | // -----[ fields ]---------------------------------------------------- |
---|
| 52 | // Parameters |
---|
| 53 | protected : const std::string _name; |
---|
| 54 | protected : const Parameters * _param; |
---|
| 55 | private : const Tusage_t _usage; |
---|
| 56 | |
---|
| 57 | #ifdef STATISTICS |
---|
| 58 | public : Stat * _stat; |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | public : Component * _component; |
---|
| 62 | private : Interfaces * _interfaces; |
---|
| 63 | |
---|
| 64 | #ifdef SYSTEMC |
---|
| 65 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | public : SC_CLOCK * in_CLOCK ; |
---|
| 68 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 69 | |
---|
[111] | 70 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 71 | public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ;//[nb_inst_predict] |
---|
| 72 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ;//[nb_inst_predict] |
---|
| 73 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ;//[nb_inst_predict] |
---|
| 74 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ;//[nb_inst_predict] // = MSB[history] |
---|
| 75 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ;//[nb_inst_predict] |
---|
| 76 | |
---|
| 77 | // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 78 | public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;//[nb_inst_update] |
---|
| 79 | public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;//[nb_inst_update] |
---|
| 80 | public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] |
---|
| 81 | public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] |
---|
[112] | 82 | public : SC_IN (Tcontrol_t) ** in_UPDATE_HISTORY_VAL ;//[nb_inst_update] |
---|
[111] | 83 | public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] |
---|
| 84 | |
---|
[110] | 85 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[111] | 86 | private : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor ** _component_two_level_branch_predictor;//[nb_predictor] |
---|
| 87 | private : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue ::Meta_Predictor_Glue * _component_glue; |
---|
[110] | 88 | |
---|
| 89 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 90 | |
---|
| 91 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 92 | #endif |
---|
| 93 | |
---|
| 94 | // -----[ Methods ]--------------------------------------------------- |
---|
| 95 | |
---|
| 96 | #ifdef SYSTEMC |
---|
| 97 | SC_HAS_PROCESS (Meta_Predictor); |
---|
| 98 | #endif |
---|
| 99 | public : Meta_Predictor |
---|
| 100 | ( |
---|
| 101 | #ifdef SYSTEMC |
---|
| 102 | sc_module_name name, |
---|
| 103 | #else |
---|
| 104 | std::string name, |
---|
| 105 | #endif |
---|
| 106 | #ifdef STATISTICS |
---|
| 107 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 108 | #endif |
---|
| 109 | Parameters * param, |
---|
| 110 | morpheo::behavioural::Tusage_t usage |
---|
| 111 | ); |
---|
| 112 | public : ~Meta_Predictor (void); |
---|
| 113 | |
---|
| 114 | private : void allocation ( |
---|
| 115 | #ifdef STATISTICS |
---|
| 116 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 117 | #else |
---|
| 118 | void |
---|
| 119 | #endif |
---|
| 120 | ); |
---|
| 121 | private : void deallocation (void); |
---|
| 122 | |
---|
| 123 | #ifdef SYSTEMC |
---|
| 124 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 125 | public : void transition (void); |
---|
| 126 | # endif |
---|
| 127 | #endif |
---|
| 128 | |
---|
| 129 | #if VHDL |
---|
| 130 | public : void vhdl (void); |
---|
| 131 | #endif |
---|
| 132 | |
---|
| 133 | #ifdef STATISTICS |
---|
| 134 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 135 | public : void statistics_deallocation (void); |
---|
| 136 | #endif |
---|
| 137 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 138 | private : void end_cycle (void); |
---|
| 139 | #endif |
---|
| 140 | }; |
---|
| 141 | |
---|
| 142 | }; // end namespace meta_predictor |
---|
| 143 | }; // end namespace direction |
---|
| 144 | }; // end namespace prediction_unit |
---|
| 145 | }; // end namespace front_end |
---|
| 146 | }; // end namespace multi_front_end |
---|
| 147 | }; // end namespace core |
---|
| 148 | |
---|
| 149 | }; // end namespace behavioural |
---|
| 150 | }; // end namespace morpheo |
---|
| 151 | |
---|
| 152 | #endif |
---|