[78] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Free_List_unit_genMealy_push_gpr.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace rename_unit { |
---|
| 17 | namespace register_translation_unit { |
---|
| 18 | namespace free_list_unit { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Free_List_unit::genMealy_push_gpr" |
---|
| 23 | void Free_List_unit::genMealy_push_gpr (void) |
---|
| 24 | { |
---|
[88] | 25 | log_begin(Free_List_unit,FUNCTION); |
---|
| 26 | log_function(Free_List_unit,FUNCTION,_name.c_str()); |
---|
[78] | 27 | |
---|
[123] | 28 | if (PORT_READ(in_NRESET)) |
---|
| 29 | { |
---|
[108] | 30 | // bank conflit |
---|
[78] | 31 | bool bank_use [_param->_nb_bank]; |
---|
| 32 | for (uint32_t i=0; i<_param->_nb_bank; i++) |
---|
| 33 | bank_use [i] = false; |
---|
| 34 | |
---|
| 35 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 36 | { |
---|
[108] | 37 | log_printf(TRACE,Free_List_unit,FUNCTION," * PUSH [%d]",i); |
---|
| 38 | |
---|
[78] | 39 | bool gpr_ack = not PORT_READ(in_PUSH_GPR_VAL[i]); |
---|
[108] | 40 | |
---|
| 41 | log_printf(TRACE,Free_List_unit,FUNCTION," * GPR_VAL : %d",PORT_READ(in_PUSH_GPR_VAL[i])); |
---|
[78] | 42 | |
---|
| 43 | if (not gpr_ack) |
---|
| 44 | { |
---|
[108] | 45 | // // num_bank : MSB |
---|
| 46 | // uint32_t bank = PORT_READ(in_PUSH_GPR_NUM_REG[i]) >> _param->_bank_gpr_size_slot; |
---|
| 47 | // num_bank : LSB |
---|
| 48 | uint32_t bank = PORT_READ(in_PUSH_GPR_NUM_REG[i]) & _param->_mask_gpr; |
---|
[78] | 49 | |
---|
| 50 | if (not bank_use [bank]) |
---|
| 51 | { |
---|
[108] | 52 | log_printf(TRACE,Free_List_unit,FUNCTION," * find "); |
---|
| 53 | log_printf(TRACE,Free_List_unit,FUNCTION," * bank : %d",bank); |
---|
| 54 | |
---|
[78] | 55 | // find |
---|
| 56 | gpr_ack = true; |
---|
| 57 | internal_PUSH_GPR_BANK [i] = bank; |
---|
| 58 | bank_use [bank] = true; |
---|
| 59 | } |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | internal_PUSH_GPR_ACK [i] = gpr_ack; |
---|
| 63 | } |
---|
[123] | 64 | } |
---|
| 65 | else |
---|
| 66 | { |
---|
| 67 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 68 | internal_PUSH_GPR_ACK [i] = 0; |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | for (uint32_t i=0; i<_param->_nb_push; i++) |
---|
| 72 | PORT_WRITE(out_PUSH_GPR_ACK [i], internal_PUSH_GPR_ACK [i]); |
---|
[78] | 73 | |
---|
[88] | 74 | log_end(Free_List_unit,FUNCTION); |
---|
[78] | 75 | }; |
---|
| 76 | |
---|
| 77 | }; // end namespace free_list_unit |
---|
| 78 | }; // end namespace register_translation_unit |
---|
| 79 | }; // end namespace rename_unit |
---|
| 80 | }; // end namespace ooo_engine |
---|
| 81 | }; // end namespace multi_ooo_engine |
---|
| 82 | }; // end namespace core |
---|
| 83 | |
---|
| 84 | }; // end namespace behavioural |
---|
| 85 | }; // end namespace morpheo |
---|
| 86 | #endif |
---|