[88] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 146 2011-02-01 20:57:54Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_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 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Rename_unit::Parameters" |
---|
| 21 | Parameters::Parameters (uint32_t nb_front_end , |
---|
| 22 | uint32_t * nb_context , |
---|
| 23 | uint32_t * nb_inst_decod , |
---|
| 24 | uint32_t nb_inst_insert , |
---|
| 25 | uint32_t nb_inst_retire , |
---|
| 26 | uint32_t nb_load_store_queue , |
---|
| 27 | uint32_t * size_store_queue , |
---|
| 28 | uint32_t * size_load_queue , |
---|
[146] | 29 | Tpredictor_t * speculative_commit_predictor_scheme,//[nb_load_store_queue] |
---|
| 30 | uint32_t ** lsu_pht_size_counter ,//[nb_load_store_queue][1] |
---|
| 31 | uint32_t ** lsu_pht_nb_counter ,//[nb_load_store_queue][1] |
---|
| 32 | Tpht_scheme_t ** lsu_pht_scheme ,//[nb_load_store_queue][1] |
---|
[110] | 33 | uint32_t * nb_inst_memory , |
---|
[88] | 34 | uint32_t ** link_load_store_unit_with_thread , |
---|
| 35 | Tpriority_t rename_select_priority , |
---|
| 36 | Tload_balancing_t rename_select_load_balancing , |
---|
| 37 | uint32_t rename_select_nb_front_end_select, |
---|
| 38 | uint32_t max_branch_speculated , |
---|
| 39 | uint32_t size_general_data , |
---|
| 40 | uint32_t nb_general_register , |
---|
| 41 | uint32_t nb_special_register , |
---|
[139] | 42 | Trat_scheme_t rat_scheme , |
---|
[88] | 43 | uint32_t nb_reg_free , |
---|
| 44 | uint32_t nb_bank , |
---|
[112] | 45 | // uint32_t size_read_counter , |
---|
[139] | 46 | uint32_t ** nb_branch_speculated ,//[nb_front_end][nb_context] |
---|
[88] | 47 | bool is_toplevel) |
---|
| 48 | { |
---|
| 49 | log_begin(Rename_unit,FUNCTION); |
---|
| 50 | |
---|
| 51 | _nb_front_end = nb_front_end ; |
---|
| 52 | _nb_context = nb_context ; |
---|
| 53 | _nb_inst_decod = nb_inst_decod ; |
---|
| 54 | _nb_inst_insert = nb_inst_insert ; |
---|
| 55 | _nb_inst_retire = nb_inst_retire ; |
---|
| 56 | _nb_load_store_queue = nb_load_store_queue ; |
---|
| 57 | _size_store_queue = size_store_queue ; |
---|
| 58 | _size_load_queue = size_load_queue ; |
---|
[146] | 59 | _speculative_commit_predictor_scheme = speculative_commit_predictor_scheme; |
---|
| 60 | _lsu_pht_size_counter = lsu_pht_size_counter ; |
---|
| 61 | _lsu_pht_nb_counter = lsu_pht_nb_counter ; |
---|
| 62 | _lsu_pht_scheme = lsu_pht_scheme ; |
---|
[110] | 63 | _nb_inst_memory = nb_inst_memory ; |
---|
[88] | 64 | _link_load_store_unit_with_thread = link_load_store_unit_with_thread ; |
---|
| 65 | _rename_select_priority = rename_select_priority ; |
---|
| 66 | _rename_select_load_balancing = rename_select_load_balancing ; |
---|
| 67 | _rename_select_nb_front_end_select = rename_select_nb_front_end_select; |
---|
| 68 | _max_branch_speculated = max_branch_speculated ; |
---|
| 69 | _nb_general_register = nb_general_register ; |
---|
| 70 | _nb_special_register = nb_special_register ; |
---|
[139] | 71 | _rat_scheme = rat_scheme ; |
---|
[88] | 72 | _nb_reg_free = nb_reg_free ; |
---|
| 73 | _nb_bank = nb_bank ; |
---|
[139] | 74 | // _size_read_counter = size_read_counter ; |
---|
| 75 | _nb_branch_speculated = nb_branch_speculated ; |
---|
| 76 | |
---|
[88] | 77 | uint32_t size_special_register = log2(_nb_special_register); |
---|
| 78 | |
---|
| 79 | test(); |
---|
| 80 | |
---|
| 81 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_rename_select.")); |
---|
| 82 | _param_rename_select = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters |
---|
| 83 | ( |
---|
| 84 | _nb_front_end , |
---|
| 85 | _nb_context , |
---|
| 86 | _max_branch_speculated, |
---|
| 87 | _size_general_data , |
---|
| 88 | _nb_inst_insert , |
---|
| 89 | _nb_inst_decod , |
---|
| 90 | _rename_select_nb_front_end_select , |
---|
| 91 | _rename_select_priority , |
---|
| 92 | _rename_select_load_balancing |
---|
| 93 | ); |
---|
| 94 | |
---|
| 95 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_register_translation_unit.")); |
---|
| 96 | _param_register_translation_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::Parameters |
---|
| 97 | ( |
---|
| 98 | _nb_front_end , |
---|
| 99 | _nb_context , |
---|
| 100 | _nb_general_register , |
---|
| 101 | _nb_special_register , |
---|
[139] | 102 | _rat_scheme , |
---|
[88] | 103 | _nb_inst_insert , |
---|
| 104 | _nb_inst_retire , |
---|
| 105 | _nb_reg_free , |
---|
[139] | 106 | _nb_bank , |
---|
| 107 | // _size_read_counter , |
---|
| 108 | _nb_branch_speculated |
---|
[88] | 109 | ); |
---|
| 110 | |
---|
| 111 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_load_store_pointer_unit.")); |
---|
| 112 | _param_load_store_pointer_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit::Parameters |
---|
| 113 | ( |
---|
| 114 | _nb_front_end , |
---|
| 115 | _nb_context , |
---|
| 116 | _nb_load_store_queue , |
---|
| 117 | _size_store_queue , |
---|
| 118 | _size_load_queue , |
---|
[146] | 119 | _speculative_commit_predictor_scheme, |
---|
| 120 | _lsu_pht_size_counter , |
---|
| 121 | _lsu_pht_nb_counter , |
---|
| 122 | _lsu_pht_scheme , |
---|
[110] | 123 | _nb_inst_memory , |
---|
[88] | 124 | _link_load_store_unit_with_thread, |
---|
| 125 | _nb_inst_insert , |
---|
| 126 | _nb_inst_retire |
---|
| 127 | ); |
---|
| 128 | |
---|
| 129 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_glue.")); |
---|
| 130 | _param_glue = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_unit_glue::Parameters |
---|
| 131 | ( |
---|
| 132 | _nb_front_end , |
---|
| 133 | _nb_context , |
---|
| 134 | _nb_inst_insert , |
---|
| 135 | _nb_inst_retire , |
---|
| 136 | _size_general_data , |
---|
[139] | 137 | _size_special_register, |
---|
| 138 | _rat_scheme |
---|
[88] | 139 | ); |
---|
| 140 | |
---|
| 141 | if (is_toplevel) |
---|
| 142 | { |
---|
[97] | 143 | _size_instruction_address = size_general_data-2; |
---|
[88] | 144 | _size_front_end_id = log2(_nb_front_end); |
---|
| 145 | _size_context_id = log2(max<uint32_t>(_nb_context,_nb_front_end)); |
---|
| 146 | _size_store_queue_ptr = log2(max<uint32_t>(_size_store_queue,nb_load_store_queue)); |
---|
| 147 | _size_load_queue_ptr = log2(max<uint32_t>(_size_load_queue ,nb_load_store_queue)); |
---|
| 148 | _size_general_register = log2(_nb_general_register); |
---|
| 149 | _size_special_register = size_special_register; |
---|
| 150 | _size_depth = log2(_max_branch_speculated); |
---|
| 151 | _size_general_data = size_general_data ; |
---|
| 152 | |
---|
| 153 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 154 | _have_port_context_id = _size_context_id > 0; |
---|
| 155 | _have_port_load_queue_ptr = _size_load_queue_ptr > 0; |
---|
| 156 | _have_port_depth = _size_depth > 0; |
---|
| 157 | |
---|
| 158 | copy(); |
---|
| 159 | } |
---|
| 160 | |
---|
| 161 | log_end(Rename_unit,FUNCTION); |
---|
| 162 | }; |
---|
| 163 | |
---|
| 164 | // #undef FUNCTION |
---|
| 165 | // #define FUNCTION "Rename_unit::Parameters (copy)" |
---|
| 166 | // Parameters::Parameters (Parameters & param) |
---|
| 167 | // { |
---|
| 168 | // log_begin(Rename_unit,FUNCTION); |
---|
| 169 | // test(); |
---|
| 170 | // log_end(Rename_unit,FUNCTION); |
---|
| 171 | // }; |
---|
| 172 | |
---|
| 173 | #undef FUNCTION |
---|
| 174 | #define FUNCTION "Rename_unit::~Parameters" |
---|
| 175 | Parameters::~Parameters (void) |
---|
| 176 | { |
---|
| 177 | log_begin(Rename_unit,FUNCTION); |
---|
| 178 | |
---|
| 179 | delete _param_rename_select ; |
---|
| 180 | delete _param_register_translation_unit; |
---|
| 181 | delete _param_load_store_pointer_unit ; |
---|
| 182 | delete _param_glue ; |
---|
| 183 | |
---|
| 184 | log_end(Rename_unit,FUNCTION); |
---|
| 185 | }; |
---|
| 186 | |
---|
| 187 | #undef FUNCTION |
---|
| 188 | #define FUNCTION "Rename_unit::copy" |
---|
| 189 | void Parameters::copy (void) |
---|
| 190 | { |
---|
| 191 | log_begin(Rename_unit,FUNCTION); |
---|
| 192 | |
---|
| 193 | COPY(_param_rename_select ); |
---|
| 194 | COPY(_param_register_translation_unit); |
---|
| 195 | COPY(_param_load_store_pointer_unit ); |
---|
| 196 | COPY(_param_glue ); |
---|
| 197 | |
---|
| 198 | log_end(Rename_unit,FUNCTION); |
---|
| 199 | }; |
---|
| 200 | |
---|
| 201 | }; // end namespace rename_unit |
---|
| 202 | }; // end namespace ooo_engine |
---|
| 203 | }; // end namespace multi_ooo_engine |
---|
| 204 | }; // end namespace core |
---|
| 205 | |
---|
| 206 | }; // end namespace behavioural |
---|
| 207 | }; // end namespace morpheo |
---|