[60] | 1 | /* |
---|
| 2 | * $Id: Register_unit_Glue.cpp 128 2009-06-26 08:43:23Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace register_unit { |
---|
| 16 | namespace register_unit_glue { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Register_unit_Glue::Register_unit_Glue" |
---|
| 21 | Register_unit_Glue::Register_unit_Glue |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
[75] | 26 | std::string name, |
---|
[60] | 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Register_unit_Glue,FUNCTION,"Begin"); |
---|
| 39 | |
---|
[123] | 40 | // #if DEBUG_Register_unit_Glue == true |
---|
| 41 | // log_printf(INFO,Register_unit_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
[88] | 42 | |
---|
[123] | 43 | // std::cout << *param << std::endl; |
---|
| 44 | // #endif |
---|
[88] | 45 | |
---|
[60] | 46 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Allocation"); |
---|
| 47 | allocation (); |
---|
| 48 | |
---|
| 49 | #ifdef STATISTICS |
---|
[88] | 50 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 51 | { |
---|
| 52 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Allocation of statistics"); |
---|
| 53 | |
---|
| 54 | // Allocation of statistics |
---|
| 55 | statistics_declaration(param_statistics); |
---|
| 56 | } |
---|
[60] | 57 | #endif |
---|
| 58 | |
---|
| 59 | #ifdef VHDL |
---|
[88] | 60 | if (usage_is_set(_usage,USE_VHDL)) |
---|
| 61 | { |
---|
| 62 | // generate the vhdl |
---|
| 63 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Generate the vhdl"); |
---|
| 64 | |
---|
| 65 | vhdl(); |
---|
| 66 | } |
---|
[60] | 67 | #endif |
---|
| 68 | |
---|
| 69 | #ifdef SYSTEMC |
---|
[88] | 70 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 71 | { |
---|
[60] | 72 | // Constant |
---|
[128] | 73 | // PORT_WRITE(out_CONST_0 ,0); |
---|
| 74 | // PORT_WRITE(out_CONST_1 ,1); |
---|
| 75 | for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i) |
---|
| 76 | { |
---|
| 77 | for (uint32_t j=0; j<_param->_nb_gpr_write; ++j) |
---|
| 78 | PORT_WRITE(out_GPR_WRITE_STATUS_DATA [i][j],1); |
---|
| 79 | for (uint32_t j=0; j<_param->_nb_spr_write; ++j) |
---|
| 80 | PORT_WRITE(out_SPR_WRITE_STATUS_DATA [i][j],1); |
---|
[60] | 81 | |
---|
[128] | 82 | for (uint32_t j=0; j<_param->_nb_inst_insert_rob[i]; ++j) |
---|
| 83 | { |
---|
| 84 | PORT_WRITE(out_INSERT_ROB_GPR_STATUS_DATA [i][j],0); |
---|
| 85 | PORT_WRITE(out_INSERT_ROB_SPR_STATUS_DATA [i][j],0); |
---|
| 86 | } |
---|
| 87 | } |
---|
[60] | 88 | |
---|
| 89 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - transition"); |
---|
| 90 | |
---|
| 91 | SC_METHOD (transition); |
---|
| 92 | dont_initialize (); |
---|
| 93 | sensitive_pos << *(in_CLOCK); |
---|
| 94 | |
---|
| 95 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 96 | // List dependency information |
---|
| 97 | #endif |
---|
| 98 | |
---|
| 99 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_read"); |
---|
| 100 | |
---|
| 101 | SC_METHOD (genMealy_gpr_read); |
---|
| 102 | dont_initialize (); |
---|
[61] | 103 | // sensitive_neg << *(in_CLOCK); |
---|
[60] | 104 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 105 | { |
---|
| 106 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 107 | sensitive << *(in_GPR_READ_OOO_ENGINE_ID [j]); |
---|
| 108 | |
---|
| 109 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 110 | sensitive << *(in_GPR_READ_REGISTERFILE_ACK [i][j]) |
---|
| 111 | << *(in_GPR_READ_REGISTERFILE_DATA [i][j]) |
---|
| 112 | << *(in_GPR_READ_STATUS_ACK [i][j]) |
---|
| 113 | << *(in_GPR_READ_STATUS_DATA_VAL [i][j]); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 117 | // List dependency information |
---|
| 118 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 119 | { |
---|
| 120 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 121 | { |
---|
| 122 | (*(out_GPR_READ_ACK [j])) (*( in_GPR_READ_OOO_ENGINE_ID [j])); |
---|
| 123 | (*(out_GPR_READ_DATA_VAL [j])) (*( in_GPR_READ_OOO_ENGINE_ID [j])); |
---|
| 124 | (*(out_GPR_READ_DATA [j])) (*( in_GPR_READ_OOO_ENGINE_ID [j])); |
---|
| 125 | } |
---|
| 126 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 127 | { |
---|
| 128 | (*(out_GPR_READ_ACK [j])) (*( in_GPR_READ_REGISTERFILE_ACK [i][j])); |
---|
| 129 | (*(out_GPR_READ_ACK [j])) (*( in_GPR_READ_STATUS_ACK [i][j])); |
---|
| 130 | (*(out_GPR_READ_DATA [j])) (*( in_GPR_READ_REGISTERFILE_DATA [i][j])); |
---|
| 131 | (*(out_GPR_READ_DATA_VAL [j])) (*( in_GPR_READ_STATUS_DATA_VAL [i][j])); |
---|
[61] | 132 | } |
---|
| 133 | } |
---|
| 134 | #endif |
---|
[60] | 135 | |
---|
[61] | 136 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_read_status"); |
---|
[60] | 137 | |
---|
[61] | 138 | SC_METHOD (genMealy_gpr_read_status); |
---|
| 139 | dont_initialize (); |
---|
| 140 | // sensitive_neg << *(in_CLOCK); |
---|
| 141 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 142 | { |
---|
| 143 | sensitive << *(in_GPR_READ_VAL [j]); |
---|
| 144 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 145 | sensitive << *(in_GPR_READ_OOO_ENGINE_ID [j]); |
---|
| 146 | |
---|
| 147 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 148 | sensitive << *(in_GPR_READ_REGISTERFILE_ACK [i][j]); |
---|
| 149 | } |
---|
| 150 | |
---|
| 151 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 152 | // List dependency information |
---|
| 153 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 154 | { |
---|
| 155 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 156 | { |
---|
[60] | 157 | (*(out_GPR_READ_STATUS_VAL [i][j])) (*( in_GPR_READ_VAL [j])); |
---|
| 158 | (*(out_GPR_READ_STATUS_VAL [i][j])) (*( in_GPR_READ_REGISTERFILE_ACK [i][j])); |
---|
| 159 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 160 | (*(out_GPR_READ_STATUS_VAL [i][j])) (*( in_GPR_READ_OOO_ENGINE_ID [j])); |
---|
| 161 | } |
---|
| 162 | } |
---|
| 163 | #endif |
---|
| 164 | |
---|
[61] | 165 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_read_registerfile"); |
---|
| 166 | |
---|
| 167 | SC_METHOD (genMealy_gpr_read_registerfile); |
---|
| 168 | dont_initialize (); |
---|
| 169 | // sensitive_neg << *(in_CLOCK); |
---|
| 170 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 171 | { |
---|
| 172 | sensitive << *(in_GPR_READ_VAL [j]); |
---|
| 173 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 174 | sensitive << *(in_GPR_READ_OOO_ENGINE_ID [j]); |
---|
| 175 | |
---|
| 176 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 177 | sensitive << *(in_GPR_READ_STATUS_ACK [i][j]); |
---|
| 178 | } |
---|
| 179 | |
---|
| 180 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 181 | // List dependency information |
---|
| 182 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 183 | { |
---|
| 184 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 185 | { |
---|
| 186 | (*(out_GPR_READ_REGISTERFILE_VAL [i][j])) (*( in_GPR_READ_VAL [j])); |
---|
| 187 | (*(out_GPR_READ_REGISTERFILE_VAL [i][j])) (*( in_GPR_READ_STATUS_ACK [i][j])); |
---|
| 188 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 189 | (*(out_GPR_READ_REGISTERFILE_VAL [i][j])) (*( in_GPR_READ_OOO_ENGINE_ID [j])); |
---|
| 190 | } |
---|
| 191 | } |
---|
| 192 | #endif |
---|
| 193 | |
---|
[60] | 194 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_write"); |
---|
| 195 | |
---|
| 196 | SC_METHOD (genMealy_gpr_write); |
---|
| 197 | dont_initialize (); |
---|
[61] | 198 | // sensitive_neg << *(in_CLOCK); |
---|
[60] | 199 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 200 | { |
---|
| 201 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 202 | sensitive << *(in_GPR_WRITE_OOO_ENGINE_ID [j]); |
---|
| 203 | |
---|
| 204 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 205 | sensitive << *(in_GPR_WRITE_REGISTERFILE_ACK [i][j]) |
---|
| 206 | << *(in_GPR_WRITE_STATUS_ACK [i][j]); |
---|
| 207 | } |
---|
| 208 | |
---|
| 209 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 210 | // List dependency information |
---|
| 211 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 212 | { |
---|
| 213 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 214 | (*(out_GPR_WRITE_ACK [j])) (*( in_GPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 215 | |
---|
| 216 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 217 | { |
---|
| 218 | (*(out_GPR_WRITE_ACK [j])) (*( in_GPR_WRITE_REGISTERFILE_ACK [i][j])); |
---|
| 219 | (*(out_GPR_WRITE_ACK [j])) (*( in_GPR_WRITE_STATUS_ACK [i][j])); |
---|
[61] | 220 | } |
---|
| 221 | } |
---|
| 222 | #endif |
---|
[60] | 223 | |
---|
[61] | 224 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_write_status"); |
---|
| 225 | |
---|
| 226 | SC_METHOD (genMealy_gpr_write_status); |
---|
| 227 | dont_initialize (); |
---|
| 228 | // sensitive_neg << *(in_CLOCK); |
---|
| 229 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 230 | { |
---|
| 231 | sensitive << *(in_GPR_WRITE_VAL [j]); |
---|
| 232 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 233 | sensitive << *(in_GPR_WRITE_OOO_ENGINE_ID [j]); |
---|
| 234 | |
---|
| 235 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 236 | sensitive << *(in_GPR_WRITE_REGISTERFILE_ACK [i][j]); |
---|
| 237 | } |
---|
| 238 | |
---|
| 239 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 240 | // List dependency information |
---|
| 241 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 242 | { |
---|
| 243 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 244 | { |
---|
[60] | 245 | (*(out_GPR_WRITE_STATUS_VAL [i][j])) (*( in_GPR_WRITE_VAL [j])); |
---|
| 246 | (*(out_GPR_WRITE_STATUS_VAL [i][j])) (*( in_GPR_WRITE_REGISTERFILE_ACK [i][j])); |
---|
| 247 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 248 | (*(out_GPR_WRITE_STATUS_VAL [i][j])) (*( in_GPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 249 | } |
---|
| 250 | } |
---|
| 251 | #endif |
---|
| 252 | |
---|
[61] | 253 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_gpr_write_registerfile"); |
---|
[60] | 254 | |
---|
[61] | 255 | SC_METHOD (genMealy_gpr_write_registerfile); |
---|
| 256 | dont_initialize (); |
---|
[60] | 257 | // sensitive_neg << *(in_CLOCK); |
---|
[61] | 258 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 259 | { |
---|
| 260 | sensitive << *(in_GPR_WRITE_VAL [j]); |
---|
| 261 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 262 | sensitive << *(in_GPR_WRITE_OOO_ENGINE_ID [j]); |
---|
[60] | 263 | |
---|
[61] | 264 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 265 | sensitive << *(in_GPR_WRITE_STATUS_ACK [i][j]); |
---|
| 266 | } |
---|
[60] | 267 | |
---|
[61] | 268 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 269 | // List dependency information |
---|
| 270 | for (uint32_t j=0; j<_param->_nb_gpr_write; j++) |
---|
| 271 | { |
---|
| 272 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 273 | { |
---|
| 274 | (*(out_GPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_GPR_WRITE_VAL [j])); |
---|
| 275 | (*(out_GPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_GPR_WRITE_STATUS_ACK [i][j])); |
---|
| 276 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 277 | (*(out_GPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_GPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 278 | } |
---|
| 279 | } |
---|
| 280 | #endif |
---|
[60] | 281 | |
---|
| 282 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_read"); |
---|
| 283 | |
---|
| 284 | SC_METHOD (genMealy_spr_read); |
---|
| 285 | dont_initialize (); |
---|
[61] | 286 | // sensitive_neg << *(in_CLOCK); |
---|
[60] | 287 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 288 | { |
---|
| 289 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 290 | sensitive << *(in_SPR_READ_OOO_ENGINE_ID [j]); |
---|
| 291 | |
---|
| 292 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 293 | sensitive << *(in_SPR_READ_REGISTERFILE_ACK [i][j]) |
---|
| 294 | << *(in_SPR_READ_REGISTERFILE_DATA [i][j]) |
---|
| 295 | << *(in_SPR_READ_STATUS_ACK [i][j]) |
---|
| 296 | << *(in_SPR_READ_STATUS_DATA_VAL [i][j]); |
---|
| 297 | } |
---|
| 298 | |
---|
| 299 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 300 | // List dependency information |
---|
| 301 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 302 | { |
---|
| 303 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 304 | { |
---|
| 305 | (*(out_SPR_READ_ACK [j])) (*( in_SPR_READ_OOO_ENGINE_ID [j])); |
---|
| 306 | (*(out_SPR_READ_DATA_VAL [j])) (*( in_SPR_READ_OOO_ENGINE_ID [j])); |
---|
| 307 | (*(out_SPR_READ_DATA [j])) (*( in_SPR_READ_OOO_ENGINE_ID [j])); |
---|
| 308 | } |
---|
| 309 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 310 | { |
---|
| 311 | (*(out_SPR_READ_ACK [j])) (*( in_SPR_READ_REGISTERFILE_ACK [i][j])); |
---|
| 312 | (*(out_SPR_READ_ACK [j])) (*( in_SPR_READ_STATUS_ACK [i][j])); |
---|
| 313 | (*(out_SPR_READ_DATA [j])) (*( in_SPR_READ_REGISTERFILE_DATA [i][j])); |
---|
| 314 | (*(out_SPR_READ_DATA_VAL [j])) (*( in_SPR_READ_STATUS_DATA_VAL [i][j])); |
---|
[61] | 315 | } |
---|
| 316 | } |
---|
| 317 | #endif |
---|
[60] | 318 | |
---|
[61] | 319 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_read_status"); |
---|
| 320 | |
---|
| 321 | SC_METHOD (genMealy_spr_read_status); |
---|
| 322 | dont_initialize (); |
---|
| 323 | // sensitive_neg << *(in_CLOCK); |
---|
| 324 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 325 | { |
---|
| 326 | sensitive << *(in_SPR_READ_VAL [j]); |
---|
| 327 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 328 | sensitive << *(in_SPR_READ_OOO_ENGINE_ID [j]); |
---|
| 329 | |
---|
| 330 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 331 | sensitive << *(in_SPR_READ_REGISTERFILE_ACK [i][j]); |
---|
| 332 | } |
---|
| 333 | |
---|
| 334 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 335 | // List dependency information |
---|
| 336 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 337 | { |
---|
| 338 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 339 | { |
---|
[60] | 340 | (*(out_SPR_READ_STATUS_VAL [i][j])) (*( in_SPR_READ_VAL [j])); |
---|
| 341 | (*(out_SPR_READ_STATUS_VAL [i][j])) (*( in_SPR_READ_REGISTERFILE_ACK [i][j])); |
---|
| 342 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 343 | (*(out_SPR_READ_STATUS_VAL [i][j])) (*( in_SPR_READ_OOO_ENGINE_ID [j])); |
---|
| 344 | } |
---|
| 345 | } |
---|
| 346 | #endif |
---|
| 347 | |
---|
[61] | 348 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_read_registerfile"); |
---|
| 349 | |
---|
| 350 | SC_METHOD (genMealy_spr_read_registerfile); |
---|
| 351 | dont_initialize (); |
---|
| 352 | // sensitive_neg << *(in_CLOCK); |
---|
| 353 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 354 | { |
---|
| 355 | sensitive << *(in_SPR_READ_VAL [j]); |
---|
| 356 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 357 | sensitive << *(in_SPR_READ_OOO_ENGINE_ID [j]); |
---|
| 358 | |
---|
| 359 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 360 | sensitive << *(in_SPR_READ_STATUS_ACK [i][j]); |
---|
| 361 | } |
---|
| 362 | |
---|
| 363 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 364 | // List dependency information |
---|
| 365 | for (uint32_t j=0; j<_param->_nb_spr_read; j++) |
---|
| 366 | { |
---|
| 367 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 368 | { |
---|
| 369 | (*(out_SPR_READ_REGISTERFILE_VAL [i][j])) (*( in_SPR_READ_VAL [j])); |
---|
| 370 | (*(out_SPR_READ_REGISTERFILE_VAL [i][j])) (*( in_SPR_READ_STATUS_ACK [i][j])); |
---|
| 371 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 372 | (*(out_SPR_READ_REGISTERFILE_VAL [i][j])) (*( in_SPR_READ_OOO_ENGINE_ID [j])); |
---|
| 373 | } |
---|
| 374 | } |
---|
| 375 | #endif |
---|
| 376 | |
---|
[60] | 377 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_write"); |
---|
| 378 | |
---|
| 379 | SC_METHOD (genMealy_spr_write); |
---|
| 380 | dont_initialize (); |
---|
[61] | 381 | // sensitive_neg << *(in_CLOCK); |
---|
[60] | 382 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 383 | { |
---|
| 384 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 385 | sensitive << *(in_SPR_WRITE_OOO_ENGINE_ID [j]); |
---|
| 386 | |
---|
| 387 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 388 | sensitive << *(in_SPR_WRITE_REGISTERFILE_ACK [i][j]) |
---|
| 389 | << *(in_SPR_WRITE_STATUS_ACK [i][j]); |
---|
| 390 | } |
---|
| 391 | |
---|
| 392 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 393 | // List dependency information |
---|
| 394 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 395 | { |
---|
| 396 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 397 | (*(out_SPR_WRITE_ACK [j])) (*( in_SPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 398 | |
---|
| 399 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 400 | { |
---|
| 401 | (*(out_SPR_WRITE_ACK [j])) (*( in_SPR_WRITE_REGISTERFILE_ACK [i][j])); |
---|
| 402 | (*(out_SPR_WRITE_ACK [j])) (*( in_SPR_WRITE_STATUS_ACK [i][j])); |
---|
[61] | 403 | } |
---|
| 404 | } |
---|
| 405 | #endif |
---|
[60] | 406 | |
---|
[61] | 407 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_write_status"); |
---|
| 408 | |
---|
| 409 | SC_METHOD (genMealy_spr_write_status); |
---|
| 410 | dont_initialize (); |
---|
| 411 | // sensitive_neg << *(in_CLOCK); |
---|
| 412 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 413 | { |
---|
| 414 | sensitive << *(in_SPR_WRITE_VAL [j]); |
---|
| 415 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 416 | sensitive << *(in_SPR_WRITE_OOO_ENGINE_ID [j]); |
---|
| 417 | |
---|
| 418 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 419 | sensitive << *(in_SPR_WRITE_REGISTERFILE_ACK [i][j]); |
---|
| 420 | } |
---|
| 421 | |
---|
| 422 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 423 | // List dependency information |
---|
| 424 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 425 | { |
---|
| 426 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 427 | { |
---|
[60] | 428 | (*(out_SPR_WRITE_STATUS_VAL [i][j])) (*( in_SPR_WRITE_VAL [j])); |
---|
| 429 | (*(out_SPR_WRITE_STATUS_VAL [i][j])) (*( in_SPR_WRITE_REGISTERFILE_ACK [i][j])); |
---|
| 430 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 431 | (*(out_SPR_WRITE_STATUS_VAL [i][j])) (*( in_SPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 432 | } |
---|
| 433 | } |
---|
| 434 | #endif |
---|
| 435 | |
---|
[61] | 436 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_spr_write_registerfile"); |
---|
| 437 | |
---|
| 438 | SC_METHOD (genMealy_spr_write_registerfile); |
---|
| 439 | dont_initialize (); |
---|
| 440 | // sensitive_neg << *(in_CLOCK); |
---|
| 441 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 442 | { |
---|
| 443 | sensitive << *(in_SPR_WRITE_VAL [j]); |
---|
| 444 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 445 | sensitive << *(in_SPR_WRITE_OOO_ENGINE_ID [j]); |
---|
| 446 | |
---|
| 447 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 448 | sensitive << *(in_SPR_WRITE_STATUS_ACK [i][j]); |
---|
| 449 | } |
---|
| 450 | |
---|
| 451 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 452 | // List dependency information |
---|
| 453 | for (uint32_t j=0; j<_param->_nb_spr_write; j++) |
---|
| 454 | { |
---|
| 455 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 456 | { |
---|
| 457 | (*(out_SPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_SPR_WRITE_VAL [j])); |
---|
| 458 | (*(out_SPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_SPR_WRITE_STATUS_ACK [i][j])); |
---|
| 459 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 460 | (*(out_SPR_WRITE_REGISTERFILE_VAL [i][j])) (*( in_SPR_WRITE_OOO_ENGINE_ID [j])); |
---|
| 461 | } |
---|
| 462 | } |
---|
| 463 | #endif |
---|
| 464 | |
---|
[60] | 465 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_insert"); |
---|
| 466 | |
---|
| 467 | SC_METHOD (genMealy_insert); |
---|
| 468 | dont_initialize (); |
---|
[61] | 469 | // sensitive_neg << *(in_CLOCK); |
---|
[60] | 470 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 471 | { |
---|
| 472 | uint32_t x=_param->_nb_inst_insert_rob [i]; |
---|
| 473 | for (uint32_t j=0; j<x; j++) |
---|
| 474 | sensitive << *( in_INSERT_ROB_VAL [i][j]) |
---|
| 475 | << *( in_INSERT_ROB_RD_USE [i][j]) |
---|
| 476 | << *( in_INSERT_ROB_RE_USE [i][j]) |
---|
| 477 | << *( in_INSERT_ROB_GPR_STATUS_ACK [i][j]) |
---|
| 478 | << *( in_INSERT_ROB_SPR_STATUS_ACK [i][j]); |
---|
| 479 | } |
---|
| 480 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 481 | // List dependency information |
---|
| 482 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 483 | { |
---|
| 484 | uint32_t x=_param->_nb_inst_insert_rob [i]; |
---|
| 485 | for (uint32_t j=0; j<x; j++) |
---|
| 486 | { |
---|
| 487 | (*(out_INSERT_ROB_ACK [i][j]))(*( in_INSERT_ROB_GPR_STATUS_ACK [i][j])); |
---|
| 488 | (*(out_INSERT_ROB_ACK [i][j]))(*( in_INSERT_ROB_SPR_STATUS_ACK [i][j])); |
---|
| 489 | |
---|
| 490 | (*(out_INSERT_ROB_GPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_VAL [i][j])); |
---|
| 491 | (*(out_INSERT_ROB_GPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_RD_USE [i][j])); |
---|
| 492 | (*(out_INSERT_ROB_GPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_SPR_STATUS_ACK [i][j])); |
---|
| 493 | |
---|
| 494 | (*(out_INSERT_ROB_SPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_VAL [i][j])); |
---|
| 495 | (*(out_INSERT_ROB_SPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_RE_USE [i][j])); |
---|
| 496 | (*(out_INSERT_ROB_SPR_STATUS_VAL [i][j]))(*( in_INSERT_ROB_GPR_STATUS_ACK [i][j])); |
---|
| 497 | } |
---|
| 498 | } |
---|
| 499 | #endif |
---|
| 500 | |
---|
[88] | 501 | // log_printf(INFO,Register_unit_Glue,FUNCTION,"Method - genMealy_retire"); |
---|
[60] | 502 | |
---|
[88] | 503 | // SC_METHOD (genMealy_retire); |
---|
| 504 | // dont_initialize (); |
---|
| 505 | // // sensitive_neg << *(in_CLOCK); |
---|
| 506 | // for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 507 | // { |
---|
| 508 | // uint32_t x=_param->_nb_inst_retire_rob [i]; |
---|
| 509 | // for (uint32_t j=0; j<x; j++) |
---|
| 510 | // sensitive << *( in_RETIRE_ROB_VAL [i][j]) |
---|
| 511 | // << *( in_RETIRE_ROB_RD_OLD_USE [i][j]) |
---|
| 512 | // << *( in_RETIRE_ROB_RD_NEW_USE [i][j]) |
---|
| 513 | // << *( in_RETIRE_ROB_RE_OLD_USE [i][j]) |
---|
| 514 | // << *( in_RETIRE_ROB_RE_NEW_USE [i][j]) |
---|
| 515 | // << *( in_RETIRE_ROB_GPR_STATUS_NEW_ACK [i][j]) |
---|
| 516 | // << *( in_RETIRE_ROB_GPR_STATUS_OLD_ACK [i][j]) |
---|
| 517 | // << *( in_RETIRE_ROB_SPR_STATUS_NEW_ACK [i][j]) |
---|
| 518 | // << *( in_RETIRE_ROB_SPR_STATUS_OLD_ACK [i][j]); |
---|
| 519 | // } |
---|
| 520 | // #ifdef SYSTEMCASS_SPECIFIC |
---|
| 521 | // // List dependency information |
---|
| 522 | // for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 523 | // { |
---|
| 524 | // uint32_t x=_param->_nb_inst_retire_rob [i]; |
---|
| 525 | // for (uint32_t j=0; j<x; j++) |
---|
| 526 | // { |
---|
| 527 | // (*(out_RETIRE_ROB_ACK [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_NEW_ACK [i][j])); |
---|
| 528 | // (*(out_RETIRE_ROB_ACK [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_OLD_ACK [i][j])); |
---|
| 529 | // (*(out_RETIRE_ROB_ACK [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_NEW_ACK [i][j])); |
---|
| 530 | // (*(out_RETIRE_ROB_ACK [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_OLD_ACK [i][j])); |
---|
[60] | 531 | |
---|
[88] | 532 | // (*(out_RETIRE_ROB_GPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_VAL [i][j])); |
---|
| 533 | // (*(out_RETIRE_ROB_GPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_RD_OLD_USE [i][j])); |
---|
| 534 | // (*(out_RETIRE_ROB_GPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_NEW_ACK [i][j])); |
---|
| 535 | // (*(out_RETIRE_ROB_GPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_NEW_ACK [i][j])); |
---|
| 536 | // (*(out_RETIRE_ROB_GPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_OLD_ACK [i][j])); |
---|
[60] | 537 | |
---|
[88] | 538 | // (*(out_RETIRE_ROB_GPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_VAL [i][j])); |
---|
| 539 | // (*(out_RETIRE_ROB_GPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_RD_NEW_USE [i][j])); |
---|
| 540 | // (*(out_RETIRE_ROB_GPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_OLD_ACK [i][j])); |
---|
| 541 | // (*(out_RETIRE_ROB_GPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_NEW_ACK [i][j])); |
---|
| 542 | // (*(out_RETIRE_ROB_GPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_OLD_ACK [i][j])); |
---|
[60] | 543 | |
---|
[88] | 544 | // (*(out_RETIRE_ROB_SPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_VAL [i][j])); |
---|
| 545 | // (*(out_RETIRE_ROB_SPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_RE_OLD_USE [i][j])); |
---|
| 546 | // (*(out_RETIRE_ROB_SPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_NEW_ACK [i][j])); |
---|
| 547 | // (*(out_RETIRE_ROB_SPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_OLD_ACK [i][j])); |
---|
| 548 | // (*(out_RETIRE_ROB_SPR_STATUS_OLD_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_NEW_ACK [i][j])); |
---|
[60] | 549 | |
---|
[88] | 550 | // (*(out_RETIRE_ROB_SPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_VAL [i][j])); |
---|
| 551 | // (*(out_RETIRE_ROB_SPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_RE_NEW_USE [i][j])); |
---|
| 552 | // (*(out_RETIRE_ROB_SPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_NEW_ACK [i][j])); |
---|
| 553 | // (*(out_RETIRE_ROB_SPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_GPR_STATUS_OLD_ACK [i][j])); |
---|
| 554 | // (*(out_RETIRE_ROB_SPR_STATUS_NEW_VAL [i][j]))(*( in_RETIRE_ROB_SPR_STATUS_OLD_ACK [i][j])); |
---|
| 555 | // } |
---|
| 556 | // } |
---|
| 557 | // #endif |
---|
[60] | 558 | } |
---|
| 559 | #endif |
---|
| 560 | log_printf(FUNC,Register_unit_Glue,FUNCTION,"End"); |
---|
| 561 | }; |
---|
| 562 | |
---|
| 563 | #undef FUNCTION |
---|
| 564 | #define FUNCTION "Register_unit_Glue::~Register_unit_Glue" |
---|
| 565 | Register_unit_Glue::~Register_unit_Glue (void) |
---|
| 566 | { |
---|
| 567 | log_printf(FUNC,Register_unit_Glue,FUNCTION,"Begin"); |
---|
| 568 | |
---|
| 569 | #ifdef STATISTICS |
---|
[88] | 570 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
| 571 | { |
---|
| 572 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Generate Statistics file"); |
---|
| 573 | |
---|
| 574 | delete _stat; |
---|
| 575 | } |
---|
[60] | 576 | #endif |
---|
| 577 | |
---|
| 578 | log_printf(INFO,Register_unit_Glue,FUNCTION,"Deallocation"); |
---|
| 579 | deallocation (); |
---|
| 580 | |
---|
| 581 | log_printf(FUNC,Register_unit_Glue,FUNCTION,"End"); |
---|
| 582 | }; |
---|
| 583 | |
---|
| 584 | }; // end namespace register_unit_glue |
---|
| 585 | }; // end namespace register_unit |
---|
| 586 | }; // end namespace execute_loop |
---|
| 587 | }; // end namespace multi_execute_loop |
---|
| 588 | }; // end namespace core |
---|
| 589 | |
---|
| 590 | }; // end namespace behavioural |
---|
| 591 | }; // end namespace morpheo |
---|
[61] | 592 | |
---|
| 593 | |
---|
| 594 | |
---|