[81] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_front_end { |
---|
| 15 | namespace front_end { |
---|
| 16 | namespace prediction_unit { |
---|
| 17 | namespace update_prediction_table { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Update_Prediction_Table::genMealy_predict" |
---|
| 22 | void Update_Prediction_Table::genMealy_predict (void) |
---|
| 23 | { |
---|
| 24 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
| 25 | |
---|
| 26 | for (uint32_t i=0; i<_param->_nb_inst_predict; i++) |
---|
| 27 | { |
---|
| 28 | Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0; |
---|
| 29 | uint32_t top = reg_TOP[context]; |
---|
| 30 | |
---|
| 31 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT [%d] (genMealy)",i); |
---|
| 32 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); |
---|
| 33 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); |
---|
| 34 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * state : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][top]._state).c_str()); |
---|
| 35 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * is accurate : %d",PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i])); |
---|
| 36 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * need update : %d",reg_NB_ELT_NEED_UPDATE [context]); |
---|
| 37 | |
---|
| 38 | // Not Full, accurate and no previous miss |
---|
| 39 | // Optimisation to restart faster : |
---|
| 40 | // don't counter nb_elt_ko, but just nb_elt that need a update (change branch structure) |
---|
| 41 | internal_PREDICT_ACK [i] = ((reg_UPDATE_PREDICTION_TABLE [context][top]._state == UPDATE_PREDICTION_STATE_EMPTY) and |
---|
| 42 | PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]) and |
---|
| 43 | (reg_NB_ELT_NEED_UPDATE [context] == 0)); |
---|
| 44 | |
---|
| 45 | // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ACK : %d",internal_PREDICT_ACK [i]); |
---|
| 46 | |
---|
| 47 | PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 51 | }; |
---|
| 52 | |
---|
| 53 | }; // end namespace update_prediction_table |
---|
| 54 | }; // end namespace prediction_unit |
---|
| 55 | }; // end namespace front_end |
---|
| 56 | }; // end namespace multi_front_end |
---|
| 57 | }; // end namespace core |
---|
| 58 | |
---|
| 59 | }; // end namespace behavioural |
---|
| 60 | }; // end namespace morpheo |
---|
| 61 | #endif |
---|