[78] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.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 rename_select { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Rename_select::transition" |
---|
| 22 | void Rename_select::transition (void) |
---|
| 23 | { |
---|
| 24 | log_printf(FUNC,Rename_select,FUNCTION,"Begin"); |
---|
| 25 | |
---|
| 26 | if (PORT_READ(in_NRESET) == 0) |
---|
| 27 | { |
---|
| 28 | select.clear(); |
---|
| 29 | reg_FRONT_END_PRIORITY = 0; |
---|
| 30 | } |
---|
| 31 | else |
---|
| 32 | { |
---|
| 33 | switch (_param->_priority) |
---|
| 34 | { |
---|
| 35 | case PRIORITY_STATIC : |
---|
| 36 | { |
---|
| 37 | reg_FRONT_END_PRIORITY = (reg_FRONT_END_PRIORITY+_param->_nb_front_end_select)%_param->_nb_front_end; |
---|
| 38 | break; |
---|
| 39 | } |
---|
| 40 | case PRIORITY_ROUND_ROBIN : |
---|
| 41 | { |
---|
| 42 | reg_FRONT_END_PRIORITY = (reg_FRONT_END_PRIORITY+1)%_param->_nb_front_end; |
---|
| 43 | break; |
---|
| 44 | } |
---|
| 45 | default: |
---|
| 46 | { |
---|
| 47 | break; |
---|
| 48 | } |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | // flush list |
---|
| 52 | select.clear(); |
---|
| 53 | |
---|
| 54 | // Compute next scan order !!! |
---|
| 55 | switch (_param->_load_balancing) |
---|
| 56 | { |
---|
| 57 | case LOAD_BALANCING_BALANCE : |
---|
| 58 | { |
---|
| 59 | for (uint32_t j=0; j<_param->_max_nb_inst_decod; j++) |
---|
| 60 | for (uint32_t i=0; i<_param->_nb_front_end_select; i++) |
---|
| 61 | { |
---|
| 62 | uint32_t x=(reg_FRONT_END_PRIORITY+i)%_param->_nb_front_end; |
---|
| 63 | |
---|
| 64 | // Test valid inst_decod |
---|
| 65 | if (j < _param->_nb_inst_decod[x]) |
---|
| 66 | select.push_back(select_t(x,j)); |
---|
| 67 | } |
---|
| 68 | |
---|
| 69 | break; |
---|
| 70 | } |
---|
| 71 | case LOAD_BALANCING_MAXIMUM_FOR_PRIORITY : |
---|
| 72 | { |
---|
| 73 | |
---|
| 74 | for (uint32_t i=0; i<_param->_nb_front_end_select; i++) |
---|
| 75 | { |
---|
| 76 | uint32_t x=(reg_FRONT_END_PRIORITY+i)%_param->_nb_front_end; |
---|
| 77 | |
---|
| 78 | for (uint32_t j=0; j<_param->_nb_inst_decod[x]; j++) |
---|
| 79 | select.push_back(select_t(x,j)); |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | break; |
---|
| 83 | } |
---|
| 84 | default : |
---|
| 85 | { |
---|
| 86 | break; |
---|
| 87 | } |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | // #if (DEBUG >= DEBUG_TRACE) |
---|
| 91 | // log_printf(TRACE,Rename_select,FUNCTION,"Select priority (front_end, inst_decod)"); |
---|
| 92 | // for (std::list<select_t>::iterator it=select.begin(); |
---|
| 93 | // it != select.end(); |
---|
| 94 | // it++) |
---|
| 95 | // log_printf(TRACE,Rename_select,FUNCTION," %d %d",it->_front_end, it->_inst_decod); |
---|
| 96 | // #endif |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 100 | end_cycle (); |
---|
| 101 | #endif |
---|
| 102 | |
---|
| 103 | log_printf(FUNC,Rename_select,FUNCTION,"End"); |
---|
| 104 | }; |
---|
| 105 | |
---|
| 106 | }; // end namespace rename_select |
---|
| 107 | }; // end namespace rename_unit |
---|
| 108 | }; // end namespace ooo_engine |
---|
| 109 | }; // end namespace multi_ooo_engine |
---|
| 110 | }; // end namespace core |
---|
| 111 | |
---|
| 112 | }; // end namespace behavioural |
---|
| 113 | }; // end namespace morpheo |
---|
| 114 | #endif |
---|