[78] | 1 | /* |
---|
| 2 | * $Id: Decod.cpp 101 2009-01-15 17:19:08Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace decod_unit { |
---|
| 16 | namespace decod { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Decod::Decod" |
---|
| 21 | Decod::Decod |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
| 39 | |
---|
[88] | 40 | #if DEBUG_Decod == true |
---|
| 41 | log_printf(INFO,Decod,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
| 42 | |
---|
| 43 | std::cout << *param << std::endl; |
---|
| 44 | #endif |
---|
| 45 | |
---|
[78] | 46 | log_printf(INFO,Decod,FUNCTION,"Allocation"); |
---|
| 47 | |
---|
| 48 | allocation ( |
---|
| 49 | #ifdef STATISTICS |
---|
| 50 | param_statistics |
---|
| 51 | #endif |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | #ifdef STATISTICS |
---|
[88] | 55 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 56 | { |
---|
| 57 | log_printf(INFO,Decod,FUNCTION,"Allocation of statistics"); |
---|
| 58 | |
---|
| 59 | statistics_allocation(param_statistics); |
---|
| 60 | } |
---|
| 61 | #endif |
---|
| 62 | |
---|
| 63 | #ifdef VHDL |
---|
[88] | 64 | if (usage_is_set(_usage,USE_VHDL)) |
---|
[78] | 65 | { |
---|
| 66 | // generate the vhdl |
---|
| 67 | log_printf(INFO,Decod,FUNCTION,"Generate the vhdl"); |
---|
| 68 | |
---|
| 69 | vhdl(); |
---|
| 70 | } |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | #ifdef SYSTEMC |
---|
[88] | 74 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[78] | 75 | { |
---|
| 76 | log_printf(INFO,Decod,FUNCTION,"Method - transition"); |
---|
| 77 | |
---|
| 78 | SC_METHOD (transition); |
---|
| 79 | dont_initialize (); |
---|
| 80 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 81 | |
---|
| 82 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 83 | // List dependency information |
---|
| 84 | # endif |
---|
| 85 | |
---|
| 86 | log_printf(INFO,Decod,FUNCTION,"Method - genMealy"); |
---|
| 87 | |
---|
| 88 | SC_METHOD (genMealy); |
---|
| 89 | dont_initialize (); |
---|
| 90 | sensitive << (*(in_CLOCK)).neg() //use internal register |
---|
| 91 | << (*(in_CONTEXT_EVENT_ACK)); |
---|
| 92 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 93 | { |
---|
| 94 | for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; j++) |
---|
| 95 | sensitive << (*(in_IFETCH_VAL [i][j])) |
---|
| 96 | << (*(in_IFETCH_INSTRUCTION [i][j])); |
---|
| 97 | sensitive << (*(in_IFETCH_ADDRESS [i])) |
---|
| 98 | // << (*(in_IFETCH_ADDRESS_NEXT [i])) |
---|
| 99 | << (*(in_IFETCH_BRANCH_STATE [i])) |
---|
| 100 | << (*(in_CONTEXT_DECOD_ENABLE [i])); |
---|
| 101 | if (_param->_have_port_context_id) |
---|
| 102 | sensitive << (*(in_IFETCH_CONTEXT_ID [i])); |
---|
[88] | 103 | if (_param->_have_port_depth) |
---|
[78] | 104 | sensitive << (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i])); |
---|
[101] | 105 | sensitive << (*(in_CONTEXT_DEPTH_VAL [i])); |
---|
[78] | 106 | if (_param->_have_port_depth) |
---|
| 107 | sensitive << (*(in_CONTEXT_DEPTH [i])); |
---|
| 108 | if (_param->_have_port_inst_ifetch_ptr) |
---|
| 109 | sensitive << (*(in_IFETCH_INST_IFETCH_PTR [i])); |
---|
| 110 | } |
---|
| 111 | |
---|
| 112 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 113 | sensitive << (*(in_DECOD_ACK [i])) |
---|
| 114 | << (*(in_PREDICT_ACK [i])) |
---|
| 115 | // << (*(in_PREDICT_CAN_CONTINUE [i])) |
---|
| 116 | ; |
---|
| 117 | |
---|
| 118 | # ifdef SYSTEMCASS_SPECIFIC |
---|
[88] | 119 | /* |
---|
[78] | 120 | // List dependency information |
---|
| 121 | |
---|
| 122 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 123 | { |
---|
| 124 | for (uint32_t j=0; j<_param->_nb_inst_fetch [i]; j++) |
---|
| 125 | { |
---|
| 126 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_VAL [i][j])); |
---|
| 127 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_INSTRUCTION [i][j])); |
---|
| 128 | if (_param->_have_port_context_id) |
---|
| 129 | (*(out_IFETCH_ACK [i][j])) (*(in_IFETCH_CONTEXT_ID [i] )); |
---|
| 130 | (*(out_IFETCH_ACK [i][j])) (*(in_CONTEXT_DECOD_ENABLE [i] )); |
---|
| 131 | (*(out_IFETCH_ACK [i][j])) (*(in_CONTEXT_EVENT_ACK )); |
---|
| 132 | for (uint32_t x=0; x<_param->_nb_inst_decod; x++) |
---|
| 133 | { |
---|
| 134 | (*(out_IFETCH_ACK [i][j])) (*(in_DECOD_ACK [x])); |
---|
| 135 | (*(out_IFETCH_ACK [i][j])) (*(in_PREDICT_ACK [x])); |
---|
| 136 | // (*(out_IFETCH_ACK [i][j])) (*(in_PREDICT_CAN_CONTINUE [x])); |
---|
| 137 | } |
---|
| 138 | } |
---|
| 139 | } |
---|
| 140 | |
---|
| 141 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 142 | { |
---|
| 143 | |
---|
| 144 | (*(out_DECOD_VAL [i])) (*(in_PREDICT_ACK [i])); |
---|
| 145 | // (*(out_DECOD_VAL [i])) (*(in_PREDICT_CAN_CONTINUE [i])); |
---|
| 146 | (*(out_DECOD_VAL [i])) (*(in_CONTEXT_EVENT_ACK )); |
---|
| 147 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 148 | { |
---|
| 149 | (*(out_DECOD_VAL [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 150 | if (_param->_have_port_context_id) |
---|
| 151 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 152 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 153 | { |
---|
| 154 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 155 | (*(out_DECOD_VAL [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 156 | } |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | if (_param->_have_port_context_id) |
---|
| 160 | { |
---|
| 161 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 162 | { |
---|
| 163 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 164 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 165 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 166 | { |
---|
| 167 | (*(out_DECOD_CONTEXT_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 168 | } |
---|
| 169 | } |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 173 | { |
---|
[88] | 174 | if (_param->_have_port_depth[i]) |
---|
| 175 | { |
---|
| 176 | |
---|
[78] | 177 | (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 178 | (*(out_DECOD_DEPTH [i])) (*(in_CONTEXT_DEPTH [x])); |
---|
| 179 | if (_param->_have_port_context_id) |
---|
| 180 | (*(out_DECOD_DEPTH [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 181 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 182 | { |
---|
| 183 | (*(out_DECOD_DEPTH [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 184 | } |
---|
| 185 | } |
---|
| 186 | } |
---|
| 187 | |
---|
| 188 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 189 | { |
---|
| 190 | (*(out_DECOD_TYPE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 191 | if (_param->_have_port_context_id) |
---|
| 192 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 193 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 194 | { |
---|
| 195 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 196 | (*(out_DECOD_TYPE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 197 | } |
---|
| 198 | } |
---|
| 199 | |
---|
| 200 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 201 | { |
---|
| 202 | (*(out_DECOD_OPERATION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 203 | if (_param->_have_port_context_id) |
---|
| 204 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 205 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 206 | { |
---|
| 207 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 208 | (*(out_DECOD_OPERATION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 209 | } |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 213 | { |
---|
| 214 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 215 | if (_param->_have_port_context_id) |
---|
| 216 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 217 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 218 | { |
---|
| 219 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 220 | (*(out_DECOD_IS_DELAY_SLOT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 221 | } |
---|
| 222 | } |
---|
| 223 | |
---|
| 224 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 225 | { |
---|
| 226 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 227 | if (_param->_have_port_context_id) |
---|
| 228 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 229 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 230 | { |
---|
| 231 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 232 | (*(out_DECOD_HAS_IMMEDIAT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 233 | } |
---|
| 234 | } |
---|
| 235 | |
---|
| 236 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 237 | { |
---|
| 238 | (*(out_DECOD_READ_RA [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 239 | if (_param->_have_port_context_id) |
---|
| 240 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 241 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 242 | { |
---|
| 243 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 244 | (*(out_DECOD_READ_RA [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 245 | } |
---|
| 246 | } |
---|
| 247 | |
---|
| 248 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 249 | { |
---|
| 250 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 251 | if (_param->_have_port_context_id) |
---|
| 252 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 253 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 254 | { |
---|
| 255 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 256 | (*(out_DECOD_NUM_REG_RA [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 257 | } |
---|
| 258 | } |
---|
| 259 | |
---|
| 260 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 261 | { |
---|
| 262 | (*(out_DECOD_READ_RB [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 263 | if (_param->_have_port_context_id) |
---|
| 264 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 265 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 266 | { |
---|
| 267 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 268 | (*(out_DECOD_READ_RB [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 269 | } |
---|
| 270 | } |
---|
| 271 | |
---|
| 272 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 273 | { |
---|
| 274 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 275 | if (_param->_have_port_context_id) |
---|
| 276 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 277 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 278 | { |
---|
| 279 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 280 | (*(out_DECOD_NUM_REG_RB [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 281 | } |
---|
| 282 | } |
---|
| 283 | |
---|
| 284 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 285 | { |
---|
| 286 | (*(out_DECOD_READ_RC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 287 | if (_param->_have_port_context_id) |
---|
| 288 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 289 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 290 | { |
---|
| 291 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 292 | (*(out_DECOD_READ_RC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 293 | } |
---|
| 294 | } |
---|
| 295 | |
---|
| 296 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 297 | { |
---|
| 298 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 299 | if (_param->_have_port_context_id) |
---|
| 300 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 301 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 302 | { |
---|
| 303 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 304 | (*(out_DECOD_NUM_REG_RC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 305 | } |
---|
| 306 | } |
---|
| 307 | |
---|
| 308 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 309 | { |
---|
| 310 | (*(out_DECOD_WRITE_RD [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 311 | if (_param->_have_port_context_id) |
---|
| 312 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 313 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 314 | { |
---|
| 315 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 316 | (*(out_DECOD_WRITE_RD [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 317 | } |
---|
| 318 | } |
---|
| 319 | |
---|
| 320 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 321 | { |
---|
| 322 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 323 | if (_param->_have_port_context_id) |
---|
| 324 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 325 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 326 | { |
---|
| 327 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 328 | (*(out_DECOD_NUM_REG_RD [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 329 | } |
---|
| 330 | } |
---|
| 331 | |
---|
| 332 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 333 | { |
---|
| 334 | (*(out_DECOD_WRITE_RE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 335 | if (_param->_have_port_context_id) |
---|
| 336 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 337 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 338 | { |
---|
| 339 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 340 | (*(out_DECOD_WRITE_RE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 341 | } |
---|
| 342 | } |
---|
| 343 | |
---|
| 344 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 345 | { |
---|
| 346 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 347 | if (_param->_have_port_context_id) |
---|
| 348 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 349 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 350 | { |
---|
| 351 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 352 | (*(out_DECOD_NUM_REG_RE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 353 | } |
---|
| 354 | } |
---|
| 355 | |
---|
| 356 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 357 | { |
---|
| 358 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 359 | if (_param->_have_port_context_id) |
---|
| 360 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 361 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 362 | { |
---|
| 363 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 364 | (*(out_DECOD_EXCEPTION_USE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 365 | } |
---|
| 366 | } |
---|
| 367 | |
---|
| 368 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 369 | { |
---|
| 370 | (*(out_DECOD_ADDRESS [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 371 | if (_param->_have_port_context_id) |
---|
| 372 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 373 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
| 374 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 375 | { |
---|
| 376 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 377 | (*(out_DECOD_ADDRESS [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 378 | } |
---|
| 379 | } |
---|
| 380 | |
---|
| 381 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 382 | { |
---|
| 383 | (*(out_DECOD_IMMEDIAT [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 384 | if (_param->_have_port_context_id) |
---|
| 385 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 386 | // (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
| 387 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 388 | { |
---|
| 389 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 390 | (*(out_DECOD_IMMEDIAT [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 391 | } |
---|
| 392 | } |
---|
| 393 | |
---|
| 394 | if (_param->_have_port_context_id) |
---|
| 395 | { |
---|
| 396 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 397 | { |
---|
| 398 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 399 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 400 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 401 | { |
---|
| 402 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 403 | (*(out_PREDICT_CONTEXT_ID [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 404 | } |
---|
| 405 | } |
---|
| 406 | } |
---|
| 407 | |
---|
| 408 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 409 | { |
---|
| 410 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 411 | if (_param->_have_port_context_id) |
---|
| 412 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
[88] | 413 | if (_param->_have_port_inst_ifetch_ptr[i]) |
---|
[78] | 414 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INST_IFETCH_PTR [x])); |
---|
| 415 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 416 | { |
---|
| 417 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 418 | (*(out_PREDICT_MATCH_INST_IFETCH_PTR [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 419 | } |
---|
| 420 | } |
---|
| 421 | |
---|
| 422 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 423 | { |
---|
| 424 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 425 | if (_param->_have_port_context_id) |
---|
| 426 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 427 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_BRANCH_STATE [x])); |
---|
| 428 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 429 | { |
---|
| 430 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 431 | (*(out_PREDICT_BRANCH_STATE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 432 | } |
---|
| 433 | } |
---|
| 434 | |
---|
| 435 | if (_param->_have_port_branch_update_prediction_id) |
---|
| 436 | { |
---|
| 437 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 438 | { |
---|
| 439 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 440 | if (_param->_have_port_context_id) |
---|
| 441 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 442 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x])); |
---|
| 443 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 444 | { |
---|
| 445 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 446 | (*(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 447 | } |
---|
| 448 | } |
---|
| 449 | } |
---|
| 450 | |
---|
| 451 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 452 | { |
---|
| 453 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 454 | if (_param->_have_port_context_id) |
---|
| 455 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 456 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 457 | { |
---|
| 458 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 459 | (*(out_PREDICT_BRANCH_CONDITION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 460 | } |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | // for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 464 | // { |
---|
| 465 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 466 | // if (_param->_have_port_context_id) |
---|
| 467 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 468 | // for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 469 | // { |
---|
| 470 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 471 | // (*(out_PREDICT_BRANCH_STACK_WRITE [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 472 | // } |
---|
| 473 | // } |
---|
| 474 | |
---|
| 475 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 476 | { |
---|
| 477 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 478 | if (_param->_have_port_context_id) |
---|
| 479 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 480 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 481 | { |
---|
| 482 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 483 | (*(out_PREDICT_BRANCH_DIRECTION [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 484 | } |
---|
| 485 | } |
---|
| 486 | |
---|
| 487 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 488 | { |
---|
| 489 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 490 | if (_param->_have_port_context_id) |
---|
| 491 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 492 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
| 493 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 494 | { |
---|
| 495 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 496 | (*(out_PREDICT_ADDRESS_DEST [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 497 | } |
---|
| 498 | |
---|
| 499 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 500 | if (_param->_have_port_context_id) |
---|
| 501 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 502 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
| 503 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 504 | { |
---|
| 505 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 506 | (*(out_PREDICT_ADDRESS_SRC [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 507 | } |
---|
| 508 | |
---|
| 509 | } |
---|
| 510 | |
---|
| 511 | |
---|
| 512 | (*(out_PREDICT_VAL [i])) (*(in_CONTEXT_EVENT_ACK)); |
---|
| 513 | (*(out_PREDICT_VAL [i])) (*(in_DECOD_ACK [i])); |
---|
| 514 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 515 | { |
---|
| 516 | (*(out_PREDICT_VAL [i])) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 517 | if (_param->_have_port_context_id) |
---|
| 518 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 519 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_ADDRESS [x])); |
---|
| 520 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 521 | { |
---|
| 522 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_VAL [x][y])); |
---|
| 523 | (*(out_PREDICT_VAL [i])) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 524 | } |
---|
| 525 | } |
---|
| 526 | } |
---|
| 527 | |
---|
| 528 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 529 | { |
---|
| 530 | (*(out_CONTEXT_EVENT_VAL)) (*(in_PREDICT_ACK [i])); |
---|
| 531 | // (*(out_CONTEXT_EVENT_VAL)) (*(in_PREDICT_CAN_CONTINUE [i])); |
---|
| 532 | (*(out_CONTEXT_EVENT_VAL)) (*(in_DECOD_ACK [i])); |
---|
| 533 | } |
---|
| 534 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 535 | { |
---|
| 536 | (*(out_CONTEXT_EVENT_VAL)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 537 | if (_param->_have_port_context_id) |
---|
| 538 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 539 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_ADDRESS [x])); |
---|
| 540 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 541 | { |
---|
| 542 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_VAL [x][y])); |
---|
| 543 | (*(out_CONTEXT_EVENT_VAL)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 544 | } |
---|
| 545 | } |
---|
| 546 | |
---|
| 547 | if (_param->_have_port_context_id) |
---|
| 548 | { |
---|
| 549 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 550 | { |
---|
| 551 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 552 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 553 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 554 | { |
---|
| 555 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_VAL [x][y])); |
---|
| 556 | (*(out_CONTEXT_EVENT_CONTEXT_ID)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 557 | } |
---|
| 558 | } |
---|
| 559 | } |
---|
| 560 | |
---|
| 561 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 562 | { |
---|
| 563 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 564 | if (_param->_have_port_context_id) |
---|
| 565 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 566 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 567 | { |
---|
| 568 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_VAL [x][y])); |
---|
| 569 | (*(out_CONTEXT_EVENT_TYPE)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 570 | } |
---|
| 571 | } |
---|
| 572 | |
---|
| 573 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 574 | { |
---|
| 575 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 576 | if (_param->_have_port_context_id) |
---|
| 577 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 578 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 579 | { |
---|
| 580 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_VAL [x][y])); |
---|
| 581 | (*(out_CONTEXT_EVENT_IS_DELAY_SLOT)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 582 | } |
---|
| 583 | } |
---|
| 584 | |
---|
| 585 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 586 | { |
---|
| 587 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 588 | if (_param->_have_port_context_id) |
---|
| 589 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 590 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_ADDRESS [x])); |
---|
| 591 | // (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
| 592 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 593 | { |
---|
| 594 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_VAL [x][y])); |
---|
| 595 | (*(out_CONTEXT_EVENT_ADDRESS)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 596 | } |
---|
| 597 | } |
---|
| 598 | |
---|
| 599 | for (uint32_t x=0; x<_param->_nb_context; x++) |
---|
| 600 | { |
---|
| 601 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_CONTEXT_DECOD_ENABLE [x])); |
---|
| 602 | if (_param->_have_port_context_id) |
---|
| 603 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_CONTEXT_ID [x])); |
---|
| 604 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_ADDRESS [x])); |
---|
| 605 | // (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_ADDRESS_NEXT [x])); |
---|
| 606 | for (uint32_t y=0; y<_param->_nb_inst_fetch [x]; y++) |
---|
| 607 | { |
---|
| 608 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_VAL [x][y])); |
---|
| 609 | (*(out_CONTEXT_EVENT_ADDRESS_EPCR)) (*(in_IFETCH_INSTRUCTION [x][y])); |
---|
| 610 | } |
---|
| 611 | } |
---|
[88] | 612 | */ |
---|
[78] | 613 | # endif |
---|
| 614 | |
---|
| 615 | } |
---|
| 616 | #endif |
---|
| 617 | |
---|
| 618 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
| 619 | }; |
---|
| 620 | |
---|
| 621 | #undef FUNCTION |
---|
| 622 | #define FUNCTION "Decod::~Decod" |
---|
| 623 | Decod::~Decod (void) |
---|
| 624 | { |
---|
| 625 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
| 626 | |
---|
| 627 | #ifdef STATISTICS |
---|
[88] | 628 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 629 | { |
---|
| 630 | statistics_deallocation(); |
---|
| 631 | } |
---|
| 632 | #endif |
---|
| 633 | |
---|
| 634 | log_printf(INFO,Decod,FUNCTION,"Deallocation"); |
---|
| 635 | deallocation (); |
---|
| 636 | |
---|
| 637 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
| 638 | }; |
---|
| 639 | |
---|
| 640 | }; // end namespace decod |
---|
| 641 | }; // end namespace decod_unit |
---|
| 642 | }; // end namespace front_end |
---|
| 643 | }; // end namespace multi_front_end |
---|
| 644 | }; // end namespace core |
---|
| 645 | |
---|
| 646 | }; // end namespace behavioural |
---|
| 647 | }; // end namespace morpheo |
---|