[4] | 1 | #ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h |
---|
| 2 | #define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h |
---|
| 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" |
---|
[4] | 18 | |
---|
| 19 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h" |
---|
| 20 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Types.h" |
---|
| 21 | #ifdef STATISTICS |
---|
| 22 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h" |
---|
| 23 | #endif |
---|
| 24 | #ifdef VHDL |
---|
| 25 | #include "Behavioural/include/Vhdl.h" |
---|
| 26 | #endif |
---|
[44] | 27 | #include "Behavioural/include/Component.h" |
---|
[4] | 28 | |
---|
| 29 | using namespace std; |
---|
| 30 | |
---|
| 31 | namespace morpheo { |
---|
| 32 | namespace behavioural { |
---|
| 33 | namespace stage_1_ifetch { |
---|
| 34 | namespace predictor { |
---|
| 35 | namespace meta_predictor { |
---|
| 36 | namespace meta_predictor_glue { |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | class Meta_Predictor_Glue |
---|
| 40 | #if SYSTEMC |
---|
| 41 | : public sc_module |
---|
| 42 | #endif |
---|
| 43 | { |
---|
| 44 | // -----[ fields ]---------------------------------------------------- |
---|
| 45 | // Parameters |
---|
| 46 | protected : const string _name; |
---|
| 47 | |
---|
| 48 | protected : const Parameters _param; |
---|
| 49 | //#ifdef STATISTICS |
---|
| 50 | // protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
| 51 | //#endif |
---|
| 52 | |
---|
| 53 | #ifdef STATISTICS |
---|
| 54 | private : Statistics * _stat; |
---|
| 55 | #endif |
---|
| 56 | |
---|
[44] | 57 | public : Component * _component; |
---|
| 58 | private : Interfaces * _interfaces; |
---|
[4] | 59 | |
---|
| 60 | #ifdef SYSTEMC |
---|
| 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 62 | // Interface |
---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
---|
[44] | 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[4] | 65 | |
---|
| 66 | // Interface Predict |
---|
| 67 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_0_ACK ; |
---|
| 68 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_1_ACK ; |
---|
| 69 | public : SC_IN (Tcontrol_t) ** in_PREDICT_PREDICTOR_2_ACK ; |
---|
| 70 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
| 71 | |
---|
| 72 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_0_BHT_HISTORY ; |
---|
| 73 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_0_PHT_HISTORY ; |
---|
| 74 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_1_BHT_HISTORY ; |
---|
| 75 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_1_PHT_HISTORY ; |
---|
| 76 | public : SC_IN (Tbht_history_t) ** in_PREDICT_PREDICTOR_2_BHT_HISTORY ; |
---|
| 77 | public : SC_IN (Tpht_history_t) ** in_PREDICT_PREDICTOR_2_PHT_HISTORY ; |
---|
| 78 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ; |
---|
| 79 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ; |
---|
| 80 | |
---|
| 81 | // Interface Branch_complete |
---|
[5] | 82 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; |
---|
| 83 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_VAL ; |
---|
| 84 | |
---|
[4] | 85 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_0_ACK ; |
---|
| 86 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_1_ACK ; |
---|
| 87 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_PREDICTOR_2_ACK ; |
---|
| 88 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
| 89 | |
---|
| 90 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY; |
---|
| 91 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY; |
---|
| 92 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY; |
---|
| 93 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY; |
---|
| 94 | public : SC_OUT(Tbht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY; |
---|
| 95 | public : SC_OUT(Tpht_history_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY; |
---|
| 96 | public : SC_IN (Thistory_t) ** in_BRANCH_COMPLETE_HISTORY ; |
---|
[5] | 97 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION ; |
---|
| 98 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION ; |
---|
[4] | 99 | |
---|
| 100 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 101 | |
---|
| 102 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 103 | |
---|
| 104 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 105 | #endif |
---|
| 106 | |
---|
| 107 | // -----[ methods ]--------------------------------------------------- |
---|
| 108 | |
---|
| 109 | #ifdef SYSTEMC |
---|
| 110 | SC_HAS_PROCESS (Meta_Predictor_Glue); |
---|
| 111 | #endif |
---|
| 112 | public : Meta_Predictor_Glue ( |
---|
| 113 | #ifdef SYSTEMC |
---|
| 114 | sc_module_name name, |
---|
| 115 | #else |
---|
| 116 | string name, |
---|
| 117 | #endif |
---|
| 118 | #ifdef STATISTICS |
---|
| 119 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 120 | #endif |
---|
| 121 | Parameters param ); |
---|
| 122 | |
---|
| 123 | public : Meta_Predictor_Glue (Parameters param ); |
---|
| 124 | public : ~Meta_Predictor_Glue (void); |
---|
| 125 | |
---|
| 126 | #ifdef SYSTEMC |
---|
| 127 | private : void allocation (void); |
---|
| 128 | private : void deallocation (void); |
---|
| 129 | |
---|
| 130 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 131 | public : void transition (void); |
---|
| 132 | #endif |
---|
| 133 | public : void genMealy_predict_ack (void); |
---|
| 134 | public : void genMealy_predict_history (void); |
---|
[5] | 135 | public : void genMealy_branch_complete_val (void); |
---|
[4] | 136 | public : void genMealy_branch_complete_ack (void); |
---|
| 137 | public : void genMealy_branch_complete_history (void); |
---|
| 138 | |
---|
| 139 | #endif |
---|
| 140 | #ifdef STATISTICS |
---|
| 141 | public : string statistics (uint32_t depth); |
---|
| 142 | #endif |
---|
| 143 | |
---|
| 144 | #if VHDL |
---|
| 145 | public : void vhdl (void); |
---|
[44] | 146 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 147 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[4] | 148 | #endif |
---|
| 149 | #ifdef VHDL_TESTBENCH |
---|
| 150 | private : void vhdl_testbench_transition (void); |
---|
| 151 | #endif |
---|
| 152 | }; |
---|
| 153 | |
---|
| 154 | }; // end namespace meta_predictor_glue |
---|
| 155 | }; // end namespace meta_predictor |
---|
| 156 | }; // end namespace predictor |
---|
| 157 | }; // end namespace stage_1_ifetch |
---|
| 158 | |
---|
| 159 | }; // end namespace behavioural |
---|
| 160 | }; // end namespace morpheo |
---|
| 161 | |
---|
| 162 | #endif |
---|