Changeset 97 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table
- Timestamp:
- Dec 19, 2008, 4:34:00 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/Makefile.deps
r81 r97 21 21 22 22 Update_Prediction_Table_LIBRARY = -lUpdate_Prediction_Table \ 23 $(Behavioural_LIBRARY) 23 $(Behavioural_LIBRARY) 24 24 25 25 Update_Prediction_Table_DIR_LIBRARY = -L$(Update_Prediction_Table_DIR)/lib \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp
r95 r97 42 42 43 43 #ifdef STATISTICS 44 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5, 50);44 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); 45 45 #endif 46 46 … … 137 137 ALLOC1_SC_SIGNAL(out_UPDATE_RAS_PREDICTION_IFETCH ,"out_UPDATE_RAS_PREDICTION_IFETCH ",Tcontrol_t ,_param->_nb_inst_update); 138 138 139 ALLOC1_SC_SIGNAL( in_EVENT_STATE ," in_EVENT_STATE ",Tevent_state_t ,_param->_nb_context); 139 ALLOC1_SC_SIGNAL( in_EVENT_VAL ," in_EVENT_VAL ",Tcontrol_t ,_param->_nb_context); 140 ALLOC1_SC_SIGNAL(out_EVENT_ACK ,"out_EVENT_ACK ",Tcontrol_t ,_param->_nb_context); 140 141 ALLOC1_SC_SIGNAL( in_EVENT_TYPE ," in_EVENT_TYPE ",Tevent_type_t ,_param->_nb_context); 141 142 ALLOC1_SC_SIGNAL( in_EVENT_DEPTH ," in_EVENT_DEPTH ",Tdepth_t ,_param->_nb_context); … … 230 231 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_INDEX ,_param->_nb_inst_update); 231 232 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_PREDICTION_IFETCH ,_param->_nb_inst_update); 232 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_EVENT_STATE ,_param->_nb_context); 233 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_EVENT_VAL ,_param->_nb_context); 234 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_EVENT_ACK ,_param->_nb_context); 233 235 INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_EVENT_TYPE ,_param->_nb_context); 234 236 if (_param->_have_port_depth) … … 316 318 in_UPDATE_ACK [i]->write(0); 317 319 for (uint32_t i=0; i<_param->_nb_context; ++i) 318 { 319 in_EVENT_STATE [i]->write(EVENT_STATE_NO_EVENT); 320 in_EVENT_TYPE [i]->write(EVENT_TYPE_NONE ); 321 } 320 in_EVENT_VAL [i]->write(0); 321 322 322 //--------------------------------------------------------------------- 323 323 //--------------------------------------------------------------------- … … 932 932 933 933 SC_START(1); 934 in_EVENT_ STATE [context]->write(EVENT_STATE_END);934 in_EVENT_VAL [context]->write(1); 935 935 in_EVENT_TYPE [context]->write(EVENT_TYPE_MISS_SPECULATION); 936 936 937 937 SC_START(1); 938 in_EVENT_ STATE [context]->write(EVENT_STATE_NO_EVENT);938 in_EVENT_VAL [context]->write(0); 939 939 in_EVENT_TYPE [context]->write(EVENT_TYPE_NONE ); 940 940 } … … 1366 1366 1367 1367 SC_START(1); 1368 in_EVENT_ STATE [context]->write(EVENT_STATE_END);1368 in_EVENT_VAL [context]->write(1); 1369 1369 in_EVENT_TYPE [context]->write(EVENT_TYPE_MISS_SPECULATION); 1370 1370 1371 1371 SC_START(1); 1372 in_EVENT_ STATE [context]->write(EVENT_STATE_NO_EVENT);1372 in_EVENT_VAL [context]->write(0); 1373 1373 in_EVENT_TYPE [context]->write(EVENT_TYPE_NONE ); 1374 1374 } … … 1974 1974 1975 1975 SC_START(1); 1976 in_EVENT_ STATE [context]->write(EVENT_STATE_END);1976 in_EVENT_VAL [context]->write(1); 1977 1977 in_EVENT_TYPE [context]->write(EVENT_TYPE_MISS_SPECULATION); 1978 1978 1979 1979 SC_START(1); 1980 in_EVENT_ STATE [context]->write(EVENT_STATE_NO_EVENT);1980 in_EVENT_VAL [context]->write(0); 1981 1981 in_EVENT_TYPE [context]->write(EVENT_TYPE_NONE ); 1982 1982 } … … 2155 2155 delete [] out_UPDATE_RAS_PREDICTION_IFETCH; 2156 2156 2157 DELETE1_SC_SIGNAL( in_EVENT_STATE ,_param->_nb_context); 2157 DELETE1_SC_SIGNAL( in_EVENT_VAL ,_param->_nb_context); 2158 DELETE1_SC_SIGNAL(out_EVENT_ACK ,_param->_nb_context); 2158 2159 DELETE1_SC_SIGNAL( in_EVENT_TYPE ,_param->_nb_context); 2159 2160 DELETE1_SC_SIGNAL( in_EVENT_DEPTH ,_param->_nb_context); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h
r95 r97 52 52 public : Stat * _stat; 53 53 54 private : counter_t ** _stat_nb_branch_hit ; //[nb_context] 55 private : counter_t ** _stat_nb_branch_miss ; //[nb_context] 56 private : counter_t ** _stat_nb_branch_unused ; //[nb_context] 57 private : counter_t ** _stat_queue_nb_cycle_empty; //[nb_context] 58 private : counter_t ** _stat_queue_nb_cycle_full ; //[nb_context] 59 private : counter_t ** _stat_queue_nb_elt ; //[nb_context] 54 private : counter_t *** _stat_nb_branch_hit ; //[nb_context][MAX_BRANCH_CONDITION] 55 private : counter_t *** _stat_nb_branch_miss ; //[nb_context][MAX_BRANCH_CONDITION] 56 private : counter_t ** _stat_nb_branch_unused ; //[nb_context] 57 private : counter_t ** _stat_ufpt_queue_nb_elt ; //[nb_context] 58 private : counter_t ** _stat_upt_queue_nb_elt ; //[nb_context] 60 59 61 60 #endif … … 143 142 144 143 // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 145 public : SC_IN (Tevent_state_t ) ** in_EVENT_STATE ; //[nb_context] 144 public : SC_IN (Tcontrol_t ) ** in_EVENT_VAL ; //[nb_context] 145 public : SC_OUT(Tcontrol_t ) ** out_EVENT_ACK ; //[nb_context] 146 146 public : SC_IN (Tevent_type_t ) ** in_EVENT_TYPE ; //[nb_context] 147 147 public : SC_IN (Tdepth_t ) ** in_EVENT_DEPTH ; //[nb_context] … … 197 197 private : Tdepth_t * internal_UPDATE_DEPTH ; //[nb_inst_update] 198 198 private : bool * internal_UPDATE_RAS ; //[nb_inst_update] 199 private : Tcontrol_t * internal_EVENT_ACK ; //[nb_context] 199 200 200 201 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp
r88 r97 76 76 if (usage_is_set(_usage,USE_SYSTEMC)) 77 77 { 78 78 // Constant 79 79 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 80 80 { … … 82 82 PORT_WRITE(out_BRANCH_COMPLETE_ACK [i], internal_BRANCH_COMPLETE_ACK [i]); 83 83 } 84 for (uint32_t i=0; i<_param->_nb_context; ++i) 85 { 86 internal_EVENT_ACK [i] = 1; 87 PORT_WRITE(out_EVENT_ACK [i], internal_EVENT_ACK [i]); 88 } 84 89 85 90 log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - transition"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp
r95 r97 151 151 ALLOC1_INTERFACE("event", IN,SOUTH,"event", _param->_nb_context); 152 152 153 ALLOC1_SIGNAL_IN ( in_EVENT_STATE ,"state",Tevent_state_t,_param->_size_event_state); 153 ALLOC1_VALACK_IN ( in_EVENT_VAL ,VAL); 154 ALLOC1_VALACK_OUT(out_EVENT_ACK ,ACK); 154 155 ALLOC1_SIGNAL_IN ( in_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type ); 155 156 ALLOC1_SIGNAL_IN ( in_EVENT_DEPTH ,"depth",Tdepth_t ,_param->_size_depth ); … … 183 184 ALLOC1(internal_UPDATE_DEPTH ,Tdepth_t ,_param->_nb_inst_update); 184 185 ALLOC1(internal_UPDATE_RAS ,bool ,_param->_nb_inst_update); 186 ALLOC1(internal_EVENT_ACK ,Tcontrol_t,_param->_nb_context); 185 187 186 188 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp
r95 r97 111 111 112 112 // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 DELETE1_SIGNAL( in_EVENT_STATE ,_param->_nb_context,_param->_size_event_state); 113 DELETE1_SIGNAL( in_EVENT_VAL ,_param->_nb_context,1); 114 DELETE1_SIGNAL(out_EVENT_ACK ,_param->_nb_context,1); 114 115 DELETE1_SIGNAL( in_EVENT_TYPE ,_param->_nb_context,_param->_size_event_type ); 115 116 DELETE1_SIGNAL( in_EVENT_DEPTH ,_param->_nb_context,_param->_size_depth ); … … 137 138 DELETE1(internal_UPDATE_DEPTH ,_param->_nb_inst_update); 138 139 DELETE1(internal_UPDATE_RAS ,_param->_nb_inst_update); 140 DELETE1(internal_EVENT_ACK ,_param->_nb_context); 139 141 140 142 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp
r94 r97 67 67 if (take != 1) 68 68 throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad direction.",i,toString(condition).c_str())); 69 if (addr_dest != addr_good)70 throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str()));69 // if (addr_dest != addr_good) 70 // throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str())); 71 71 #endif 72 72 … … 85 85 86 86 #ifdef DEBUG_TEST 87 if (addr_dest != addr_good)88 throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str()));87 // if (addr_dest != addr_good) 88 // throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str())); 89 89 #endif 90 90 … … 103 103 104 104 #ifdef DEBUG_TEST 105 if (addr_dest != addr_good)106 throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str()));105 // if (addr_dest != addr_good) 106 // throw ERRORMORPHEO(FUNCTION,toString("Branch_complete[%d] (condition %s) : bad destination address.",i,toString(condition).c_str())); 107 107 #endif 108 108 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_statistics_allocation.cpp
r88 r97 8 8 9 9 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h" 10 #include "Behavioural/include/Allocation.h" 11 10 12 11 13 namespace morpheo { … … 28 30 param_statistics); 29 31 30 // _stat_nb_branch_hit = new counter_t * [_param->_nb_context]; 31 // _stat_nb_branch_miss = new counter_t * [_param->_nb_context]; 32 // _stat_nb_branch_unused = new counter_t * [_param->_nb_context]; 33 // _stat_queue_nb_cycle_empty = new counter_t * [_param->_nb_context]; 34 // _stat_queue_nb_cycle_full = new counter_t * [_param->_nb_context]; 35 // _stat_queue_nb_elt = new counter_t * [_param->_nb_context]; 36 37 // for (uint32_t i=0; i<_param->_nb_context; ++i) 38 // { 39 // _stat_nb_branch_hit [i] = _stat->create_counter("nb_branch_hit_" +toString(i),"",toString(_("Branch hit speculation (context %d)"),i)); 40 // _stat_nb_branch_miss [i] = _stat->create_counter("nb_branch_miss_" +toString(i),"",toString(_("Branch miss speculation (context %d)"),i)); 41 // _stat_nb_branch_unused [i] = _stat->create_counter("nb_branch_unused_" +toString(i),"",toString(_("Branch unused, because an previous branch have miss speculation (context %d)"),i)); 42 // _stat_queue_nb_cycle_empty [i] = _stat->create_counter("queue_nb_cycle_empty_"+toString(i),"",toString(_("Cycle number where the Update Prediction Table is empty (context %d)"),i)); 43 // _stat_queue_nb_cycle_full [i] = _stat->create_counter("queue_nb_cycle_full_" +toString(i),"",toString(_("Cycle number where the Update Prediction Table is full (%d elements) (context %d)"),_param->_size_queue[i],i)); 44 // _stat_queue_nb_elt [i] = _stat->create_counter("queue_nb_elt_" +toString(i),"",toString(_("Average branchement by cycle in Update Prediction Table (context %d)"),i)); 45 // } 46 32 { 33 ALLOC2(_stat_nb_branch_hit ,counter_t *,_param->_nb_context,MAX_BRANCH_CONDITION); 34 ALLOC2(_stat_nb_branch_miss ,counter_t *,_param->_nb_context,MAX_BRANCH_CONDITION); 35 ALLOC1(_stat_nb_branch_unused ,counter_t *,_param->_nb_context); 36 37 for (uint32_t i=0; i<_param->_nb_context; ++i) 38 { 39 std::string sum_miss = "0"; 40 std::string sum_branchement = "0"; 41 42 for (uint32_t j=0; j<MAX_BRANCH_CONDITION; ++j) 43 if (is_branch_condition_valid(j)) 44 { 45 std::string nb_miss = "nb_branch_miss_"+toString(i)+"_"+toString(j); 46 std::string nb_branchement = "+ nb_branch_hit_"+toString(i)+"_"+toString(j)+" nb_branch_miss_"+toString(i)+"_"+toString(j); 47 _stat_nb_branch_hit [i][j] = _stat->create_counter("nb_branch_hit_" +toString(i)+"_"+toString(j),"",toString(_("Branch hit speculation, branch condition : %s (context %d)"),toString(static_cast<branch_condition_t>(j)).c_str(),i)); 48 _stat_nb_branch_miss [i][j] = _stat->create_counter(nb_miss,"",toString(_("Branch miss speculation, branch condition : %s (context %d)"),toString(static_cast<branch_condition_t>(j)).c_str(),i)); 49 50 // _stat->create_expr_average("average_miss_"+toString(i)+"_"+toString(j), 51 // "nb_branch_miss_"+toString(i)+"_"+toString(j), 52 // nb_branchement, 53 // "miss/branchement", 54 // toString(_("Average miss by branchement, branch condition : %s (context %d)"),toString(static_cast<branch_condition_t>(j)).c_str(),i)); 55 56 _stat->create_expr_percent("percent_miss_"+toString(i)+"_"+toString(j), 57 nb_miss, 58 nb_branchement, 59 toString(_("Percent miss by branchement, branch condition : %s (context %d)"),toString(static_cast<branch_condition_t>(j)).c_str(),i)); 60 61 sum_miss = "+ "+nb_miss +" "+ sum_miss; 62 sum_branchement = "+ "+nb_branchement+" "+sum_branchement; 63 } 64 65 // _stat->create_expr_average("average_miss_"+toString(i), 66 // sum_miss, 67 // sum_branchement, 68 // "miss/branchement", 69 // toString(_("Average miss by branchement (context %d)"),i)); 70 71 _stat->create_expr_percent("percent_miss_"+toString(i), 72 sum_miss, 73 sum_branchement, 74 toString(_("Percent miss by branchement (context %d)"),i)); 75 76 _stat_nb_branch_unused [i] = _stat->create_counter("nb_branch_unused_" +toString(i),"",toString(_("Branch unused (previous speculation) (context %d)"),i)); 77 } 78 } 79 80 { 81 ALLOC1(_stat_ufpt_queue_nb_elt ,counter_t *,_param->_nb_context); 82 83 for (uint32_t i=0; i<_param->_nb_context; ++i) 84 { 85 _stat_ufpt_queue_nb_elt [i] = _stat->create_counter("ufpt_queue_nb_elt_"+toString(i),"",toString(_("Branchement in Update Fetch Prediction Table (context %d)"),i)); 86 87 _stat->create_expr_average_by_cycle("average_occupation_ufpt_queue_"+toString(i),"ufpt_queue_nb_elt_"+toString(i), "", toString(_("Average instruction by cycle in Update Fetch Prediction Table (context %d)"),i)); 88 _stat->create_expr_percent ("percent_occupation_ufpt_queue_"+toString(i), "average_occupation_ufpt_queue_"+toString(i), toString(_param->_size_ufpt_queue[i]), toString(_("Percent occupation of Update Fetch Prediction Table (context %d)"),i)); 89 } 90 } 91 92 { 93 ALLOC1(_stat_upt_queue_nb_elt ,counter_t *,_param->_nb_context); 94 95 for (uint32_t i=0; i<_param->_nb_context; ++i) 96 { 97 _stat_upt_queue_nb_elt [i] = _stat->create_counter("upt_queue_nb_elt_"+toString(i),"",toString(_("Average branchement by cycle in Update Prediction Table (context %d)"),i)); 98 99 _stat->create_expr_average_by_cycle("average_occupation_upt_queue_"+toString(i),"upt_queue_nb_elt_"+toString(i), "", toString(_("Average instruction by cycle in Update Prediction Table (context %d)"),i)); 100 _stat->create_expr_percent ("percent_occupation_upt_queue_"+toString(i), "average_occupation_upt_queue_"+toString(i), toString(_param->_size_upt_queue[i]), toString(_("Percent occupation of Update Prediction Table (context %d)"),i)); 101 } 102 } 103 47 104 log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); 48 105 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_statistics_deallocation.cpp
r88 r97 8 8 9 9 #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h" 10 #include "Behavioural/include/Allocation.h" 10 11 11 12 namespace morpheo { … … 27 28 28 29 delete _stat; 29 // delete [] _stat_nb_branch_hit ; 30 // delete [] _stat_nb_branch_miss;31 // delete [] _stat_nb_branch_unused;32 // delete [] _stat_queue_nb_cycle_empty;33 // delete [] _stat_queue_nb_cycle_full;34 // delete [] _stat_queue_nb_elt;30 31 DELETE2(_stat_nb_branch_hit ,_param->_nb_context,MAX_BRANCH_CONDITION); 32 DELETE2(_stat_nb_branch_miss ,_param->_nb_context,MAX_BRANCH_CONDITION); 33 DELETE1(_stat_nb_branch_unused ,_param->_nb_context); 34 DELETE1(_stat_ufpt_queue_nb_elt ,_param->_nb_context); 35 DELETE1(_stat_upt_queue_nb_elt ,_param->_nb_context); 35 36 36 37 log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp
r95 r97 472 472 // bool have_event = ((reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO) or 473 473 // (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_EVENT)); 474 #ifdef STATISTICS 475 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition; 476 bool ok = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_OK); 477 #endif 474 478 bool ko = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO); 475 479 … … 480 484 481 485 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO; 486 487 #ifdef STATISTICS 488 if (usage_is_set(_usage,USE_STATISTICS)) 489 (*_stat_nb_branch_miss [context][condition])++; 490 #endif 482 491 } 483 492 else … … 486 495 487 496 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK; 497 498 499 #ifdef STATISTICS 500 if (usage_is_set(_usage,USE_STATISTICS)) 501 { 502 if (ok) 503 (*_stat_nb_branch_hit [context][condition]) ++; 504 else 505 (*_stat_nb_branch_unused [context]) ++; 506 } 507 #endif 488 508 } 489 509 … … 548 568 // =================================================================== 549 569 for (uint32_t i=0; i<_param->_nb_context; ++i) 550 { 551 //---------------------------------------------------------------- 552 // Cases 553 //---------------------------------------------------------------- 554 // * EVENT_TYPE_NONE - nothing 555 // * EVENT_TYPE_MISS_SPECULATION 556 // * EVENT_STATE_END - Change state, reset pointer 557 // * EVENT_TYPE_EXCEPTION - 558 // * EVENT_STATE_EVENT - Flush upft and upt 559 // * EVENT_STATE_END - Change state, reset pointer 560 // * EVENT_TYPE_BRANCH_NO_ACCURATE - nothing : manage in decod and update 561 // * EVENT_TYPE_SPR_ACCESS - nothing 562 // * EVENT_TYPE_MSYNC - nothing 563 // * EVENT_TYPE_PSYNC - nothing 564 // * EVENT_TYPE_CSYNC - nothing 565 566 Tevent_state_t event_state = PORT_READ(in_EVENT_STATE [i]); 567 Tevent_type_t event_type = PORT_READ(in_EVENT_TYPE [i]); 568 // Tdepth_t depth = PORT_READ(in_EVENT_DEPTH [i]); 570 if (PORT_READ(in_EVENT_VAL [i]) and internal_EVENT_ACK [i]) 571 { 572 //---------------------------------------------------------------- 573 // Cases 574 //---------------------------------------------------------------- 575 // * EVENT_TYPE_NONE - nothing 576 // * EVENT_TYPE_MISS_SPECULATION - Change state, reset pointer 577 // * EVENT_TYPE_EXCEPTION - Flush upft and upt, Change state, reset pointer 578 // * EVENT_TYPE_BRANCH_NO_ACCURATE - nothing : manage in decod and update 579 // * EVENT_TYPE_SPR_ACCESS - nothing 580 // * EVENT_TYPE_MSYNC - nothing 581 // * EVENT_TYPE_PSYNC - nothing 582 // * EVENT_TYPE_CSYNC - nothing 583 584 Tevent_type_t event_type = PORT_READ(in_EVENT_TYPE [i]); 585 // Tdepth_t depth = PORT_READ(in_EVENT_DEPTH [i]); 569 586 570 // Test if end of miss 571 if ((event_state == EVENT_STATE_END) and 572 (event_type == EVENT_TYPE_MISS_SPECULATION)) 573 { 574 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT"); 575 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * state : EVENT_STATE_END"); 576 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * type : EVENT_TYPE_MISS_SPECULATION"); 577 578 #ifdef DEBUG_TEST 579 if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT) 580 throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state.")); 581 #endif 582 583 // Change state 584 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_OK (event)",i); 585 586 reg_EVENT_STATE [i] = EVENT_STATE_OK; 587 588 // uint32_t bottom = reg_UPT_BOTTOM [i]; 589 590 // reg_UPT_TOP [i] = bottom; 591 // reg_UPT_UPDATE [i] = bottom; 592 } 593 } 587 // Test if end of miss 588 if (event_type == EVENT_TYPE_MISS_SPECULATION) 589 { 590 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT"); 591 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * type : EVENT_TYPE_MISS_SPECULATION"); 592 593 #ifdef DEBUG_TEST 594 if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT) 595 throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state.")); 596 #endif 597 598 // Change state 599 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_OK (event)",i); 600 601 reg_EVENT_STATE [i] = EVENT_STATE_OK; 602 } 603 } 594 604 595 605 // =================================================================== … … 634 644 } 635 645 646 #ifdef STATISTICS 647 if (usage_is_set(_usage,USE_STATISTICS)) 648 for (uint32_t i=0; i<_param->_nb_context; i++) 649 { 650 for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; j++) 651 if (reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state != UPDATE_FETCH_PREDICTION_STATE_EMPTY) 652 (*_stat_ufpt_queue_nb_elt [i]) ++; 653 for (uint32_t j=0; j<_param->_size_upt_queue[i]; j++) 654 if (reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_EMPTY) 655 (*_stat_upt_queue_nb_elt [i]) ++; 656 } 657 #endif 658 636 659 // =================================================================== 637 660 // =====[ PRINT ]=====================================================
Note: See TracChangeset
for help on using the changeset viewer.