[48] | 1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h |
---|
| 2 | #define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h |
---|
[2] | 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Two_Level_Branch_Predictor.h 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
[44] | 16 | #include "Common/include/ToString.h" |
---|
| 17 | #include "Common/include/Debug.h" |
---|
[2] | 18 | |
---|
| 19 | // Internal structure |
---|
[48] | 20 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h" |
---|
| 21 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h" |
---|
| 22 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h" |
---|
[2] | 23 | |
---|
[48] | 24 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h" |
---|
| 25 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h" |
---|
[2] | 26 | #ifdef STATISTICS |
---|
[48] | 27 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h" |
---|
[2] | 28 | #endif |
---|
| 29 | #ifdef VHDL |
---|
| 30 | #include "Behavioural/include/Vhdl.h" |
---|
| 31 | #endif |
---|
[42] | 32 | #include "Behavioural/include/Component.h" |
---|
[2] | 33 | |
---|
| 34 | using namespace std; |
---|
| 35 | |
---|
| 36 | namespace morpheo { |
---|
| 37 | namespace behavioural { |
---|
[48] | 38 | namespace core { |
---|
| 39 | namespace multi_front_end { |
---|
| 40 | namespace front_end { |
---|
| 41 | namespace prediction_unit { |
---|
| 42 | namespace direction { |
---|
| 43 | |
---|
[2] | 44 | namespace meta_predictor { |
---|
| 45 | namespace two_level_branch_predictor { |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | class Two_Level_Branch_Predictor |
---|
| 49 | #if SYSTEMC |
---|
| 50 | : public sc_module |
---|
| 51 | #endif |
---|
| 52 | { |
---|
| 53 | // -----[ fields ]---------------------------------------------------- |
---|
| 54 | // Parameters |
---|
| 55 | protected : const string _name; |
---|
| 56 | |
---|
| 57 | protected : const Parameters _param; |
---|
| 58 | #ifdef STATISTICS |
---|
| 59 | protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
| 60 | #endif |
---|
| 61 | |
---|
| 62 | #ifdef STATISTICS |
---|
| 63 | private : Statistics * _stat; |
---|
| 64 | #endif |
---|
| 65 | |
---|
[42] | 66 | public : Component * _component; |
---|
| 67 | private : Interfaces * _interfaces; |
---|
[2] | 68 | |
---|
| 69 | #ifdef SYSTEMC |
---|
| 70 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 71 | // Interface |
---|
| 72 | public : SC_CLOCK * in_CLOCK ; |
---|
[15] | 73 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 74 | // Interface Predict |
---|
| 75 | public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ; |
---|
| 76 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
| 77 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ; |
---|
| 78 | public : SC_OUT(Tbht_history_t) ** out_PREDICT_BHT_HISTORY ; |
---|
| 79 | public : SC_OUT(Tpht_history_t) ** out_PREDICT_PHT_HISTORY ; |
---|
| 80 | |
---|
| 81 | // Interface Branch_complete |
---|
| 82 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; |
---|
| 83 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
| 84 | public : SC_IN (Taddress_t) ** in_BRANCH_COMPLETE_ADDRESS ; |
---|
| 85 | public : SC_IN (Tbht_history_t) ** in_BRANCH_COMPLETE_BHT_HISTORY; |
---|
| 86 | public : SC_IN (Tpht_history_t) ** in_BRANCH_COMPLETE_PHT_HISTORY; |
---|
[3] | 87 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION ; |
---|
[2] | 88 | |
---|
| 89 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 90 | |
---|
| 91 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 92 | private : SC_SIGNAL(Tcontrol_t) ** signal_PREDICT_BHT_ACK ; |
---|
| 93 | private : SC_SIGNAL(Tcontrol_t) ** signal_PREDICT_PHT_ACK ; |
---|
| 94 | private : SC_SIGNAL(Taddress_t) ** signal_PREDICT_BHT_ADDRESS ; |
---|
| 95 | private : SC_SIGNAL(Taddress_t) ** signal_PREDICT_PHT_ADDRESS ; |
---|
| 96 | |
---|
| 97 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_BHT_ACK ; |
---|
| 98 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PHT_ACK ; |
---|
| 99 | private : SC_SIGNAL(Taddress_t) ** signal_BRANCH_COMPLETE_BHT_ADDRESS; |
---|
| 100 | private : SC_SIGNAL(Taddress_t) ** signal_BRANCH_COMPLETE_PHT_ADDRESS; |
---|
| 101 | #endif |
---|
| 102 | |
---|
| 103 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[48] | 104 | protected : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table * component_Branch_History_Table; |
---|
| 105 | protected : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table * component_Pattern_History_Table; |
---|
| 106 | protected : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue * component_Two_Level_Branch_Predictor_Glue; |
---|
[2] | 107 | |
---|
| 108 | // -----[ methods ]--------------------------------------------------- |
---|
| 109 | |
---|
| 110 | #ifdef SYSTEMC |
---|
| 111 | SC_HAS_PROCESS (Two_Level_Branch_Predictor); |
---|
| 112 | #endif |
---|
| 113 | public : Two_Level_Branch_Predictor ( |
---|
| 114 | #ifdef SYSTEMC |
---|
| 115 | sc_module_name name, |
---|
| 116 | #else |
---|
| 117 | string name, |
---|
| 118 | #endif |
---|
| 119 | #ifdef STATISTICS |
---|
| 120 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 121 | #endif |
---|
| 122 | Parameters param ); |
---|
| 123 | |
---|
| 124 | public : Two_Level_Branch_Predictor (Parameters param ); |
---|
| 125 | public : ~Two_Level_Branch_Predictor (void); |
---|
| 126 | |
---|
| 127 | #ifdef SYSTEMC |
---|
| 128 | private : void allocation (void); |
---|
| 129 | private : void deallocation (void); |
---|
| 130 | |
---|
| 131 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) |
---|
| 132 | public : void transition (void); |
---|
| 133 | #endif |
---|
| 134 | #endif |
---|
| 135 | #ifdef STATISTICS |
---|
| 136 | public : string statistics (uint32_t depth); |
---|
| 137 | #endif |
---|
| 138 | |
---|
| 139 | #if VHDL |
---|
| 140 | public : void vhdl (void); |
---|
[42] | 141 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 142 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 143 | #endif |
---|
| 144 | #ifdef VHDL_TESTBENCH |
---|
| 145 | private : void vhdl_testbench_transition (void); |
---|
| 146 | #endif |
---|
| 147 | }; |
---|
| 148 | |
---|
| 149 | }; // end namespace two_level_branch_predictor |
---|
| 150 | }; // end namespace meta_predictor |
---|
| 151 | |
---|
[48] | 152 | }; // end namespace core |
---|
| 153 | }; // end namespace multi_front_end |
---|
| 154 | }; // end namespace front_end |
---|
| 155 | }; // end namespace prediction_unit |
---|
| 156 | }; // end namespace direction |
---|
| 157 | |
---|
| 158 | |
---|
[2] | 159 | }; // end namespace behavioural |
---|
| 160 | }; // end namespace morpheo |
---|
| 161 | |
---|
| 162 | #endif |
---|