[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 139 2010-07-30 14:47:27Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/include/Parameters.h" |
---|
| 9 | #include "Common/include/Max.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 | |
---|
| 19 | |
---|
| 20 | #undef FUNCTION |
---|
| 21 | #define FUNCTION "Register_translation_unit::Parameters" |
---|
[139] | 22 | Parameters::Parameters (uint32_t nb_front_end , |
---|
| 23 | uint32_t * nb_context ,//[nb_front_end] |
---|
| 24 | uint32_t nb_general_register , |
---|
| 25 | uint32_t nb_special_register , |
---|
| 26 | Trat_scheme_t rat_scheme , |
---|
| 27 | uint32_t nb_inst_insert , |
---|
| 28 | uint32_t nb_inst_retire , |
---|
| 29 | uint32_t nb_reg_free , |
---|
| 30 | uint32_t nb_bank , |
---|
| 31 | // uint32_t size_read_counter , |
---|
| 32 | uint32_t ** nb_branch_speculated,//[nb_front_end][nb_context] |
---|
| 33 | bool is_toplevel) |
---|
[78] | 34 | { |
---|
| 35 | log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
| 36 | |
---|
[139] | 37 | _nb_front_end = nb_front_end ; |
---|
| 38 | _nb_context = nb_context ; |
---|
| 39 | _nb_general_register = nb_general_register ; |
---|
| 40 | _nb_special_register = nb_special_register ; |
---|
| 41 | _rat_scheme = rat_scheme ; |
---|
| 42 | _nb_inst_insert = nb_inst_insert ; |
---|
| 43 | _nb_inst_retire = nb_inst_retire ; |
---|
| 44 | _nb_reg_free = nb_reg_free ; |
---|
| 45 | _nb_bank = nb_bank ; |
---|
| 46 | // _size_read_counter = size_read_counter ; |
---|
| 47 | _nb_branch_speculated = nb_branch_speculated; |
---|
[78] | 48 | |
---|
[88] | 49 | uint32_t size_general_register = log2(nb_general_register); |
---|
| 50 | uint32_t size_special_register = log2(nb_special_register); |
---|
| 51 | uint32_t max_nb_context = max<uint32_t>(nb_context, nb_front_end); |
---|
[78] | 52 | |
---|
| 53 | uint32_t nb_thread = 0; |
---|
| 54 | for (uint32_t i=0; i<nb_front_end; i++) |
---|
| 55 | nb_thread += nb_context[i]; |
---|
| 56 | |
---|
| 57 | _param_dependency_checking_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::dependency_checking_unit::Parameters |
---|
| 58 | (_nb_front_end , |
---|
| 59 | max_nb_context , |
---|
| 60 | _nb_general_register, |
---|
| 61 | _nb_special_register, |
---|
| 62 | _nb_inst_insert ); |
---|
| 63 | |
---|
| 64 | _param_free_list_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::free_list_unit::Parameters |
---|
| 65 | (nb_thread , |
---|
| 66 | _nb_general_register, |
---|
| 67 | _nb_special_register, |
---|
| 68 | _nb_bank , |
---|
| 69 | _nb_inst_insert , |
---|
| 70 | _nb_reg_free , |
---|
| 71 | PRIORITY_ROUND_ROBIN); |
---|
| 72 | |
---|
| 73 | _param_register_address_translation_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Parameters |
---|
[139] | 74 | (_nb_front_end , |
---|
| 75 | _nb_context , |
---|
| 76 | _nb_general_register , |
---|
| 77 | _nb_special_register , |
---|
| 78 | _rat_scheme , |
---|
| 79 | _nb_inst_insert , |
---|
| 80 | _nb_inst_retire , |
---|
| 81 | _nb_branch_speculated); |
---|
[78] | 82 | |
---|
| 83 | _param_stat_list_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::stat_list_unit::Parameters |
---|
| 84 | (_nb_front_end , |
---|
| 85 | _nb_context , |
---|
| 86 | _nb_general_register, |
---|
| 87 | _nb_special_register, |
---|
| 88 | _nb_inst_insert , |
---|
| 89 | _nb_inst_retire , |
---|
| 90 | _nb_reg_free , |
---|
[112] | 91 | _nb_bank // , |
---|
| 92 | // _size_read_counter |
---|
| 93 | ); |
---|
[78] | 94 | |
---|
| 95 | _param_register_translation_unit_glue = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_translation_unit_glue::Parameters |
---|
| 96 | (_nb_inst_insert, |
---|
[88] | 97 | _nb_inst_retire, |
---|
| 98 | size_general_register, |
---|
| 99 | size_special_register); |
---|
[78] | 100 | |
---|
| 101 | test(); |
---|
[88] | 102 | |
---|
| 103 | if (is_toplevel) |
---|
| 104 | { |
---|
| 105 | _size_front_end_id = log2(nb_front_end ); |
---|
| 106 | _size_context_id = log2(max_nb_context ); |
---|
[139] | 107 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_front_end,_nb_context)); |
---|
[88] | 108 | _size_general_register = size_general_register; |
---|
| 109 | _size_special_register = size_special_register; |
---|
| 110 | |
---|
| 111 | _have_port_front_end_id = _size_front_end_id>0; |
---|
| 112 | _have_port_context_id = _size_context_id >0; |
---|
[139] | 113 | _have_port_depth = _size_depth >0; |
---|
[88] | 114 | |
---|
| 115 | copy(); |
---|
| 116 | } |
---|
| 117 | |
---|
[78] | 118 | log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | // #undef FUNCTION |
---|
| 122 | // #define FUNCTION "Register_translation_unit::Parameters (copy)" |
---|
| 123 | // Parameters::Parameters (Parameters & param) |
---|
| 124 | // { |
---|
| 125 | // log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
| 126 | // test(); |
---|
| 127 | // log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
| 128 | // }; |
---|
| 129 | |
---|
| 130 | #undef FUNCTION |
---|
| 131 | #define FUNCTION "Register_translation_unit::~Parameters" |
---|
| 132 | Parameters::~Parameters () |
---|
| 133 | { |
---|
| 134 | log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
| 135 | |
---|
[128] | 136 | delete _param_dependency_checking_unit; |
---|
| 137 | delete _param_free_list_unit; |
---|
| 138 | delete _param_register_address_translation_unit; |
---|
| 139 | delete _param_stat_list_unit; |
---|
| 140 | delete _param_register_translation_unit_glue; |
---|
[78] | 141 | |
---|
| 142 | log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
| 143 | }; |
---|
| 144 | |
---|
[88] | 145 | #undef FUNCTION |
---|
| 146 | #define FUNCTION "Register_translation_unit::copy" |
---|
| 147 | void Parameters::copy (void) |
---|
| 148 | { |
---|
| 149 | log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
| 150 | |
---|
| 151 | COPY(_param_dependency_checking_unit); |
---|
| 152 | COPY(_param_free_list_unit); |
---|
| 153 | COPY(_param_register_address_translation_unit); |
---|
| 154 | COPY(_param_stat_list_unit); |
---|
| 155 | COPY(_param_register_translation_unit_glue); |
---|
| 156 | |
---|
| 157 | log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
| 158 | }; |
---|
| 159 | |
---|
[78] | 160 | }; // end namespace register_translation_unit |
---|
| 161 | }; // end namespace rename_unit |
---|
| 162 | }; // end namespace ooo_engine |
---|
| 163 | }; // end namespace multi_ooo_engine |
---|
| 164 | }; // end namespace core |
---|
| 165 | |
---|
| 166 | }; // end namespace behavioural |
---|
| 167 | }; // end namespace morpheo |
---|