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 | log_printf(FUNC,Meta_Predictor,"allocation","Begin"); |
---|
21 | |
---|
22 | _component = new Component (); |
---|
23 | |
---|
24 | Entity * entity = _component->set_entity (_name |
---|
25 | ,"Meta_Predictor" |
---|
26 | #ifdef POSITION |
---|
27 | ,MIXTE |
---|
28 | #endif |
---|
29 | ); |
---|
30 | |
---|
31 | _interfaces = entity->set_interfaces(); |
---|
32 | |
---|
33 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
34 | { |
---|
35 | Interface * interface = _interfaces->set_interface("" |
---|
36 | #ifdef POSITION |
---|
37 | , IN |
---|
38 | , SOUTH |
---|
39 | , "Generalist interface" |
---|
40 | #endif |
---|
41 | ); |
---|
42 | |
---|
43 | in_CLOCK = interface->set_signal_clk ("clock" ,1); |
---|
44 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_YES); |
---|
45 | } |
---|
46 | |
---|
47 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
48 | |
---|
49 | in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction ]; |
---|
50 | out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ]; |
---|
51 | in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction ]; |
---|
52 | out_PREDICT_HISTORY = new SC_OUT(Thistory_t) * [_param._nb_prediction ]; |
---|
53 | out_PREDICT_DIRECTION = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ]; |
---|
54 | |
---|
55 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
56 | { |
---|
57 | Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i) |
---|
58 | #ifdef POSITION |
---|
59 | , IN |
---|
60 | , WEST |
---|
61 | , "Interface Predict" |
---|
62 | #endif |
---|
63 | ); |
---|
64 | |
---|
65 | in_PREDICT_VAL [i] = interface->set_signal_valack_in ("val" , VAL); |
---|
66 | out_PREDICT_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); |
---|
67 | in_PREDICT_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address" , _param._size_address); |
---|
68 | out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history" , _param._size_history); |
---|
69 | out_PREDICT_DIRECTION [i] = interface->set_signal_out <Tcontrol_t> ("direction", 1); |
---|
70 | } |
---|
71 | |
---|
72 | // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
73 | |
---|
74 | in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
75 | out_BRANCH_COMPLETE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete]; |
---|
76 | in_BRANCH_COMPLETE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_branch_complete]; |
---|
77 | in_BRANCH_COMPLETE_HISTORY = new SC_IN (Thistory_t) * [_param._nb_branch_complete]; |
---|
78 | in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; |
---|
79 | |
---|
80 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
81 | { |
---|
82 | Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i) |
---|
83 | #ifdef POSITION |
---|
84 | , IN |
---|
85 | , EAST |
---|
86 | , "Interface branch complete" |
---|
87 | #endif |
---|
88 | ); |
---|
89 | |
---|
90 | in_BRANCH_COMPLETE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); |
---|
91 | out_BRANCH_COMPLETE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); |
---|
92 | in_BRANCH_COMPLETE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address" , _param._size_address); |
---|
93 | in_BRANCH_COMPLETE_HISTORY [i] = interface->set_signal_in <Thistory_t> ("history" , _param._size_history); |
---|
94 | in_BRANCH_COMPLETE_DIRECTION [i] = interface->set_signal_in <Tcontrol_t> ("direction" , 1); |
---|
95 | } |
---|
96 | |
---|
97 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
98 | string name_component; |
---|
99 | |
---|
100 | // =====[ component_Meta_Predictor_Glue ]============================= |
---|
101 | |
---|
102 | name_component = _name+"_Meta_Predictor_Glue"; |
---|
103 | |
---|
104 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
105 | |
---|
106 | component_Meta_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str() , |
---|
107 | #ifdef STATISTICS |
---|
108 | _param_statistics , |
---|
109 | #endif |
---|
110 | *(_param._param_meta_predictor_glue)); |
---|
111 | |
---|
112 | |
---|
113 | _component->set_component (component_Meta_Predictor_Glue->_component |
---|
114 | #ifdef POSITION |
---|
115 | , 75 |
---|
116 | , 25 |
---|
117 | , 10 |
---|
118 | , 10 |
---|
119 | #endif |
---|
120 | ); |
---|
121 | |
---|
122 | |
---|
123 | // =====[ component_Two_Level_Branch_Predictor_2 ]==================== |
---|
124 | |
---|
125 | name_component = _name+"_Two_Level_Branch_Predictor_2"; |
---|
126 | |
---|
127 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
128 | |
---|
129 | 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() , |
---|
130 | #ifdef STATISTICS |
---|
131 | _param_statistics , |
---|
132 | #endif |
---|
133 | *(_param._param_two_level_branch_predictor_2)); |
---|
134 | |
---|
135 | |
---|
136 | _component->set_component (component_Two_Level_Branch_Predictor_2->_component |
---|
137 | #ifdef POSITION |
---|
138 | , 75 |
---|
139 | , 25 |
---|
140 | , 10 |
---|
141 | , 10 |
---|
142 | #endif |
---|
143 | ); |
---|
144 | |
---|
145 | |
---|
146 | |
---|
147 | if (_param._have_meta_predictor) |
---|
148 | { |
---|
149 | // =====[ component_Two_Level_Branch_Predictor_1 ]==================== |
---|
150 | |
---|
151 | name_component = _name+"_Two_Level_Branch_Predictor_1"; |
---|
152 | |
---|
153 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
154 | |
---|
155 | 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() , |
---|
156 | #ifdef STATISTICS |
---|
157 | _param_statistics , |
---|
158 | #endif |
---|
159 | *(_param._param_two_level_branch_predictor_1)); |
---|
160 | |
---|
161 | _component->set_component (component_Two_Level_Branch_Predictor_1->_component |
---|
162 | #ifdef POSITION |
---|
163 | , 75 |
---|
164 | , 25 |
---|
165 | , 10 |
---|
166 | , 10 |
---|
167 | #endif |
---|
168 | ); |
---|
169 | |
---|
170 | // =====[ component_Two_Level_Branch_Predictor_0 ]==================== |
---|
171 | |
---|
172 | name_component = _name+"_Two_Level_Branch_Predictor_0"; |
---|
173 | |
---|
174 | log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str()); |
---|
175 | |
---|
176 | 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() , |
---|
177 | #ifdef STATISTICS |
---|
178 | _param_statistics , |
---|
179 | #endif |
---|
180 | *(_param._param_two_level_branch_predictor_0)); |
---|
181 | |
---|
182 | _component->set_component (component_Two_Level_Branch_Predictor_0->_component |
---|
183 | #ifdef POSITION |
---|
184 | , 75 |
---|
185 | , 25 |
---|
186 | , 10 |
---|
187 | , 10 |
---|
188 | #endif |
---|
189 | ); |
---|
190 | |
---|
191 | } |
---|
192 | |
---|
193 | // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
194 | |
---|
195 | // =====[ component_Meta_Predictor_Glue - Instanciation ]============= |
---|
196 | |
---|
197 | name_component = _name+"_Meta_Predictor_Glue"; |
---|
198 | |
---|
199 | cout << "Instance : " << name_component << endl; |
---|
200 | |
---|
201 | #ifdef POSITION |
---|
202 | _component->interface_map ("Meta_Predictor_Glue","", |
---|
203 | _name ,""); |
---|
204 | #endif |
---|
205 | |
---|
206 | _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" ); |
---|
207 | _component->port_map(name_component, "in_NRESET", _name,"in_NRESET"); |
---|
208 | |
---|
209 | // Interface Predict |
---|
210 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
211 | { |
---|
212 | #ifdef POSITION |
---|
213 | _component->interface_map ("Meta_Predictor_Glue","predict_"+toString(i), |
---|
214 | _name ,"predict_"+toString(i)); |
---|
215 | #endif |
---|
216 | |
---|
217 | if (_param._have_meta_predictor) |
---|
218 | { |
---|
219 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK" , _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_ACK"); |
---|
220 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK" , _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_ACK"); |
---|
221 | } |
---|
222 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK" , _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_ACK"); |
---|
223 | _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_ACK" , _name , "out_PREDICT_"+toString(i)+"_ACK"); |
---|
224 | if (_param._have_meta_predictor) |
---|
225 | { |
---|
226 | if (_param._predictor_0_have_bht) |
---|
227 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY"); |
---|
228 | if (_param._predictor_0_have_pht) |
---|
229 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY"); |
---|
230 | if (_param._predictor_1_have_bht) |
---|
231 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY"); |
---|
232 | if (_param._predictor_1_have_pht) |
---|
233 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY"); |
---|
234 | } |
---|
235 | if (_param._predictor_2_have_bht) |
---|
236 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY"); |
---|
237 | if (_param._predictor_2_have_pht) |
---|
238 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY"); |
---|
239 | _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_HISTORY" , _name , "out_PREDICT_"+toString(i)+"_HISTORY"); |
---|
240 | _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_DIRECTION" , _name , "out_PREDICT_"+toString(i)+"_DIRECTION"); |
---|
241 | } |
---|
242 | |
---|
243 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
244 | { |
---|
245 | #ifdef POSITION |
---|
246 | _component->interface_map ("Meta_Predictor_Glue","branch_complete_"+toString(i), |
---|
247 | _name ,"branch_complete_"+toString(i)); |
---|
248 | #endif |
---|
249 | |
---|
250 | if (_param._have_meta_predictor) |
---|
251 | { |
---|
252 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"); |
---|
253 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL" , _name+"_Two_Level_Branch_Predictor_2", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"); |
---|
254 | |
---|
255 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK" , _name+"_Two_Level_Branch_Predictor_0", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); |
---|
256 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK" , _name+"_Two_Level_Branch_Predictor_1", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); |
---|
257 | } |
---|
258 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK" , _name+"_Two_Level_Branch_Predictor_2", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); |
---|
259 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); |
---|
260 | |
---|
261 | if (_param._have_meta_predictor) |
---|
262 | { |
---|
263 | if (_param._predictor_0_have_bht) |
---|
264 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" ); |
---|
265 | if (_param._predictor_0_have_pht) |
---|
266 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" ); |
---|
267 | if (_param._predictor_1_have_bht) |
---|
268 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" ); |
---|
269 | if (_param._predictor_1_have_pht) |
---|
270 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" ); |
---|
271 | } |
---|
272 | if (_param._predictor_2_have_bht) |
---|
273 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" ); |
---|
274 | if (_param._predictor_2_have_pht) |
---|
275 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" ); |
---|
276 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"); |
---|
277 | if (_param._have_meta_predictor) |
---|
278 | { |
---|
279 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"); |
---|
280 | _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION" , _name+"_Two_Level_Branch_Predictor_2" , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"); |
---|
281 | } |
---|
282 | } |
---|
283 | |
---|
284 | // =====[ component_Two_Level_Branch_Predictor_2 - Instanciation ]==== |
---|
285 | name_component = _name+"_Two_Level_Branch_Predictor_2"; |
---|
286 | |
---|
287 | cout << "Instance : " << name_component << endl; |
---|
288 | |
---|
289 | #ifdef POSITION |
---|
290 | _component->interface_map ("Two_Level_Branch_Predictor_2","", |
---|
291 | _name ,""); |
---|
292 | #endif |
---|
293 | |
---|
294 | _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" ); |
---|
295 | _component->port_map(name_component, "in_NRESET", _name,"in_NRESET"); |
---|
296 | |
---|
297 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
298 | { |
---|
299 | #ifdef POSITION |
---|
300 | _component->interface_map ("Two_Level_Branch_Predictor_2","predict_"+toString(i), |
---|
301 | _name ,"predict_"+toString(i)); |
---|
302 | #endif |
---|
303 | |
---|
304 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL" , _name, "in_PREDICT_"+toString(i)+"_VAL"); |
---|
305 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK"); |
---|
306 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS" , _name, "in_PREDICT_"+toString(i)+"_ADDRESS"); |
---|
307 | if (_param._predictor_2_have_bht) |
---|
308 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY"); |
---|
309 | if (_param._predictor_2_have_pht) |
---|
310 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY"); |
---|
311 | } |
---|
312 | |
---|
313 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
314 | { |
---|
315 | #ifdef POSITION |
---|
316 | _component->interface_map ("Two_Level_Branch_Predictor_2","branch_complete_"+toString(i), |
---|
317 | _name ,"branch_complete_"+toString(i)); |
---|
318 | #endif |
---|
319 | if (_param._have_meta_predictor) |
---|
320 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL" ); |
---|
321 | else |
---|
322 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); |
---|
323 | _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK" ); |
---|
324 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" ); |
---|
325 | if (_param._predictor_2_have_bht) |
---|
326 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" ); |
---|
327 | if (_param._predictor_2_have_pht) |
---|
328 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" ); |
---|
329 | if (_param._have_meta_predictor) |
---|
330 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION" ); |
---|
331 | else |
---|
332 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" ); |
---|
333 | } |
---|
334 | |
---|
335 | if (_param._have_meta_predictor) |
---|
336 | { |
---|
337 | // =====[ component_Two_Level_Branch_Predictor_1 - Instanciation ]==== |
---|
338 | |
---|
339 | name_component = _name+"_Two_Level_Branch_Predictor_1"; |
---|
340 | |
---|
341 | cout << "Instance : " << name_component << endl; |
---|
342 | |
---|
343 | #ifdef POSITION |
---|
344 | _component->interface_map ("Two_Level_Branch_Predictor_1","", |
---|
345 | _name ,""); |
---|
346 | #endif |
---|
347 | |
---|
348 | _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" ); |
---|
349 | _component->port_map(name_component, "in_NRESET", _name,"in_NRESET"); |
---|
350 | |
---|
351 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
352 | { |
---|
353 | #ifdef POSITION |
---|
354 | _component->interface_map ("Two_Level_Branch_Predictor_1","predict_"+toString(i), |
---|
355 | _name ,"predict_"+toString(i)); |
---|
356 | #endif |
---|
357 | |
---|
358 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL" , _name, "in_PREDICT_"+toString(i)+"_VAL"); |
---|
359 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"); |
---|
360 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS" , _name, "in_PREDICT_"+toString(i)+"_ADDRESS"); |
---|
361 | if (_param._predictor_1_have_bht) |
---|
362 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY"); |
---|
363 | if (_param._predictor_1_have_pht) |
---|
364 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY"); |
---|
365 | } |
---|
366 | |
---|
367 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
368 | { |
---|
369 | #ifdef POSITION |
---|
370 | _component->interface_map ("Two_Level_Branch_Predictor_1","branch_complete_"+toString(i), |
---|
371 | _name ,"branch_complete_"+toString(i)); |
---|
372 | #endif |
---|
373 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); |
---|
374 | _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK" ); |
---|
375 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" ); |
---|
376 | if (_param._predictor_1_have_bht) |
---|
377 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" ); |
---|
378 | if (_param._predictor_1_have_pht) |
---|
379 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" ); |
---|
380 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" ); |
---|
381 | } |
---|
382 | // =====[ component_Two_Level_Branch_Predictor_0 - Instanciation ]==== |
---|
383 | |
---|
384 | name_component = _name+"_Two_Level_Branch_Predictor_0"; |
---|
385 | |
---|
386 | cout << "Instance : " << name_component << endl; |
---|
387 | |
---|
388 | #ifdef POSITION |
---|
389 | _component->interface_map ("Two_Level_Branch_Predictor_0","", |
---|
390 | _name ,""); |
---|
391 | #endif |
---|
392 | |
---|
393 | _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" ); |
---|
394 | _component->port_map(name_component, "in_NRESET", _name,"in_NRESET"); |
---|
395 | |
---|
396 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
397 | { |
---|
398 | #ifdef POSITION |
---|
399 | _component->interface_map ("Two_Level_Branch_Predictor_0","predict_"+toString(i), |
---|
400 | _name ,"predict_"+toString(i)); |
---|
401 | #endif |
---|
402 | |
---|
403 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL" , _name, "in_PREDICT_"+toString(i)+"_VAL"); |
---|
404 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK"); |
---|
405 | _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS" , _name, "in_PREDICT_"+toString(i)+"_ADDRESS"); |
---|
406 | if (_param._predictor_0_have_bht) |
---|
407 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY"); |
---|
408 | if (_param._predictor_0_have_pht) |
---|
409 | _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY"); |
---|
410 | } |
---|
411 | |
---|
412 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
413 | { |
---|
414 | #ifdef POSITION |
---|
415 | _component->interface_map ("Two_Level_Branch_Predictor_0","branch_complete_"+toString(i), |
---|
416 | _name ,"branch_complete_"+toString(i)); |
---|
417 | #endif |
---|
418 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); |
---|
419 | _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK" ); |
---|
420 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" ); |
---|
421 | if (_param._predictor_0_have_bht) |
---|
422 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" ); |
---|
423 | if (_param._predictor_0_have_pht) |
---|
424 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" ); |
---|
425 | _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION" ); |
---|
426 | } |
---|
427 | } |
---|
428 | |
---|
429 | log_printf(FUNC,Meta_Predictor,"allocation","End"); |
---|
430 | }; |
---|
431 | |
---|
432 | }; // end namespace meta_predictor |
---|
433 | }; // end namespace predictor |
---|
434 | }; // end namespace stage_1_ifetch |
---|
435 | }; // end namespace behavioural |
---|
436 | }; // end namespace morpheo |
---|
437 | #endif |
---|