1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace stage_1_ifetch { |
---|
14 | namespace predictor { |
---|
15 | namespace meta_predictor { |
---|
16 | |
---|
17 | |
---|
18 | void Meta_Predictor::allocation (void) |
---|
19 | { |
---|
20 | string rename; |
---|
21 | |
---|
22 | log_printf(FUNC,Meta_Predictor,"allocation","Begin"); |
---|
23 | |
---|
24 | in_CLOCK = new SC_CLOCK ("in_CLOCK"); |
---|
25 | in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); |
---|
26 | |
---|
27 | in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction ]; |
---|
28 | out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ]; |
---|
29 | in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction ]; |
---|
30 | out_PREDICT_HISTORY = new SC_OUT(Thistory_t) * [_param._nb_prediction ]; |
---|
31 | out_PREDICT_DIRECTION = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ]; |
---|
32 | |
---|
33 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
34 | { |
---|
35 | rename = "in_PREDICT_VAL_" +toString(i); |
---|
36 | in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
37 | |
---|
38 | rename = "out_PREDICT_ACK_" +toString(i); |
---|
39 | out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
40 | |
---|
41 | rename = "in_PREDICT_ADDRESS_" +toString(i); |
---|
42 | in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
43 | |
---|
44 | rename = "out_PREDICT_HISTORY_" +toString(i); |
---|
45 | out_PREDICT_HISTORY [i] = new SC_OUT(Thistory_t) (rename.c_str()); |
---|
46 | |
---|
47 | rename = "out_PREDICT_DIRECTION_" +toString(i); |
---|
48 | out_PREDICT_DIRECTION [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
49 | } |
---|
50 | |
---|
51 | in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
52 | out_BRANCH_COMPLETE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete]; |
---|
53 | in_BRANCH_COMPLETE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_branch_complete]; |
---|
54 | in_BRANCH_COMPLETE_HISTORY = new SC_IN (Thistory_t) * [_param._nb_branch_complete]; |
---|
55 | in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
56 | |
---|
57 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
58 | { |
---|
59 | rename = "in_BRANCH_COMPLETE_VAL_" +toString(i); |
---|
60 | in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
61 | |
---|
62 | rename = "out_BRANCH_COMPLETE_ACK_" +toString(i); |
---|
63 | out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
64 | |
---|
65 | rename = "in_BRANCH_COMPLETE_ADDRESS_" +toString(i); |
---|
66 | in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
67 | |
---|
68 | rename = "in_BRANCH_COMPLETE_HISTORY_" +toString(i); |
---|
69 | in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str()); |
---|
70 | |
---|
71 | rename = "in_BRANCH_COMPLETE_DIRECTION_" +toString(i); |
---|
72 | in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
73 | } |
---|
74 | |
---|
75 | // ~~~~~[ Signal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
76 | |
---|
77 | if (_param._have_meta_predictor) |
---|
78 | { |
---|
79 | signal_PREDICT_PREDICTOR_0_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
80 | signal_PREDICT_PREDICTOR_1_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
81 | } |
---|
82 | signal_PREDICT_PREDICTOR_2_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
83 | |
---|
84 | if (_param._have_meta_predictor) |
---|
85 | { |
---|
86 | if (_param._predictor_0_have_bht) |
---|
87 | signal_PREDICT_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
88 | if (_param._predictor_0_have_pht) |
---|
89 | signal_PREDICT_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
90 | if (_param._predictor_0_have_bht) |
---|
91 | signal_PREDICT_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
92 | if (_param._predictor_1_have_pht) |
---|
93 | signal_PREDICT_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
94 | } |
---|
95 | if (_param._predictor_2_have_bht) |
---|
96 | signal_PREDICT_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
97 | if (_param._predictor_2_have_pht) |
---|
98 | signal_PREDICT_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
99 | |
---|
100 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
101 | { |
---|
102 | if (_param._have_meta_predictor) |
---|
103 | { |
---|
104 | rename = "signal_PREDICT_PREDICTOR_0_ACK_"+toString(i); |
---|
105 | signal_PREDICT_PREDICTOR_0_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
106 | rename = "signal_PREDICT_PREDICTOR_1_ACK_"+toString(i); |
---|
107 | signal_PREDICT_PREDICTOR_1_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
108 | } |
---|
109 | rename = "signal_PREDICT_PREDICTOR_2_ACK_"+toString(i); |
---|
110 | signal_PREDICT_PREDICTOR_2_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
111 | |
---|
112 | if (_param._have_meta_predictor) |
---|
113 | { |
---|
114 | if (_param._predictor_0_have_bht) |
---|
115 | { |
---|
116 | rename = "signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i); |
---|
117 | signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
118 | } |
---|
119 | if (_param._predictor_0_have_pht) |
---|
120 | { |
---|
121 | rename = "signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i); |
---|
122 | signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
123 | } |
---|
124 | if (_param._predictor_1_have_bht) |
---|
125 | { |
---|
126 | rename = "signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i); |
---|
127 | signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
128 | } |
---|
129 | if (_param._predictor_1_have_pht) |
---|
130 | { |
---|
131 | rename = "signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i); |
---|
132 | signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
133 | } |
---|
134 | } |
---|
135 | if (_param._predictor_2_have_bht) |
---|
136 | { |
---|
137 | rename = "signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i); |
---|
138 | signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
139 | } |
---|
140 | if (_param._predictor_2_have_pht) |
---|
141 | { |
---|
142 | rename = "signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i); |
---|
143 | signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
144 | } |
---|
145 | } |
---|
146 | if (_param._have_meta_predictor) |
---|
147 | { |
---|
148 | signal_BRANCH_COMPLETE_PREDICTOR_0_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
149 | signal_BRANCH_COMPLETE_PREDICTOR_1_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
150 | signal_BRANCH_COMPLETE_PREDICTOR_2_VAL = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
151 | signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
152 | } |
---|
153 | signal_BRANCH_COMPLETE_PREDICTOR_2_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; |
---|
154 | |
---|
155 | if (_param._have_meta_predictor) |
---|
156 | { |
---|
157 | if (_param._predictor_0_have_bht) |
---|
158 | signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
159 | if (_param._predictor_0_have_pht) |
---|
160 | signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
161 | if (_param._predictor_0_have_bht) |
---|
162 | signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
163 | if (_param._predictor_1_have_pht) |
---|
164 | signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
165 | } |
---|
166 | if (_param._predictor_2_have_bht) |
---|
167 | signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction]; |
---|
168 | if (_param._predictor_2_have_pht) |
---|
169 | signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction]; |
---|
170 | |
---|
171 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
172 | { |
---|
173 | if (_param._have_meta_predictor) |
---|
174 | { |
---|
175 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i); |
---|
176 | signal_BRANCH_COMPLETE_PREDICTOR_0_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
177 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i); |
---|
178 | signal_BRANCH_COMPLETE_PREDICTOR_1_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
179 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i); |
---|
180 | signal_BRANCH_COMPLETE_PREDICTOR_2_VAL [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
181 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i); |
---|
182 | signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
183 | } |
---|
184 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i); |
---|
185 | signal_BRANCH_COMPLETE_PREDICTOR_2_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str()); |
---|
186 | |
---|
187 | if (_param._have_meta_predictor) |
---|
188 | { |
---|
189 | if (_param._predictor_0_have_bht) |
---|
190 | { |
---|
191 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i); |
---|
192 | signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
193 | } |
---|
194 | if (_param._predictor_0_have_pht) |
---|
195 | { |
---|
196 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i); |
---|
197 | signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
198 | } |
---|
199 | if (_param._predictor_1_have_bht) |
---|
200 | { |
---|
201 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i); |
---|
202 | signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
203 | } |
---|
204 | if (_param._predictor_1_have_pht) |
---|
205 | { |
---|
206 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i); |
---|
207 | signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
208 | } |
---|
209 | } |
---|
210 | if (_param._predictor_2_have_bht) |
---|
211 | { |
---|
212 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i); |
---|
213 | signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) (rename.c_str()); |
---|
214 | } |
---|
215 | if (_param._predictor_2_have_pht) |
---|
216 | { |
---|
217 | rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i); |
---|
218 | signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) (rename.c_str()); |
---|
219 | } |
---|
220 | } |
---|
221 | |
---|
222 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
223 | string name_component; |
---|
224 | |
---|
225 | // =====[ component_Meta_Predictor_Glue ]============================= |
---|
226 | |
---|
227 | name_component = _name+"_Meta_Predictor_Glue"; |
---|
228 | |
---|
229 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
230 | |
---|
231 | component_Meta_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str() , |
---|
232 | #ifdef STATISTICS |
---|
233 | _param_statistics , |
---|
234 | #endif |
---|
235 | *(_param._param_meta_predictor_glue)); |
---|
236 | |
---|
237 | // Instantiation |
---|
238 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
239 | (*(component_Meta_Predictor_Glue->in_CLOCK )) (*(in_CLOCK )); |
---|
240 | #endif |
---|
241 | |
---|
242 | // Interface Predict |
---|
243 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
244 | { |
---|
245 | if (_param._have_meta_predictor) |
---|
246 | { |
---|
247 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_ACK [i])) (*(signal_PREDICT_PREDICTOR_0_ACK [i])); |
---|
248 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_ACK [i])) (*(signal_PREDICT_PREDICTOR_1_ACK [i])); |
---|
249 | } |
---|
250 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_ACK [i])) (*(signal_PREDICT_PREDICTOR_2_ACK [i])); |
---|
251 | (*(component_Meta_Predictor_Glue->out_PREDICT_ACK [i])) (*( out_PREDICT_ACK [i])); |
---|
252 | if (_param._have_meta_predictor) |
---|
253 | { |
---|
254 | if (_param._predictor_0_have_bht) |
---|
255 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i])); |
---|
256 | if (_param._predictor_0_have_pht) |
---|
257 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i])); |
---|
258 | if (_param._predictor_1_have_bht) |
---|
259 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i])); |
---|
260 | if (_param._predictor_1_have_pht) |
---|
261 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i])); |
---|
262 | } |
---|
263 | if (_param._predictor_2_have_bht) |
---|
264 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i])); |
---|
265 | if (_param._predictor_2_have_pht) |
---|
266 | (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i])); |
---|
267 | (*(component_Meta_Predictor_Glue->out_PREDICT_HISTORY [i])) (*( out_PREDICT_HISTORY [i])); |
---|
268 | (*(component_Meta_Predictor_Glue->out_PREDICT_DIRECTION [i])) (*( out_PREDICT_DIRECTION [i])); |
---|
269 | } |
---|
270 | |
---|
271 | // Interface Branch_complete |
---|
272 | |
---|
273 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
274 | { |
---|
275 | if (_param._have_meta_predictor) |
---|
276 | { |
---|
277 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); |
---|
278 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])); |
---|
279 | |
---|
280 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])); |
---|
281 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])); |
---|
282 | } |
---|
283 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK [i])); |
---|
284 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); |
---|
285 | |
---|
286 | if (_param._have_meta_predictor) |
---|
287 | { |
---|
288 | if (_param._predictor_0_have_bht) |
---|
289 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])); |
---|
290 | if (_param._predictor_0_have_pht) |
---|
291 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])); |
---|
292 | if (_param._predictor_1_have_bht) |
---|
293 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])); |
---|
294 | if (_param._predictor_1_have_pht) |
---|
295 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])); |
---|
296 | } |
---|
297 | if (_param._predictor_2_have_bht) |
---|
298 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])); |
---|
299 | if (_param._predictor_2_have_pht) |
---|
300 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])); |
---|
301 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY [i])); |
---|
302 | if (_param._have_meta_predictor) |
---|
303 | { |
---|
304 | (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); |
---|
305 | (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])); |
---|
306 | } |
---|
307 | } |
---|
308 | |
---|
309 | // =====[ component_Two_Level_Branch_Predictor_2 ]==================== |
---|
310 | |
---|
311 | name_component = _name+"_Two_Level_Branch_Predictor_2"; |
---|
312 | |
---|
313 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
314 | |
---|
315 | component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str() , |
---|
316 | #ifdef STATISTICS |
---|
317 | _param_statistics , |
---|
318 | #endif |
---|
319 | *(_param._param_two_level_branch_predictor_2)); |
---|
320 | |
---|
321 | // Instantiation |
---|
322 | (*(component_Two_Level_Branch_Predictor_2->in_CLOCK )) (*(in_CLOCK )); |
---|
323 | (*(component_Two_Level_Branch_Predictor_2->in_NRESET)) (*(in_NRESET)); |
---|
324 | |
---|
325 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
326 | { |
---|
327 | (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); |
---|
328 | (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_ACK [i])) (*(signal_PREDICT_PREDICTOR_2_ACK [i])); |
---|
329 | (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); |
---|
330 | if (_param._predictor_2_have_bht) |
---|
331 | (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i])); |
---|
332 | if (_param._predictor_2_have_pht) |
---|
333 | (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i])); |
---|
334 | } |
---|
335 | |
---|
336 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
337 | { |
---|
338 | if (_param._have_meta_predictor) |
---|
339 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL [i])); |
---|
340 | else |
---|
341 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); |
---|
342 | (*(component_Two_Level_Branch_Predictor_2->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK [i])); |
---|
343 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); |
---|
344 | if (_param._predictor_2_have_bht) |
---|
345 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])); |
---|
346 | if (_param._predictor_2_have_pht) |
---|
347 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])); |
---|
348 | if (_param._have_meta_predictor) |
---|
349 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])); |
---|
350 | else |
---|
351 | (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); |
---|
352 | } |
---|
353 | |
---|
354 | if (_param._have_meta_predictor) |
---|
355 | { |
---|
356 | // =====[ component_Two_Level_Branch_Predictor_1 ]==================== |
---|
357 | |
---|
358 | name_component = _name+"_Two_Level_Branch_Predictor_1"; |
---|
359 | |
---|
360 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
361 | |
---|
362 | component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str() , |
---|
363 | #ifdef STATISTICS |
---|
364 | _param_statistics , |
---|
365 | #endif |
---|
366 | *(_param._param_two_level_branch_predictor_1)); |
---|
367 | |
---|
368 | // Instantiation |
---|
369 | (*(component_Two_Level_Branch_Predictor_1->in_CLOCK )) (*(in_CLOCK )); |
---|
370 | (*(component_Two_Level_Branch_Predictor_1->in_NRESET)) (*(in_NRESET)); |
---|
371 | |
---|
372 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
373 | { |
---|
374 | (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); |
---|
375 | (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_ACK [i])) (*(signal_PREDICT_PREDICTOR_1_ACK [i])); |
---|
376 | (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); |
---|
377 | if (_param._predictor_1_have_bht) |
---|
378 | (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i])); |
---|
379 | if (_param._predictor_1_have_pht) |
---|
380 | (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i])); |
---|
381 | } |
---|
382 | |
---|
383 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
384 | { |
---|
385 | (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); |
---|
386 | (*(component_Two_Level_Branch_Predictor_1->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK [i])); |
---|
387 | (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); |
---|
388 | if (_param._predictor_1_have_bht) |
---|
389 | (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])); |
---|
390 | if (_param._predictor_1_have_pht) |
---|
391 | (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])); |
---|
392 | (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); |
---|
393 | } |
---|
394 | |
---|
395 | // =====[ component_Two_Level_Branch_Predictor_0 ]==================== |
---|
396 | |
---|
397 | name_component = _name+"_Two_Level_Branch_Predictor_0"; |
---|
398 | |
---|
399 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
400 | |
---|
401 | component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str() , |
---|
402 | #ifdef STATISTICS |
---|
403 | _param_statistics , |
---|
404 | #endif |
---|
405 | *(_param._param_two_level_branch_predictor_0)); |
---|
406 | |
---|
407 | // Instantiation |
---|
408 | (*(component_Two_Level_Branch_Predictor_0->in_CLOCK )) (*(in_CLOCK )); |
---|
409 | (*(component_Two_Level_Branch_Predictor_0->in_NRESET)) (*(in_NRESET)); |
---|
410 | |
---|
411 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
412 | { |
---|
413 | (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i])); |
---|
414 | (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_ACK [i])) (*(signal_PREDICT_PREDICTOR_0_ACK [i])); |
---|
415 | (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); |
---|
416 | if (_param._predictor_0_have_bht) |
---|
417 | (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_BHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i])); |
---|
418 | if (_param._predictor_0_have_pht) |
---|
419 | (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_PHT_HISTORY [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i])); |
---|
420 | } |
---|
421 | |
---|
422 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
423 | { |
---|
424 | (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); |
---|
425 | (*(component_Two_Level_Branch_Predictor_0->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])); |
---|
426 | (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); |
---|
427 | if (_param._predictor_0_have_bht) |
---|
428 | (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])); |
---|
429 | if (_param._predictor_0_have_pht) |
---|
430 | (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])); |
---|
431 | (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); |
---|
432 | } |
---|
433 | } |
---|
434 | |
---|
435 | log_printf(FUNC,Meta_Predictor,"allocation","End"); |
---|
436 | }; |
---|
437 | |
---|
438 | }; // end namespace meta_predictor |
---|
439 | }; // end namespace predictor |
---|
440 | }; // end namespace stage_1_ifetch |
---|
441 | }; // end namespace behavioural |
---|
442 | }; // end namespace morpheo |
---|
443 | #endif |
---|