Changeset 101 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit
- Timestamp:
- Jan 15, 2009, 6:19:08 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/src/test.cpp
r88 r101 67 67 ALLOC1_SC_SIGNAL( in_PREDICT_INSTRUCTION_ENABLE ," in_PREDICT_INSTRUCTION_ENABLE ",Tcontrol_t ,_param->_nb_instruction); 68 68 ALLOC_SC_SIGNAL ( in_PREDICT_INST_IFETCH_PTR ," in_PREDICT_INST_IFETCH_PTR ",Tinst_ifetch_ptr_t); 69 //ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_IS_CURRENT ," in_PREDICT_BRANCH_IS_CURRENT ",Tcontrol_t ); 69 70 ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_STATE ," in_PREDICT_BRANCH_STATE ",Tbranch_state_t ); 70 71 ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID," in_PREDICT_BRANCH_UPDATE_PREDICTION_ID",Tprediction_ptr_t ); … … 104 105 if (_param->_have_port_inst_ifetch_ptr) 105 106 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_INST_IFETCH_PTR ); 107 //INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_IS_CURRENT ); 106 108 INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_STATE ); 107 109 if (_param->_have_port_depth) … … 129 131 srand(seed); 130 132 131 const int32_t percent_transaction_address = 75;132 const int32_t percent_transaction_predict = 75;133 const int32_t percent_transaction_event = 5;133 const int32_t percent_transaction_address = 100; 134 const int32_t percent_transaction_predict = 100; 135 const int32_t percent_transaction_event = 0; 134 136 135 137 SC_START(0); … … 155 157 uint32_t nb_packet = 1; 156 158 159 Tcontrol_t a_val = false; 157 160 Tcontrol_t c_val = false; 158 Tcontrol_t n_val = false;161 Tcontrol_t n_val = true ; 159 162 Tcontrol_t nn_val = false; 160 163 164 Tgeneral_data_t a_addr = 0x100>>2; 161 165 Tgeneral_data_t c_addr = 0x100>>2; 162 166 Tgeneral_data_t n_addr = 0x100>>2; 163 167 Tgeneral_data_t nn_addr = 0x100>>2; 164 168 169 Tcontrol_t a_enable [_param->_nb_instruction]; 165 170 Tcontrol_t c_enable [_param->_nb_instruction]; 166 171 Tcontrol_t n_enable [_param->_nb_instruction]; 167 172 173 Tcontrol_t a_is_ds_take = 0; 168 174 Tcontrol_t c_is_ds_take = 0; 169 175 Tcontrol_t n_is_ds_take = 0; 170 176 Tcontrol_t nn_is_ds_take = 0; 171 177 172 c_enable [0] = 1;178 n_enable [0] = 1; 173 179 for (uint32_t i=1; i<_param->_nb_instruction; i++) 174 c_enable [i] = 0;180 n_enable [i] = 0; 175 181 176 182 LABEL("Send Reset"); … … 216 222 in_PREDICT_PC_NEXT_IS_DS_TAKE ->write(take); 217 223 in_PREDICT_INST_IFETCH_PTR ->write(0); 224 // in_PREDICT_BRANCH_IS_CURRENT ->write(0); 218 225 in_PREDICT_BRANCH_STATE ->write(0); 219 226 in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0); … … 251 258 for (uint32_t i=0; i<_param->_nb_instruction; i++) 252 259 n_enable [i] = in_PREDICT_INSTRUCTION_ENABLE [i]->read(); 260 261 LABEL(" * nn_addr : %.8x",nn_addr); 253 262 } 254 263 … … 256 265 { 257 266 LABEL("ADDRESS : Transaction accepted"); 258 LABEL(" * address wait : %.8x", c_addr);259 260 TEST(Tgeneral_address_t,out_ADDRESS_INSTRUCTION_ADDRESS ->read(), c_addr);267 LABEL(" * address wait : %.8x",a_addr); 268 269 TEST(Tgeneral_address_t,out_ADDRESS_INSTRUCTION_ADDRESS ->read(),a_addr); 261 270 for (uint32_t i=0; i<_param->_nb_instruction; i++) 262 TEST(Tcontrol_t ,out_ADDRESS_INSTRUCTION_ENABLE [i] ->read(), c_enable[i]);271 TEST(Tcontrol_t ,out_ADDRESS_INSTRUCTION_ENABLE [i] ->read(),a_enable[i]); 263 272 if (_param->_have_port_inst_ifetch_ptr) 264 273 TEST(Tinst_ifetch_ptr_t,out_ADDRESS_INST_IFETCH_PTR ->read(),0); … … 267 276 TEST(Tprediction_ptr_t ,out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID->read(),0); 268 277 269 c_val = 0;278 a_val = 0; 270 279 nb_packet ++; 271 280 } 272 281 282 { 283 string str_a_enable = ""; 284 string str_c_enable = ""; 285 string str_n_enable = ""; 286 287 for (uint32_t i=0; i<_param->_nb_instruction; i++) 288 { 289 str_a_enable += " " + toString(a_enable [i]); 290 str_c_enable += " " + toString(c_enable [i]); 291 str_n_enable += " " + toString(n_enable [i]); 292 } 293 294 LABEL("----[ Before ]---------------------"); 295 LABEL(" * nb_packet : %d",nb_packet); 296 LABEL(" * pc a : %d %d %.8x %s",a_val ,a_is_ds_take ,a_addr ,str_a_enable.c_str()); 297 LABEL(" * pc : %d %d %.8x %s",c_val ,c_is_ds_take ,c_addr ,str_c_enable.c_str()); 298 LABEL(" * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take ,n_addr ,str_n_enable.c_str()); 299 LABEL(" * pc+8 : %d %d %.8x" ,nn_val,nn_is_ds_take,nn_addr); 300 LABEL("-----------------------------------"); 301 } 302 303 if (not a_val) 304 { 305 if (c_val and n_val and nn_val) 306 { 307 a_val = 1; 308 c_val = 0; 309 a_addr = c_addr; 310 a_is_ds_take = c_is_ds_take; 311 312 for (uint32_t i=0; i<_param->_nb_instruction; i++) 313 a_enable [i] = c_enable [i]; 314 } 315 } 273 316 274 317 if (not c_val) 275 { 276 if (n_val and nn_val) 277 { 278 c_val = 1; 279 c_addr = n_addr; 280 c_is_ds_take = n_is_ds_take; 281 282 for (uint32_t i=0; i<_param->_nb_instruction; i++) 283 c_enable [i] = n_enable [i]; 284 285 n_val = 1; 286 n_addr = nn_addr; 287 n_is_ds_take = nn_is_ds_take; 288 289 nn_val = 0; 290 } 291 } 318 { 319 c_val = n_val; 320 if (n_val) 321 { 322 c_addr = n_addr; 323 c_is_ds_take = n_is_ds_take; 324 325 for (uint32_t i=0; i<_param->_nb_instruction; i++) 326 c_enable [i] = n_enable [i]; 327 } 328 n_val = 0; 329 } 330 331 if (not n_val) 332 { 333 n_val = nn_val; 334 if (nn_val) 335 { 336 n_addr = nn_addr; 337 n_is_ds_take = nn_is_ds_take; 338 339 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 340 // n_enable [i] = nn_enable [i]; 341 } 342 nn_val = 0; 343 } 292 344 293 345 if (in_EVENT_VAL->read() and out_EVENT_ACK->read()) … … 295 347 LABEL("EVENT : Transaction accepted"); 296 348 349 a_val = false; 297 350 c_val = false; 298 351 n_val = true; … … 312 365 313 366 { 367 string str_a_enable = ""; 314 368 string str_c_enable = ""; 315 369 string str_n_enable = ""; … … 317 371 for (uint32_t i=0; i<_param->_nb_instruction; i++) 318 372 { 373 str_a_enable += " " + toString(a_enable [i]); 319 374 str_c_enable += " " + toString(c_enable [i]); 320 375 str_n_enable += " " + toString(n_enable [i]); 321 376 } 322 377 323 LABEL("---- -------------------------------");378 LABEL("----[ After ]----------------------"); 324 379 LABEL(" * nb_packet : %d",nb_packet); 325 LABEL(" * pc : %d %d %.8x %s",c_val ,c_is_ds_take , c_addr ,str_c_enable.c_str()); 326 if (nn_val) 327 { 328 LABEL(" * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take , n_addr ,str_n_enable.c_str()); 329 } 330 else 331 { 332 LABEL(" * pc+4 : %d %d %.8x" ,n_val ,n_is_ds_take , n_addr ); 333 } 334 LABEL(" * pc+8 : %d %d %.8x" ,nn_val ,nn_is_ds_take, nn_addr); 380 LABEL(" * pc a : %d %d %.8x %s",a_val ,a_is_ds_take ,a_addr ,str_a_enable.c_str()); 381 LABEL(" * pc : %d %d %.8x %s",c_val ,c_is_ds_take ,c_addr ,str_c_enable.c_str()); 382 LABEL(" * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take ,n_addr ,str_n_enable.c_str()); 383 LABEL(" * pc+8 : %d %d %.8x" ,nn_val,nn_is_ds_take,nn_addr); 335 384 LABEL("-----------------------------------"); 336 385 } … … 368 417 delete [] in_PREDICT_INSTRUCTION_ENABLE ; 369 418 delete in_PREDICT_INST_IFETCH_PTR ; 419 //delete in_PREDICT_BRANCH_IS_CURRENT ; 370 420 delete in_PREDICT_BRANCH_STATE ; 371 421 delete in_PREDICT_BRANCH_UPDATE_PREDICTION_ID; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Address_management.h
r88 r101 83 83 public : SC_IN (Tcontrol_t ) * in_PREDICT_PC_NEXT_IS_DS_TAKE ; 84 84 public : SC_IN (Tcontrol_t ) ** in_PREDICT_INSTRUCTION_ENABLE ; //[nb_instruction] 85 public : SC_IN (Tinst_ifetch_ptr_t ) * in_PREDICT_INST_IFETCH_PTR;85 //public : SC_IN (Tcontrol_t ) * in_PREDICT_BRANCH_IS_CURRENT ; 86 86 public : SC_IN (Tbranch_state_t ) * in_PREDICT_BRANCH_STATE ; 87 87 public : SC_IN (Tprediction_ptr_t ) * in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ; 88 public : SC_IN (Tinst_ifetch_ptr_t ) * in_PREDICT_INST_IFETCH_PTR ; 88 89 89 90 // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 98 99 99 100 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 private : Tcontrol_t reg_PC_ACCESS_VAL ; 102 private : Tgeneral_address_t reg_PC_ACCESS ; 103 private : Tcontrol_t reg_PC_ACCESS_IS_DS_TAKE ; 104 private : Tcontrol_t * reg_PC_ACCESS_INSTRUCTION_ENABLE ; //[nb_instruction] 105 private : Tinst_ifetch_ptr_t reg_PC_ACCESS_INST_IFETCH_PTR ; 106 private : Tbranch_state_t reg_PC_ACCESS_BRANCH_STATE ; 107 private : Tprediction_ptr_t reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID ; 108 100 109 private : Tcontrol_t reg_PC_CURRENT_VAL ; 101 110 private : Tgeneral_address_t reg_PC_CURRENT ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_allocation.cpp
r88 r101 85 85 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT ,"pc_next" ,Tgeneral_address_t,_param->_size_instruction_address); 86 86 ALLOC_SIGNAL_IN ( in_PREDICT_PC_NEXT_IS_DS_TAKE ,"pc_next_is_ds_take" ,Tcontrol_t ,1); 87 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr);87 // ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_IS_CURRENT ,"branch_is_current" ,Tcontrol_t ,1); 88 88 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state); 89 89 ALLOC_SIGNAL_IN ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth); 90 ALLOC_SIGNAL_IN ( in_PREDICT_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr); 90 91 } 91 92 { … … 110 111 if (usage_is_set(_usage,USE_SYSTEMC)) 111 112 { 112 reg_PC_CURRENT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction]; 113 reg_PC_NEXT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction]; 113 ALLOC1(reg_PC_ACCESS_INSTRUCTION_ENABLE ,Tcontrol_t,_param->_nb_instruction); 114 ALLOC1(reg_PC_CURRENT_INSTRUCTION_ENABLE,Tcontrol_t,_param->_nb_instruction); 115 ALLOC1(reg_PC_NEXT_INSTRUCTION_ENABLE ,Tcontrol_t,_param->_nb_instruction); 114 116 } 115 117 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_deallocation.cpp
r88 r101 47 47 if (_param->_have_port_inst_ifetch_ptr) 48 48 delete in_PREDICT_INST_IFETCH_PTR ; 49 // delete in_PREDICT_BRANCH_IS_CURRENT ; 49 50 delete in_PREDICT_BRANCH_STATE ; 50 51 if (_param->_have_port_depth) … … 60 61 if (usage_is_set(_usage,USE_SYSTEMC)) 61 62 { 63 delete reg_PC_ACCESS_INSTRUCTION_ENABLE ; 62 64 delete reg_PC_CURRENT_INSTRUCTION_ENABLE; 63 65 delete reg_PC_NEXT_INSTRUCTION_ENABLE ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_genMoore.cpp
r88 r101 28 28 // ========================================= 29 29 30 internal_ADDRESS_VAL = reg_PC_ CURRENT_VAL;30 internal_ADDRESS_VAL = reg_PC_ACCESS_VAL; 31 31 32 32 PORT_WRITE(out_ADDRESS_VAL ,internal_ADDRESS_VAL ); 33 PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS ,reg_PC_ CURRENT);33 PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS ,reg_PC_ACCESS ); 34 34 if (_param->_have_port_inst_ifetch_ptr) 35 PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR ,reg_PC_ CURRENT_INST_IFETCH_PTR );36 PORT_WRITE(out_ADDRESS_BRANCH_STATE ,reg_PC_ CURRENT_BRANCH_STATE );35 PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR ,reg_PC_ACCESS_INST_IFETCH_PTR ); 36 PORT_WRITE(out_ADDRESS_BRANCH_STATE ,reg_PC_ACCESS_BRANCH_STATE ); 37 37 if (_param->_have_port_depth) 38 PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_ CURRENT_BRANCH_UPDATE_PREDICTION_ID);38 PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID); 39 39 40 40 for (uint32_t i=0; i<_param->_nb_instruction; i++) 41 PORT_WRITE(out_ADDRESS_INSTRUCTION_ENABLE [i], reg_PC_ CURRENT_INSTRUCTION_ENABLE[i]);41 PORT_WRITE(out_ADDRESS_INSTRUCTION_ENABLE [i], reg_PC_ACCESS_INSTRUCTION_ENABLE[i]); 42 42 43 43 // ========================================= -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp
r98 r101 28 28 { 29 29 // nothing is valid 30 reg_PC_ACCESS_VAL = 0; 31 30 32 reg_PC_CURRENT_VAL = 0; 31 33 32 34 reg_PC_NEXT_VAL = 1; 33 35 reg_PC_NEXT = 0x100>>2; 36 reg_PC_NEXT_IS_DS_TAKE = 0; 37 reg_PC_NEXT_INSTRUCTION_ENABLE [0] = 1; 38 for (uint32_t i=1; i<_param->_nb_instruction; i++) 39 reg_PC_NEXT_INSTRUCTION_ENABLE [i] = 0; 40 reg_PC_NEXT_INST_IFETCH_PTR = 0; 41 reg_PC_NEXT_BRANCH_STATE = 0; 42 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = 0; 43 34 44 35 45 reg_PC_NEXT_NEXT_VAL = 0; … … 42 52 if (PORT_READ(in_PREDICT_ACK) and internal_PREDICT_VAL) 43 53 { 54 bool branch_is_current = reg_PC_NEXT_IS_DS_TAKE; 55 if (branch_is_current) 56 { 57 if (_param->_have_port_inst_ifetch_ptr) 58 reg_PC_CURRENT_INST_IFETCH_PTR = PORT_READ(in_PREDICT_INST_IFETCH_PTR ); 59 reg_PC_CURRENT_BRANCH_STATE = PORT_READ(in_PREDICT_BRANCH_STATE ); 60 if (_param->_have_port_depth) 61 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID); 62 } 63 else 64 { 65 if (_param->_have_port_inst_ifetch_ptr) 66 reg_PC_NEXT_INST_IFETCH_PTR = PORT_READ(in_PREDICT_INST_IFETCH_PTR ); 67 reg_PC_NEXT_BRANCH_STATE = PORT_READ(in_PREDICT_BRANCH_STATE ); 68 if (_param->_have_port_depth) 69 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID); 70 } 71 44 72 for (uint32_t i=0; i<_param->_nb_instruction; i++) 45 73 reg_PC_NEXT_INSTRUCTION_ENABLE [i] = PORT_READ(in_PREDICT_INSTRUCTION_ENABLE [i]); 46 if (_param->_have_port_inst_ifetch_ptr)47 reg_PC_NEXT_INST_IFETCH_PTR = PORT_READ(in_PREDICT_INST_IFETCH_PTR );48 reg_PC_NEXT_BRANCH_STATE = PORT_READ(in_PREDICT_BRANCH_STATE );49 if (_param->_have_port_depth)50 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);51 74 52 75 reg_PC_NEXT_NEXT_VAL = 1; // address is valid … … 64 87 // ========================================= 65 88 // transaction with icache 66 if ( (internal_ADDRESS_VAL and PORT_READ(in_ADDRESS_ACK)) or not reg_PC_CURRENT_VAL) 67 { 89 if (internal_ADDRESS_VAL and PORT_READ(in_ADDRESS_ACK)) 90 { 91 reg_PC_ACCESS_VAL = 0; 68 92 #ifdef STATISTICS 69 93 if (usage_is_set(_usage,USE_STATISTICS)) 70 if (reg_PC_CURRENT_VAL) 71 { 94 { 72 95 (*_stat_nb_transaction_address) ++; 73 96 74 97 for (uint32_t i=0; i<_param->_nb_instruction; i++) 75 if (reg_PC_ CURRENT_INSTRUCTION_ENABLE [i] == true)98 if (reg_PC_ACCESS_INSTRUCTION_ENABLE [i] == true) 76 99 (*_stat_sum_packet_size) ++; 77 100 } 78 101 #endif 79 80 81 Tcontrol_t pc_next_val = reg_PC_NEXT_VAL and reg_PC_NEXT_NEXT_VAL; 82 83 // next pc became current pc 84 reg_PC_CURRENT_VAL = pc_next_val; 85 86 // if pc_next is not valid : don't erase PC and PC_IS_DS_TAKE : this register is send a the predict (to compute pc_next) 87 if (pc_next_val) 88 { 89 reg_PC_CURRENT = reg_PC_NEXT ; 90 reg_PC_CURRENT_IS_DS_TAKE = reg_PC_NEXT_IS_DS_TAKE ; 91 reg_PC_CURRENT_INST_IFETCH_PTR = reg_PC_NEXT_INST_IFETCH_PTR ; 92 reg_PC_CURRENT_BRANCH_STATE = reg_PC_NEXT_BRANCH_STATE ; 93 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID; 94 95 for (uint32_t i=0; i<_param->_nb_instruction; i++) 96 reg_PC_CURRENT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_INSTRUCTION_ENABLE [i]; 97 98 reg_PC_NEXT_VAL = reg_PC_NEXT_NEXT_VAL ; 99 // if pc_next_next is not valid : don't erase PC_NEXT and PC_NEXT_IS_DS_TAKE : this register is send a the predict (to compute pc_next) 100 if (reg_PC_NEXT_NEXT_VAL) 101 { 102 reg_PC_NEXT = reg_PC_NEXT_NEXT ; 103 reg_PC_NEXT_IS_DS_TAKE = reg_PC_NEXT_NEXT_IS_DS_TAKE; 104 } 105 106 // invalid next next pc 107 reg_PC_NEXT_NEXT_VAL = 0; 108 } 109 110 } 111 102 } 103 104 // Shift register 105 106 if (not reg_PC_ACCESS_VAL and reg_PC_CURRENT_VAL and reg_PC_NEXT_VAL and reg_PC_NEXT_NEXT_VAL) 107 { 108 reg_PC_ACCESS_VAL = 1; // new request 109 reg_PC_CURRENT_VAL = 0; // invalid current 110 111 reg_PC_ACCESS = reg_PC_CURRENT ; 112 reg_PC_ACCESS_IS_DS_TAKE = reg_PC_CURRENT_IS_DS_TAKE ; 113 reg_PC_ACCESS_INST_IFETCH_PTR = reg_PC_CURRENT_INST_IFETCH_PTR ; 114 reg_PC_ACCESS_BRANCH_STATE = reg_PC_CURRENT_BRANCH_STATE ; 115 reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID = reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID; 116 117 for (uint32_t i=0; i<_param->_nb_instruction; i++) 118 reg_PC_ACCESS_INSTRUCTION_ENABLE [i] = reg_PC_CURRENT_INSTRUCTION_ENABLE [i]; 119 } 120 121 if (not reg_PC_CURRENT_VAL) 122 { 123 bool val = reg_PC_NEXT_VAL; 124 reg_PC_CURRENT_VAL = val; // new PC_CURRENT if PC_NEXT is valid 125 reg_PC_NEXT_VAL = 0; // invalid next 126 127 if (val) 128 { 129 reg_PC_CURRENT = reg_PC_NEXT ; 130 reg_PC_CURRENT_IS_DS_TAKE = reg_PC_NEXT_IS_DS_TAKE ; 131 reg_PC_CURRENT_INST_IFETCH_PTR = reg_PC_NEXT_INST_IFETCH_PTR ; 132 reg_PC_CURRENT_BRANCH_STATE = reg_PC_NEXT_BRANCH_STATE ; 133 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID; 134 135 for (uint32_t i=0; i<_param->_nb_instruction; i++) 136 reg_PC_CURRENT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_INSTRUCTION_ENABLE [i]; 137 } 138 } 139 140 if (not reg_PC_NEXT_VAL) 141 { 142 bool val = reg_PC_NEXT_NEXT_VAL; 143 reg_PC_NEXT_VAL = val; // new PC_NEXT if PC_NEXT_NEXT is valid 144 reg_PC_NEXT_NEXT_VAL = 0; // invalid next_next 145 146 if (val) 147 { 148 reg_PC_NEXT = reg_PC_NEXT_NEXT ; 149 reg_PC_NEXT_IS_DS_TAKE = reg_PC_NEXT_NEXT_IS_DS_TAKE ; 150 // reg_PC_NEXT_INST_IFETCH_PTR = reg_PC_NEXT_NEXT_INST_IFETCH_PTR ; 151 // reg_PC_NEXT_BRANCH_STATE = reg_PC_NEXT_NEXT_BRANCH_STATE ; 152 // reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_NEXT_BRANCH_UPDATE_PREDICTION_ID; 153 154 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 155 // reg_PC_NEXT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_NEXT_INSTRUCTION_ENABLE [i]; 156 } 157 } 112 158 113 159 // ========================================= … … 121 167 log_printf(TRACE,Address_management,FUNCTION," * ADDRESS_NEXT : %.8x (%.8x)",PORT_READ(in_EVENT_ADDRESS_NEXT ),PORT_READ(in_EVENT_ADDRESS_NEXT )<<2); 122 168 log_printf(TRACE,Address_management,FUNCTION," * ADDRESS_NEXT_VAL : %d" ,PORT_READ(in_EVENT_ADDRESS_NEXT_VAL)); 169 170 reg_PC_ACCESS_VAL = 0; 123 171 reg_PC_CURRENT_VAL = 0; 124 172 reg_PC_NEXT_VAL = 1; … … 157 205 } 158 206 159 #if defined(DEBUG) and (DEBUG >= DEBUG_TRACE)207 #if defined(DEBUG) and DEBUG_Address_management and (DEBUG >= DEBUG_TRACE) 160 208 log_printf(TRACE,Address_management,FUNCTION," * Dump PC"); 161 log_printf(TRACE,Address_management,FUNCTION," * Current : %d %d 0x%.8x (%.8x)",reg_PC_CURRENT_VAL , reg_PC_CURRENT_IS_DS_TAKE , reg_PC_CURRENT , reg_PC_CURRENT <<2); 162 log_printf(TRACE,Address_management,FUNCTION," * Next : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_VAL , reg_PC_NEXT_IS_DS_TAKE , reg_PC_NEXT , reg_PC_NEXT <<2); 163 log_printf(TRACE,Address_management,FUNCTION," * Next_Next : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_NEXT_VAL, reg_PC_NEXT_NEXT_IS_DS_TAKE, reg_PC_NEXT_NEXT, reg_PC_NEXT_NEXT<<2); 209 { 210 std::string instruction_enable; 211 for (uint32_t i=0; i<_param->_nb_instruction; ++i) 212 instruction_enable += toString(reg_PC_ACCESS_INSTRUCTION_ENABLE [i])+ " "; 213 214 log_printf(TRACE,Address_management,FUNCTION," * Access : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s", 215 reg_PC_ACCESS_VAL, 216 reg_PC_ACCESS_IS_DS_TAKE, 217 reg_PC_ACCESS, 218 reg_PC_ACCESS<<2, 219 reg_PC_ACCESS_BRANCH_STATE, 220 reg_PC_ACCESS_INST_IFETCH_PTR, 221 reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID, 222 instruction_enable.c_str() 223 ); 224 } 225 { 226 std::string instruction_enable; 227 for (uint32_t i=0; i<_param->_nb_instruction; ++i) 228 instruction_enable += toString(reg_PC_CURRENT_INSTRUCTION_ENABLE [i])+ " "; 229 230 log_printf(TRACE,Address_management,FUNCTION," * Current : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s", 231 reg_PC_CURRENT_VAL, 232 reg_PC_CURRENT_IS_DS_TAKE, 233 reg_PC_CURRENT, 234 reg_PC_CURRENT<<2, 235 reg_PC_CURRENT_BRANCH_STATE, 236 reg_PC_CURRENT_INST_IFETCH_PTR, 237 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID, 238 instruction_enable.c_str() 239 ); 240 } 241 { 242 std::string instruction_enable; 243 for (uint32_t i=0; i<_param->_nb_instruction; ++i) 244 instruction_enable += toString(reg_PC_NEXT_INSTRUCTION_ENABLE [i])+ " "; 245 246 log_printf(TRACE,Address_management,FUNCTION," * Next : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s", 247 reg_PC_NEXT_VAL, 248 reg_PC_NEXT_IS_DS_TAKE, 249 reg_PC_NEXT, 250 reg_PC_NEXT<<2, 251 reg_PC_NEXT_BRANCH_STATE, 252 reg_PC_NEXT_INST_IFETCH_PTR, 253 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID, 254 instruction_enable.c_str()); 255 } 256 log_printf(TRACE,Address_management,FUNCTION," * Next_Next : %d %d 0x%.8x (%.8x)", 257 reg_PC_NEXT_NEXT_VAL, 258 reg_PC_NEXT_NEXT_IS_DS_TAKE, 259 reg_PC_NEXT_NEXT, 260 reg_PC_NEXT_NEXT<<2); 164 261 #endif 165 262 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Types.h
r85 r101 22 22 { 23 23 IFETCH_QUEUE_STATE_EMPTY , // slot is empty 24 //IFETCH_QUEUE_STATE_WAIT_REQ , // slot is allocated - wait request to cache24 // IFETCH_QUEUE_STATE_WAIT_REQ , // slot is allocated - wait request to cache 25 25 IFETCH_QUEUE_STATE_WAIT_RSP , // slot have send a request - wait respons from cache 26 26 IFETCH_QUEUE_STATE_HAVE_RSP , // slot have a bloc of instruction - wait accept by decod -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp
r88 r101 41 41 // New slot in ifetch_queue is allocated 42 42 43 _queue[reg_PTR_WRITE]->_state 43 _queue[reg_PTR_WRITE]->_state = IFETCH_QUEUE_STATE_WAIT_RSP; 44 44 45 45 #ifdef STATISTICS … … 58 58 } 59 59 60 _queue[reg_PTR_WRITE]->_address = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS 60 _queue[reg_PTR_WRITE]->_address = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS); 61 61 _queue[reg_PTR_WRITE]->_inst_ifetch_ptr = (_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR ):0; 62 _queue[reg_PTR_WRITE]->_branch_state = PORT_READ(in_ADDRESS_BRANCH_STATE 62 _queue[reg_PTR_WRITE]->_branch_state = PORT_READ(in_ADDRESS_BRANCH_STATE); 63 63 _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_depth)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0; 64 64 … … 142 142 for (uint32_t i=0; i<_param->_size_queue; i++) 143 143 { 144 log_printf(TRACE,Ifetch_queue,FUNCTION," * [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception); 144 log_printf(TRACE,Ifetch_queue,FUNCTION," * [%d] 0x%.8x (0x%.8x) %d - %d %d %d - %s", 145 i, 146 _queue [i]->_address, 147 _queue [i]->_address<<2, 148 _queue [i]->_inst_ifetch_ptr, 149 _queue [i]->_branch_state, 150 _queue [i]->_branch_update_prediction_id, 151 _queue [i]->_exception, 152 toString(_queue [i]->_state).c_str() 153 ); 145 154 146 155 for (uint32_t j=0; j<_param->_nb_instruction; j++) 147 log_printf(TRACE,Ifetch_queue,FUNCTION," * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);156 log_printf(TRACE,Ifetch_queue,FUNCTION," * %d 0x%.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]); 148 157 } 149 158 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/src/test.cpp
r88 r101 250 250 LABEL("Iteration %d",iteration); 251 251 252 // PREDICT253 {254 in_PREDICT_ACK ->write((rand()%100)<percent_transaction_predict);252 // // PREDICT 253 // { 254 // in_PREDICT_ACK ->write((rand()%100)<percent_transaction_predict); 255 255 256 SC_START(0);257 258 Taddress_t addr = (out_PREDICT_PC_CURRENT_IS_DS_TAKE->read())?out_PREDICT_PC_PREVIOUS->read():out_PREDICT_PC_CURRENT->read();259 260 uint32_t begin = addr%_param->_nb_instruction;261 uint32_t end = ((begin<<1)>_param->_nb_instruction)?(_param->_nb_instruction-1):(begin<<1);262 Tcontrol_t take = (nb_packet_in%jump)==0;256 // SC_START(0); 257 258 // Taddress_t addr = (out_PREDICT_PC_CURRENT_IS_DS_TAKE->read())?out_PREDICT_PC_PREVIOUS->read():out_PREDICT_PC_CURRENT->read(); 259 260 // uint32_t begin = addr%_param->_nb_instruction; 261 // uint32_t end = ((begin<<1)>_param->_nb_instruction)?(_param->_nb_instruction-1):(begin<<1); 262 // Tcontrol_t take = (nb_packet_in%jump)==0; 263 263 264 if (take)265 addr += 0x100;266 else267 addr += end-begin+1;268 269 for (uint32_t i=0; i<_param->_nb_instruction; i++)270 in_PREDICT_INSTRUCTION_ENABLE [i] ->write((i>=begin) and (i<=end));271 in_PREDICT_PC_NEXT ->write(addr);272 in_PREDICT_PC_NEXT_IS_DS_TAKE ->write(take);273 in_PREDICT_INST_IFETCH_PTR ->write(0);274 in_PREDICT_BRANCH_STATE ->write(0);275 in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0);276 }277 278 // DECOD279 {280 uint32_t nb_decod = (rand()%_param->_nb_instruction);281 282 for (uint32_t i=0; i<_param->_nb_instruction; i++)283 in_DECOD_ACK [i]->write(i<=nb_decod);284 }285 286 // EVENT287 in_EVENT_VAL ->write((rand()%100)<percent_transaction_event );288 in_EVENT_ADDRESS ->write(0x77);289 in_EVENT_ADDRESS_NEXT ->write(0x171);290 Tcontrol_t is_ds_take = rand();291 in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take);292 in_EVENT_IS_DS_TAKE ->write(is_ds_take);293 294 // ICACHE_REQ295 in_ICACHE_REQ_ACK->write((rand()%100)<percent_transaction_icache_req);296 297 // ICACHE_RSP298 {299 Tcontrol_t val = false;300 if (not cache->empty())301 {302 slot_t<cache_req_t *> cache_rsp = cache->read();303 304 val = (cache_rsp._delay == 0);264 // if (take) 265 // addr += 0x100; 266 // else 267 // addr += end-begin+1; 268 269 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 270 // in_PREDICT_INSTRUCTION_ENABLE [i] ->write((i>=begin) and (i<=end)); 271 // in_PREDICT_PC_NEXT ->write(addr); 272 // in_PREDICT_PC_NEXT_IS_DS_TAKE ->write(take); 273 // in_PREDICT_INST_IFETCH_PTR ->write(0); 274 // in_PREDICT_BRANCH_STATE ->write(0); 275 // in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0); 276 // } 277 278 // // DECOD 279 // { 280 // uint32_t nb_decod = (rand()%_param->_nb_instruction); 281 282 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 283 // in_DECOD_ACK [i]->write(i<=nb_decod); 284 // } 285 286 // // EVENT 287 // in_EVENT_VAL ->write((rand()%100)<percent_transaction_event ); 288 // in_EVENT_ADDRESS ->write(0x77); 289 // in_EVENT_ADDRESS_NEXT ->write(0x171); 290 // Tcontrol_t is_ds_take = rand(); 291 // in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take); 292 // in_EVENT_IS_DS_TAKE ->write(is_ds_take); 293 294 // // ICACHE_REQ 295 // in_ICACHE_REQ_ACK->write((rand()%100)<percent_transaction_icache_req); 296 297 // // ICACHE_RSP 298 // { 299 // Tcontrol_t val = false; 300 // if (not cache->empty()) 301 // { 302 // slot_t<cache_req_t *> cache_rsp = cache->read(); 303 304 // val = (cache_rsp._delay == 0); 305 305 306 Tpacket_t packet = cache_rsp._data->packet ;307 Taddress_t address = cache_rsp._data->address;306 // Tpacket_t packet = cache_rsp._data->packet ; 307 // Taddress_t address = cache_rsp._data->address; 308 308 309 in_ICACHE_RSP_PACKET_ID ->write(packet);310 for (uint32_t i=0; i<_param->_nb_instruction; i++)311 in_ICACHE_RSP_INSTRUCTION [i]->write(address+i);312 in_ICACHE_RSP_ERROR ->write(0);313 }314 315 in_ICACHE_RSP_VAL->write(val);316 }317 318 //-------------------------------------------------319 SC_START(0);320 //-------------------------------------------------321 322 if (out_ICACHE_REQ_VAL->read() and in_ICACHE_REQ_ACK->read())323 {324 LABEL("ICACHE_REQ : Transaction accepted");325 326 Tpacket_t packet = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;327 Taddress_t address = out_ICACHE_REQ_ADDRESS->read();328 329 TEST(bool ,slot_use[packet], false);330 TEST(Taddress_t,address ,c_addr);331 332 slot_use[packet] = true;333 334 uint32_t delay;335 if ((rand()%100)<percent_hit)336 delay = 1;337 else338 delay = delay_miss_min + (rand()%(delay_miss_max-delay_miss_min+1));339 340 cache_req_t * cache_req = new cache_req_t(packet,address);341 cache->push(delay,cache_req);342 343 c_val = 0;344 nb_packet_in ++;345 }346 347 {348 bool find=false;349 350 Taddress_t addr=out_DECOD_ADDRESS->read();351 for (uint32_t i=0; i<_param->_nb_instruction; i++)352 if (out_DECOD_VAL[i]->read() and in_DECOD_ACK [i]->read())353 {354 Tinstruction_t inst = out_DECOD_INSTRUCTION[i]->read();355 LABEL("DECOD [%d] : Transaction accepted",i);356 LABEL(" address : 0x%x",addr);357 LABEL(" instruction : 0x%x",inst);358 359 find = true;360 TEST(Tinstruction_t,inst,addr+i);361 }362 363 if (find)364 {365 if (_param->_have_port_inst_ifetch_ptr)366 TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR ->read(), 0);367 TEST(Tbranch_state_t , out_DECOD_BRANCH_STATE ->read(), 0);368 if (_param->_have_port_depth)369 TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0);370 TEST(Texception_t , out_DECOD_EXCEPTION ->read(), 0);371 }372 }309 // in_ICACHE_RSP_PACKET_ID ->write(packet); 310 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 311 // in_ICACHE_RSP_INSTRUCTION [i]->write(address+i); 312 // in_ICACHE_RSP_ERROR ->write(0); 313 // } 314 315 // in_ICACHE_RSP_VAL->write(val); 316 // } 317 318 // //------------------------------------------------- 319 // SC_START(0); 320 // //------------------------------------------------- 321 322 // if (out_ICACHE_REQ_VAL->read() and in_ICACHE_REQ_ACK->read()) 323 // { 324 // LABEL("ICACHE_REQ : Transaction accepted"); 325 326 // Tpacket_t packet = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0; 327 // Taddress_t address = out_ICACHE_REQ_ADDRESS->read(); 328 329 // TEST(bool ,slot_use[packet], false); 330 // TEST(Taddress_t,address ,c_addr); 331 332 // slot_use[packet] = true; 333 334 // uint32_t delay; 335 // if ((rand()%100)<percent_hit) 336 // delay = 1; 337 // else 338 // delay = delay_miss_min + (rand()%(delay_miss_max-delay_miss_min+1)); 339 340 // cache_req_t * cache_req = new cache_req_t(packet,address); 341 // cache->push(delay,cache_req); 342 343 // c_val = 0; 344 // nb_packet_in ++; 345 // } 346 347 // { 348 // bool find=false; 349 350 // Taddress_t addr=out_DECOD_ADDRESS->read(); 351 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 352 // if (out_DECOD_VAL[i]->read() and in_DECOD_ACK [i]->read()) 353 // { 354 // Tinstruction_t inst = out_DECOD_INSTRUCTION[i]->read(); 355 // LABEL("DECOD [%d] : Transaction accepted",i); 356 // LABEL(" address : 0x%x",addr); 357 // LABEL(" instruction : 0x%x",inst); 358 359 // find = true; 360 // TEST(Tinstruction_t,inst,addr+i); 361 // } 362 363 // if (find) 364 // { 365 // if (_param->_have_port_inst_ifetch_ptr) 366 // TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR ->read(), 0); 367 // TEST(Tbranch_state_t , out_DECOD_BRANCH_STATE ->read(), 0); 368 // if (_param->_have_port_depth) 369 // TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0); 370 // TEST(Texception_t , out_DECOD_EXCEPTION ->read(), 0); 371 // } 372 // } 373 373 374 if (in_ICACHE_RSP_VAL->read() and out_ICACHE_RSP_ACK->read())375 {376 LABEL("ICACHE_RSP : Transaction accepted");377 378 slot_use[cache->read()._data->packet] = false;379 380 cache->pop();381 }382 383 if (out_PREDICT_VAL->read() and in_PREDICT_ACK->read())384 {385 LABEL("PREDICT : Transaction accepted");386 387 if (c_val)388 TEST(Tgeneral_address_t,out_PREDICT_PC_PREVIOUS ->read(),c_addr );389 TEST(Tgeneral_address_t,out_PREDICT_PC_CURRENT ->read(),n_addr );390 TEST(Tcontrol_t ,out_PREDICT_PC_CURRENT_IS_DS_TAKE->read(),n_is_ds_take);391 392 nn_val = true;393 nn_addr = in_PREDICT_PC_NEXT ->read();394 nn_is_ds_take = in_PREDICT_PC_NEXT_IS_DS_TAKE->read();374 // if (in_ICACHE_RSP_VAL->read() and out_ICACHE_RSP_ACK->read()) 375 // { 376 // LABEL("ICACHE_RSP : Transaction accepted"); 377 378 // slot_use[cache->read()._data->packet] = false; 379 380 // cache->pop(); 381 // } 382 383 // if (out_PREDICT_VAL->read() and in_PREDICT_ACK->read()) 384 // { 385 // LABEL("PREDICT : Transaction accepted"); 386 387 // if (c_val) 388 // TEST(Tgeneral_address_t,out_PREDICT_PC_PREVIOUS ->read(),c_addr ); 389 // TEST(Tgeneral_address_t,out_PREDICT_PC_CURRENT ->read(),n_addr ); 390 // TEST(Tcontrol_t ,out_PREDICT_PC_CURRENT_IS_DS_TAKE->read(),n_is_ds_take); 391 392 // nn_val = true; 393 // nn_addr = in_PREDICT_PC_NEXT ->read(); 394 // nn_is_ds_take = in_PREDICT_PC_NEXT_IS_DS_TAKE->read(); 395 395 396 for (uint32_t i=0; i<_param->_nb_instruction; i++)397 n_enable [i] = in_PREDICT_INSTRUCTION_ENABLE [i]->read();398 }399 400 if (not c_val)401 {402 if (n_val and nn_val)403 {404 c_val = 1;405 c_addr = n_addr;406 c_is_ds_take = n_is_ds_take;407 408 for (uint32_t i=0; i<_param->_nb_instruction; i++)409 c_enable [i] = n_enable [i];396 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 397 // n_enable [i] = in_PREDICT_INSTRUCTION_ENABLE [i]->read(); 398 // } 399 400 // if (not c_val) 401 // { 402 // if (n_val and nn_val) 403 // { 404 // c_val = 1; 405 // c_addr = n_addr; 406 // c_is_ds_take = n_is_ds_take; 407 408 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 409 // c_enable [i] = n_enable [i]; 410 410 411 n_val = 1;412 n_addr = nn_addr;413 n_is_ds_take = nn_is_ds_take;411 // n_val = 1; 412 // n_addr = nn_addr; 413 // n_is_ds_take = nn_is_ds_take; 414 414 415 nn_val = 0;416 }417 }418 419 if (in_EVENT_VAL->read() and out_EVENT_ACK->read())420 {421 LABEL("EVENT : Transaction accepted");422 423 c_val = false;424 n_val = true;425 426 n_addr = in_EVENT_ADDRESS->read();427 n_is_ds_take = in_EVENT_IS_DS_TAKE->read();428 nn_val = in_EVENT_ADDRESS_NEXT_VAL->read();429 nn_addr = in_EVENT_ADDRESS_NEXT ->read();430 nn_is_ds_take = 0;431 432 n_enable [0] = 1;433 for (uint32_t i=1; i<_param->_nb_instruction; i++)434 n_enable [i] = 0;435 }415 // nn_val = 0; 416 // } 417 // } 418 419 // if (in_EVENT_VAL->read() and out_EVENT_ACK->read()) 420 // { 421 // LABEL("EVENT : Transaction accepted"); 422 423 // c_val = false; 424 // n_val = true; 425 426 // n_addr = in_EVENT_ADDRESS->read(); 427 // n_is_ds_take = in_EVENT_IS_DS_TAKE->read(); 428 // nn_val = in_EVENT_ADDRESS_NEXT_VAL->read(); 429 // nn_addr = in_EVENT_ADDRESS_NEXT ->read(); 430 // nn_is_ds_take = 0; 431 432 // n_enable [0] = 1; 433 // for (uint32_t i=1; i<_param->_nb_instruction; i++) 434 // n_enable [i] = 0; 435 // } 436 436 437 437 438 {439 string str_c_enable = "";440 string str_n_enable = "";441 442 for (uint32_t i=0; i<_param->_nb_instruction; i++)443 {444 str_c_enable += " " + toString(c_enable [i]);445 str_n_enable += " " + toString(n_enable [i]);446 }447 448 LABEL("-----------------------------------");449 LABEL(" * nb_packet_in : %d",nb_packet_in);450 LABEL(" * nb_packet_out : %d",nb_packet_out);451 LABEL(" * pc : %d %d %.8x %s",c_val ,c_is_ds_take , c_addr ,str_c_enable.c_str());452 if (nn_val)453 {454 LABEL(" * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take , n_addr ,str_n_enable.c_str());455 }456 else457 {458 LABEL(" * pc+4 : %d %d %.8x" ,n_val ,n_is_ds_take , n_addr );459 }460 LABEL(" * pc+8 : %d %d %.8x" ,nn_val ,nn_is_ds_take, nn_addr);461 LABEL("-----------------------------------");462 }463 464 SC_START(1);465 cache->transition();438 // { 439 // string str_c_enable = ""; 440 // string str_n_enable = ""; 441 442 // for (uint32_t i=0; i<_param->_nb_instruction; i++) 443 // { 444 // str_c_enable += " " + toString(c_enable [i]); 445 // str_n_enable += " " + toString(n_enable [i]); 446 // } 447 448 // LABEL("-----------------------------------"); 449 // LABEL(" * nb_packet_in : %d",nb_packet_in); 450 // LABEL(" * nb_packet_out : %d",nb_packet_out); 451 // LABEL(" * pc : %d %d %.8x %s",c_val ,c_is_ds_take , c_addr ,str_c_enable.c_str()); 452 // if (nn_val) 453 // { 454 // LABEL(" * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take , n_addr ,str_n_enable.c_str()); 455 // } 456 // else 457 // { 458 // LABEL(" * pc+4 : %d %d %.8x" ,n_val ,n_is_ds_take , n_addr ); 459 // } 460 // LABEL(" * pc+8 : %d %d %.8x" ,nn_val ,nn_is_ds_take, nn_addr); 461 // LABEL("-----------------------------------"); 462 // } 463 464 // SC_START(1); 465 // cache->transition(); 466 466 } 467 467 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Ifetch_unit.h
r88 r101 90 90 public : SC_IN (Tcontrol_t ) * in_PREDICT_PC_NEXT_IS_DS_TAKE ; 91 91 public : SC_IN (Tcontrol_t ) ** in_PREDICT_INSTRUCTION_ENABLE ; //[nb_instruction] 92 public : SC_IN (Tinst_ifetch_ptr_t ) * in_PREDICT_INST_IFETCH_PTR ;93 92 public : SC_IN (Tbranch_state_t ) * in_PREDICT_BRANCH_STATE ; 94 93 public : SC_IN (Tprediction_ptr_t ) * in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ; 94 public : SC_IN (Tinst_ifetch_ptr_t ) * in_PREDICT_INST_IFETCH_PTR ; 95 95 96 96 // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: See TracChangeset
for help on using the changeset viewer.