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