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