Changeset 111 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_allocation.cpp
- Timestamp:
- Feb 27, 2009, 7:37:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_allocation.cpp
r110 r111 18 18 namespace meta_predictor { 19 19 20 21 22 20 #undef FUNCTION 23 21 #define FUNCTION "Meta_Predictor::allocation" … … 57 55 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 58 56 } 57 58 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 { 60 ALLOC1_INTERFACE("predict",IN,WEST,_("Predict direction interface"),_param->_nb_inst_predict); 61 62 ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); 63 ALLOC1_VALACK_OUT(out_PREDICT_ACK ,ACK); 64 ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 65 ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 66 ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 67 } 68 69 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 { 71 ALLOC1_INTERFACE("update",IN,WEST,_("Update direction interface"),_param->_nb_inst_update); 72 73 ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); 74 ALLOC1_VALACK_OUT(out_UPDATE_ACK ,ACK); 75 ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"ADDRESS" ,Taddress_t,_param->_size_address); 76 ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY ,"HISTORY" ,Thistory_t,_param->_size_history); 77 ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION ,"DIRECTION" ,Tcontrol_t,1 ); 78 } 59 79 60 80 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 82 std::string name; 83 84 85 { 86 _component_two_level_branch_predictor = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * [_param->_nb_predictor]; 87 88 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 89 { 90 name = _name+"_two_level_branch_predictor_"+toString(i); 91 log_printf(INFO,Meta_Predictor,FUNCTION,_("Create : %s"),name.c_str()); 92 93 _component_two_level_branch_predictor [i] = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor 94 (name.c_str() 95 #ifdef STATISTICS 96 ,param_statistics 97 #endif 98 ,_param->_param_two_level_branch_predictor[i] 99 ,_usage); 100 101 _component->set_component (_component_two_level_branch_predictor[i]->_component 102 #ifdef POSITION 103 , 50, 50, 10, 10 104 #endif 105 ); 106 } 107 } 108 109 { 110 name = _name+"_glue"; 111 log_printf(INFO,Meta_Predictor,FUNCTION,_("Create : %s"),name.c_str()); 112 113 _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue 114 (name.c_str() 115 #ifdef STATISTICS 116 ,param_statistics 117 #endif 118 ,_param->_param_glue 119 ,_usage); 120 121 _component->set_component (_component_glue->_component 122 #ifdef POSITION 123 , 50, 50, 10, 10 124 #endif 125 ); 126 } 61 127 62 128 // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 63 129 std::string src,dest; 130 131 // =================================================================== 132 // =====[ Two_Level_Branch_Predictor ]================================ 133 // =================================================================== 134 135 for (uint32_t i=0; i<_param->_nb_predictor; ++i) 136 { 137 src = _name+"_two_level_branch_predictor_"+toString(i); 138 log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); 139 140 { 141 dest = _name; 142 #ifdef POSITION 143 _component->interface_map (src ,"", 144 dest,""); 145 #endif 146 147 PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); 148 PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); 149 } 150 151 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 152 for (uint32_t j=0; j<_param->_nb_inst_predict; ++j) 153 { 154 dest = _name; 155 156 #ifdef POSITION 157 _component->interface_map (src ,"predict_"+toString(j), 158 dest,"predict_"+toString(j)); 159 #endif 160 161 PORT_MAP(_component,src , "in_PREDICT_"+toString(j)+"_ADDRESS" , 162 dest, "in_PREDICT_"+toString(j)+"_ADDRESS" ); 163 164 dest = _name+"_glue"; 165 166 #ifdef POSITION 167 _component->interface_map (src ,"predict_"+toString(j), 168 dest,"predict_predictor_"+toString(i)+"_"+toString(j)); 169 #endif 170 171 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_VAL" , 172 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_VAL" ); 173 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_ACK" , 174 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ACK" ); 175 // COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_ADDRESS" , 176 // dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ADDRESS" ); 177 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_DIRECTION" , 178 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 179 COMPONENT_MAP(_component,src ,"out_PREDICT_" +toString(j)+"_HISTORY" , 180 dest, "in_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY" ); 181 if (_param->_predictor_update_on_prediction [i]) 182 { 183 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_DIRECTION_VAL", 184 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION_VAL"); 185 COMPONENT_MAP(_component,src , "in_PREDICT_" +toString(j)+"_DIRECTION" , 186 dest,"out_PREDICT_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 187 } 188 } 189 190 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 191 for (uint32_t j=0; j<_param->_nb_inst_update; ++j) 192 { 193 dest = _name; 194 195 #ifdef POSITION 196 _component->interface_map (src ,"update_"+toString(j), 197 dest,"update_"+toString(j)); 198 #endif 199 200 PORT_MAP(_component,src , "in_UPDATE_"+toString(j)+"_ADDRESS" , 201 dest, "in_UPDATE_"+toString(j)+"_ADDRESS" ); 202 203 dest = _name+"_glue"; 204 205 #ifdef POSITION 206 _component->interface_map (src ,"update_"+toString(j), 207 dest,"update_predictor_"+toString(i)+"_"+toString(j)); 208 #endif 209 210 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_VAL" , 211 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_VAL" ); 212 COMPONENT_MAP(_component,src ,"out_UPDATE_" +toString(j)+"_ACK" , 213 dest, "in_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ACK" ); 214 // COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_ADDRESS" , 215 // dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_ADDRESS" ); 216 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_DIRECTION" , 217 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_DIRECTION" ); 218 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_HISTORY" , 219 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_HISTORY" ); 220 if (_param->_predictor_update_on_prediction [i]) 221 COMPONENT_MAP(_component,src , "in_UPDATE_" +toString(j)+"_MISS" , 222 dest,"out_UPDATE_PREDICTOR_"+toString(i)+"_"+toString(j)+"_MISS" ); 223 } 224 // // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 225 // public : SC_IN (Tcontrol_t) ** in_UPDATE_VAL ;//[nb_inst_update] 226 // public : SC_OUT(Tcontrol_t) ** out_UPDATE_ACK ;//[nb_inst_update] 227 // public : SC_IN (Taddress_t) ** in_UPDATE_ADDRESS ;//[nb_inst_update] 228 // public : SC_IN (Thistory_t) ** in_UPDATE_HISTORY ;//[nb_inst_update] 229 // public : SC_IN (Tcontrol_t) ** in_UPDATE_DIRECTION ;//[nb_inst_update] 230 // public : SC_IN (Tcontrol_t) ** in_UPDATE_MISS ;//[nb_inst_update] // if update_on_prediction 231 232 } 233 234 // =================================================================== 235 // =====[ Glue ]====================================================== 236 // =================================================================== 237 238 { 239 src = _name+"_glue"; 240 log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str()); 241 242 { 243 dest = _name; 244 #ifdef POSITION 245 _component->interface_map (src ,"", 246 dest,""); 247 #endif 248 249 PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK"); 250 PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET"); 251 } 252 253 // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 254 for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) 255 { 256 dest = _name; 257 #ifdef POSITION 258 _component->interface_map (src ,"predict_"+toString(i), 259 dest,"predict_"+toString(i)); 260 #endif 261 262 PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_VAL" , 263 dest, "in_PREDICT_"+toString(i)+"_VAL" ); 264 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ACK" , 265 dest,"out_PREDICT_"+toString(i)+"_ACK" ); 266 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_HISTORY" , 267 dest,"out_PREDICT_"+toString(i)+"_HISTORY" ); 268 PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_DIRECTION", 269 dest,"out_PREDICT_"+toString(i)+"_DIRECTION"); 270 } 271 272 // out_PREDICT_PREDICTOR_VAL -> two_level_branch_predictor. in_PREDICT_PREDICTOR_VAL 273 // in_PREDICT_PREDICTOR_ACK -> two_level_branch_predictor.out_PREDICT_PREDICTOR_ACK 274 // in_PREDICT_PREDICTOR_HISTORY -> two_level_branch_predictor.out_PREDICT_PREDICTOR_HISTORY 275 // in_PREDICT_PREDICTOR_DIRECTION -> two_level_branch_predictor.out_PREDICT_PREDICTOR_DIRECTION 276 // out_PREDICT_PREDICTOR_DIRECTION_VAL -> two_level_branch_predictor. in_PREDICT_PREDICTOR_DIRECTION_VAL 277 // out_PREDICT_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_PREDICT_PREDICTOR_DIRECTION 278 279 // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 280 for (uint32_t i=0; i<_param->_nb_inst_update; ++i) 281 { 282 dest = _name; 283 #ifdef POSITION 284 _component->interface_map (src ,"update_"+toString(i), 285 dest,"update_"+toString(i)); 286 #endif 287 288 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_VAL" , 289 dest, "in_UPDATE_"+toString(i)+"_VAL" ); 290 PORT_MAP(_component,src ,"out_UPDATE_"+toString(i)+"_ACK" , 291 dest,"out_UPDATE_"+toString(i)+"_ACK" ); 292 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_HISTORY" , 293 dest, "in_UPDATE_"+toString(i)+"_HISTORY" ); 294 PORT_MAP(_component,src , "in_UPDATE_"+toString(i)+"_DIRECTION", 295 dest, "in_UPDATE_"+toString(i)+"_DIRECTION"); 296 } 297 298 // out_UPDATE_PREDICTOR_VAL -> two_level_branch_predictor. in_UPDATE_PREDICTOR_VAL 299 // in_UPDATE_PREDICTOR_ACK -> two_level_branch_predictor.out_UPDATE_PREDICTOR_ACK 300 // out_UPDATE_PREDICTOR_HISTORY -> two_level_branch_predictor. in_UPDATE_PREDICTOR_HISTORY 301 // out_UPDATE_PREDICTOR_DIRECTION -> two_level_branch_predictor. in_UPDATE_PREDICTOR_DIRECTION 302 // out_UPDATE_PREDICTOR_MISS -> two_level_branch_predictor. in_UPDATE_PREDICTOR_MISS 303 304 } 64 305 65 306 // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: See TracChangeset
for help on using the changeset viewer.