[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 |
---|
| 29 | #ifdef VHDL_TESTBENCH |
---|
| 30 | #include "Behavioural/include/Vhdl_Testbench.h" |
---|
| 31 | #endif |
---|
| 32 | |
---|
| 33 | using namespace std; |
---|
| 34 | |
---|
| 35 | namespace morpheo { |
---|
| 36 | namespace behavioural { |
---|
| 37 | namespace stage_1_ifetch { |
---|
| 38 | namespace predictor { |
---|
| 39 | namespace meta_predictor { |
---|
| 40 | namespace two_level_branch_predictor { |
---|
| 41 | namespace branch_history_table { |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | class Branch_History_Table |
---|
| 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 |
---|
| 55 | protected : const morpheo::behavioural::Parameters_Statistics _param_statistics; |
---|
| 56 | #endif |
---|
| 57 | #ifdef STATISTICS |
---|
| 58 | private : Statistics * _stat; |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | #ifdef VHDL_TESTBENCH |
---|
| 62 | private : Vhdl_Testbench * _vhdl_testbench; |
---|
| 63 | #endif |
---|
| 64 | |
---|
| 65 | #ifdef SYSTEMC |
---|
| 66 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | // Interface |
---|
| 68 | public : SC_CLOCK * in_CLOCK ; |
---|
[15] | 69 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 70 | |
---|
| 71 | public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ; |
---|
| 72 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
| 73 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ; |
---|
| 74 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ; |
---|
| 75 | |
---|
| 76 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; |
---|
| 77 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
| 78 | public : SC_IN (Taddress_t) ** in_BRANCH_COMPLETE_ADDRESS; |
---|
| 79 | public : SC_IN (Thistory_t) ** in_BRANCH_COMPLETE_HISTORY; |
---|
[3] | 80 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION; |
---|
[2] | 81 | |
---|
| 82 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 83 | |
---|
| 84 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 85 | public : SC_SIGNAL(Thistory_t) ** signal_BRANCH_COMPLETE_HISTORY; |
---|
| 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 | |
---|
| 120 | #if VHDL |
---|
| 121 | public : void vhdl (void); |
---|
| 122 | private : void vhdl_port (Vhdl & vhdl); |
---|
| 123 | private : void vhdl_type (Vhdl & vhdl); |
---|
| 124 | private : void vhdl_signal (Vhdl & vhdl); |
---|
| 125 | private : void vhdl_body (Vhdl & vhdl); |
---|
| 126 | #endif |
---|
| 127 | #ifdef STATISTICS |
---|
| 128 | public : string statistics (uint32_t depth); |
---|
| 129 | #endif |
---|
| 130 | |
---|
| 131 | #ifdef VHDL_TESTBENCH |
---|
| 132 | private : void vhdl_testbench_port (void); |
---|
| 133 | private : void vhdl_testbench_transition (void); |
---|
| 134 | #endif |
---|
| 135 | public : void vhdl_testbench_label (string label); |
---|
| 136 | }; |
---|
| 137 | |
---|
| 138 | }; // end namespace branch_history_table |
---|
| 139 | }; // end namespace two_level_branch_predictor |
---|
| 140 | }; // end namespace meta_predictor |
---|
| 141 | }; // end namespace predictor |
---|
| 142 | }; // end namespace stage_1_ifetch |
---|
| 143 | |
---|
| 144 | }; // end namespace behavioural |
---|
| 145 | }; // end namespace morpheo |
---|
| 146 | |
---|
| 147 | #endif |
---|