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