Changeset 44 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
- Timestamp:
- Jul 17, 2007, 4:47:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
r43 r44 18 18 void Two_Level_Branch_Predictor::allocation (void) 19 19 { 20 string rename;21 22 20 log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin"); 23 21 … … 176 174 if (_param._have_bht) 177 175 { 178 cout << "GEU 1" << endl;179 176 #ifdef POSITION 180 177 _component->interface_map (_name+"_Branch_History_Table","", … … 214 211 if (_param._have_pht) 215 212 { 216 cout << "GEU 2" << endl;217 213 #ifdef POSITION 218 214 _component->interface_map (_name+"_Pattern_History_Table","", … … 250 246 251 247 // =====[ component_Two_Level_Branch_Predictor_Glue - Instanciation ]= 252 cout << "GEU 3" << endl;253 248 #ifdef POSITION 254 249 _component->interface_map (_name+"_Two_Level_Branch_Predictor_Glue","", … … 258 253 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_NRESET", _name,"in_NRESET"); 259 254 260 cout << "GEU 3.1" << endl;261 255 for (uint32_t i=0; i<_param._nb_prediction; i++) 262 256 { 263 cout << "GEU 3.1.1" << endl;264 257 if (_param._have_bht) 265 258 { … … 267 260 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" , "in_PREDICT_"+toString(i)+"_ADDRESS"); 268 261 } 269 cout << "GEU 3.1.2" << endl;270 262 if (_param._have_pht) 271 263 { … … 273 265 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS"); 274 266 } 275 cout << "GEU 3.1.3" << endl;276 267 if (_param._have_bht and _param._have_pht) 277 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY"); 278 cout << "GEU 3.1.4.1" << endl; 268 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Branch_History_Table" ,"out_PREDICT_"+toString(i)+"_HISTORY"); 279 269 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_ACK" , _name ,"out_PREDICT_"+toString(i)+"_ACK"); 280 270 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_ADDRESS" , _name , "in_PREDICT_"+toString(i)+"_ADDRESS"); 281 271 } 282 272 283 cout << "GEU 3.2" << endl;284 273 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 285 274 { … … 299 288 _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS" , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"); 300 289 } 301 cout << "GEU 4" << endl;302 290 #ifdef POSITION 303 291 _component->generate_file(); … … 306 294 log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End"); 307 295 }; 308 309 310 311 312 313 314 315 // void Two_Level_Branch_Predictor::allocation (void)316 // {317 // string rename;318 319 // log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");320 321 // _component = new Component ();322 323 // Entity * entity = _component->set_entity (_name324 // #ifdef POSITION325 // ,"Two_Level_Branch_Predictor"326 // ,MIXTE327 // #endif328 // );329 330 // _interfaces = entity->set_interfaces();331 332 // // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~333 // {334 // Interface * interface = _interfaces->set_interface(""335 // #ifdef POSITION336 // , IN337 // , SOUTH338 // , "Generalist interface"339 // #endif340 // );341 342 // in_CLOCK = interface->set_signal_clk ("clock" ,1);343 // in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);344 // }345 346 // // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~347 348 // in_PREDICT_VAL = new SC_IN (Tcontrol_t) * [_param._nb_prediction ];349 // out_PREDICT_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_prediction ];350 // in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction ];351 // if (_param._have_bht)352 // out_PREDICT_BHT_HISTORY = new SC_OUT(Tbht_history_t) * [_param._nb_prediction ];353 // if (_param._have_pht)354 // out_PREDICT_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_prediction ];355 // // if (_param._have_bht)356 // // {357 // // signal_PREDICT_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];358 // // signal_PREDICT_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction];359 // // }360 // // if (_param._have_pht)361 // // {362 // // signal_PREDICT_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];363 // // signal_PREDICT_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction];364 // // }365 366 // for (uint32_t i=0; i<_param._nb_prediction; i++)367 // {368 // rename = "in_PREDICT_VAL_" +toString(i);369 // in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str());370 371 // rename = "out_PREDICT_ACK_" +toString(i);372 // out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str());373 374 // rename = "in_PREDICT_ADDRESS_" +toString(i);375 // in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());376 377 // if (_param._have_bht)378 // {379 // rename = "out_PREDICT_BHT_HISTORY_"+toString(i);380 // out_PREDICT_BHT_HISTORY [i] = new SC_OUT(Tbht_history_t) (rename.c_str());381 // }382 383 // if (_param._have_pht)384 // {385 // rename = "out_PREDICT_PHT_HISTORY_"+toString(i);386 // out_PREDICT_PHT_HISTORY [i] = new SC_OUT(Tpht_history_t) (rename.c_str());387 // }388 389 // // if (_param._have_bht)390 // // {391 // // rename = "signal_PREDICT_BHT_ACK_" +toString(i);392 // // signal_PREDICT_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());393 394 // // rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);395 // // signal_PREDICT_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());396 // // }397 398 // // if (_param._have_pht)399 // // {400 // // rename = "signal_PREDICT_PHT_ACK_" +toString(i);401 // // signal_PREDICT_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());402 403 // // rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i);404 // // signal_PREDICT_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());405 // // }406 // }407 408 // in_BRANCH_COMPLETE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete];409 // out_BRANCH_COMPLETE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_branch_complete];410 // in_BRANCH_COMPLETE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_branch_complete];411 // if (_param._have_bht)412 // in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete];413 // if (_param._have_pht)414 // in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];415 // in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete];416 // // if (_param._have_bht)417 // // {418 // // signal_BRANCH_COMPLETE_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];419 // // signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];420 // // }421 // // if (_param._have_pht)422 // // {423 // // signal_BRANCH_COMPLETE_PHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];424 // // signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete];425 // // }426 427 // for (uint32_t i=0; i<_param._nb_branch_complete; i++)428 // {429 // rename = "in_BRANCH_COMPLETE_VAL_" +toString(i);430 // in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str());431 432 // rename = "out_BRANCH_COMPLETE_ACK_" +toString(i);433 // out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str());434 435 // rename = "in_BRANCH_COMPLETE_ADDRESS_" +toString(i);436 // in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());437 438 // if (_param._have_bht)439 // {440 // rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);441 // in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str());442 // }443 // if (_param._have_pht)444 // {445 // rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);446 // in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str());447 // }448 // rename = "in_BRANCH_COMPLETE_DIRECTION_" +toString(i);449 // in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str());450 // // if (_param._have_bht)451 // // {452 // // rename = "signal_BRANCH_COMPLETE_BHT_ACK_" +toString(i);453 // // signal_BRANCH_COMPLETE_BHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());454 455 // // rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i);456 // // signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());457 // // }458 // // if (_param._have_pht)459 // // {460 // // rename = "signal_BRANCH_COMPLETE_PHT_ACK_" +toString(i);461 // // signal_BRANCH_COMPLETE_PHT_ACK [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());462 463 // // rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i);464 // // signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str());465 // // }466 // }467 468 // // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~469 // string name_component;470 471 // // =====[ component_Branch_History_Table ]============================472 // if (_param._have_bht)473 // {474 // name_component = _name+"_Branch_History_Table";475 476 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());477 478 // component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str() ,479 // #ifdef STATISTICS480 // _param_statistics ,481 // #endif482 // *(_param._param_branch_history_table));483 484 // // Instantiation485 // (*(component_Branch_History_Table->in_CLOCK )) (*(in_CLOCK ));486 // (*(component_Branch_History_Table->in_NRESET)) (*(in_NRESET));487 488 // for (uint32_t i=0; i<_param._nb_prediction; i++)489 // {490 // (*(component_Branch_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i]));491 // (*(component_Branch_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i]));492 // (*(component_Branch_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i]));493 // (*(component_Branch_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i]));494 // }495 496 // for (uint32_t i=0; i<_param._nb_branch_complete; i++)497 // {498 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i]));499 // (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i]));500 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));501 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i]));502 // (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i]));503 // }504 // }505 506 // // =====[ component_Pattern_History_Table ]===========================507 // if (_param._have_pht)508 // {509 // name_component = _name+"_Pattern_History_Table";510 511 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());512 513 // component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str() ,514 // #ifdef STATISTICS515 // _param_statistics ,516 // #endif517 // *(_param._param_pattern_history_table));518 519 // // Instantiation520 // (*(component_Pattern_History_Table->in_CLOCK)) (*(in_CLOCK));521 // (*(component_Pattern_History_Table->in_NRESET)) (*(in_NRESET));522 523 // for (uint32_t i=0; i<_param._nb_prediction; i++)524 // {525 // (*(component_Pattern_History_Table-> in_PREDICT_VAL [i])) (*( in_PREDICT_VAL [i]));526 // (*(component_Pattern_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i]));527 // (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i]));528 // (*(component_Pattern_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_PHT_HISTORY [i]));529 // }530 531 // for (uint32_t i=0; i<_param._nb_branch_complete; i++)532 // {533 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i]));534 // (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i]));535 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));536 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_PHT_HISTORY [i]));537 // (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i]));538 // }539 // }540 541 // // =====[ component_Two_Level_Branch_Predictor_Glue ]===========================542 // name_component = _name+"_Two_Level_Branch_Predictor_Glue";543 544 // log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());545 546 // component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str() ,547 // #ifdef STATISTICS548 // _param_statistics ,549 // #endif550 // *(_param._param_two_level_branch_predictor_glue));551 552 // // Instantiation553 // #if defined(STATISTICS) or defined(VHDL_TESTBENCH)554 // (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK)) (*(in_CLOCK));555 // #endif556 // for (uint32_t i=0; i<_param._nb_prediction; i++)557 // {558 // if (_param._have_bht)559 // {560 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i]));561 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i]));562 // }563 // if (_param._have_pht)564 // {565 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i]));566 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i]));567 // }568 // if (_param._have_bht and _param._have_pht)569 // {570 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i]));571 // }572 // (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK [i])) (*( out_PREDICT_ACK [i]));573 // (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i]));574 // }575 576 // for (uint32_t i=0; i<_param._nb_branch_complete; i++)577 // {578 // if (_param._have_bht)579 // {580 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i]));581 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));582 // }583 // if (_param._have_pht)584 // {585 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i]));586 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));587 // }588 // if (_param._have_bht and _param._have_pht)589 // {590 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i]));591 // }592 // (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i]));593 // (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i]));594 // }595 596 // log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");597 // };598 296 599 297 }; // end namespace two_level_branch_predictor
Note: See TracChangeset
for help on using the changeset viewer.