[78] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Free_List_unit_genMealy_pop.cpp 88 2008-12-10 18:31:39Z 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_pop" |
---|
| 23 | void Free_List_unit::genMealy_pop (void) |
---|
| 24 | { |
---|
[88] | 25 | log_begin(Free_List_unit,FUNCTION); |
---|
| 26 | log_function(Free_List_unit,FUNCTION,_name.c_str()); |
---|
[78] | 27 | |
---|
| 28 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
| 29 | { |
---|
| 30 | uint32_t offset = i*_param->_nb_bank_by_pop; |
---|
| 31 | |
---|
| 32 | // GPR |
---|
| 33 | bool gpr_ack = not PORT_READ(in_POP_GPR_VAL[i]); |
---|
| 34 | |
---|
| 35 | if (not gpr_ack) |
---|
| 36 | for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++) |
---|
| 37 | { |
---|
| 38 | uint32_t bank = offset+((j+internal_BANK_PRIORITY)%_param->_nb_bank_by_pop); |
---|
| 39 | |
---|
| 40 | if (not _gpr_list[bank].empty()) |
---|
| 41 | { |
---|
| 42 | // find |
---|
| 43 | gpr_ack = true; |
---|
| 44 | internal_POP_GPR_BANK [i] = bank; |
---|
| 45 | PORT_WRITE(out_POP_GPR_NUM_REG [i], |
---|
| 46 | //(bank << _param->_shift) | |
---|
| 47 | _gpr_list[bank].front()); |
---|
| 48 | |
---|
| 49 | break; |
---|
| 50 | } |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | // SPR |
---|
| 54 | bool spr_ack = not PORT_READ(in_POP_SPR_VAL[i]); |
---|
| 55 | |
---|
| 56 | if (not spr_ack) |
---|
| 57 | for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++) |
---|
| 58 | { |
---|
| 59 | uint32_t bank = offset+((j+internal_BANK_PRIORITY)%_param->_nb_bank_by_pop); |
---|
| 60 | |
---|
| 61 | if (not _spr_list[bank].empty()) |
---|
| 62 | { |
---|
| 63 | // find |
---|
| 64 | spr_ack = true; |
---|
| 65 | internal_POP_SPR_BANK [i] = bank; |
---|
| 66 | PORT_WRITE(out_POP_SPR_NUM_REG [i], |
---|
| 67 | //(bank << _param->_shift) | |
---|
| 68 | _spr_list[bank].front()); |
---|
| 69 | |
---|
| 70 | break; |
---|
| 71 | } |
---|
| 72 | } |
---|
| 73 | |
---|
| 74 | internal_POP_ACK [i] = gpr_ack and spr_ack; |
---|
| 75 | |
---|
| 76 | PORT_WRITE(out_POP_ACK [i], internal_POP_ACK [i]); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
[88] | 80 | log_end(Free_List_unit,FUNCTION); |
---|
[78] | 81 | }; |
---|
| 82 | |
---|
| 83 | }; // end namespace free_list_unit |
---|
| 84 | }; // end namespace register_translation_unit |
---|
| 85 | }; // end namespace rename_unit |
---|
| 86 | }; // end namespace ooo_engine |
---|
| 87 | }; // end namespace multi_ooo_engine |
---|
| 88 | }; // end namespace core |
---|
| 89 | |
---|
| 90 | }; // end namespace behavioural |
---|
| 91 | }; // end namespace morpheo |
---|
| 92 | #endif |
---|