[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_decod" |
---|
| 22 | void Update_Prediction_Table::genMealy_decod (void) |
---|
| 23 | { |
---|
[88] | 24 | log_begin(Update_Prediction_Table,FUNCTION); |
---|
| 25 | log_function(Update_Prediction_Table,FUNCTION,_name.c_str()); |
---|
[81] | 26 | |
---|
[88] | 27 | // WARNING : One branch per context per cycle |
---|
[95] | 28 | if (PORT_READ(in_NRESET) != 0) |
---|
| 29 | { |
---|
[81] | 30 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 31 | { |
---|
[88] | 32 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * DECOD [%d]",i); |
---|
[81] | 33 | |
---|
[88] | 34 | Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0; |
---|
| 35 | bool is_accurate = reg_IS_ACCURATE [context]; |
---|
| 36 | event_state_t event_state = reg_EVENT_STATE [context]; |
---|
| 37 | uint32_t ptr_write = reg_UPT_TOP [context]; |
---|
[81] | 38 | |
---|
[88] | 39 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context ); |
---|
| 40 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * is_accurate : %d",is_accurate); |
---|
| 41 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * event_state : %s",toString(event_state).c_str()); |
---|
| 42 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ptr_write : %d",ptr_write ); |
---|
| 43 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_state : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str()); |
---|
| 44 | |
---|
| 45 | // ack : |
---|
| 46 | // * in all case (miss or hit), need empty slot |
---|
| 47 | // * is_accurate |
---|
| 48 | // * event_state : don't update upt |
---|
| 49 | internal_DECOD_ACK [i] = ((reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state == UPDATE_PREDICTION_STATE_EMPTY) and |
---|
| 50 | is_accurate and |
---|
| 51 | // ( |
---|
| 52 | (event_state == EVENT_STATE_OK )// or |
---|
| 53 | // (event_state == EVENT_STATE_FLUSH_UFPT ) or |
---|
| 54 | // (event_state == EVENT_STATE_UPDATE_CONTEXT)) |
---|
| 55 | ); |
---|
| 56 | internal_DECOD_UPT_PTR_WRITE [i] = ptr_write; |
---|
| 57 | |
---|
| 58 | log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ack : %d",internal_DECOD_ACK [i]); |
---|
| 59 | |
---|
[81] | 60 | PORT_WRITE(out_DECOD_ACK [i], internal_DECOD_ACK [i]); |
---|
| 61 | } |
---|
[95] | 62 | } |
---|
[88] | 63 | log_end(Update_Prediction_Table,FUNCTION); |
---|
[81] | 64 | }; |
---|
| 65 | |
---|
| 66 | }; // end namespace update_prediction_table |
---|
| 67 | }; // end namespace prediction_unit |
---|
| 68 | }; // end namespace front_end |
---|
| 69 | }; // end namespace multi_front_end |
---|
| 70 | }; // end namespace core |
---|
| 71 | |
---|
| 72 | }; // end namespace behavioural |
---|
| 73 | }; // end namespace morpheo |
---|
| 74 | #endif |
---|