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