[60] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Parameters.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_execute_loop { |
---|
| 14 | namespace execute_loop { |
---|
| 15 | namespace register_unit { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Register_unit::Parameters" |
---|
| 20 | Parameters::Parameters (uint32_t nb_ooo_engine , |
---|
| 21 | uint32_t size_general_data , |
---|
| 22 | uint32_t size_special_data , |
---|
| 23 | uint32_t nb_gpr_read , |
---|
| 24 | uint32_t nb_gpr_write , |
---|
| 25 | uint32_t nb_gpr_bank , |
---|
| 26 | uint32_t nb_gpr_port_read_by_bank , |
---|
| 27 | uint32_t nb_gpr_port_write_by_bank, |
---|
| 28 | uint32_t nb_spr_read , |
---|
| 29 | uint32_t nb_spr_write , |
---|
| 30 | uint32_t nb_spr_bank , |
---|
| 31 | uint32_t nb_spr_port_read_by_bank , |
---|
| 32 | uint32_t nb_spr_port_write_by_bank, |
---|
| 33 | uint32_t * nb_general_register , |
---|
| 34 | uint32_t * nb_special_register , |
---|
| 35 | uint32_t * nb_inst_insert_rob , |
---|
| 36 | uint32_t * nb_inst_retire_rob ): |
---|
| 37 | _nb_ooo_engine (nb_ooo_engine ), |
---|
| 38 | _size_general_data (size_general_data ), |
---|
| 39 | _size_special_data (size_special_data ), |
---|
| 40 | _nb_gpr_read (nb_gpr_read ), |
---|
| 41 | _nb_gpr_write (nb_gpr_write ), |
---|
| 42 | _nb_gpr_bank (nb_gpr_bank ), |
---|
| 43 | _nb_gpr_port_read_by_bank (nb_gpr_port_read_by_bank ), |
---|
| 44 | _nb_gpr_port_write_by_bank (nb_gpr_port_write_by_bank), |
---|
| 45 | _nb_spr_read (nb_spr_read ), |
---|
| 46 | _nb_spr_write (nb_spr_write ), |
---|
| 47 | _nb_spr_bank (nb_spr_bank ), |
---|
| 48 | _nb_spr_port_read_by_bank (nb_spr_port_read_by_bank ), |
---|
| 49 | _nb_spr_port_write_by_bank (nb_spr_port_write_by_bank), |
---|
| 50 | _nb_general_register (nb_general_register ), |
---|
| 51 | _nb_special_register (nb_special_register ), |
---|
| 52 | _nb_inst_insert_rob (nb_inst_insert_rob ), |
---|
| 53 | _nb_inst_retire_rob (nb_inst_retire_rob ), |
---|
| 54 | _have_port_ooo_engine_id (nb_ooo_engine>1 ) |
---|
| 55 | |
---|
| 56 | { |
---|
| 57 | log_printf(FUNC,Register_unit,FUNCTION,"Begin"); |
---|
| 58 | |
---|
| 59 | _size_gpr_address = log2(nb_general_register [0]); |
---|
[65] | 60 | |
---|
[60] | 61 | for (uint32_t i=1; i<nb_ooo_engine; i++) |
---|
[65] | 62 | { |
---|
| 63 | uint32_t new_size = log2(nb_general_register [i]); |
---|
| 64 | if (new_size > _size_gpr_address) |
---|
| 65 | _size_gpr_address = new_size; |
---|
| 66 | } |
---|
[60] | 67 | |
---|
| 68 | _size_spr_address = log2(nb_special_register [0]); |
---|
[65] | 69 | |
---|
[60] | 70 | for (uint32_t i=1; i<nb_ooo_engine; i++) |
---|
[65] | 71 | { |
---|
| 72 | uint32_t new_size = log2(nb_special_register [i]); |
---|
| 73 | if (new_size > _size_spr_address) |
---|
| 74 | _size_spr_address = new_size; |
---|
| 75 | } |
---|
[60] | 76 | |
---|
[65] | 77 | |
---|
[60] | 78 | _param_gpr = new morpheo::behavioural::generic::registerfile::Parameters * [_nb_ooo_engine]; |
---|
| 79 | _param_gpr_status = new morpheo::behavioural::generic::registerfile::Parameters * [_nb_ooo_engine]; |
---|
| 80 | _param_spr = new morpheo::behavioural::generic::registerfile::Parameters * [_nb_ooo_engine]; |
---|
| 81 | _param_spr_status = new morpheo::behavioural::generic::registerfile::Parameters * [_nb_ooo_engine]; |
---|
| 82 | |
---|
| 83 | __param_gpr = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * [_nb_ooo_engine]; |
---|
| 84 | __param_gpr_status = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters * [_nb_ooo_engine]; |
---|
| 85 | __param_spr = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * [_nb_ooo_engine]; |
---|
| 86 | __param_spr_status = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters * [_nb_ooo_engine]; |
---|
| 87 | |
---|
| 88 | for (uint32_t i=0; i<_nb_ooo_engine; i++) |
---|
| 89 | { |
---|
| 90 | Tcrossbar_t crossbar = PARTIAL_CROSSBAR; |
---|
| 91 | |
---|
| 92 | __param_gpr [i] = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters |
---|
| 93 | (_nb_gpr_read , |
---|
| 94 | _nb_gpr_write , |
---|
| 95 | _nb_general_register[i] , |
---|
| 96 | _size_general_data , |
---|
| 97 | _nb_gpr_bank , |
---|
| 98 | _nb_gpr_port_read_by_bank , |
---|
| 99 | _nb_gpr_port_write_by_bank, |
---|
| 100 | crossbar ); |
---|
| 101 | |
---|
| 102 | __param_gpr_status [i] = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters |
---|
| 103 | (_nb_gpr_read , |
---|
| 104 | _nb_gpr_write+_nb_inst_insert_rob[i]+2*_nb_inst_retire_rob[i], |
---|
| 105 | 0, |
---|
| 106 | nb_general_register[i], |
---|
| 107 | 1); |
---|
| 108 | |
---|
| 109 | __param_spr [i] = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters |
---|
| 110 | (_nb_spr_read , |
---|
| 111 | _nb_spr_write , |
---|
| 112 | _nb_special_register[i] , |
---|
| 113 | _size_special_data , |
---|
| 114 | _nb_spr_bank , |
---|
| 115 | _nb_spr_port_read_by_bank , |
---|
| 116 | _nb_spr_port_write_by_bank, |
---|
| 117 | crossbar ); |
---|
| 118 | |
---|
| 119 | __param_spr_status [i] = new morpheo::behavioural::generic::registerfile::registerfile_monolithic ::Parameters |
---|
| 120 | (_nb_spr_read , |
---|
| 121 | _nb_spr_write+_nb_inst_insert_rob[i]+2*_nb_inst_retire_rob[i], |
---|
| 122 | 0, |
---|
| 123 | nb_special_register[i], |
---|
| 124 | 1); |
---|
| 125 | |
---|
| 126 | _param_gpr [i] = new morpheo::behavioural::generic::registerfile::Parameters (__param_gpr [i]); |
---|
| 127 | _param_gpr_status [i] = new morpheo::behavioural::generic::registerfile::Parameters (__param_gpr_status [i]); |
---|
| 128 | _param_spr [i] = new morpheo::behavioural::generic::registerfile::Parameters (__param_spr [i]); |
---|
| 129 | _param_spr_status [i] = new morpheo::behavioural::generic::registerfile::Parameters (__param_spr_status [i]); |
---|
| 130 | } |
---|
| 131 | |
---|
| 132 | _param_glue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Parameters (_nb_ooo_engine , |
---|
| 133 | _size_general_data , |
---|
| 134 | _size_special_data , |
---|
| 135 | _nb_gpr_read , |
---|
| 136 | _nb_spr_read , |
---|
| 137 | _nb_gpr_write , |
---|
| 138 | _nb_spr_write , |
---|
| 139 | _nb_inst_insert_rob , |
---|
| 140 | _nb_inst_retire_rob ); |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | test(); |
---|
| 146 | log_printf(FUNC,Register_unit,FUNCTION,"End"); |
---|
| 147 | }; |
---|
| 148 | |
---|
| 149 | #undef FUNCTION |
---|
| 150 | #define FUNCTION "Register_unit::Parameters (copy)" |
---|
| 151 | Parameters::Parameters (Parameters & param): |
---|
| 152 | _nb_ooo_engine (param._nb_ooo_engine ), |
---|
| 153 | _size_general_data (param._size_general_data ), |
---|
| 154 | _size_special_data (param._size_special_data ), |
---|
| 155 | _nb_gpr_read (param._nb_gpr_read ), |
---|
| 156 | _nb_gpr_write (param._nb_gpr_write ), |
---|
| 157 | _nb_gpr_bank (param._nb_gpr_bank ), |
---|
| 158 | _nb_gpr_port_read_by_bank (param._nb_gpr_port_read_by_bank ), |
---|
| 159 | _nb_gpr_port_write_by_bank (param._nb_gpr_port_write_by_bank), |
---|
| 160 | _nb_spr_read (param._nb_spr_read ), |
---|
| 161 | _nb_spr_write (param._nb_spr_write ), |
---|
| 162 | _nb_spr_bank (param._nb_spr_bank ), |
---|
| 163 | _nb_spr_port_read_by_bank (param._nb_spr_port_read_by_bank ), |
---|
| 164 | _nb_spr_port_write_by_bank (param._nb_spr_port_write_by_bank), |
---|
| 165 | _nb_general_register (param._nb_general_register ), |
---|
| 166 | _nb_special_register (param._nb_special_register ), |
---|
| 167 | _nb_inst_insert_rob (param._nb_inst_insert_rob ), |
---|
| 168 | _nb_inst_retire_rob (param._nb_inst_retire_rob ), |
---|
| 169 | _have_port_ooo_engine_id (param._have_port_ooo_engine_id ) |
---|
| 170 | { |
---|
| 171 | log_printf(FUNC,Register_unit,FUNCTION,"Begin"); |
---|
| 172 | |
---|
| 173 | _size_gpr_address = param._size_gpr_address; |
---|
| 174 | _size_spr_address = param._size_spr_address; |
---|
| 175 | |
---|
| 176 | __param_gpr = param.__param_gpr ; |
---|
| 177 | __param_gpr_status = param.__param_gpr_status; |
---|
| 178 | __param_spr = param.__param_spr ; |
---|
| 179 | __param_spr_status = param.__param_spr_status; |
---|
| 180 | _param_gpr = param._param_gpr ; |
---|
| 181 | _param_gpr_status = param._param_gpr_status; |
---|
| 182 | _param_spr = param._param_spr ; |
---|
| 183 | _param_spr_status = param._param_spr_status; |
---|
| 184 | _param_glue = param._param_glue ; |
---|
| 185 | |
---|
| 186 | test(); |
---|
| 187 | log_printf(FUNC,Register_unit,FUNCTION,"End"); |
---|
| 188 | }; |
---|
| 189 | |
---|
| 190 | #undef FUNCTION |
---|
| 191 | #define FUNCTION "Register_unit::~Parameters" |
---|
| 192 | Parameters::~Parameters () |
---|
| 193 | { |
---|
| 194 | log_printf(FUNC,Register_unit,FUNCTION,"Begin"); |
---|
| 195 | |
---|
| 196 | delete [] _param_gpr ; |
---|
| 197 | delete [] _param_gpr_status; |
---|
| 198 | delete [] _param_spr ; |
---|
| 199 | delete [] _param_spr_status; |
---|
| 200 | delete [] __param_gpr ; |
---|
| 201 | delete [] __param_gpr_status; |
---|
| 202 | delete [] __param_spr ; |
---|
| 203 | delete [] __param_spr_status; |
---|
| 204 | delete _param_glue; |
---|
| 205 | |
---|
| 206 | log_printf(FUNC,Register_unit,FUNCTION,"End"); |
---|
| 207 | }; |
---|
| 208 | |
---|
| 209 | }; // end namespace register_unit |
---|
| 210 | }; // end namespace execute_loop |
---|
| 211 | }; // end namespace multi_execute_loop |
---|
| 212 | }; // end namespace core |
---|
| 213 | |
---|
| 214 | }; // end namespace behavioural |
---|
| 215 | }; // end namespace morpheo |
---|