Changeset 43 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp
- Timestamp:
- Jul 9, 2007, 11:04:26 AM (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_vhdl_body.cpp
r42 r43 21 21 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin"); 22 22 23 list<string> list_port_map;23 // list<string> list_port_map; 24 24 25 if (_param._have_bht)26 {27 list_port_map.clear();25 // if (_param._have_bht) 26 // { 27 // list_port_map.clear(); 28 28 29 vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");30 vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");29 // vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK "); 30 // vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET"); 31 31 32 for (uint32_t i=0; i<_param._nb_prediction; i++)33 {34 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+" "," in_PREDICT_VAL_"+toString(i));35 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" ","signal_PREDICT_BHT_ACK_"+toString(i));36 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" ","signal_PREDICT_BHT_ADDRESS_"+toString(i));37 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+" ","signal_PREDICT_BHT_HISTORY_"+toString(i));38 }32 // for (uint32_t i=0; i<_param._nb_prediction; i++) 33 // { 34 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+" "," in_PREDICT_VAL_"+toString(i)); 35 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" ","signal_PREDICT_BHT_ACK_"+toString(i)); 36 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" ","signal_PREDICT_BHT_ADDRESS_"+toString(i)); 37 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+" ","signal_PREDICT_BHT_HISTORY_"+toString(i)); 38 // } 39 39 40 for (uint32_t i=0; i<_param._nb_branch_complete; i++)41 {42 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+" "," in_BRANCH_COMPLETE_VAL_"+toString(i));43 vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));44 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));45 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" "," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));46 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+""," in_BRANCH_COMPLETE_DIRECTION_"+toString(i));47 }40 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 41 // { 42 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+" "," in_BRANCH_COMPLETE_VAL_"+toString(i)); 43 // vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i)); 44 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)); 45 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" "," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)); 46 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+""," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)); 47 // } 48 48 49 vhdl.set_body_component ("component_Branch_History_Table",_name+"_Branch_History_Table",list_port_map);50 }49 // vhdl.set_body_component ("component_Branch_History_Table",_name+"_Branch_History_Table",list_port_map); 50 // } 51 51 52 if (_param._have_pht)53 {54 list_port_map.clear();52 // if (_param._have_pht) 53 // { 54 // list_port_map.clear(); 55 55 56 vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");57 vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");56 // vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK "); 57 // vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET"); 58 58 59 for (uint32_t i=0; i<_param._nb_prediction; i++)60 {61 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+" "," in_PREDICT_VAL_"+toString(i));62 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" ","signal_PREDICT_PHT_ACK_"+toString(i));63 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" ","signal_PREDICT_PHT_ADDRESS_"+toString(i));64 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+" "," out_PREDICT_PHT_HISTORY_"+toString(i));65 }59 // for (uint32_t i=0; i<_param._nb_prediction; i++) 60 // { 61 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+" "," in_PREDICT_VAL_"+toString(i)); 62 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" ","signal_PREDICT_PHT_ACK_"+toString(i)); 63 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" ","signal_PREDICT_PHT_ADDRESS_"+toString(i)); 64 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+" "," out_PREDICT_PHT_HISTORY_"+toString(i)); 65 // } 66 66 67 for (uint32_t i=0; i<_param._nb_branch_complete; i++)68 {69 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+" "," in_BRANCH_COMPLETE_VAL_"+toString(i));70 vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));71 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));72 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" "," in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i));73 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+""," in_BRANCH_COMPLETE_DIRECTION_"+toString(i));74 }67 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 68 // { 69 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+" "," in_BRANCH_COMPLETE_VAL_"+toString(i)); 70 // vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i)); 71 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)); 72 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+" "," in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)); 73 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+""," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)); 74 // } 75 75 76 vhdl.set_body_component ("component_Pattern_History_Table",_name+"_Pattern_History_Table",list_port_map);77 }76 // vhdl.set_body_component ("component_Pattern_History_Table",_name+"_Pattern_History_Table",list_port_map); 77 // } 78 78 79 list_port_map.clear();79 // list_port_map.clear(); 80 80 81 for (uint32_t i=0; i<_param._nb_prediction; i++)82 {83 if (_param._have_bht)84 {85 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_ACK_"+toString(i)+" ","signal_PREDICT_BHT_ACK_"+toString(i));86 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_ADDRESS_"+toString(i)+" ","signal_PREDICT_BHT_ADDRESS_"+toString(i));87 }88 if (_param._have_pht)89 {90 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PHT_ACK_"+toString(i)+" ","signal_PREDICT_PHT_ACK_"+toString(i));91 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_ADDRESS_"+toString(i)+" ","signal_PREDICT_PHT_ADDRESS_"+toString(i));92 }93 if (_param._have_bht and _param._have_pht)94 {95 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_HISTORY_"+toString(i)+" ","signal_PREDICT_BHT_HISTORY_"+toString(i));96 }97 vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" "," out_PREDICT_ACK_"+toString(i));98 vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i));99 }81 // for (uint32_t i=0; i<_param._nb_prediction; i++) 82 // { 83 // if (_param._have_bht) 84 // { 85 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_ACK_"+toString(i)+" ","signal_PREDICT_BHT_ACK_"+toString(i)); 86 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_ADDRESS_"+toString(i)+" ","signal_PREDICT_BHT_ADDRESS_"+toString(i)); 87 // } 88 // if (_param._have_pht) 89 // { 90 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PHT_ACK_"+toString(i)+" ","signal_PREDICT_PHT_ACK_"+toString(i)); 91 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_ADDRESS_"+toString(i)+" ","signal_PREDICT_PHT_ADDRESS_"+toString(i)); 92 // } 93 // if (_param._have_bht and _param._have_pht) 94 // { 95 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_HISTORY_"+toString(i)+" ","signal_PREDICT_BHT_HISTORY_"+toString(i)); 96 // } 97 // vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+" "," out_PREDICT_ACK_"+toString(i)); 98 // vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i)); 99 // } 100 100 101 for (uint32_t i=0; i<_param._nb_branch_complete; i++)102 {103 if (_param._have_bht)104 {105 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));106 vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));107 }108 if (_param._have_pht)109 {110 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));111 vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));112 }113 if (_param._have_bht and _param._have_pht)114 {115 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+""," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));116 }117 vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" "," out_BRANCH_COMPLETE_ACK_"+toString(i));118 vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" "," in_BRANCH_COMPLETE_ADDRESS_"+toString(i));119 }101 // for (uint32_t i=0; i<_param._nb_branch_complete; i++) 102 // { 103 // if (_param._have_bht) 104 // { 105 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i)); 106 // vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)); 107 // } 108 // if (_param._have_pht) 109 // { 110 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_ACK_"+toString(i)+" ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i)); 111 // vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)); 112 // } 113 // if (_param._have_bht and _param._have_pht) 114 // { 115 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+""," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)); 116 // } 117 // vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+" "," out_BRANCH_COMPLETE_ACK_"+toString(i)); 118 // vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+" "," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)); 119 // } 120 120 121 vhdl.set_body_component ("component_Two_Level_Branch_Predictor_Glue",_name+"_Two_Level_Branch_Predictor_Glue",list_port_map);121 // vhdl.set_body_component ("component_Two_Level_Branch_Predictor_Glue",_name+"_Two_Level_Branch_Predictor_Glue",list_port_map); 122 122 123 if (_param._have_bht)124 for (uint32_t i=0; i<_param._nb_prediction; i++)125 vhdl.set_body("out_PREDICT_BHT_HISTORY_"+toString(i)+" <= signal_PREDICT_BHT_HISTORY_"+toString(i)+";");123 // if (_param._have_bht) 124 // for (uint32_t i=0; i<_param._nb_prediction; i++) 125 // vhdl.set_body("out_PREDICT_BHT_HISTORY_"+toString(i)+" <= signal_PREDICT_BHT_HISTORY_"+toString(i)+";"); 126 126 127 127 log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","End");
Note: See TracChangeset
for help on using the changeset viewer.