Changeset 105 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp
- Timestamp:
- Feb 5, 2009, 12:18:31 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp
r104 r105 51 51 reg_PC_CURRENT_IS_DS [i][j] = 0; 52 52 reg_PC_CURRENT_IS_DS_TAKE [i][j] = 0; 53 //reg_PC_NEXT [i][j] = (0x100+4)>>2;53 reg_PC_NEXT [i][j] = (0x100+4)>>2; 54 54 } 55 55 … … 138 138 entry->operation = operation; 139 139 entry->is_delay_slot = PORT_READ(in_INSERT_IS_DELAY_SLOT [x][y]); 140 entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]);140 // entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]); 141 141 entry->exception = exception; 142 142 entry->exception_use = PORT_READ(in_INSERT_EXCEPTION_USE [x][y]); … … 162 162 entry->num_reg_re_phy_old = PORT_READ(in_INSERT_NUM_REG_RE_PHY_OLD [x][y]); 163 163 entry->num_reg_re_phy_new = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW [x][y]); 164 entry->no_sequence = type == TYPE_BRANCH; 165 entry->address_next = PORT_READ(in_INSERT_ADDRESS_NEXT [x][y]); 164 166 165 167 // Test if exception : … … 295 297 case ROB_MISS_WAIT_END : {state = ROB_END_KO_SPECULATIVE; break;} 296 298 // Store OK, Load and other instruction 297 case ROB_OTHER_WAIT_END : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:((have_miss_speculation)?ROB_END_ MISS:ROB_END_OK_SPECULATIVE); break;}299 case ROB_OTHER_WAIT_END : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:((have_miss_speculation)?ROB_END_LOAD_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE); break;} 298 300 default : 299 301 { … … 304 306 305 307 // update Re Order Buffer 306 entry->state = state; 307 entry->exception = exception; 308 entry->flags = PORT_READ(in_COMMIT_FLAGS [x]); 309 entry->no_sequence = PORT_READ(in_COMMIT_NO_SEQUENCE [x]); 310 entry->data_commit = PORT_READ(in_COMMIT_ADDRESS [x]); 308 entry->state = state; 309 entry->exception = exception; 310 entry->flags = PORT_READ(in_COMMIT_FLAGS [x]); 311 entry->no_sequence = PORT_READ(in_COMMIT_NO_SEQUENCE [x]); 312 // jalr, jr : address_dest is in register 313 if ((entry->type == TYPE_BRANCH) and 314 (entry->operation == OPERATION_BRANCH_L_JALR) and 315 (entry->read_rb)) 316 entry->address_next = PORT_READ(in_COMMIT_ADDRESS [x]); 311 317 } 312 318 } … … 345 351 Ttype_t type = entry->type ; 346 352 347 if (state == ROB_END_BRANCH_MISS) 353 if ((state == ROB_END_OK ) or // LOAD_MISS 354 // (state == ROB_END_KO ) or 355 (state == ROB_END_BRANCH_MISS)// or 356 // (state == ROB_END_LOAD_MISS ) or 357 // (state == ROB_END_MISS ) or 358 // (state == ROB_END_EXCEPTION ) 359 ) 360 { 361 // reg_PC_PREVIOUS [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id]; 362 reg_PC_CURRENT [front_end_id][context_id] = reg_PC_NEXT [front_end_id][context_id]; 363 reg_PC_CURRENT_IS_DS [front_end_id][context_id] = entry->type == TYPE_BRANCH; 364 reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence; 365 reg_PC_NEXT [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1); 366 } 367 368 if ((state == ROB_END_BRANCH_MISS) or 369 (state == ROB_END_LOAD_MISS)) 348 370 { 349 371 reg_EVENT_STATE [front_end_id][context_id] = EVENT_STATE_EVENT; 350 372 reg_EVENT_FLUSH [front_end_id][context_id] = true; 351 352 // TODO Compute address !!!!!!!!!!!353 373 } 354 374 … … 412 432 // =====[ UPDATE ]==================================================== 413 433 // =================================================================== 414 { 415 // Not yet implemented 416 } 434 if (internal_UPDATE_VAL and PORT_READ(in_UPDATE_ACK)) 435 { 436 log_printf(TRACE,Commit_unit,FUNCTION," * UPDATE"); 437 438 entry_t * entry = _rob [internal_UPDATE_NUM_BANK].front(); 439 440 switch (entry->state) 441 { 442 // case ROB_END_EXCEPTION_UPDATE : 443 // { 444 // entry->state = ROB_END_KO; 445 // throw ERRORMORPHEO(FUNCTION,_("Moore : exception is not yet supported (Coming Soon).\n")); 446 // break; 447 // } 448 case ROB_END_LOAD_MISS_UPDATE : 449 { 450 log_printf(TRACE,Commit_unit,FUNCTION," * ROB_END_LOAD_MISS_UPDATE"); 451 452 entry->state = ROB_END_LOAD_MISS; 453 break; 454 } 455 default : 456 { 457 throw ERRORMORPHEO(FUNCTION,_("Update : invalid state.\n")); 458 break; 459 } 460 } 461 462 } 417 463 418 464 // =================================================================== … … 438 484 439 485 Tdepth_t depth_min = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0; 440 //Tdepth_t depth_max = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0;441 //Tcontrol_t depth_full = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]);486 Tdepth_t depth_max = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0; 487 Tcontrol_t depth_full = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]); 442 488 443 489 // is a valid instruction ? … … 455 501 // ....... max ...X... min ....... KO 456 502 457 // Tcontrol_t is_valid = ((depth == depth_min) or458 // depth_full or459 // ((depth_min <= depth_max)?460 // ((depth >= depth_min) and (depth <=depth_max)):461 // ((depth >= depth_min) or (depth <=depth_max))));462 463 503 bool flush = reg_EVENT_FLUSH [front_end_id][context_id]; 464 Tcontrol_t is_valid = ((depth == depth_min) and not flush); 504 505 Tcontrol_t is_valid = (((depth == depth_min) or 506 depth_full or 507 ((depth_min <= depth_max)? 508 ((depth >= depth_min) and (depth <=depth_max)): 509 ((depth >= depth_min) or (depth <=depth_max)))) 510 and not flush); 511 512 // Tcontrol_t is_valid = ((depth == depth_min) and not flush); 465 513 466 514 log_printf(TRACE,Commit_unit,FUNCTION," * HEAD [%d]",i); 467 log_printf(TRACE,Commit_unit,FUNCTION," * is_valid : %d ",is_valid);515 log_printf(TRACE,Commit_unit,FUNCTION," * is_valid : %d ((depth == depth_min) and not flush)",is_valid); 468 516 log_printf(TRACE,Commit_unit,FUNCTION," * depth : %d",depth ); 469 517 log_printf(TRACE,Commit_unit,FUNCTION," * depth_min : %d",depth_min); 470 // log_printf(TRACE,Commit_unit,FUNCTION," * depth_max : %d",depth_max); 518 log_printf(TRACE,Commit_unit,FUNCTION," * depth_max : %d",depth_max); 519 log_printf(TRACE,Commit_unit,FUNCTION," * depth_full : %d",depth_full); 471 520 log_printf(TRACE,Commit_unit,FUNCTION," * flush : %d",flush); 472 521 … … 481 530 case ROB_BRANCH_COMPLETE : {state = ROB_END_MISS ; break;} 482 531 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 532 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 483 533 case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_KO; break;} 484 534 //case ROB_STORE_WAIT_HEAD_KO : {state = ; break;} … … 498 548 case ROB_END_KO : 499 549 case ROB_END_BRANCH_MISS : 550 case ROB_END_LOAD_MISS_UPDATE : 551 case ROB_END_LOAD_MISS : 552 case ROB_END_EXCEPTION_UPDATE : 500 553 case ROB_END_EXCEPTION : 501 554 default : … … 517 570 case ROB_END_KO_SPECULATIVE : {state = ROB_END_KO ; break;} 518 571 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS ; break;} 572 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_LOAD_MISS_UPDATE ; break;} 519 573 default : {break;} 520 574 } … … 528 582 switch (state) 529 583 { 530 case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_OK; break;}531 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION ; break;}584 case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_OK; break;} 585 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION_UPDATE; break;} 532 586 default : {break;} 533 587 } … … 549 603 for (uint32_t j=0; j<_param->_nb_context [i]; j++) 550 604 { 551 log_printf(TRACE,Commit_unit,FUNCTION," * [%d][%d] num_inst_all : %d, num_inst_mem : %d",i,j,reg_NB_INST_COMMIT_ALL[i][j],reg_NB_INST_COMMIT_MEM[i][j]);552 605 log_printf(TRACE,Commit_unit,FUNCTION," * [%d][%d] state : %s",i,j,toString(reg_EVENT_STATE [i][j]).c_str()); 606 log_printf(TRACE,Commit_unit,FUNCTION," * num_inst_all : %d",reg_NB_INST_COMMIT_ALL[i][j]); 607 log_printf(TRACE,Commit_unit,FUNCTION," * num_inst_mem : %d",reg_NB_INST_COMMIT_MEM[i][j]); 608 log_printf(TRACE,Commit_unit,FUNCTION," * PC_CURRENT : %.8x - %d %d",reg_PC_CURRENT [i][j], reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]); 609 log_printf(TRACE,Commit_unit,FUNCTION," * PC_NEXT : %.8x",reg_PC_NEXT [i][j]); 553 610 } 554 611 … … 567 624 it++) 568 625 { 569 log_printf(TRACE,Commit_unit,FUNCTION," [%.4d] %.4d %.4d %.4d %.4d, %.3d %.3d, %. 8x (%.8x) %.1d, %.1d %.4d, %.1d %.4d, %s - %d",626 log_printf(TRACE,Commit_unit,FUNCTION," [%.4d] %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s - %d", 570 627 x, 571 628 (*it)->front_end_id , … … 575 632 (*it)->type , 576 633 (*it)->operation , 577 578 634 // (*it)->address , 635 // (*it)->address << 2 , 579 636 (*it)->is_delay_slot , 580 637 (*it)->use_store_queue , … … 603 660 (*it)->num_reg_re_phy_new ); 604 661 605 log_printf(TRACE,Commit_unit,FUNCTION," %.2d %.2d %.1d %.1d %.8x ",662 log_printf(TRACE,Commit_unit,FUNCTION," %.2d %.2d %.1d %.1d %.8x (%.8x)", 606 663 (*it)->exception_use , 607 664 (*it)->exception , 608 665 (*it)->flags , 609 666 (*it)->no_sequence , 610 (*it)->data_commit 667 (*it)->address_next , 668 (*it)->address_next<<2 611 669 ); 612 670
Note: See TracChangeset
for help on using the changeset viewer.