[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/include/Parameters.h" |
---|
[88] | 9 | #include "Common/include/Max.h" |
---|
[78] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_execute_loop { |
---|
| 15 | namespace execute_loop { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Execute_loop::Parameters" |
---|
| 20 | Parameters::Parameters (uint32_t nb_read_unit , |
---|
| 21 | uint32_t nb_functionnal_unit , |
---|
| 22 | uint32_t nb_load_store_unit , |
---|
| 23 | uint32_t nb_write_unit , |
---|
| 24 | |
---|
| 25 | uint32_t nb_context , |
---|
| 26 | uint32_t nb_front_end , |
---|
| 27 | uint32_t nb_ooo_engine , |
---|
| 28 | uint32_t nb_packet , |
---|
| 29 | uint32_t size_general_data , |
---|
| 30 | uint32_t size_special_data , |
---|
| 31 | |
---|
[88] | 32 | uint32_t * size_read_queue ,//[nb_read_unit] |
---|
| 33 | uint32_t * size_reservation_station ,//[nb_read_unit] |
---|
| 34 | uint32_t * nb_inst_retire ,//[nb_read_unit] |
---|
| 35 | |
---|
| 36 | uint32_t * nb_inst_functionnal_unit ,//[nb_functionnal_unit] |
---|
| 37 | execute_timing_t *** timing ,//[nb_functionnal_unit][nb_type][nb_operation] |
---|
| 38 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void), |
---|
[78] | 39 | |
---|
[88] | 40 | uint32_t * size_store_queue ,//[nb_load_store_unit] |
---|
| 41 | uint32_t * size_load_queue ,//[nb_load_store_unit] |
---|
| 42 | uint32_t * size_speculative_access_queue ,//[nb_load_store_unit] |
---|
| 43 | uint32_t * nb_port_check ,//[nb_load_store_unit] |
---|
| 44 | Tspeculative_load_t * speculative_load ,//[nb_load_store_unit] |
---|
| 45 | uint32_t * nb_bypass_memory ,//[nb_load_store_unit] |
---|
| 46 | uint32_t * nb_cache_port ,//[nb_load_store_unit] |
---|
| 47 | uint32_t * nb_inst_memory ,//[nb_load_store_unit] |
---|
[78] | 48 | |
---|
[88] | 49 | uint32_t * size_write_queue ,//[nb_write_unit] |
---|
| 50 | uint32_t * size_execute_queue ,//[nb_write_unit] |
---|
| 51 | uint32_t * nb_bypass_write ,//[nb_write_unit] |
---|
[78] | 52 | |
---|
| 53 | uint32_t nb_gpr_bank , |
---|
| 54 | uint32_t nb_gpr_port_read_by_bank , |
---|
| 55 | uint32_t nb_gpr_port_write_by_bank , |
---|
| 56 | uint32_t nb_spr_bank , |
---|
| 57 | uint32_t nb_spr_port_read_by_bank , |
---|
| 58 | uint32_t nb_spr_port_write_by_bank , |
---|
[88] | 59 | uint32_t * nb_general_register ,//[nb_ooo_engine] |
---|
| 60 | uint32_t * nb_special_register ,//[nb_ooo_engine] |
---|
| 61 | uint32_t * nb_inst_insert_rob ,//[nb_ooo_engine] |
---|
| 62 | uint32_t * nb_inst_retire_rob ,//[nb_ooo_engine] |
---|
[78] | 63 | |
---|
| 64 | Tpriority_t execution_unit_to_write_unit_priority , |
---|
[88] | 65 | bool *** execution_unit_to_write_unit_table_routing,//[nb_execute_unit][nb_execute_unit_port][nb_write_unit] |
---|
| 66 | bool ** execution_unit_to_write_unit_table_thread ,//[nb_write_unit][nb_thread] |
---|
| 67 | |
---|
| 68 | Tpriority_t read_unit_to_execution_unit_priority , |
---|
| 69 | bool *** read_unit_to_execution_unit_table_routing ,//[nb_read_unit][nb_execute_unit][nb_execute_unit_port] |
---|
| 70 | bool ** read_unit_to_execution_unit_table_thread ,//[nb_execute_unit][nb_thread] |
---|
| 71 | |
---|
| 72 | bool * is_load_store_unit ,//[nb_execute_unit] |
---|
| 73 | uint32_t * translate_num_execute_unit ,//[nb_execute_unit] |
---|
| 74 | |
---|
| 75 | bool is_toplevel |
---|
| 76 | ) |
---|
[78] | 77 | { |
---|
| 78 | log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 79 | |
---|
[88] | 80 | _nb_read_unit = nb_read_unit ; |
---|
| 81 | _nb_functionnal_unit = nb_functionnal_unit ; |
---|
| 82 | _nb_load_store_unit = nb_load_store_unit ; |
---|
| 83 | _nb_write_unit = nb_write_unit ; |
---|
| 84 | |
---|
| 85 | _nb_context = nb_context ; |
---|
| 86 | _nb_front_end = nb_front_end ; |
---|
| 87 | _nb_ooo_engine = nb_ooo_engine ; |
---|
| 88 | _nb_packet = nb_packet ; |
---|
| 89 | |
---|
| 90 | _size_read_queue = size_read_queue ; |
---|
| 91 | _size_reservation_station = size_reservation_station ; |
---|
| 92 | _nb_inst_retire = nb_inst_retire ; |
---|
| 93 | |
---|
| 94 | _nb_inst_functionnal_unit = nb_inst_functionnal_unit ; |
---|
| 95 | _timing = timing ; |
---|
| 96 | _get_custom_information = get_custom_information ; |
---|
| 97 | |
---|
| 98 | _size_store_queue = size_store_queue ; |
---|
| 99 | _size_load_queue = size_load_queue ; |
---|
| 100 | _size_speculative_access_queue = size_speculative_access_queue ; |
---|
| 101 | _nb_port_check = nb_port_check ; |
---|
| 102 | _speculative_load = speculative_load ; |
---|
| 103 | _nb_bypass_memory = nb_bypass_memory ; |
---|
| 104 | _nb_cache_port = nb_cache_port ; |
---|
| 105 | _nb_inst_memory = nb_inst_memory ; |
---|
| 106 | |
---|
| 107 | _size_write_queue = size_write_queue ; |
---|
| 108 | _size_execute_queue = size_execute_queue ; |
---|
| 109 | _nb_bypass_write = nb_bypass_write ; |
---|
| 110 | |
---|
| 111 | _nb_gpr_bank = nb_gpr_bank ; |
---|
| 112 | _nb_gpr_port_read_by_bank = nb_gpr_port_read_by_bank ; |
---|
| 113 | _nb_gpr_port_write_by_bank = nb_gpr_port_write_by_bank ; |
---|
| 114 | _nb_spr_bank = nb_spr_bank ; |
---|
| 115 | _nb_spr_port_read_by_bank = nb_spr_port_read_by_bank ; |
---|
| 116 | _nb_spr_port_write_by_bank = nb_spr_port_write_by_bank ; |
---|
| 117 | _nb_general_register = nb_general_register ; |
---|
| 118 | _nb_special_register = nb_special_register ; |
---|
| 119 | _nb_inst_insert_rob = nb_inst_insert_rob ; |
---|
| 120 | _nb_inst_retire_rob = nb_inst_retire_rob ; |
---|
[78] | 121 | |
---|
| 122 | _execution_unit_to_write_unit_priority = execution_unit_to_write_unit_priority; |
---|
| 123 | _execution_unit_to_write_unit_table_routing = execution_unit_to_write_unit_table_routing; |
---|
| 124 | _execution_unit_to_write_unit_table_thread = execution_unit_to_write_unit_table_thread ; |
---|
| 125 | |
---|
[88] | 126 | _read_unit_to_execution_unit_priority = read_unit_to_execution_unit_priority ; |
---|
[78] | 127 | _read_unit_to_execution_unit_table_routing = read_unit_to_execution_unit_table_routing ; |
---|
| 128 | _read_unit_to_execution_unit_table_thread = read_unit_to_execution_unit_table_thread ; |
---|
| 129 | |
---|
[88] | 130 | _is_load_store_unit = is_load_store_unit ; |
---|
| 131 | _translate_num_execute_unit = translate_num_execute_unit; |
---|
[78] | 132 | |
---|
[88] | 133 | _nb_execute_unit = _nb_functionnal_unit + _nb_load_store_unit; |
---|
[78] | 134 | |
---|
[88] | 135 | _nb_execute_unit_port = new uint32_t [_nb_execute_unit]; |
---|
| 136 | |
---|
[78] | 137 | _read_unit_to_execution_unit_table_execute_type = new bool * [_nb_execute_unit]; |
---|
| 138 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
| 139 | { |
---|
| 140 | _read_unit_to_execution_unit_table_execute_type [i] = new bool [_nb_type]; |
---|
| 141 | for (uint32_t j=0; j<_nb_type; j++) |
---|
| 142 | _read_unit_to_execution_unit_table_execute_type [i][j] = false; |
---|
| 143 | } |
---|
| 144 | |
---|
| 145 | // Fill execute_type |
---|
| 146 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
[88] | 147 | // is load store |
---|
| 148 | if (is_load_store_unit [i]) |
---|
| 149 | _read_unit_to_execution_unit_table_execute_type [i][TYPE_MEMORY] = true; |
---|
| 150 | else |
---|
| 151 | for (uint32_t j=0; j<_nb_type; j++) |
---|
| 152 | if (is_type_valid (j)) |
---|
| 153 | for (uint32_t k=0; k<_nb_operation; k++) |
---|
| 154 | { |
---|
| 155 | uint32_t x = translate_num_execute_unit [i]; |
---|
| 156 | if (timing[x][j][k]._latence > 0) |
---|
| 157 | { |
---|
| 158 | log_printf(TRACE,Execute_loop,FUNCTION,"Execute unit '%d' (functional unit '%d') can execute type '%s'.",i,x,toString_type(j).c_str()); |
---|
| 159 | _read_unit_to_execution_unit_table_execute_type [i][j] = true; |
---|
| 160 | break; // find an operation |
---|
| 161 | } |
---|
| 162 | } |
---|
[78] | 163 | |
---|
| 164 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
[88] | 165 | { |
---|
| 166 | uint32_t x = translate_num_execute_unit [i]; |
---|
| 167 | |
---|
| 168 | if (_is_load_store_unit [i]) |
---|
| 169 | _nb_execute_unit_port [i] = _nb_inst_memory [x]; |
---|
| 170 | else |
---|
| 171 | _nb_execute_unit_port [i] = _nb_inst_functionnal_unit [x]; |
---|
| 172 | } |
---|
[78] | 173 | |
---|
| 174 | _nb_gpr_read = 2*_nb_read_unit; |
---|
| 175 | _nb_spr_read = 1*_nb_read_unit; |
---|
| 176 | _nb_gpr_write = 1*_nb_write_unit; |
---|
| 177 | _nb_spr_write = 1*_nb_write_unit; |
---|
| 178 | |
---|
[88] | 179 | _max_nb_general_register = max<uint32_t>(nb_general_register,nb_ooo_engine); |
---|
| 180 | _max_nb_special_register = max<uint32_t>(nb_special_register,nb_ooo_engine); |
---|
[78] | 181 | |
---|
[88] | 182 | _max_size_store_queue = max<uint32_t>(size_store_queue,nb_load_store_unit); |
---|
| 183 | _max_size_load_queue = max<uint32_t>(size_load_queue ,nb_load_store_unit); |
---|
[78] | 184 | |
---|
| 185 | uint32_t _nb_thread = get_nb_thread(_nb_context, |
---|
| 186 | _nb_front_end, |
---|
| 187 | _nb_ooo_engine); |
---|
| 188 | |
---|
[88] | 189 | uint32_t _max_nb_inst_memory = max<uint32_t>(_nb_inst_memory,_nb_load_store_unit); |
---|
| 190 | |
---|
[78] | 191 | _set_read_unit_source_register_write = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 192 | _set_read_unit_source_bypass_write = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 193 | _set_read_unit_source_bypass_memory = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 194 | |
---|
| 195 | _read_unit_nb_register_write = new uint32_t [_nb_read_unit]; |
---|
| 196 | _read_unit_nb_bypass_write = new uint32_t [_nb_read_unit]; |
---|
| 197 | _read_unit_nb_bypass_memory = new uint32_t [_nb_read_unit]; |
---|
| 198 | |
---|
[88] | 199 | _link_read_unit_with_load_store_unit = new bool ** [nb_read_unit]; |
---|
| 200 | _link_read_unit_with_write_unit = new bool * [nb_read_unit]; |
---|
| 201 | _link_read_unit_with_thread = new bool * [nb_read_unit]; |
---|
[78] | 202 | |
---|
| 203 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 204 | { |
---|
| 205 | _read_unit_nb_register_write [i] = 0; |
---|
| 206 | _read_unit_nb_bypass_write [i] = 0; |
---|
| 207 | _read_unit_nb_bypass_memory [i] = 0; |
---|
| 208 | |
---|
[88] | 209 | _link_read_unit_with_load_store_unit [i] = new bool * [_nb_execute_unit]; |
---|
| 210 | _link_read_unit_with_write_unit [i] = new bool [_nb_write_unit]; |
---|
| 211 | _link_read_unit_with_thread [i] = new bool [_nb_thread]; |
---|
[78] | 212 | |
---|
| 213 | for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
[88] | 214 | { |
---|
| 215 | _link_read_unit_with_load_store_unit [i][j] = new bool [_max_nb_inst_memory]; |
---|
| 216 | |
---|
| 217 | for (uint32_t k=0; k<_max_nb_inst_memory; k++) |
---|
| 218 | _link_read_unit_with_load_store_unit [i][j][k] = false; |
---|
| 219 | } |
---|
[78] | 220 | for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 221 | _link_read_unit_with_write_unit [i][j] = false; |
---|
| 222 | for (uint32_t j=0; j<_nb_thread; j++) |
---|
| 223 | _link_read_unit_with_thread [i][j] = false; |
---|
| 224 | |
---|
| 225 | // fill link array |
---|
[88] | 226 | for (uint32_t x=0; x<_nb_execute_unit; x++) |
---|
| 227 | for (uint32_t y=0; y<_nb_execute_unit_port[x]; y++) |
---|
| 228 | { |
---|
| 229 | // Test if this read unit can send operation at this execute_unit |
---|
| 230 | if (_read_unit_to_execution_unit_table_routing [i][x][y]) |
---|
| 231 | { |
---|
| 232 | if (_is_load_store_unit [x]) |
---|
| 233 | { |
---|
| 234 | _link_read_unit_with_load_store_unit [i][x][y] = true; |
---|
| 235 | } |
---|
| 236 | |
---|
| 237 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 238 | { |
---|
| 239 | if (_read_unit_to_execution_unit_table_thread [x][k]) |
---|
| 240 | { |
---|
| 241 | _link_read_unit_with_thread [i][k] = true; |
---|
| 242 | } |
---|
| 243 | } |
---|
| 244 | // Scearch associed write_unit |
---|
| 245 | for (uint32_t k=0; k<_nb_write_unit; k++) |
---|
| 246 | { |
---|
| 247 | // Test if this execute_unit can send operation at this write_unit |
---|
| 248 | // Test if have not a previous link ! (a same read_unit can send operation à two execute_unit and each execute_unit send at the same write_unit) |
---|
| 249 | if (_execution_unit_to_write_unit_table_routing [x][y][k] and |
---|
| 250 | not _link_read_unit_with_write_unit [i][k]) |
---|
| 251 | // if yes : this write_unit can have operation sended by this read_unit |
---|
| 252 | { |
---|
| 253 | _link_read_unit_with_write_unit [i][k] = true; |
---|
| 254 | } |
---|
| 255 | } |
---|
| 256 | } |
---|
| 257 | } |
---|
[78] | 258 | } |
---|
| 259 | |
---|
| 260 | // Compute the gpr_write and spr_write port for the read_unit : |
---|
| 261 | // * Max : 2*nb_write_unit gpr_write_port. |
---|
| 262 | // * a specific read_unit and a specific write_unit can execute a null intersection of thread operation. Also it's unnecessarry to send the gpr_write at the read_unit. |
---|
| 263 | |
---|
| 264 | |
---|
[88] | 265 | // std::cout << "_link_......." << std::endl; |
---|
| 266 | // std::cout << "_link_read_unit_with_load_store_unit" << std::endl; |
---|
| 267 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 268 | // { |
---|
| 269 | // std::cout << "\t" << std::endl; |
---|
| 270 | // for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
| 271 | // for (uint32_t k=0; k<_nb_execute_unit_port[j]; k++) |
---|
| 272 | // std::cout << _link_read_unit_with_load_store_unit [i][j][k] << " "; |
---|
| 273 | // std::cout << std::endl; |
---|
| 274 | // } |
---|
| 275 | // std::cout << "_link_read_unit_with_write_unit" << std::endl; |
---|
| 276 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 277 | // { |
---|
| 278 | // std::cout << "\t" << std::endl; |
---|
| 279 | // for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 280 | // std::cout << _link_read_unit_with_write_unit [i][j] << " "; |
---|
| 281 | // std::cout << std::endl; |
---|
| 282 | // } |
---|
| 283 | // std::cout << "_link_read_unit_with_thread" << std::endl; |
---|
| 284 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 285 | // { |
---|
| 286 | // std::cout << "\t" << std::endl; |
---|
| 287 | // for (uint32_t j=0; j<_nb_thread; j++) |
---|
| 288 | // std::cout << _link_read_unit_with_thread [i][j] << " "; |
---|
| 289 | // std::cout << std::endl; |
---|
| 290 | // } |
---|
[78] | 291 | |
---|
[88] | 292 | // std::cout << "_set_......." << std::endl; |
---|
[78] | 293 | |
---|
| 294 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 295 | { |
---|
[88] | 296 | // std::cout << " * Read_unit[" << i << "]" << std::endl; |
---|
[78] | 297 | for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 298 | { |
---|
[88] | 299 | // std::cout << " * Write_unit[" << j << "]" << std::endl; |
---|
[78] | 300 | // Test the thread executed on this write_unit |
---|
| 301 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 302 | { |
---|
[88] | 303 | // std::cout << " * Thread[" << k << "]" << std::endl; |
---|
[78] | 304 | if ( (_execution_unit_to_write_unit_table_thread [j][k]) and |
---|
| 305 | (_link_read_unit_with_thread [i][k])) |
---|
| 306 | { |
---|
[88] | 307 | // std::cout << " * Find !!!!" << std::endl; |
---|
| 308 | // std::cout << " * Read_unit "+toString(i)+" must take the gpr_write with write_unit "+toString(j)+"." << std::endl; |
---|
[78] | 309 | _set_read_unit_source_register_write[i].insert(j); |
---|
| 310 | _read_unit_nb_register_write [i] ++; |
---|
| 311 | |
---|
[88] | 312 | // std::cout << " * bypass_write : " << _nb_bypass_write [j] << std::endl; |
---|
| 313 | // std::cout << " * Read_unit "+toString(i)+" must take the bypass_write with write_unit "+toString(j)+"." << std::endl; |
---|
[78] | 314 | _set_read_unit_source_bypass_write [i].insert(j); |
---|
| 315 | _read_unit_nb_bypass_write [i] += _nb_bypass_write [j]; |
---|
| 316 | break; |
---|
| 317 | } |
---|
| 318 | } |
---|
| 319 | } |
---|
| 320 | } |
---|
| 321 | |
---|
| 322 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 323 | { |
---|
[88] | 324 | // std::cout << " * Read_unit[" << i << "]" << std::endl; |
---|
[78] | 325 | for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
| 326 | { |
---|
[88] | 327 | uint32_t x = translate_num_execute_unit [j]; |
---|
| 328 | |
---|
| 329 | // std::cout << " * Execute_unit[" << j << "]" << std::endl; |
---|
[78] | 330 | // Test the thread executed on this execute_unit |
---|
| 331 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 332 | { |
---|
[88] | 333 | // std::cout << " * Thread[" << k << "]" << std::endl; |
---|
[78] | 334 | if ((_read_unit_to_execution_unit_table_thread [j][k]) and |
---|
| 335 | (_link_read_unit_with_thread [i][k]) and |
---|
| 336 | (_is_load_store_unit [j])) |
---|
| 337 | { |
---|
[88] | 338 | // std::cout << " * Find !!!!" << std::endl; |
---|
| 339 | // std::cout << " * Bypass_memory !!!!" << std::endl; |
---|
| 340 | // std::cout << " * Read_unit "+toString(i)+" must take the bypass_memory with load_store_unit "+toString(j)+"." << std::endl; |
---|
[78] | 341 | |
---|
| 342 | _set_read_unit_source_bypass_memory [i].insert(j); |
---|
[88] | 343 | _read_unit_nb_bypass_memory [i] += _nb_bypass_memory [x]; |
---|
| 344 | |
---|
| 345 | break; // loop on thread |
---|
[78] | 346 | } |
---|
| 347 | } |
---|
| 348 | } |
---|
| 349 | } |
---|
| 350 | |
---|
[88] | 351 | uint32_t size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
| 352 | uint32_t size_general_register = log2(_max_nb_general_register); |
---|
| 353 | uint32_t size_special_register = log2(_max_nb_special_register); |
---|
| 354 | |
---|
[78] | 355 | test(); |
---|
| 356 | |
---|
[88] | 357 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : glue"); |
---|
| 358 | |
---|
| 359 | _param_glue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::execute_loop_glue::Parameters |
---|
| 360 | (_nb_gpr_write , |
---|
| 361 | _nb_spr_write , |
---|
| 362 | size_ooo_engine_id , |
---|
| 363 | size_general_register , |
---|
| 364 | size_special_register , |
---|
| 365 | size_general_data , |
---|
| 366 | size_special_data ); |
---|
| 367 | |
---|
| 368 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : read_unit"); |
---|
| 369 | |
---|
[78] | 370 | _param_read_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters * [_nb_read_unit]; |
---|
| 371 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 372 | _param_read_unit [i] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters |
---|
| 373 | (_size_read_queue [i], |
---|
| 374 | _size_reservation_station [i], |
---|
| 375 | _nb_context , |
---|
| 376 | _nb_front_end , |
---|
| 377 | _nb_ooo_engine , |
---|
| 378 | _nb_packet , |
---|
[88] | 379 | size_general_data , |
---|
| 380 | size_special_data , |
---|
[78] | 381 | _max_nb_general_register , |
---|
| 382 | _max_nb_special_register , |
---|
| 383 | 1*_read_unit_nb_register_write [i], |
---|
| 384 | 1*_read_unit_nb_register_write [i], |
---|
| 385 | _max_size_store_queue , |
---|
| 386 | _max_size_load_queue , |
---|
| 387 | _nb_inst_retire [i], |
---|
| 388 | _read_unit_nb_bypass_write [i], |
---|
| 389 | _read_unit_nb_bypass_memory [i]); |
---|
| 390 | |
---|
[88] | 391 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execute_unit"); |
---|
| 392 | |
---|
[78] | 393 | _param_functionnal_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters * [_nb_functionnal_unit]; |
---|
| 394 | _param_load_store_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * [_nb_load_store_unit]; |
---|
| 395 | |
---|
| 396 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
[88] | 397 | { |
---|
| 398 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 399 | if (_is_load_store_unit [i] == false) |
---|
[78] | 400 | _param_functionnal_unit [x] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters |
---|
| 401 | (_nb_context , |
---|
| 402 | _nb_front_end , |
---|
| 403 | _nb_ooo_engine , |
---|
| 404 | _nb_packet , |
---|
[88] | 405 | size_general_data , |
---|
[78] | 406 | _max_nb_general_register , |
---|
[88] | 407 | size_special_data , |
---|
[78] | 408 | _max_nb_special_register , |
---|
| 409 | _max_size_store_queue , |
---|
| 410 | _max_size_load_queue , |
---|
[88] | 411 | _timing [x], |
---|
[78] | 412 | _get_custom_information ); |
---|
[88] | 413 | else |
---|
| 414 | _param_load_store_unit [x] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters |
---|
| 415 | (_size_store_queue [x], |
---|
| 416 | _size_load_queue [x], |
---|
| 417 | _size_speculative_access_queue [x], |
---|
| 418 | _nb_port_check [x], |
---|
| 419 | _speculative_load [x], |
---|
| 420 | _nb_bypass_memory [x], |
---|
| 421 | _nb_cache_port [x], |
---|
| 422 | _nb_inst_memory [x], |
---|
[78] | 423 | _nb_context , |
---|
| 424 | _nb_front_end , |
---|
| 425 | _nb_ooo_engine , |
---|
| 426 | _nb_packet , |
---|
[88] | 427 | size_general_data , |
---|
| 428 | size_special_data , |
---|
[78] | 429 | _max_nb_special_register , |
---|
| 430 | _max_nb_general_register ); |
---|
[88] | 431 | } |
---|
[78] | 432 | |
---|
[88] | 433 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : write_unit"); |
---|
| 434 | |
---|
[78] | 435 | _param_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * [_nb_write_unit]; |
---|
| 436 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 437 | _param_write_unit [i] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters |
---|
| 438 | (_size_write_queue [i], |
---|
| 439 | _size_execute_queue [i], |
---|
| 440 | _nb_context , |
---|
| 441 | _nb_front_end , |
---|
| 442 | _nb_ooo_engine , |
---|
| 443 | _nb_packet , |
---|
[88] | 444 | size_general_data , |
---|
[78] | 445 | _max_nb_general_register , |
---|
[88] | 446 | size_special_data , |
---|
[78] | 447 | _max_nb_special_register , |
---|
| 448 | _nb_bypass_write [i]); |
---|
| 449 | |
---|
| 450 | |
---|
[88] | 451 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : read_unit_to_execution_unit"); |
---|
| 452 | |
---|
[78] | 453 | _param_read_unit_to_execution_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Parameters |
---|
| 454 | (_nb_read_unit , |
---|
[88] | 455 | _nb_inst_retire , |
---|
[78] | 456 | _nb_execute_unit , |
---|
[88] | 457 | _nb_execute_unit_port , |
---|
[78] | 458 | _nb_context , |
---|
| 459 | _nb_front_end , |
---|
| 460 | _nb_ooo_engine , |
---|
| 461 | _nb_packet , |
---|
[88] | 462 | size_general_data , |
---|
| 463 | size_special_data , |
---|
[78] | 464 | _max_nb_general_register , |
---|
| 465 | _max_nb_special_register , |
---|
| 466 | _max_size_store_queue , |
---|
| 467 | _max_size_load_queue , |
---|
| 468 | _read_unit_to_execution_unit_priority , |
---|
| 469 | _read_unit_to_execution_unit_table_routing , |
---|
| 470 | _read_unit_to_execution_unit_table_execute_type, |
---|
| 471 | _read_unit_to_execution_unit_table_thread ); |
---|
| 472 | |
---|
[88] | 473 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execution_unit_to_write_unit"); |
---|
| 474 | |
---|
[78] | 475 | _param_execution_unit_to_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::execution_unit_to_write_unit::Parameters |
---|
| 476 | (_nb_execute_unit , |
---|
[88] | 477 | _nb_execute_unit_port , |
---|
[78] | 478 | _nb_write_unit , |
---|
| 479 | _nb_context , |
---|
| 480 | _nb_front_end , |
---|
| 481 | _nb_ooo_engine , |
---|
| 482 | _nb_packet , |
---|
[88] | 483 | size_general_data , |
---|
| 484 | size_special_data , |
---|
[78] | 485 | _max_nb_general_register , |
---|
| 486 | _max_nb_special_register , |
---|
| 487 | _execution_unit_to_write_unit_priority , |
---|
| 488 | _execution_unit_to_write_unit_table_routing, |
---|
| 489 | _execution_unit_to_write_unit_table_thread ); |
---|
| 490 | |
---|
[88] | 491 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : register_unit"); |
---|
| 492 | |
---|
[78] | 493 | _param_register_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::Parameters |
---|
| 494 | (_nb_ooo_engine , |
---|
[88] | 495 | size_general_data , |
---|
| 496 | size_special_data , |
---|
[78] | 497 | _nb_gpr_read , |
---|
| 498 | _nb_gpr_write , |
---|
| 499 | _nb_gpr_bank , |
---|
| 500 | _nb_gpr_port_read_by_bank , |
---|
| 501 | _nb_gpr_port_write_by_bank , |
---|
| 502 | _nb_spr_read , |
---|
| 503 | _nb_spr_write , |
---|
| 504 | _nb_spr_bank , |
---|
| 505 | _nb_spr_port_read_by_bank , |
---|
| 506 | _nb_spr_port_write_by_bank , |
---|
| 507 | _nb_general_register , |
---|
| 508 | _nb_special_register , |
---|
| 509 | _nb_inst_insert_rob , |
---|
| 510 | _nb_inst_retire_rob ); |
---|
| 511 | |
---|
| 512 | _max_size_dcache_context_id = 0; |
---|
| 513 | _max_size_dcache_packet_id = 0; |
---|
| 514 | |
---|
| 515 | for (uint32_t i=0; i<_nb_load_store_unit; i++) |
---|
| 516 | { |
---|
| 517 | if (_param_load_store_unit [i]->_size_dcache_context_id > _max_size_dcache_context_id) _max_size_dcache_context_id = _param_load_store_unit [i]->_size_dcache_context_id; |
---|
| 518 | if (_param_load_store_unit [i]->_size_dcache_packet_id > _max_size_dcache_packet_id) _max_size_dcache_packet_id = _param_load_store_unit [i]->_size_dcache_packet_id; |
---|
| 519 | } |
---|
| 520 | |
---|
| 521 | _have_port_dcache_context_id = (_max_size_dcache_context_id>1); |
---|
| 522 | |
---|
[88] | 523 | |
---|
| 524 | if (is_toplevel) |
---|
| 525 | { |
---|
| 526 | _size_context_id = log2(nb_context); |
---|
| 527 | _size_front_end_id = log2(nb_front_end); |
---|
| 528 | _size_ooo_engine_id = size_ooo_engine_id; |
---|
| 529 | _size_rob_ptr = log2(nb_packet); |
---|
| 530 | _size_general_data = size_general_data; |
---|
| 531 | _size_special_data = size_special_data; |
---|
| 532 | _size_general_register = size_general_register; |
---|
| 533 | _size_special_register = size_special_register; |
---|
| 534 | |
---|
| 535 | _size_store_queue_ptr = log2(_max_size_store_queue); |
---|
| 536 | _size_load_queue_ptr = log2(_max_size_load_queue ); |
---|
| 537 | |
---|
| 538 | _have_port_context_id = _size_context_id > 0; |
---|
| 539 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 540 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 541 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
| 542 | _have_port_load_queue_ptr= _size_load_queue_ptr > 0; |
---|
| 543 | |
---|
| 544 | copy(); |
---|
| 545 | } |
---|
| 546 | |
---|
[78] | 547 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 548 | }; |
---|
| 549 | |
---|
| 550 | // #undef FUNCTION |
---|
| 551 | // #define FUNCTION "Execute_loop::Parameters (copy)" |
---|
| 552 | // Parameters::Parameters (Parameters & param) |
---|
| 553 | // { |
---|
| 554 | // log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 555 | |
---|
| 556 | // test(); |
---|
| 557 | |
---|
| 558 | // log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 559 | // }; |
---|
| 560 | |
---|
| 561 | #undef FUNCTION |
---|
| 562 | #define FUNCTION "Execute_loop::~Parameters" |
---|
[88] | 563 | Parameters::~Parameters (void) |
---|
[78] | 564 | { |
---|
| 565 | log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 566 | |
---|
[88] | 567 | delete _param_glue; |
---|
| 568 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 569 | delete _param_read_unit [i]; |
---|
[78] | 570 | delete [] _param_read_unit; |
---|
[88] | 571 | |
---|
| 572 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
| 573 | { |
---|
| 574 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 575 | |
---|
| 576 | if (_is_load_store_unit [i] == false) |
---|
| 577 | delete _param_functionnal_unit [x]; |
---|
| 578 | else |
---|
| 579 | delete _param_load_store_unit [x]; |
---|
| 580 | } |
---|
[78] | 581 | delete [] _param_functionnal_unit; |
---|
| 582 | delete [] _param_load_store_unit; |
---|
[88] | 583 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 584 | delete _param_write_unit [i]; |
---|
[78] | 585 | delete [] _param_write_unit; |
---|
| 586 | delete _param_read_unit_to_execution_unit; |
---|
| 587 | delete _param_execution_unit_to_write_unit; |
---|
| 588 | delete _param_register_unit; |
---|
| 589 | |
---|
| 590 | delete [] _read_unit_to_execution_unit_table_execute_type; |
---|
| 591 | delete [] _read_unit_nb_register_write; |
---|
| 592 | delete [] _read_unit_nb_bypass_write; |
---|
| 593 | delete [] _read_unit_nb_bypass_memory; |
---|
| 594 | delete [] _set_read_unit_source_register_write ; |
---|
| 595 | delete [] _set_read_unit_source_bypass_write ; |
---|
| 596 | delete [] _set_read_unit_source_bypass_memory ; |
---|
| 597 | delete [] _link_read_unit_with_load_store_unit; |
---|
| 598 | delete [] _link_read_unit_with_write_unit; |
---|
| 599 | delete [] _link_read_unit_with_thread; |
---|
| 600 | delete [] _is_load_store_unit; |
---|
| 601 | delete [] _translate_num_execute_unit; |
---|
[88] | 602 | delete [] _nb_execute_unit_port; |
---|
| 603 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 604 | }; |
---|
[78] | 605 | |
---|
[88] | 606 | |
---|
| 607 | #undef FUNCTION |
---|
| 608 | #define FUNCTION "Execute_loop::copy" |
---|
| 609 | void Parameters::copy (void) |
---|
| 610 | { |
---|
| 611 | log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 612 | |
---|
| 613 | COPY(_param_glue); |
---|
| 614 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 615 | COPY(_param_read_unit [i]); |
---|
| 616 | |
---|
| 617 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
| 618 | { |
---|
| 619 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 620 | |
---|
| 621 | if (_is_load_store_unit [i] == false) |
---|
| 622 | COPY(_param_functionnal_unit [x]); |
---|
| 623 | else |
---|
| 624 | COPY(_param_load_store_unit [x]); |
---|
| 625 | } |
---|
| 626 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 627 | COPY(_param_write_unit [i]); |
---|
| 628 | COPY(_param_read_unit_to_execution_unit); |
---|
| 629 | COPY(_param_execution_unit_to_write_unit); |
---|
| 630 | COPY(_param_register_unit); |
---|
| 631 | |
---|
[78] | 632 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 633 | }; |
---|
| 634 | |
---|
| 635 | }; // end namespace execute_loop |
---|
| 636 | }; // end namespace multi_execute_loop |
---|
| 637 | }; // end namespace core |
---|
| 638 | |
---|
| 639 | }; // end namespace behavioural |
---|
| 640 | }; // end namespace morpheo |
---|