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