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