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