[78] | 1 | /* |
---|
| 2 | * $Id: Update_Prediction_Table_deallocation.cpp 134 2009-07-15 08:41:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h" |
---|
[88] | 9 | #include "Behavioural/include/Allocation.h" |
---|
[78] | 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::deallocation" |
---|
| 22 | void Update_Prediction_Table::deallocation (void) |
---|
| 23 | { |
---|
| 24 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); |
---|
| 25 | |
---|
| 26 | if (_usage & USE_SYSTEMC) |
---|
| 27 | { |
---|
| 28 | delete in_CLOCK ; |
---|
| 29 | delete in_NRESET; |
---|
[81] | 30 | |
---|
[112] | 31 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 32 | DELETE1_SIGNAL( in_PREDICT_VAL ,_param->_nb_inst_predict,1); |
---|
| 33 | DELETE1_SIGNAL(out_PREDICT_ACK ,_param->_nb_inst_predict,1); |
---|
| 34 | DELETE1_SIGNAL( in_PREDICT_CONTEXT_ID ,_param->_nb_inst_predict,_param->_size_context_id); |
---|
| 35 | DELETE1_SIGNAL(out_PREDICT_UPDATE_PREDICTION_ID,_param->_nb_inst_predict,_param->_size_depth); |
---|
| 36 | DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_SRC ,_param->_nb_inst_predict,_param->_size_instruction_address); |
---|
| 37 | DELETE1_SIGNAL( in_PREDICT_BTB_ADDRESS_DEST ,_param->_nb_inst_predict,_param->_size_instruction_address); |
---|
| 38 | DELETE1_SIGNAL( in_PREDICT_BTB_CONDITION ,_param->_nb_inst_predict,_param->_size_branch_condition); |
---|
| 39 | DELETE1_SIGNAL( in_PREDICT_BTB_LAST_TAKE ,_param->_nb_inst_predict,1); |
---|
| 40 | DELETE1_SIGNAL( in_PREDICT_BTB_IS_ACCURATE ,_param->_nb_inst_predict,1); |
---|
| 41 | DELETE1_SIGNAL( in_PREDICT_DIR_HISTORY ,_param->_nb_inst_predict,_param->_size_history); |
---|
| 42 | DELETE1_SIGNAL( in_PREDICT_RAS_ADDRESS ,_param->_nb_inst_predict,_param->_size_instruction_address); |
---|
| 43 | DELETE1_SIGNAL( in_PREDICT_RAS_INDEX ,_param->_nb_inst_predict,_param->_max_size_ras_index); |
---|
[82] | 44 | |
---|
[112] | 45 | // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 46 | DELETE1_SIGNAL( in_DECOD_VAL ,_param->_nb_inst_decod,1); |
---|
| 47 | DELETE1_SIGNAL(out_DECOD_ACK ,_param->_nb_inst_decod,1); |
---|
| 48 | DELETE1_SIGNAL( in_DECOD_CONTEXT_ID ,_param->_nb_inst_decod,_param->_size_context_id); |
---|
| 49 | DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_SRC ,_param->_nb_inst_decod,_param->_size_instruction_address); |
---|
| 50 | DELETE1_SIGNAL( in_DECOD_BTB_ADDRESS_DEST ,_param->_nb_inst_decod,_param->_size_instruction_address); |
---|
| 51 | DELETE1_SIGNAL( in_DECOD_BTB_CONDITION ,_param->_nb_inst_decod,_param->_size_branch_condition); |
---|
| 52 | DELETE1_SIGNAL( in_DECOD_BTB_LAST_TAKE ,_param->_nb_inst_decod,1); |
---|
| 53 | DELETE1_SIGNAL( in_DECOD_RAS_ADDRESS ,_param->_nb_inst_decod,_param->_size_instruction_address); |
---|
| 54 | DELETE1_SIGNAL( in_DECOD_RAS_INDEX ,_param->_nb_inst_decod,_param->_max_size_ras_index); |
---|
| 55 | DELETE1_SIGNAL( in_DECOD_MISS_IFETCH ,_param->_nb_inst_decod,1); |
---|
| 56 | DELETE1_SIGNAL( in_DECOD_MISS_DECOD ,_param->_nb_inst_decod,1); |
---|
| 57 | DELETE1_SIGNAL( in_DECOD_UPDATE_PREDICTION_ID,_param->_nb_inst_decod,_param->_size_depth); |
---|
| 58 | // DELETE1_SIGNAL(out_DECOD_DEPTH ,_param->_nb_inst_decod,_param->_size_depth); |
---|
| 59 | DELETE1_SIGNAL( in_DECOD_IS_ACCURATE ,_param->_nb_inst_decod,1); |
---|
| 60 | DELETE1_SIGNAL(out_DECOD_CAN_CONTINUE ,_param->_nb_inst_decod,1); |
---|
| 61 | |
---|
| 62 | // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 63 | DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL ,_param->_nb_inst_branch_complete,1); |
---|
| 64 | DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK ,_param->_nb_inst_branch_complete,1); |
---|
| 65 | DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID ,_param->_nb_inst_branch_complete,_param->_size_context_id); |
---|
| 66 | DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH ,_param->_nb_inst_branch_complete,_param->_size_depth); |
---|
| 67 | DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS ,_param->_nb_inst_branch_complete,_param->_size_instruction_address); |
---|
| 68 | DELETE1_SIGNAL( in_BRANCH_COMPLETE_NO_SEQUENCE ,_param->_nb_inst_branch_complete,1); |
---|
| 69 | DELETE1_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete,1); |
---|
| 70 | // DELETE1_SIGNAL(out_BRANCH_COMPLETE_TAKE ,_param->_nb_inst_branch_complete,1); |
---|
| 71 | // DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC ,_param->_nb_inst_branch_complete,_param->_size_instruction_address); |
---|
| 72 | // DELETE1_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete,_param->_size_instruction_address); |
---|
| 73 | |
---|
[82] | 74 | // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[95] | 75 | DELETE1_SIGNAL(out_BRANCH_EVENT_VAL ,_param->_nb_context,1); |
---|
| 76 | DELETE1_SIGNAL( in_BRANCH_EVENT_ACK ,_param->_nb_context,1); |
---|
| 77 | // DELETE1_SIGNAL(out_BRANCH_EVENT_CONTEXT_ID ,_param->_nb_context,_param->_size_context_id); |
---|
[98] | 78 | DELETE1_SIGNAL(out_BRANCH_EVENT_DEPTH ,_param->_nb_context,_param->_size_depth); |
---|
[95] | 79 | // DELETE1_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION ,_param->_nb_context,1); |
---|
| 80 | DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC ,_param->_nb_context,_param->_size_instruction_address); |
---|
| 81 | DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST_VAL ,_param->_nb_context,1); |
---|
| 82 | DELETE1_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST ,_param->_nb_context,_param->_size_instruction_address); |
---|
[119] | 83 | DELETE1_SIGNAL(out_BRANCH_EVENT_CAN_CONTINUE ,_param->_nb_context,1); |
---|
[95] | 84 | |
---|
[112] | 85 | // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 86 | DELETE1_SIGNAL(out_UPDATE_VAL ,_param->_nb_inst_update,1); |
---|
| 87 | DELETE1_SIGNAL( in_UPDATE_ACK ,_param->_nb_inst_update,1); |
---|
| 88 | DELETE1_SIGNAL(out_UPDATE_CONTEXT_ID ,_param->_nb_inst_update,_param->_size_context_id); |
---|
| 89 | DELETE1_SIGNAL(out_UPDATE_MISS_PREDICTION ,_param->_nb_inst_update,1); |
---|
| 90 | DELETE1_SIGNAL(out_UPDATE_DIRECTION_GOOD ,_param->_nb_inst_update,1); |
---|
| 91 | DELETE1_SIGNAL(out_UPDATE_PREDICTION_IFETCH ,_param->_nb_inst_update,1); |
---|
| 92 | DELETE1_SIGNAL(out_UPDATE_BTB_VAL ,_param->_nb_inst_update,1); |
---|
| 93 | DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_SRC ,_param->_nb_inst_update,_param->_size_instruction_address); |
---|
| 94 | DELETE1_SIGNAL(out_UPDATE_BTB_ADDRESS_DEST ,_param->_nb_inst_update,_param->_size_instruction_address); |
---|
| 95 | DELETE1_SIGNAL(out_UPDATE_BTB_CONDITION ,_param->_nb_inst_update,_param->_size_branch_condition); |
---|
| 96 | DELETE1_SIGNAL(out_UPDATE_DIR_VAL ,_param->_nb_inst_update,1); |
---|
| 97 | DELETE1_SIGNAL(out_UPDATE_DIR_HISTORY ,_param->_nb_inst_update,_param->_size_history); |
---|
| 98 | DELETE1_SIGNAL(out_UPDATE_RAS_VAL ,_param->_nb_inst_update,1); |
---|
| 99 | DELETE1_SIGNAL(out_UPDATE_RAS_FLUSH ,_param->_nb_inst_update,1); |
---|
| 100 | DELETE1_SIGNAL(out_UPDATE_RAS_PUSH ,_param->_nb_inst_update,1); |
---|
| 101 | DELETE1_SIGNAL(out_UPDATE_RAS_ADDRESS ,_param->_nb_inst_update,_param->_size_instruction_address); |
---|
| 102 | DELETE1_SIGNAL(out_UPDATE_RAS_INDEX ,_param->_nb_inst_update,_param->_max_size_ras_index); |
---|
[81] | 103 | |
---|
[94] | 104 | // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[97] | 105 | DELETE1_SIGNAL( in_EVENT_VAL ,_param->_nb_context,1); |
---|
| 106 | DELETE1_SIGNAL(out_EVENT_ACK ,_param->_nb_context,1); |
---|
[94] | 107 | DELETE1_SIGNAL( in_EVENT_TYPE ,_param->_nb_context,_param->_size_event_type ); |
---|
| 108 | DELETE1_SIGNAL( in_EVENT_DEPTH ,_param->_nb_context,_param->_size_depth ); |
---|
| 109 | |
---|
[81] | 110 | // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[101] | 111 | DELETE1_SIGNAL(out_DEPTH_VAL ,_param->_nb_context,1); |
---|
[95] | 112 | DELETE1_SIGNAL(out_DEPTH_CURRENT ,_param->_nb_context,_param->_size_depth); |
---|
| 113 | DELETE1_SIGNAL(out_DEPTH_MIN ,_param->_nb_context,_param->_size_depth); |
---|
[101] | 114 | DELETE1_SIGNAL(out_DEPTH_MAX ,_param->_nb_context,_param->_size_depth); |
---|
| 115 | DELETE1_SIGNAL(out_DEPTH_FULL ,_param->_nb_context,1); |
---|
[95] | 116 | |
---|
[88] | 117 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 118 | DELETE1(internal_PREDICT_ACK ,_param->_nb_inst_predict); |
---|
| 119 | DELETE1(internal_PREDICT_UPDATE_PREDICTION_ID ,_param->_nb_inst_predict); |
---|
| 120 | DELETE1(internal_DECOD_ACK ,_param->_nb_inst_decod); |
---|
| 121 | DELETE1(internal_DECOD_UPT_PTR_WRITE ,_param->_nb_inst_decod); |
---|
| 122 | DELETE1(internal_BRANCH_COMPLETE_ACK ,_param->_nb_inst_branch_complete); |
---|
| 123 | DELETE1(internal_BRANCH_COMPLETE_MISS_PREDICTION ,_param->_nb_inst_branch_complete); |
---|
| 124 | DELETE1(internal_BRANCH_COMPLETE_TAKE ,_param->_nb_inst_branch_complete); |
---|
| 125 | DELETE1(internal_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete); |
---|
| 126 | DELETE1(internal_BRANCH_EVENT_VAL ,_param->_nb_context); |
---|
| 127 | DELETE1(internal_BRANCH_EVENT_DEPTH ,_param->_nb_context); |
---|
| 128 | DELETE1(internal_UPDATE_VAL ,_param->_nb_inst_update); |
---|
| 129 | DELETE1(internal_UPDATE_VAL_WITHOUT_ACK ,_param->_nb_inst_update); |
---|
| 130 | DELETE1(internal_UPDATE_CONTEXT_ID ,_param->_nb_inst_update); |
---|
| 131 | DELETE1(internal_UPDATE_FROM_UFPT ,_param->_nb_inst_update); |
---|
| 132 | DELETE1(internal_UPDATE_DEPTH ,_param->_nb_inst_update); |
---|
| 133 | DELETE1(internal_UPDATE_RAS ,_param->_nb_inst_update); |
---|
[97] | 134 | DELETE1(internal_EVENT_ACK ,_param->_nb_context); |
---|
[88] | 135 | |
---|
| 136 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 137 | DELETE1(reg_IS_ACCURATE ,_param->_nb_context); |
---|
| 138 | |
---|
| 139 | DELETE2(reg_UPDATE_FETCH_PREDICTION_TABLE,_param->_nb_context,_param->_size_ufpt_queue[it1]); |
---|
| 140 | DELETE1(reg_UFPT_BOTTOM ,_param->_nb_context); |
---|
| 141 | DELETE1(reg_UFPT_TOP ,_param->_nb_context); |
---|
| 142 | DELETE1(reg_UFPT_UPDATE ,_param->_nb_context); |
---|
| 143 | DELETE1(reg_UFPT_NB_NEED_UPDATE ,_param->_nb_context); |
---|
[106] | 144 | DELETE1(reg_UFPT_NB_UPDATE ,_param->_nb_context); |
---|
[88] | 145 | |
---|
| 146 | DELETE2(reg_UPDATE_PREDICTION_TABLE ,_param->_nb_context,_param->_size_upt_queue[it1]); |
---|
| 147 | DELETE1(reg_UPT_BOTTOM ,_param->_nb_context); |
---|
| 148 | DELETE1(reg_UPT_TOP ,_param->_nb_context); |
---|
[95] | 149 | DELETE1(reg_UPT_TOP_EVENT ,_param->_nb_context); |
---|
[88] | 150 | DELETE1(reg_UPT_UPDATE ,_param->_nb_context); |
---|
[101] | 151 | DELETE1(reg_UPT_EMPTY ,_param->_nb_context); |
---|
[88] | 152 | |
---|
[122] | 153 | DELETE1(reg_UFPT_EVENT_STATE ,_param->_nb_context); |
---|
| 154 | DELETE1(reg_UPT_EVENT_STATE ,_param->_nb_context); |
---|
| 155 | |
---|
| 156 | // DELETE1(reg_EVENT_VAL ,_param->_nb_context); |
---|
[105] | 157 | DELETE1(reg_EVENT_UPT_PTR ,_param->_nb_context); |
---|
[112] | 158 | DELETE1(reg_EVENT_UPT_FULL ,_param->_nb_context); |
---|
[105] | 159 | |
---|
[122] | 160 | // DELETE1(reg_EVENT_STATE ,_param->_nb_context); |
---|
| 161 | // DELETE1(reg_EVENT_IS_BRANCH ,_param->_nb_context); |
---|
[98] | 162 | DELETE1(reg_EVENT_DEPTH ,_param->_nb_context); |
---|
[88] | 163 | DELETE1(reg_EVENT_ADDRESS_SRC ,_param->_nb_context); |
---|
[94] | 164 | DELETE1(reg_EVENT_ADDRESS_DEST_VAL ,_param->_nb_context); |
---|
[88] | 165 | DELETE1(reg_EVENT_ADDRESS_DEST ,_param->_nb_context); |
---|
[119] | 166 | DELETE1(reg_EVENT_CAN_CONTINUE ,_param->_nb_context); |
---|
[88] | 167 | } |
---|
[81] | 168 | |
---|
[78] | 169 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 170 | |
---|
| 171 | delete _component; |
---|
| 172 | |
---|
[111] | 173 | #if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true) |
---|
[134] | 174 | if (log_file_generate) |
---|
| 175 | { |
---|
| 176 | for (uint32_t i=0; i<_param->_nb_thread; ++i) |
---|
| 177 | if (_param->_have_thread [i]) |
---|
| 178 | { |
---|
| 179 | branchement_log_file [i].close(); |
---|
| 180 | } |
---|
| 181 | delete [] branchement_log_file; |
---|
| 182 | } |
---|
[111] | 183 | #endif |
---|
| 184 | |
---|
[78] | 185 | log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End"); |
---|
| 186 | }; |
---|
| 187 | |
---|
| 188 | }; // end namespace update_prediction_table |
---|
| 189 | }; // end namespace prediction_unit |
---|
| 190 | }; // end namespace front_end |
---|
| 191 | }; // end namespace multi_front_end |
---|
| 192 | }; // end namespace core |
---|
| 193 | |
---|
| 194 | }; // end namespace behavioural |
---|
| 195 | }; // end namespace morpheo |
---|