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