1 | #ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_Meta_Predictor_h |
---|
2 | #define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_Meta_Predictor_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Meta_Predictor.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> |
---|
16 | #include "Common/include/ToString.h" |
---|
17 | #include "Common/include/Debug.h" |
---|
18 | |
---|
19 | // Internal structure |
---|
20 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h" |
---|
21 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" |
---|
22 | |
---|
23 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Parameters.h" |
---|
24 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Types.h" |
---|
25 | #ifdef STATISTICS |
---|
26 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Statistics.h" |
---|
27 | #endif |
---|
28 | #ifdef VHDL |
---|
29 | #include "Behavioural/include/Vhdl.h" |
---|
30 | #endif |
---|
31 | #include "Behavioural/include/Component.h" |
---|
32 | |
---|
33 | using namespace std; |
---|
34 | |
---|
35 | namespace morpheo { |
---|
36 | namespace behavioural { |
---|
37 | namespace core { |
---|
38 | namespace multi_front_end { |
---|
39 | namespace front_end { |
---|
40 | namespace prediction_unit { |
---|
41 | namespace direction { |
---|
42 | |
---|
43 | namespace meta_predictor { |
---|
44 | |
---|
45 | |
---|
46 | class Meta_Predictor |
---|
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 | |
---|
60 | #ifdef STATISTICS |
---|
61 | private : Statistics * _stat; |
---|
62 | #endif |
---|
63 | |
---|
64 | public : Component * _component; |
---|
65 | private : Interfaces * _interfaces; |
---|
66 | |
---|
67 | #ifdef SYSTEMC |
---|
68 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
69 | // Interface |
---|
70 | public : SC_CLOCK * in_CLOCK ; |
---|
71 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
72 | |
---|
73 | // Interface Predict |
---|
74 | public : SC_IN (Tcontrol_t) ** in_PREDICT_VAL ; |
---|
75 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_ACK ; |
---|
76 | public : SC_IN (Taddress_t) ** in_PREDICT_ADDRESS ; |
---|
77 | public : SC_OUT(Thistory_t) ** out_PREDICT_HISTORY ; |
---|
78 | public : SC_OUT(Tcontrol_t) ** out_PREDICT_DIRECTION ; |
---|
79 | |
---|
80 | // Interface Branch_complete |
---|
81 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_VAL ; |
---|
82 | public : SC_OUT(Tcontrol_t) ** out_BRANCH_COMPLETE_ACK ; |
---|
83 | public : SC_IN (Taddress_t) ** in_BRANCH_COMPLETE_ADDRESS ; |
---|
84 | public : SC_IN (Thistory_t) ** in_BRANCH_COMPLETE_HISTORY ; |
---|
85 | public : SC_IN (Tcontrol_t) ** in_BRANCH_COMPLETE_DIRECTION ; |
---|
86 | |
---|
87 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
88 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_0; |
---|
89 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_1; |
---|
90 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_2; |
---|
91 | public : morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue * component_Meta_Predictor_Glue ; |
---|
92 | |
---|
93 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
94 | |
---|
95 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
96 | |
---|
97 | // Interface Predict |
---|
98 | private : SC_SIGNAL(Tcontrol_t) ** signal_PREDICT_PREDICTOR_0_ACK ; |
---|
99 | private : SC_SIGNAL(Tcontrol_t) ** signal_PREDICT_PREDICTOR_1_ACK ; |
---|
100 | private : SC_SIGNAL(Tcontrol_t) ** signal_PREDICT_PREDICTOR_2_ACK ; |
---|
101 | |
---|
102 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_0_BHT_HISTORY; |
---|
103 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_0_PHT_HISTORY; |
---|
104 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_1_BHT_HISTORY; |
---|
105 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_1_PHT_HISTORY; |
---|
106 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_2_BHT_HISTORY; |
---|
107 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_2_PHT_HISTORY; |
---|
108 | |
---|
109 | |
---|
110 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PREDICTOR_0_ACK ; |
---|
111 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PREDICTOR_1_ACK ; |
---|
112 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_VAL ; |
---|
113 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_ACK ; |
---|
114 | private : SC_SIGNAL(Tcontrol_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION; |
---|
115 | |
---|
116 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY; |
---|
117 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY; |
---|
118 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY; |
---|
119 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY; |
---|
120 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY; |
---|
121 | private : SC_SIGNAL(morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY; |
---|
122 | |
---|
123 | #endif |
---|
124 | |
---|
125 | // -----[ methods ]--------------------------------------------------- |
---|
126 | |
---|
127 | #ifdef SYSTEMC |
---|
128 | SC_HAS_PROCESS (Meta_Predictor); |
---|
129 | #endif |
---|
130 | public : Meta_Predictor ( |
---|
131 | #ifdef SYSTEMC |
---|
132 | sc_module_name name, |
---|
133 | #else |
---|
134 | string name, |
---|
135 | #endif |
---|
136 | #ifdef STATISTICS |
---|
137 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
138 | #endif |
---|
139 | Parameters param ); |
---|
140 | |
---|
141 | public : Meta_Predictor (Parameters param ); |
---|
142 | public : ~Meta_Predictor (void); |
---|
143 | |
---|
144 | #ifdef SYSTEMC |
---|
145 | private : void allocation (void); |
---|
146 | private : void deallocation (void); |
---|
147 | |
---|
148 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
149 | public : void transition (void); |
---|
150 | #endif |
---|
151 | #endif |
---|
152 | #ifdef STATISTICS |
---|
153 | public : string statistics (uint32_t depth); |
---|
154 | #endif |
---|
155 | |
---|
156 | #if VHDL |
---|
157 | public : void vhdl (void); |
---|
158 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
159 | private : void vhdl_body (Vhdl * & vhdl); |
---|
160 | #endif |
---|
161 | #ifdef VHDL_TESTBENCH |
---|
162 | private : void vhdl_testbench_transition (void); |
---|
163 | #endif |
---|
164 | }; |
---|
165 | |
---|
166 | }; // end namespace meta_predictor |
---|
167 | |
---|
168 | }; // end namespace core |
---|
169 | }; // end namespace multi_front_end |
---|
170 | }; // end namespace front_end |
---|
171 | }; // end namespace prediction_unit |
---|
172 | }; // end namespace direction |
---|
173 | |
---|
174 | |
---|
175 | }; // end namespace behavioural |
---|
176 | }; // end namespace morpheo |
---|
177 | |
---|
178 | #endif |
---|