1 | /* |
---|
2 | * $Id: Prediction_unit_allocation.cpp 119 2009-05-25 17:40:26Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Prediction_unit.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace prediction_unit { |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Prediction_unit::allocation" |
---|
20 | void Prediction_unit::allocation ( |
---|
21 | #ifdef STATISTICS |
---|
22 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
23 | #else |
---|
24 | void |
---|
25 | #endif |
---|
26 | ) |
---|
27 | { |
---|
28 | log_printf(FUNC,Prediction_unit,FUNCTION,"Begin"); |
---|
29 | |
---|
30 | _component = new Component (_usage); |
---|
31 | |
---|
32 | Entity * entity = _component->set_entity (_name |
---|
33 | ,"Prediction_unit" |
---|
34 | #ifdef POSITION |
---|
35 | ,COMBINATORY |
---|
36 | #endif |
---|
37 | ); |
---|
38 | |
---|
39 | _interfaces = entity->set_interfaces(); |
---|
40 | |
---|
41 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
42 | { |
---|
43 | Interface * interface = _interfaces->set_interface("" |
---|
44 | #ifdef POSITION |
---|
45 | ,IN |
---|
46 | ,SOUTH, |
---|
47 | _("Generalist interface") |
---|
48 | #endif |
---|
49 | ); |
---|
50 | |
---|
51 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
52 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
53 | } |
---|
54 | |
---|
55 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
56 | { |
---|
57 | { |
---|
58 | ALLOC1_INTERFACE_BEGIN("predict",IN,SOUTH,_("Interface with ifetch unit"),_param->_nb_context); |
---|
59 | |
---|
60 | ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); |
---|
61 | ALLOC1_VALACK_OUT(out_PREDICT_ACK ,ACK); |
---|
62 | ALLOC1_SIGNAL_IN ( in_PREDICT_PC_PREVIOUS ,"pc_previous" ,Taddress_t ,_param->_size_address); |
---|
63 | ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT ,"pc_current" ,Taddress_t ,_param->_size_address); |
---|
64 | ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT_IS_DS_TAKE ,"pc_current_is_ds_take" ,Tcontrol_t ,1); |
---|
65 | ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT ,"pc_next" ,Taddress_t ,_param->_size_address); |
---|
66 | ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT_IS_DS_TAKE ,"pc_next_is_ds_take" ,Tcontrol_t ,1); |
---|
67 | ALLOC1_SIGNAL_OUT(out_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr); |
---|
68 | ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); |
---|
69 | ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); |
---|
70 | |
---|
71 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
72 | } |
---|
73 | { |
---|
74 | ALLOC2_INTERFACE_BEGIN("predict",IN,SOUTH,_("Interface with ifetch unit"),_param->_nb_context,_param->_nb_instruction[it1]); |
---|
75 | |
---|
76 | _ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE ,"instruction_enable" ,Tcontrol_t ,1,_param->_nb_context,_param->_nb_instruction[it1]); |
---|
77 | |
---|
78 | ALLOC2_INTERFACE_END(_param->_nb_context,_param->_nb_instruction[it1]); |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
83 | { |
---|
84 | { |
---|
85 | ALLOC2_INTERFACE_BEGIN("decod",IN,SOUTH,_("Interface with decod unit"),_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
86 | |
---|
87 | _ALLOC2_VALACK_IN ( in_DECOD_VAL ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
88 | _ALLOC2_VALACK_OUT(out_DECOD_ACK ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
89 | _ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
90 | _ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR ,"match_inst_ifetch_ptr" ,Tcontrol_t ,1 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
91 | _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
92 | _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
93 | _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION ,"branch_condition" ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
94 | _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION ,"branch_direction" ,Tcontrol_t ,1 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
95 | _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC ,"address_src" ,Taddress_t ,_param->_size_address ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
96 | _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST ,"address_dest" ,Taddress_t ,_param->_size_address ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
97 | _ALLOC2_SIGNAL_OUT(out_DECOD_CAN_CONTINUE ,"can_continue" ,Tcontrol_t ,1 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
98 | |
---|
99 | |
---|
100 | ALLOC2_INTERFACE_END(_param->_nb_decod_unit,_param->_nb_inst_decod[it1]); |
---|
101 | } |
---|
102 | } |
---|
103 | |
---|
104 | // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
105 | { |
---|
106 | ALLOC1_INTERFACE_BEGIN("branch_complete", IN,SOUTH, _("branch_complete"), _param->_nb_inst_branch_complete); |
---|
107 | |
---|
108 | ALLOC1_VALACK_IN ( in_BRANCH_COMPLETE_VAL ,VAL); |
---|
109 | ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_ACK ,ACK); |
---|
110 | ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_CONTEXT_ID ,"context_id" ,Tcontext_t,_param->_size_context_id); |
---|
111 | ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); |
---|
112 | ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS ,"address" ,Taddress_t,_param->_size_address); |
---|
113 | ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_NO_SEQUENCE ,"no_sequence" ,Tcontrol_t,1); |
---|
114 | ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1); |
---|
115 | // ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_TAKE ,"take" ,Tcontrol_t,1); |
---|
116 | // ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_SRC ,"address_src" ,Taddress_t,_param->_size_address); |
---|
117 | // ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_DEST ,"address_dest" ,Taddress_t,_param->_size_address); |
---|
118 | |
---|
119 | ALLOC1_INTERFACE_END(_param->_nb_inst_branch_complete); |
---|
120 | } |
---|
121 | |
---|
122 | // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
123 | { |
---|
124 | ALLOC1_INTERFACE_BEGIN("branch_event", IN,SOUTH, _("branch_event"), _param->_nb_context); |
---|
125 | |
---|
126 | ALLOC1_VALACK_OUT(out_BRANCH_EVENT_VAL ,VAL); |
---|
127 | ALLOC1_VALACK_IN ( in_BRANCH_EVENT_ACK ,ACK); |
---|
128 | // ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t,_param->_size_context_id); |
---|
129 | ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); |
---|
130 | // ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_MISS_PREDICTION ,"miss_prediction" ,Tcontrol_t,1); |
---|
131 | ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_SRC ,"address_src" ,Taddress_t,_param->_size_address); |
---|
132 | ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST_VAL ,"address_dest_val",Tcontrol_t,1); |
---|
133 | ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST ,"address_dest" ,Taddress_t,_param->_size_address); |
---|
134 | ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_CAN_CONTINUE ,"can_continue" ,Tcontrol_t,1); |
---|
135 | |
---|
136 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
137 | } |
---|
138 | |
---|
139 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
140 | { |
---|
141 | ALLOC1_INTERFACE_BEGIN("depth",OUT,SOUTH,_("Interface with depth"),_param->_nb_context); |
---|
142 | |
---|
143 | ALLOC1_SIGNAL_OUT(out_DEPTH_VAL ,"val" ,Tcontrol_t,1); |
---|
144 | ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT ,"current" ,Tdepth_t ,_param->_size_depth); |
---|
145 | ALLOC1_SIGNAL_OUT(out_DEPTH_MIN ,"min" ,Tdepth_t ,_param->_size_depth); |
---|
146 | ALLOC1_SIGNAL_OUT(out_DEPTH_MAX ,"max" ,Tdepth_t ,_param->_size_depth); |
---|
147 | ALLOC1_SIGNAL_OUT(out_DEPTH_FULL ,"full" ,Tcontrol_t,1); |
---|
148 | |
---|
149 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
150 | } |
---|
151 | |
---|
152 | // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
153 | { |
---|
154 | ALLOC1_INTERFACE_BEGIN("event", IN,SOUTH,_("event"), _param->_nb_context); |
---|
155 | |
---|
156 | ALLOC1_VALACK_IN ( in_EVENT_VAL ,VAL); |
---|
157 | ALLOC1_VALACK_OUT(out_EVENT_ACK ,ACK); |
---|
158 | ALLOC1_SIGNAL_IN ( in_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type ); |
---|
159 | ALLOC1_SIGNAL_IN ( in_EVENT_DEPTH ,"depth",Tdepth_t ,_param->_size_depth ); |
---|
160 | |
---|
161 | ALLOC1_INTERFACE_END(_param->_nb_context); |
---|
162 | } |
---|
163 | |
---|
164 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
165 | std::string name; |
---|
166 | |
---|
167 | { |
---|
168 | name = _name+"_branch_target_buffer"; |
---|
169 | log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); |
---|
170 | |
---|
171 | _component_btb = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer::Branch_Target_Buffer |
---|
172 | (name.c_str() |
---|
173 | #ifdef STATISTICS |
---|
174 | ,param_statistics |
---|
175 | #endif |
---|
176 | ,_param->_param_btb |
---|
177 | ,_usage); |
---|
178 | |
---|
179 | _component->set_component (_component_btb->_component |
---|
180 | #ifdef POSITION |
---|
181 | , 50, 50, 10, 10 |
---|
182 | #endif |
---|
183 | ); |
---|
184 | } |
---|
185 | |
---|
186 | { |
---|
187 | name = _name+"_direction"; |
---|
188 | log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); |
---|
189 | |
---|
190 | _component_dir = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::Direction |
---|
191 | (name.c_str() |
---|
192 | #ifdef STATISTICS |
---|
193 | ,param_statistics |
---|
194 | #endif |
---|
195 | ,_param->_param_dir |
---|
196 | ,_usage); |
---|
197 | |
---|
198 | _component->set_component (_component_dir->_component |
---|
199 | #ifdef POSITION |
---|
200 | , 50, 50, 10, 10 |
---|
201 | #endif |
---|
202 | ); |
---|
203 | } |
---|
204 | |
---|
205 | { |
---|
206 | name = _name+"_return_address_stack"; |
---|
207 | log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); |
---|
208 | |
---|
209 | _component_ras = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Return_Address_Stack |
---|
210 | (name.c_str() |
---|
211 | #ifdef STATISTICS |
---|
212 | ,param_statistics |
---|
213 | #endif |
---|
214 | ,_param->_param_ras |
---|
215 | ,_usage); |
---|
216 | |
---|
217 | _component->set_component (_component_ras->_component |
---|
218 | #ifdef POSITION |
---|
219 | , 50, 50, 10, 10 |
---|
220 | #endif |
---|
221 | ); |
---|
222 | } |
---|
223 | |
---|
224 | { |
---|
225 | name = _name+"_update_prediction_table"; |
---|
226 | log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); |
---|
227 | |
---|
228 | _component_upt = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::Update_Prediction_Table |
---|
229 | (name.c_str() |
---|
230 | #ifdef STATISTICS |
---|
231 | ,param_statistics |
---|
232 | #endif |
---|
233 | ,_param->_param_upt |
---|
234 | ,_usage); |
---|
235 | |
---|
236 | _component->set_component (_component_upt->_component |
---|
237 | #ifdef POSITION |
---|
238 | , 50, 50, 10, 10 |
---|
239 | #endif |
---|
240 | ); |
---|
241 | } |
---|
242 | |
---|
243 | { |
---|
244 | name = _name+"_prediction_unit_glue"; |
---|
245 | log_printf(INFO,Prediction_unit,FUNCTION,_("Create : %s"),name.c_str()); |
---|
246 | |
---|
247 | _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Prediction_unit_Glue |
---|
248 | (name.c_str() |
---|
249 | #ifdef STATISTICS |
---|
250 | ,param_statistics |
---|
251 | #endif |
---|
252 | ,_param->_param_glue |
---|
253 | ,_usage); |
---|
254 | |
---|
255 | _component->set_component (_component_glue->_component |
---|
256 | #ifdef POSITION |
---|
257 | , 50, 50, 10, 10 |
---|
258 | #endif |
---|
259 | ); |
---|
260 | } |
---|
261 | |
---|
262 | // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
263 | std::string src,dest; |
---|
264 | |
---|
265 | // =================================================================== |
---|
266 | // =====[ branch_target_buffer ]====================================== |
---|
267 | // =================================================================== |
---|
268 | { |
---|
269 | src = _name+"_branch_target_buffer"; |
---|
270 | log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); |
---|
271 | |
---|
272 | { |
---|
273 | dest = _name; |
---|
274 | #ifdef POSITION |
---|
275 | _component->interface_map (src ,"", |
---|
276 | dest,""); |
---|
277 | #endif |
---|
278 | PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); |
---|
279 | PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); |
---|
280 | } |
---|
281 | |
---|
282 | for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++) |
---|
283 | { |
---|
284 | dest = _name+"_prediction_unit_glue"; |
---|
285 | #ifdef POSITION |
---|
286 | _component->interface_map (src ,"predict_"+toString(i), |
---|
287 | dest,"predict_btb_"+toString(i)); |
---|
288 | #endif |
---|
289 | |
---|
290 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_VAL" , |
---|
291 | dest,"out_PREDICT_BTB_"+toString(i)+"_VAL" ); |
---|
292 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ACK" , |
---|
293 | dest, "in_PREDICT_BTB_"+toString(i)+"_ACK" ); |
---|
294 | if (_param->_have_port_context_id) |
---|
295 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_CONTEXT_ID" , |
---|
296 | dest,"out_PREDICT_BTB_"+toString(i)+"_CONTEXT_ID" ); |
---|
297 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_ADDRESS" , |
---|
298 | dest,"out_PREDICT_BTB_"+toString(i)+"_ADDRESS" ); |
---|
299 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_HIT" , |
---|
300 | dest, "in_PREDICT_BTB_"+toString(i)+"_HIT" ); |
---|
301 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ADDRESS_SRC" , |
---|
302 | dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_SRC" ); |
---|
303 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ADDRESS_DEST", |
---|
304 | dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_DEST"); |
---|
305 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_CONDITION" , |
---|
306 | dest, "in_PREDICT_BTB_"+toString(i)+"_CONDITION" ); |
---|
307 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_IS_ACCURATE" , |
---|
308 | dest, "in_PREDICT_BTB_"+toString(i)+"_IS_ACCURATE" ); |
---|
309 | |
---|
310 | dest = _name+"_direction"; |
---|
311 | COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_LAST_TAKE" , |
---|
312 | dest, "in_PREDICT_"+toString(i)+"_LAST_TAKE" ); |
---|
313 | } |
---|
314 | |
---|
315 | for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++) |
---|
316 | { |
---|
317 | dest = _name+"_prediction_unit_glue"; |
---|
318 | #ifdef POSITION |
---|
319 | _component->interface_map (src ,"decod_"+toString(i), |
---|
320 | dest,"decod_btb_"+toString(i)); |
---|
321 | #endif |
---|
322 | |
---|
323 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_VAL" , |
---|
324 | dest,"out_DECOD_BTB_"+toString(i)+"_VAL" ); |
---|
325 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_ACK" , |
---|
326 | dest, "in_DECOD_BTB_"+toString(i)+"_ACK" ); |
---|
327 | if (_param->_have_port_context_id) |
---|
328 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_CONTEXT_ID" , |
---|
329 | dest,"out_DECOD_BTB_"+toString(i)+"_CONTEXT_ID" ); |
---|
330 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_ADDRESS_SRC" , |
---|
331 | dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_SRC" ); |
---|
332 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_ADDRESS_DEST" , |
---|
333 | dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_DEST" ); |
---|
334 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_CONDITION" , |
---|
335 | dest,"out_DECOD_BTB_"+toString(i)+"_CONDITION" ); |
---|
336 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_LAST_TAKE" , |
---|
337 | dest,"out_DECOD_BTB_"+toString(i)+"_LAST_TAKE" ); |
---|
338 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_MISS_PREDICTION", |
---|
339 | dest,"out_DECOD_BTB_"+toString(i)+"_MISS_PREDICTION"); |
---|
340 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_IS_ACCURATE" , |
---|
341 | dest,"out_DECOD_BTB_"+toString(i)+"_IS_ACCURATE" ); |
---|
342 | } |
---|
343 | |
---|
344 | for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++) |
---|
345 | { |
---|
346 | dest = _name+"_prediction_unit_glue"; |
---|
347 | |
---|
348 | COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(i)+"_VAL", |
---|
349 | dest,"out_UPDATE_BTB_"+toString(i)+"_VAL"); |
---|
350 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_ACK", |
---|
351 | dest, "in_UPDATE_BTB_"+toString(i)+"_ACK"); |
---|
352 | |
---|
353 | dest = _name+"_update_prediction_table"; |
---|
354 | #ifdef POSITION |
---|
355 | _component->interface_map (src ,"update_"+toString(i), |
---|
356 | dest,"update_"+toString(i)); |
---|
357 | #endif |
---|
358 | |
---|
359 | if (_param->_have_port_context_id) |
---|
360 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_CONTEXT_ID" , |
---|
361 | dest,"out_UPDATE_"+toString(i)+ "_CONTEXT_ID" ); |
---|
362 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_ADDRESS_SRC" , |
---|
363 | dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC" ); |
---|
364 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_ADDRESS_DEST" , |
---|
365 | dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_DEST" ); |
---|
366 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_CONDITION" , |
---|
367 | dest,"out_UPDATE_"+toString(i)+"_BTB_CONDITION" ); |
---|
368 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_LAST_TAKE" , |
---|
369 | dest,"out_UPDATE_"+toString(i)+ "_DIRECTION_GOOD" ); |
---|
370 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_MISS_PREDICTION", |
---|
371 | dest,"out_UPDATE_"+toString(i)+ "_MISS_PREDICTION"); |
---|
372 | } |
---|
373 | } |
---|
374 | |
---|
375 | // =================================================================== |
---|
376 | // =====[ direction ]================================================= |
---|
377 | // =================================================================== |
---|
378 | { |
---|
379 | src = _name+"_direction"; |
---|
380 | log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); |
---|
381 | |
---|
382 | { |
---|
383 | dest = _name; |
---|
384 | #ifdef POSITION |
---|
385 | _component->interface_map (src ,"", |
---|
386 | dest,""); |
---|
387 | #endif |
---|
388 | PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); |
---|
389 | PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); |
---|
390 | } |
---|
391 | |
---|
392 | for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++) |
---|
393 | { |
---|
394 | dest = _name+"_prediction_unit_glue"; |
---|
395 | #ifdef POSITION |
---|
396 | _component->interface_map (src ,"predict_"+toString(i), |
---|
397 | dest,"predict_dir_"+toString(i)); |
---|
398 | #endif |
---|
399 | |
---|
400 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_VAL" , |
---|
401 | dest,"out_PREDICT_DIR_"+toString(i)+"_VAL" ); |
---|
402 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ACK" , |
---|
403 | dest, "in_PREDICT_DIR_"+toString(i)+"_ACK" ); |
---|
404 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_ADDRESS_SRC", |
---|
405 | dest,"out_PREDICT_DIR_"+toString(i)+"_ADDRESS_SRC"); |
---|
406 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_STATIC" , |
---|
407 | dest,"out_PREDICT_DIR_"+toString(i)+"_STATIC" ); |
---|
408 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_DIRECTION" , |
---|
409 | dest, "in_PREDICT_DIR_"+toString(i)+"_DIRECTION" ); |
---|
410 | |
---|
411 | dest = _name+"_update_prediction_table"; |
---|
412 | if (_param->_have_port_history) |
---|
413 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_HISTORY" , |
---|
414 | dest, "in_PREDICT_" +toString(i)+"_DIR_HISTORY" ); |
---|
415 | //out_PREDICT_DIR_LAST_TAKE - component_map branch_target_buffer |
---|
416 | } |
---|
417 | |
---|
418 | for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++) |
---|
419 | { |
---|
420 | dest = _name+"_prediction_unit_glue"; |
---|
421 | |
---|
422 | COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(i)+"_VAL", |
---|
423 | dest,"out_UPDATE_DIR_"+toString(i)+"_VAL"); |
---|
424 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_ACK", |
---|
425 | dest, "in_UPDATE_DIR_"+toString(i)+"_ACK"); |
---|
426 | |
---|
427 | dest = _name+"_update_prediction_table"; |
---|
428 | #ifdef POSITION |
---|
429 | _component->interface_map (src ,"update_"+toString(i), |
---|
430 | dest,"update_"+toString(i)); |
---|
431 | #endif |
---|
432 | |
---|
433 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_ADDRESS" , |
---|
434 | dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC"); |
---|
435 | if (_param->_have_port_history) |
---|
436 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_HISTORY" , |
---|
437 | dest,"out_UPDATE_"+toString(i)+"_DIR_HISTORY" ); |
---|
438 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_DIRECTION", |
---|
439 | dest,"out_UPDATE_"+toString(i)+ "_DIRECTION_GOOD"); |
---|
440 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_PREDICTION_IFETCH", |
---|
441 | dest,"out_UPDATE_"+toString(i)+ "_PREDICTION_IFETCH"); |
---|
442 | } |
---|
443 | } |
---|
444 | |
---|
445 | // =================================================================== |
---|
446 | // =====[ return_address_stack ]====================================== |
---|
447 | // =================================================================== |
---|
448 | { |
---|
449 | src = _name+"_return_address_stack"; |
---|
450 | log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); |
---|
451 | |
---|
452 | |
---|
453 | { |
---|
454 | dest = _name; |
---|
455 | #ifdef POSITION |
---|
456 | _component->interface_map (src ,"", |
---|
457 | dest,""); |
---|
458 | #endif |
---|
459 | PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); |
---|
460 | PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); |
---|
461 | } |
---|
462 | |
---|
463 | for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++) |
---|
464 | { |
---|
465 | dest = _name+"_prediction_unit_glue"; |
---|
466 | #ifdef POSITION |
---|
467 | _component->interface_map (src ,"predict_"+toString(i), |
---|
468 | dest,"predict_dir_"+toString(i)); |
---|
469 | #endif |
---|
470 | |
---|
471 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_VAL" , |
---|
472 | dest,"out_PREDICT_RAS_"+toString(i)+"_VAL" ); |
---|
473 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ACK" , |
---|
474 | dest, "in_PREDICT_RAS_"+toString(i)+"_ACK" ); |
---|
475 | if (_param->_have_port_context_id) |
---|
476 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_CONTEXT_ID" , |
---|
477 | dest,"out_PREDICT_RAS_"+toString(i)+"_CONTEXT_ID" ); |
---|
478 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_HIT" , |
---|
479 | dest, "in_PREDICT_RAS_"+toString(i)+"_HIT" ); |
---|
480 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_PUSH" , |
---|
481 | dest,"out_PREDICT_RAS_"+toString(i)+"_PUSH" ); |
---|
482 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_ADDRESS_PUSH", |
---|
483 | dest,"out_PREDICT_RAS_"+toString(i)+"_ADDRESS_PUSH"); |
---|
484 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ADDRESS_POP" , |
---|
485 | dest, "in_PREDICT_RAS_"+toString(i)+"_ADDRESS_POP" ); |
---|
486 | |
---|
487 | dest = _name+"_update_prediction_table"; |
---|
488 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_INDEX", |
---|
489 | dest, "in_PREDICT_" +toString(i)+"_RAS_INDEX"); |
---|
490 | } |
---|
491 | |
---|
492 | for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++) |
---|
493 | { |
---|
494 | dest = _name+"_prediction_unit_glue"; |
---|
495 | #ifdef POSITION |
---|
496 | _component->interface_map (src ,"decod_"+toString(i), |
---|
497 | dest,"decod_ras_"+toString(i)); |
---|
498 | #endif |
---|
499 | |
---|
500 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_VAL" , |
---|
501 | dest,"out_DECOD_RAS_"+toString(i)+"_VAL" ); |
---|
502 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_ACK" , |
---|
503 | dest, "in_DECOD_RAS_"+toString(i)+"_ACK" ); |
---|
504 | if (_param->_have_port_context_id) |
---|
505 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_CONTEXT_ID" , |
---|
506 | dest,"out_DECOD_RAS_"+toString(i)+"_CONTEXT_ID" ); |
---|
507 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_HIT" , |
---|
508 | dest, "in_DECOD_RAS_"+toString(i)+"_HIT" ); |
---|
509 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_PUSH" , |
---|
510 | dest,"out_DECOD_RAS_"+toString(i)+"_PUSH" ); |
---|
511 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_ADDRESS_PUSH" , |
---|
512 | dest,"out_DECOD_RAS_"+toString(i)+"_ADDRESS_PUSH" ); |
---|
513 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_ADDRESS_POP" , |
---|
514 | dest, "in_DECOD_RAS_"+toString(i)+"_ADDRESS_POP" ); |
---|
515 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_MISS_PREDICTION", |
---|
516 | dest,"out_DECOD_RAS_"+toString(i)+"_MISS_PREDICTION"); |
---|
517 | |
---|
518 | dest = _name+"_update_prediction_table"; |
---|
519 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_INDEX" , |
---|
520 | dest, "in_DECOD_" +toString(i)+"_RAS_INDEX" ); |
---|
521 | } |
---|
522 | |
---|
523 | for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++) |
---|
524 | { |
---|
525 | dest = _name+"_prediction_unit_glue"; |
---|
526 | |
---|
527 | COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(i)+"_VAL", |
---|
528 | dest,"out_UPDATE_RAS_"+toString(i)+"_VAL"); |
---|
529 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_ACK", |
---|
530 | dest, "in_UPDATE_RAS_"+toString(i)+"_ACK"); |
---|
531 | |
---|
532 | dest = _name+"_update_prediction_table"; |
---|
533 | #ifdef POSITION |
---|
534 | _component->interface_map (src ,"update_"+toString(i), |
---|
535 | dest,"update_"+toString(i)); |
---|
536 | #endif |
---|
537 | |
---|
538 | if (_param->_have_port_context_id) |
---|
539 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_CONTEXT_ID" , |
---|
540 | dest,"out_UPDATE_"+toString(i)+ "_CONTEXT_ID" ); |
---|
541 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_PUSH" , |
---|
542 | dest,"out_UPDATE_"+toString(i)+"_RAS_PUSH" ); |
---|
543 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_FLUSH" , |
---|
544 | dest,"out_UPDATE_"+toString(i)+"_RAS_FLUSH" ); |
---|
545 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_ADDRESS" , |
---|
546 | dest,"out_UPDATE_"+toString(i)+"_RAS_ADDRESS" ); |
---|
547 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_INDEX" , |
---|
548 | dest,"out_UPDATE_"+toString(i)+"_RAS_INDEX" ); |
---|
549 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_MISS_PREDICTION" , |
---|
550 | dest,"out_UPDATE_"+toString(i)+ "_MISS_PREDICTION" ); |
---|
551 | COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+ "_PREDICTION_IFETCH", |
---|
552 | dest,"out_UPDATE_"+toString(i)+ "_PREDICTION_IFETCH"); |
---|
553 | } |
---|
554 | } |
---|
555 | |
---|
556 | // =================================================================== |
---|
557 | // =====[ update_prediction_table ]=================================== |
---|
558 | // =================================================================== |
---|
559 | { |
---|
560 | src = _name+"_update_prediction_table"; |
---|
561 | log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); |
---|
562 | |
---|
563 | { |
---|
564 | dest = _name; |
---|
565 | #ifdef POSITION |
---|
566 | _component->interface_map (src ,"", |
---|
567 | dest,""); |
---|
568 | #endif |
---|
569 | PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); |
---|
570 | PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); |
---|
571 | } |
---|
572 | |
---|
573 | for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++) |
---|
574 | { |
---|
575 | dest = _name+"_prediction_unit_glue"; |
---|
576 | #ifdef POSITION |
---|
577 | _component->interface_map (src ,"predict_"+toString(i), |
---|
578 | dest,"predict_dir_"+toString(i)); |
---|
579 | #endif |
---|
580 | |
---|
581 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_VAL" , |
---|
582 | dest,"out_PREDICT_UPT_"+toString(i)+"_VAL" ); |
---|
583 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+"_ACK" , |
---|
584 | dest, "in_PREDICT_UPT_"+toString(i)+"_ACK" ); |
---|
585 | if (_param->_have_port_context_id) |
---|
586 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_CONTEXT_ID" , |
---|
587 | dest,"out_PREDICT_UPT_"+toString(i)+"_CONTEXT_ID" ); |
---|
588 | if (_param->_have_port_depth) |
---|
589 | COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(i)+ "_UPDATE_PREDICTION_ID", |
---|
590 | dest, "in_PREDICT_UPT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID"); |
---|
591 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_BTB_ADDRESS_SRC" , |
---|
592 | dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" ); |
---|
593 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_BTB_ADDRESS_DEST", |
---|
594 | dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_DEST"); |
---|
595 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_BTB_CONDITION" , |
---|
596 | dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_CONDITION" ); |
---|
597 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_BTB_LAST_TAKE" , |
---|
598 | dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_LAST_TAKE" ); |
---|
599 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_BTB_IS_ACCURATE" , |
---|
600 | dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_IS_ACCURATE" ); |
---|
601 | COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(i)+"_RAS_ADDRESS" , |
---|
602 | dest,"out_PREDICT_UPT_"+toString(i)+"_RAS_ADDRESS" ); |
---|
603 | |
---|
604 | //out_PREDICT_HISTORY - component_map direction |
---|
605 | // in_PREDICT_RAS_INDEX - component_map return_address_stack |
---|
606 | } |
---|
607 | |
---|
608 | for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++) |
---|
609 | { |
---|
610 | dest = _name+"_prediction_unit_glue"; |
---|
611 | |
---|
612 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_VAL" , |
---|
613 | dest,"out_DECOD_UPT_"+toString(i)+"_VAL" ); |
---|
614 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_ACK" , |
---|
615 | dest, "in_DECOD_UPT_"+toString(i)+"_ACK" ); |
---|
616 | if (_param->_have_port_context_id) |
---|
617 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_CONTEXT_ID" , |
---|
618 | dest,"out_DECOD_UPT_"+toString(i)+"_CONTEXT_ID" ); |
---|
619 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_BTB_ADDRESS_SRC" , |
---|
620 | dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" ); |
---|
621 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_BTB_ADDRESS_DEST" , |
---|
622 | dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_DEST" ); |
---|
623 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_BTB_CONDITION" , |
---|
624 | dest,"out_DECOD_UPT_"+toString(i)+"_BTB_CONDITION" ); |
---|
625 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_BTB_LAST_TAKE" , |
---|
626 | dest,"out_DECOD_UPT_"+toString(i)+"_BTB_LAST_TAKE" ); |
---|
627 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_RAS_ADDRESS" , |
---|
628 | dest,"out_DECOD_UPT_"+toString(i)+"_RAS_ADDRESS" ); |
---|
629 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_MISS_IFETCH" , |
---|
630 | dest,"out_DECOD_UPT_"+toString(i)+"_MISS_IFETCH" ); |
---|
631 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_MISS_DECOD" , |
---|
632 | dest,"out_DECOD_UPT_"+toString(i)+"_MISS_DECOD" ); |
---|
633 | if (_param->_have_port_depth) |
---|
634 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_UPDATE_PREDICTION_ID", |
---|
635 | dest,"out_DECOD_UPT_"+toString(i)+"_UPDATE_PREDICTION_ID"); |
---|
636 | COMPONENT_MAP(_component,src , "in_DECOD_" +toString(i)+"_IS_ACCURATE" , |
---|
637 | dest,"out_DECOD_UPT_"+toString(i)+"_IS_ACCURATE" ); |
---|
638 | COMPONENT_MAP(_component,src ,"out_DECOD_" +toString(i)+"_CAN_CONTINUE" , |
---|
639 | dest, "in_DECOD_UPT_"+toString(i)+"_CAN_CONTINUE" ); |
---|
640 | |
---|
641 | //out_DECOD_UPT_RAS_INDEX - component_map return_address_stack |
---|
642 | } |
---|
643 | |
---|
644 | for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++) |
---|
645 | { |
---|
646 | dest = _name+"_prediction_unit_glue"; |
---|
647 | |
---|
648 | #ifdef POSITION |
---|
649 | _component->interface_map (src ,"update_"+toString(i), |
---|
650 | dest,"update_upt_"+toString(i)); |
---|
651 | #endif |
---|
652 | |
---|
653 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_VAL", |
---|
654 | dest, "in_UPDATE_UPT_"+toString(i)+"_VAL"); |
---|
655 | COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(i)+"_ACK", |
---|
656 | dest,"out_UPDATE_UPT_"+toString(i)+"_ACK"); |
---|
657 | |
---|
658 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_BTB_VAL", |
---|
659 | dest, "in_UPDATE_UPT_"+toString(i)+"_BTB_VAL"); |
---|
660 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_DIR_VAL", |
---|
661 | dest, "in_UPDATE_UPT_"+toString(i)+"_DIR_VAL"); |
---|
662 | COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(i)+"_RAS_VAL", |
---|
663 | dest, "in_UPDATE_UPT_"+toString(i)+"_RAS_VAL"); |
---|
664 | |
---|
665 | //in_UPDATE_UPT_CONTEXT_ID - component_map branch_target_buffer |
---|
666 | //in_UPDATE_UPT_MISS_PREDICTION - component_map branch_target_buffer |
---|
667 | //in_UPDATE_UPT_DIRECTION_GOOD - component_map branch_target_buffer |
---|
668 | //in_UPDATE_UPT_BTB_ADDRESS_SRC - component_map branch_target_buffer |
---|
669 | //in_UPDATE_UPT_BTB_ADDRESS_DEST - component_map branch_target_buffer |
---|
670 | //in_UPDATE_UPT_BTB_CONDITION - component_map branch_target_buffer |
---|
671 | //in_UPDATE_UPT_DIR_HISTORY - component_map direction |
---|
672 | //in_UPDATE_UPT_RAS_ADDRESS - component_map return_address_stack |
---|
673 | //in_UPDATE_UPT_RAS_PUSH - component_map return_address_stack |
---|
674 | //in_UPDATE_UPT_RAS_FLUSH - component_map return_address_stack |
---|
675 | //in_UPDATE_UPT_RAS_INDEX - component_map return_address_stack |
---|
676 | //in_UPDATE_UPT_PREDICTION_IFETCH - component_map return_address_stack, direction |
---|
677 | } |
---|
678 | |
---|
679 | for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) |
---|
680 | { |
---|
681 | dest = _name; |
---|
682 | |
---|
683 | #ifdef POSITION |
---|
684 | _component->interface_map (src ,"complete_"+toString(i), |
---|
685 | dest,"complete_"+toString(i)); |
---|
686 | #endif |
---|
687 | |
---|
688 | PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" , |
---|
689 | dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL" ); |
---|
690 | PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" , |
---|
691 | dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK" ); |
---|
692 | if (_param->_have_port_context_id) |
---|
693 | PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID" , |
---|
694 | dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID" ); |
---|
695 | if (_param->_have_port_depth) |
---|
696 | PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH" , |
---|
697 | dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH" ); |
---|
698 | PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , |
---|
699 | dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" ); |
---|
700 | PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE" , |
---|
701 | dest, "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE" ); |
---|
702 | PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION", |
---|
703 | dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION"); |
---|
704 | // PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE" , |
---|
705 | // dest,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE" ); |
---|
706 | // PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" , |
---|
707 | // dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC" ); |
---|
708 | // PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST" , |
---|
709 | // dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST" ); |
---|
710 | } |
---|
711 | |
---|
712 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
713 | { |
---|
714 | dest = _name; |
---|
715 | |
---|
716 | #ifdef POSITION |
---|
717 | _component->interface_map (src ,"branch_event_"+toString(i), |
---|
718 | dest,"branch_event_"+toString(i)); |
---|
719 | #endif |
---|
720 | |
---|
721 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_VAL" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_VAL" ); |
---|
722 | PORT_MAP(_component,src , "in_BRANCH_EVENT_"+toString(i)+"_ACK" ,dest, "in_BRANCH_EVENT_"+toString(i)+"_ACK" ); |
---|
723 | if (_param->_have_port_depth) |
---|
724 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH" ); |
---|
725 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC" ); |
---|
726 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL",dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL"); |
---|
727 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST" ); |
---|
728 | PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_CAN_CONTINUE" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_CAN_CONTINUE" ); |
---|
729 | } |
---|
730 | |
---|
731 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
732 | { |
---|
733 | dest = _name; |
---|
734 | |
---|
735 | #ifdef POSITION |
---|
736 | _component->interface_map (src ,"event_"+toString(i), |
---|
737 | dest,"event_"+toString(i)); |
---|
738 | #endif |
---|
739 | |
---|
740 | PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_VAL" ,dest, "in_EVENT_"+toString(i)+"_VAL" ); |
---|
741 | PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ACK" ,dest,"out_EVENT_"+toString(i)+"_ACK" ); |
---|
742 | PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_TYPE" ,dest, "in_EVENT_"+toString(i)+"_TYPE" ); |
---|
743 | if (_param->_have_port_depth) |
---|
744 | PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_DEPTH",dest, "in_EVENT_"+toString(i)+"_DEPTH"); |
---|
745 | } |
---|
746 | |
---|
747 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
748 | { |
---|
749 | dest = _name; |
---|
750 | #ifdef POSITION |
---|
751 | _component->interface_map (src ,"depth_"+toString(i), |
---|
752 | dest,"depth_"+toString(i)); |
---|
753 | #endif |
---|
754 | |
---|
755 | PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_VAL", |
---|
756 | dest,"out_DEPTH_"+toString(i)+"_VAL"); |
---|
757 | PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_FULL", |
---|
758 | dest,"out_DEPTH_"+toString(i)+"_FULL"); |
---|
759 | if (_param->_have_port_depth) |
---|
760 | { |
---|
761 | PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_CURRENT", |
---|
762 | dest,"out_DEPTH_"+toString(i)+"_CURRENT"); |
---|
763 | PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN", |
---|
764 | dest,"out_DEPTH_"+toString(i)+"_MIN"); |
---|
765 | PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX", |
---|
766 | dest,"out_DEPTH_"+toString(i)+"_MAX"); |
---|
767 | } |
---|
768 | } |
---|
769 | |
---|
770 | // for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
771 | // { |
---|
772 | // dest = _name+"_prediction_unit_glue"; |
---|
773 | |
---|
774 | // #ifdef POSITION |
---|
775 | // _component->interface_map (src ,"depth_"+toString(i), |
---|
776 | // dest,"depth_"+toString(i)); |
---|
777 | // #endif |
---|
778 | |
---|
779 | // COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+ "_NB_BRANCH", |
---|
780 | // dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH"); |
---|
781 | |
---|
782 | // if (_param->_have_port_depth) |
---|
783 | // COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+ "_TAIL" , |
---|
784 | // dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL" ); |
---|
785 | // } |
---|
786 | } |
---|
787 | |
---|
788 | // =================================================================== |
---|
789 | // =====[ prediction_unit_glue ]====================================== |
---|
790 | // =================================================================== |
---|
791 | { |
---|
792 | src = _name+"_prediction_unit_glue"; |
---|
793 | log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); |
---|
794 | |
---|
795 | { |
---|
796 | dest = _name; |
---|
797 | #ifdef POSITION |
---|
798 | _component->interface_map (src ,"", |
---|
799 | dest,""); |
---|
800 | #endif |
---|
801 | |
---|
802 | PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); |
---|
803 | PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); |
---|
804 | } |
---|
805 | |
---|
806 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
807 | { |
---|
808 | dest = _name; |
---|
809 | #ifdef POSITION |
---|
810 | _component->interface_map (src ,"predict_"+toString(i), |
---|
811 | dest,"predict_"+toString(i)); |
---|
812 | #endif |
---|
813 | |
---|
814 | PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_VAL" , |
---|
815 | dest, "in_PREDICT_"+toString(i)+"_VAL" ); |
---|
816 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ACK" , |
---|
817 | dest,"out_PREDICT_"+toString(i)+"_ACK" ); |
---|
818 | PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_PREVIOUS" , |
---|
819 | dest, "in_PREDICT_"+toString(i)+"_PC_PREVIOUS" ); |
---|
820 | PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT" , |
---|
821 | dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT" ); |
---|
822 | PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE" , |
---|
823 | dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE" ); |
---|
824 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT" , |
---|
825 | dest,"out_PREDICT_"+toString(i)+"_PC_NEXT" ); |
---|
826 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE" , |
---|
827 | dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE" ); |
---|
828 | if (_param->_have_port_inst_ifetch_ptr) |
---|
829 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR" , |
---|
830 | dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR" ); |
---|
831 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE" , |
---|
832 | dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE" ); |
---|
833 | if (_param->_have_port_depth) |
---|
834 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID", |
---|
835 | dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID"); |
---|
836 | |
---|
837 | for (uint32_t j=0; j<_param->_nb_instruction[i]; j++) |
---|
838 | { |
---|
839 | dest = _name; |
---|
840 | #ifdef POSITION |
---|
841 | _component->interface_map (src ,"predict_"+toString(i)+"_"+toString(j), |
---|
842 | dest,"predict_"+toString(i)+"_"+toString(j)); |
---|
843 | #endif |
---|
844 | |
---|
845 | PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE", |
---|
846 | dest,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE"); |
---|
847 | } |
---|
848 | } |
---|
849 | |
---|
850 | for (uint32_t i=0; i<_param->_nb_decod_unit; i++) |
---|
851 | for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++) |
---|
852 | { |
---|
853 | dest = _name; |
---|
854 | #ifdef POSITION |
---|
855 | _component->interface_map (src ,"decod_"+toString(i), |
---|
856 | dest,"decod_"+toString(i)); |
---|
857 | #endif |
---|
858 | |
---|
859 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL" , |
---|
860 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL" ); |
---|
861 | PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK" , |
---|
862 | dest,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK" ); |
---|
863 | if (_param->_have_port_context_id) |
---|
864 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID" , |
---|
865 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID" ); |
---|
866 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR" , |
---|
867 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR" ); |
---|
868 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE" , |
---|
869 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE" ); |
---|
870 | if (_param->_have_port_depth) |
---|
871 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID", |
---|
872 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID"); |
---|
873 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION" , |
---|
874 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION" ); |
---|
875 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION" , |
---|
876 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION" ); |
---|
877 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC" , |
---|
878 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC" ); |
---|
879 | PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST" , |
---|
880 | dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST" ); |
---|
881 | PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_CAN_CONTINUE" , |
---|
882 | dest,"out_DECOD_"+toString(i)+"_"+toString(j)+"_CAN_CONTINUE" ); |
---|
883 | } |
---|
884 | |
---|
885 | // for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
886 | // { |
---|
887 | // dest = _name; |
---|
888 | // #ifdef POSITION |
---|
889 | // _component->interface_map (src ,"depth_"+toString(i), |
---|
890 | // dest,"depth_"+toString(i)); |
---|
891 | // #endif |
---|
892 | |
---|
893 | // PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH"); |
---|
894 | // if (_param->_have_port_depth) |
---|
895 | // PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL" ,dest,"out_DEPTH_"+toString(i)+"_TAIL" ); |
---|
896 | // } |
---|
897 | } |
---|
898 | |
---|
899 | // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
900 | #if DEBUG_Prediction_unit == true |
---|
901 | _component->test_map(); |
---|
902 | #endif |
---|
903 | |
---|
904 | #ifdef POSITION |
---|
905 | if (usage_is_set(_usage,USE_POSITION)) |
---|
906 | _component->generate_file(); |
---|
907 | #endif |
---|
908 | |
---|
909 | log_printf(FUNC,Prediction_unit,FUNCTION,"End"); |
---|
910 | }; |
---|
911 | |
---|
912 | }; // end namespace prediction_unit |
---|
913 | }; // end namespace front_end |
---|
914 | }; // end namespace multi_front_end |
---|
915 | }; // end namespace core |
---|
916 | |
---|
917 | }; // end namespace behavioural |
---|
918 | }; // end namespace morpheo |
---|