[48] | 1 | #ifndef 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_h |
---|
| 2 | #define 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_h |
---|
[2] | 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 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 | |
---|
[48] | 19 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h" |
---|
| 20 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h" |
---|
[2] | 21 | #ifdef STATISTICS |
---|
[48] | 22 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h" |
---|
[2] | 23 | #endif |
---|
| 24 | #ifdef VHDL |
---|
| 25 | #include "Behavioural/include/Vhdl.h" |
---|
| 26 | #endif |
---|
[42] | 27 | #include "Behavioural/include/Component.h" |
---|
[2] | 28 | |
---|
| 29 | using namespace std; |
---|
| 30 | |
---|
| 31 | namespace morpheo { |
---|
| 32 | namespace behavioural { |
---|
[48] | 33 | namespace core { |
---|
| 34 | namespace multi_front_end { |
---|
| 35 | namespace front_end { |
---|
| 36 | namespace prediction_unit { |
---|
| 37 | namespace direction { |
---|
| 38 | |
---|
[2] | 39 | namespace meta_predictor { |
---|
| 40 | namespace two_level_branch_predictor { |
---|
| 41 | namespace two_level_branch_predictor_glue { |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | class Two_Level_Branch_Predictor_Glue |
---|
| 45 | #if SYSTEMC |
---|
| 46 | : public sc_module |
---|
| 47 | #endif |
---|
| 48 | { |
---|
| 49 | // -----[ fields ]---------------------------------------------------- |
---|
| 50 | // Parameters |
---|
| 51 | protected : const string _name; |
---|
| 52 | |
---|
| 53 | protected : const Parameters _param; |
---|
| 54 | //#ifdef STATISTICS |
---|
[5] | 55 | //protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
[2] | 56 | //#endif |
---|
| 57 | |
---|
| 58 | #ifdef STATISTICS |
---|
| 59 | private : Statistics * _stat; |
---|
| 60 | #endif |
---|
| 61 | |
---|
[42] | 62 | public : Component * _component; |
---|
| 63 | private : Interfaces * _interfaces; |
---|
[2] | 64 | |
---|
| 65 | #ifdef SYSTEMC |
---|
| 66 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | // Interface |
---|
| 68 | public : SC_CLOCK * in_CLOCK ; |
---|
[42] | 69 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 70 | |
---|
| 71 | public : SC_IN (Tcontrol_t) ** in_PREDICT_BHT_ACK ; |
---|
| 72 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PHT_ACK ; |
---|
| 73 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
| 74 | |
---|
| 75 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ; |
---|
| 76 | public : SC_IN (Tbht_history_t) ** in_PREDICT_BHT_HISTORY ; |
---|
| 77 | public : SC_OUT(Taddress_t) ** out_PREDICT_BHT_ADDRESS ; |
---|
| 78 | public : SC_OUT(Taddress_t) ** out_PREDICT_PHT_ADDRESS ; |
---|
| 79 | |
---|
| 80 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_BHT_ACK ; |
---|
| 81 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PHT_ACK ; |
---|
| 82 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
| 83 | |
---|
| 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_OUT(Taddress_t) ** out_BRANCH_COMPLETE_BHT_ADDRESS; |
---|
| 87 | public : SC_OUT(Taddress_t) ** out_BRANCH_COMPLETE_PHT_ADDRESS; |
---|
| 88 | |
---|
| 89 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 90 | |
---|
| 91 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 92 | |
---|
| 93 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 94 | #endif |
---|
| 95 | |
---|
| 96 | // -----[ methods ]--------------------------------------------------- |
---|
| 97 | |
---|
| 98 | #ifdef SYSTEMC |
---|
| 99 | SC_HAS_PROCESS (Two_Level_Branch_Predictor_Glue); |
---|
| 100 | #endif |
---|
| 101 | public : Two_Level_Branch_Predictor_Glue ( |
---|
| 102 | #ifdef SYSTEMC |
---|
| 103 | sc_module_name name, |
---|
| 104 | #else |
---|
| 105 | string name, |
---|
| 106 | #endif |
---|
| 107 | #ifdef STATISTICS |
---|
| 108 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 109 | #endif |
---|
| 110 | Parameters param ); |
---|
| 111 | |
---|
| 112 | public : Two_Level_Branch_Predictor_Glue (Parameters param ); |
---|
| 113 | public : ~Two_Level_Branch_Predictor_Glue (void); |
---|
| 114 | |
---|
| 115 | #ifdef SYSTEMC |
---|
| 116 | private : void allocation (void); |
---|
| 117 | private : void deallocation (void); |
---|
| 118 | |
---|
| 119 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 120 | public : void transition (void); |
---|
| 121 | #endif |
---|
| 122 | public : void genMealy_predict_ack (void); |
---|
| 123 | public : void genMealy_predict_bht_address (void); |
---|
| 124 | public : void genMealy_predict_pht_address (void); |
---|
| 125 | public : void genMealy_branch_complete_ack (void); |
---|
| 126 | public : void genMealy_branch_complete_bht_address (void); |
---|
| 127 | public : void genMealy_branch_complete_pht_address (void); |
---|
| 128 | #endif |
---|
| 129 | |
---|
| 130 | #ifdef STATISTICS |
---|
| 131 | public : string statistics (uint32_t depth); |
---|
| 132 | #endif |
---|
| 133 | #if VHDL |
---|
| 134 | public : void vhdl (void); |
---|
[42] | 135 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 136 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 137 | #endif |
---|
| 138 | #ifdef VHDL_TESTBENCH |
---|
| 139 | private : void vhdl_testbench_transition (void); |
---|
| 140 | #endif |
---|
| 141 | }; |
---|
| 142 | |
---|
| 143 | }; // end namespace two_level_branch_predictor_glue |
---|
| 144 | }; // end namespace two_level_branch_predictor |
---|
| 145 | }; // end namespace meta_predictor |
---|
| 146 | |
---|
[48] | 147 | }; // end namespace core |
---|
| 148 | }; // end namespace multi_front_end |
---|
| 149 | }; // end namespace front_end |
---|
| 150 | }; // end namespace prediction_unit |
---|
| 151 | }; // end namespace direction |
---|
| 152 | |
---|
| 153 | |
---|
[2] | 154 | }; // end namespace behavioural |
---|
| 155 | }; // end namespace morpheo |
---|
| 156 | |
---|
| 157 | #endif |
---|