Changeset 3 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:
- Mar 6, 2007, 3:34:04 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
r2 r3 35 35 signal_PREDICT_BHT_ACK = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction]; 36 36 signal_PREDICT_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_prediction]; 37 signal_PREDICT_BHT_HISTORY = new SC_SIGNAL(Tbht_history_t) * [_param._nb_prediction];38 37 } 39 38 if (_param._have_pht) … … 45 44 for (uint32_t i=0; i<_param._nb_prediction; i++) 46 45 { 47 rename = " in_PREDICT_VAL_"+toString(i);46 rename = "in_PREDICT_VAL_" +toString(i); 48 47 in_PREDICT_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 49 48 … … 51 50 out_PREDICT_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 52 51 53 rename = " in_PREDICT_ADDRESS_"+toString(i);52 rename = "in_PREDICT_ADDRESS_" +toString(i); 54 53 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 55 54 … … 73 72 rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i); 74 73 signal_PREDICT_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 75 76 rename = "signal_PREDICT_BHT_HISTORY_"+toString(i);77 signal_PREDICT_BHT_HISTORY [i] = new SC_SIGNAL(Tbht_history_t) (rename.c_str());78 74 } 79 75 … … 95 91 if (_param._have_pht) 96 92 in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete]; 97 in_BRANCH_COMPLETE_ HIT= new SC_IN (Tcontrol_t) * [_param._nb_branch_complete];93 in_BRANCH_COMPLETE_DIRECTION = new SC_IN (Tcontrol_t) * [_param._nb_branch_complete]; 98 94 if (_param._have_bht) 99 95 { … … 109 105 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 110 106 { 111 rename = " in_BRANCH_COMPLETE_VAL_"+toString(i);107 rename = "in_BRANCH_COMPLETE_VAL_" +toString(i); 112 108 in_BRANCH_COMPLETE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 113 109 … … 115 111 out_BRANCH_COMPLETE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 116 112 117 rename = " in_BRANCH_COMPLETE_ADDRESS_"+toString(i);113 rename = "in_BRANCH_COMPLETE_ADDRESS_" +toString(i); 118 114 in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); 119 115 120 116 if (_param._have_bht) 121 117 { 122 rename = " 118 rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i); 123 119 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str()); 124 120 } 125 if (_param._have_ bht)126 { 127 rename = " 121 if (_param._have_pht) 122 { 123 rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i); 128 124 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str()); 129 125 } 130 rename = " in_BRANCH_COMPLETE_HIT_"+toString(i);131 in_BRANCH_COMPLETE_ HIT[i] = new SC_IN (Tcontrol_t) (rename.c_str());126 rename = "in_BRANCH_COMPLETE_DIRECTION_" +toString(i); 127 in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 132 128 if (_param._have_bht) 133 129 { … … 155 151 { 156 152 name_component = _name+"_Branch_History_Table"; 153 154 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 157 155 158 156 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() , … … 170 168 (*(component_Branch_History_Table->out_PREDICT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 171 169 (*(component_Branch_History_Table-> in_PREDICT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 172 (*(component_Branch_History_Table->out_PREDICT_HISTORY [i])) (*( signal_PREDICT_BHT_HISTORY [i]));170 (*(component_Branch_History_Table->out_PREDICT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 173 171 } 174 172 175 173 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 176 174 { 177 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i]));178 (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i]));179 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));180 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i]));181 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ HIT [i])) (*( in_BRANCH_COMPLETE_HIT[i]));175 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 176 (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 177 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 178 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 179 (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 182 180 } 183 181 } … … 187 185 { 188 186 name_component = _name+"_Pattern_History_Table"; 187 188 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 189 189 190 190 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() , … … 207 207 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 208 208 { 209 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i]));210 (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i]));211 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));212 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_PHT_HISTORY [i]));213 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ HIT [i])) (*( in_BRANCH_COMPLETE_HIT[i]));209 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL [i])) (*( in_BRANCH_COMPLETE_VAL [i])); 210 (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 211 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 212 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i])) (*( in_BRANCH_COMPLETE_PHT_HISTORY [i])); 213 (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i])) (*( in_BRANCH_COMPLETE_DIRECTION [i])); 214 214 } 215 215 } 216 216 217 217 // =====[ component_Two_Level_Branch_Predictor_Glue ]=========================== 218 if (_param._have_pht)219 {220 name_component = _name+"_Two_Level_Branch_Predictor_Glue";221 222 218 name_component = _name+"_Two_Level_Branch_Predictor_Glue"; 219 220 log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str()); 221 222 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() , 223 223 #ifdef STATISTICS 224 225 #endif 226 227 228 224 _param_statistics , 225 #endif 226 *(_param._param_two_level_branch_predictor_glue)); 227 228 // Instantiation 229 229 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 230 230 (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK)) (*(in_CLOCK)); 231 231 #endif 232 233 234 235 232 for (uint32_t i=0; i<_param._nb_prediction; i++) 233 { 234 if (_param._have_bht) 235 { 236 236 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK [i])) (*(signal_PREDICT_BHT_ACK [i])); 237 237 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS [i])) (*(signal_PREDICT_BHT_ADDRESS [i])); 238 239 240 238 } 239 if (_param._have_pht) 240 { 241 241 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK [i])) (*(signal_PREDICT_PHT_ACK [i])); 242 242 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS [i])) (*(signal_PREDICT_PHT_ADDRESS [i])); 243 244 245 246 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY [i])) (*( signal_PREDICT_BHT_HISTORY [i]));247 248 249 250 251 252 253 254 255 243 } 244 if (_param._have_bht and _param._have_pht) 245 { 246 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY [i])) (*( out_PREDICT_BHT_HISTORY [i])); 247 } 248 (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK [i])) (*( out_PREDICT_ACK [i])); 249 (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS [i])) (*( in_PREDICT_ADDRESS [i])); 250 } 251 252 for (uint32_t i=0; i<_param._nb_branch_complete; i++) 253 { 254 if (_param._have_bht) 255 { 256 256 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK [i])); 257 257 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i])); 258 259 260 258 } 259 if (_param._have_pht) 260 { 261 261 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK [i])); 262 262 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i])); 263 264 265 263 } 264 if (_param._have_bht and _param._have_pht) 265 { 266 266 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_BHT_HISTORY [i])); 267 } 268 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); 269 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); 270 } 271 } 272 267 } 268 (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK [i])) (*( out_BRANCH_COMPLETE_ACK [i])); 269 (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS [i])) (*( in_BRANCH_COMPLETE_ADDRESS [i])); 270 } 271 273 272 log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End"); 274 273 }; 275 274 276 275 }; // end namespace two_level_branch_predictor 277 276 }; // end namespace meta_predictor
Note: See TracChangeset
for help on using the changeset viewer.