[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 109 2009-02-16 20:28:31Z 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 | { |
---|
[109] | 158 | log_printf(TRACE,Execute_loop,FUNCTION," * Execute unit '%d' (functional unit '%d') can execute type '%s'.",i,x,toString(j).c_str()); |
---|
[88] | 159 | _read_unit_to_execution_unit_table_execute_type [i][j] = true; |
---|
| 160 | break; // find an operation |
---|
| 161 | } |
---|
| 162 | } |
---|
[78] | 163 | |
---|
[109] | 164 | for (uint32_t i=0; i<_nb_load_store_unit; ++i) |
---|
| 165 | log_printf(TRACE,Execute_loop,FUNCTION," * Load_store_unit [%d] - nb_inst : %d",i,_nb_inst_memory [i]); |
---|
| 166 | for (uint32_t i=0; i<_nb_functionnal_unit; ++i) |
---|
| 167 | log_printf(TRACE,Execute_loop,FUNCTION," * Functionnal_unit [%d] - nb_inst : %d",i,_nb_inst_functionnal_unit [i]); |
---|
| 168 | |
---|
| 169 | |
---|
[78] | 170 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
[88] | 171 | { |
---|
| 172 | uint32_t x = translate_num_execute_unit [i]; |
---|
| 173 | |
---|
| 174 | if (_is_load_store_unit [i]) |
---|
| 175 | _nb_execute_unit_port [i] = _nb_inst_memory [x]; |
---|
| 176 | else |
---|
| 177 | _nb_execute_unit_port [i] = _nb_inst_functionnal_unit [x]; |
---|
[109] | 178 | |
---|
| 179 | log_printf(TRACE,Execute_loop,FUNCTION," * Execute unit [%d] (%d) - nb_inst : %d",i,x,_nb_execute_unit_port [i]); |
---|
[88] | 180 | } |
---|
[78] | 181 | |
---|
| 182 | _nb_gpr_read = 2*_nb_read_unit; |
---|
| 183 | _nb_spr_read = 1*_nb_read_unit; |
---|
| 184 | _nb_gpr_write = 1*_nb_write_unit; |
---|
| 185 | _nb_spr_write = 1*_nb_write_unit; |
---|
| 186 | |
---|
[88] | 187 | _max_nb_general_register = max<uint32_t>(nb_general_register,nb_ooo_engine); |
---|
| 188 | _max_nb_special_register = max<uint32_t>(nb_special_register,nb_ooo_engine); |
---|
[78] | 189 | |
---|
[88] | 190 | _max_size_store_queue = max<uint32_t>(size_store_queue,nb_load_store_unit); |
---|
| 191 | _max_size_load_queue = max<uint32_t>(size_load_queue ,nb_load_store_unit); |
---|
[78] | 192 | |
---|
| 193 | uint32_t _nb_thread = get_nb_thread(_nb_context, |
---|
| 194 | _nb_front_end, |
---|
| 195 | _nb_ooo_engine); |
---|
| 196 | |
---|
[88] | 197 | uint32_t _max_nb_inst_memory = max<uint32_t>(_nb_inst_memory,_nb_load_store_unit); |
---|
| 198 | |
---|
[78] | 199 | _set_read_unit_source_register_write = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 200 | _set_read_unit_source_bypass_write = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 201 | _set_read_unit_source_bypass_memory = new std::set<uint32_t> [_nb_read_unit]; |
---|
| 202 | |
---|
| 203 | _read_unit_nb_register_write = new uint32_t [_nb_read_unit]; |
---|
| 204 | _read_unit_nb_bypass_write = new uint32_t [_nb_read_unit]; |
---|
| 205 | _read_unit_nb_bypass_memory = new uint32_t [_nb_read_unit]; |
---|
| 206 | |
---|
[88] | 207 | _link_read_unit_with_load_store_unit = new bool ** [nb_read_unit]; |
---|
| 208 | _link_read_unit_with_write_unit = new bool * [nb_read_unit]; |
---|
| 209 | _link_read_unit_with_thread = new bool * [nb_read_unit]; |
---|
[78] | 210 | |
---|
| 211 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 212 | { |
---|
| 213 | _read_unit_nb_register_write [i] = 0; |
---|
| 214 | _read_unit_nb_bypass_write [i] = 0; |
---|
| 215 | _read_unit_nb_bypass_memory [i] = 0; |
---|
| 216 | |
---|
[88] | 217 | _link_read_unit_with_load_store_unit [i] = new bool * [_nb_execute_unit]; |
---|
| 218 | _link_read_unit_with_write_unit [i] = new bool [_nb_write_unit]; |
---|
| 219 | _link_read_unit_with_thread [i] = new bool [_nb_thread]; |
---|
[78] | 220 | |
---|
| 221 | for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
[88] | 222 | { |
---|
| 223 | _link_read_unit_with_load_store_unit [i][j] = new bool [_max_nb_inst_memory]; |
---|
| 224 | |
---|
| 225 | for (uint32_t k=0; k<_max_nb_inst_memory; k++) |
---|
| 226 | _link_read_unit_with_load_store_unit [i][j][k] = false; |
---|
| 227 | } |
---|
[78] | 228 | for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 229 | _link_read_unit_with_write_unit [i][j] = false; |
---|
| 230 | for (uint32_t j=0; j<_nb_thread; j++) |
---|
| 231 | _link_read_unit_with_thread [i][j] = false; |
---|
| 232 | |
---|
| 233 | // fill link array |
---|
[88] | 234 | for (uint32_t x=0; x<_nb_execute_unit; x++) |
---|
| 235 | for (uint32_t y=0; y<_nb_execute_unit_port[x]; y++) |
---|
| 236 | { |
---|
| 237 | // Test if this read unit can send operation at this execute_unit |
---|
| 238 | if (_read_unit_to_execution_unit_table_routing [i][x][y]) |
---|
| 239 | { |
---|
| 240 | if (_is_load_store_unit [x]) |
---|
| 241 | { |
---|
| 242 | _link_read_unit_with_load_store_unit [i][x][y] = true; |
---|
| 243 | } |
---|
| 244 | |
---|
| 245 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 246 | { |
---|
| 247 | if (_read_unit_to_execution_unit_table_thread [x][k]) |
---|
| 248 | { |
---|
| 249 | _link_read_unit_with_thread [i][k] = true; |
---|
| 250 | } |
---|
| 251 | } |
---|
| 252 | // Scearch associed write_unit |
---|
| 253 | for (uint32_t k=0; k<_nb_write_unit; k++) |
---|
| 254 | { |
---|
[109] | 255 | log_printf(TRACE,Execute_loop,FUNCTION," * Execution_unit_to_write_unit_table_routing [%d][%d][%d]",x,y,k); |
---|
| 256 | |
---|
[88] | 257 | // Test if this execute_unit can send operation at this write_unit |
---|
| 258 | // 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) |
---|
| 259 | if (_execution_unit_to_write_unit_table_routing [x][y][k] and |
---|
| 260 | not _link_read_unit_with_write_unit [i][k]) |
---|
| 261 | // if yes : this write_unit can have operation sended by this read_unit |
---|
| 262 | { |
---|
| 263 | _link_read_unit_with_write_unit [i][k] = true; |
---|
| 264 | } |
---|
| 265 | } |
---|
| 266 | } |
---|
| 267 | } |
---|
[78] | 268 | } |
---|
| 269 | |
---|
| 270 | // Compute the gpr_write and spr_write port for the read_unit : |
---|
| 271 | // * Max : 2*nb_write_unit gpr_write_port. |
---|
| 272 | // * 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. |
---|
| 273 | |
---|
| 274 | |
---|
[88] | 275 | // std::cout << "_link_......." << std::endl; |
---|
| 276 | // std::cout << "_link_read_unit_with_load_store_unit" << std::endl; |
---|
| 277 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 278 | // { |
---|
| 279 | // std::cout << "\t" << std::endl; |
---|
| 280 | // for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
| 281 | // for (uint32_t k=0; k<_nb_execute_unit_port[j]; k++) |
---|
| 282 | // std::cout << _link_read_unit_with_load_store_unit [i][j][k] << " "; |
---|
| 283 | // std::cout << std::endl; |
---|
| 284 | // } |
---|
| 285 | // std::cout << "_link_read_unit_with_write_unit" << std::endl; |
---|
| 286 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 287 | // { |
---|
| 288 | // std::cout << "\t" << std::endl; |
---|
| 289 | // for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 290 | // std::cout << _link_read_unit_with_write_unit [i][j] << " "; |
---|
| 291 | // std::cout << std::endl; |
---|
| 292 | // } |
---|
| 293 | // std::cout << "_link_read_unit_with_thread" << std::endl; |
---|
| 294 | // for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 295 | // { |
---|
| 296 | // std::cout << "\t" << std::endl; |
---|
| 297 | // for (uint32_t j=0; j<_nb_thread; j++) |
---|
| 298 | // std::cout << _link_read_unit_with_thread [i][j] << " "; |
---|
| 299 | // std::cout << std::endl; |
---|
| 300 | // } |
---|
[78] | 301 | |
---|
[88] | 302 | // std::cout << "_set_......." << std::endl; |
---|
[78] | 303 | |
---|
| 304 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 305 | { |
---|
[88] | 306 | // std::cout << " * Read_unit[" << i << "]" << std::endl; |
---|
[78] | 307 | for (uint32_t j=0; j<_nb_write_unit; j++) |
---|
| 308 | { |
---|
[88] | 309 | // std::cout << " * Write_unit[" << j << "]" << std::endl; |
---|
[78] | 310 | // Test the thread executed on this write_unit |
---|
| 311 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 312 | { |
---|
[88] | 313 | // std::cout << " * Thread[" << k << "]" << std::endl; |
---|
[78] | 314 | if ( (_execution_unit_to_write_unit_table_thread [j][k]) and |
---|
| 315 | (_link_read_unit_with_thread [i][k])) |
---|
| 316 | { |
---|
[88] | 317 | // std::cout << " * Find !!!!" << std::endl; |
---|
| 318 | // std::cout << " * Read_unit "+toString(i)+" must take the gpr_write with write_unit "+toString(j)+"." << std::endl; |
---|
[78] | 319 | _set_read_unit_source_register_write[i].insert(j); |
---|
| 320 | _read_unit_nb_register_write [i] ++; |
---|
| 321 | |
---|
[88] | 322 | // std::cout << " * bypass_write : " << _nb_bypass_write [j] << std::endl; |
---|
| 323 | // std::cout << " * Read_unit "+toString(i)+" must take the bypass_write with write_unit "+toString(j)+"." << std::endl; |
---|
[78] | 324 | _set_read_unit_source_bypass_write [i].insert(j); |
---|
| 325 | _read_unit_nb_bypass_write [i] += _nb_bypass_write [j]; |
---|
| 326 | break; |
---|
| 327 | } |
---|
| 328 | } |
---|
| 329 | } |
---|
| 330 | } |
---|
| 331 | |
---|
| 332 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 333 | { |
---|
[88] | 334 | // std::cout << " * Read_unit[" << i << "]" << std::endl; |
---|
[78] | 335 | for (uint32_t j=0; j<_nb_execute_unit; j++) |
---|
| 336 | { |
---|
[88] | 337 | uint32_t x = translate_num_execute_unit [j]; |
---|
| 338 | |
---|
| 339 | // std::cout << " * Execute_unit[" << j << "]" << std::endl; |
---|
[78] | 340 | // Test the thread executed on this execute_unit |
---|
| 341 | for (uint32_t k=0; k<_nb_thread; k++) |
---|
| 342 | { |
---|
[88] | 343 | // std::cout << " * Thread[" << k << "]" << std::endl; |
---|
[78] | 344 | if ((_read_unit_to_execution_unit_table_thread [j][k]) and |
---|
| 345 | (_link_read_unit_with_thread [i][k]) and |
---|
| 346 | (_is_load_store_unit [j])) |
---|
| 347 | { |
---|
[88] | 348 | // std::cout << " * Find !!!!" << std::endl; |
---|
| 349 | // std::cout << " * Bypass_memory !!!!" << std::endl; |
---|
| 350 | // std::cout << " * Read_unit "+toString(i)+" must take the bypass_memory with load_store_unit "+toString(j)+"." << std::endl; |
---|
[78] | 351 | |
---|
| 352 | _set_read_unit_source_bypass_memory [i].insert(j); |
---|
[88] | 353 | _read_unit_nb_bypass_memory [i] += _nb_bypass_memory [x]; |
---|
| 354 | |
---|
| 355 | break; // loop on thread |
---|
[78] | 356 | } |
---|
| 357 | } |
---|
| 358 | } |
---|
| 359 | } |
---|
| 360 | |
---|
[88] | 361 | uint32_t size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
| 362 | uint32_t size_general_register = log2(_max_nb_general_register); |
---|
| 363 | uint32_t size_special_register = log2(_max_nb_special_register); |
---|
| 364 | |
---|
[78] | 365 | test(); |
---|
| 366 | |
---|
[88] | 367 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : glue"); |
---|
| 368 | |
---|
| 369 | _param_glue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::execute_loop_glue::Parameters |
---|
| 370 | (_nb_gpr_write , |
---|
| 371 | _nb_spr_write , |
---|
| 372 | size_ooo_engine_id , |
---|
| 373 | size_general_register , |
---|
| 374 | size_special_register , |
---|
| 375 | size_general_data , |
---|
| 376 | size_special_data ); |
---|
| 377 | |
---|
| 378 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : read_unit"); |
---|
| 379 | |
---|
[78] | 380 | _param_read_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters * [_nb_read_unit]; |
---|
| 381 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 382 | _param_read_unit [i] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters |
---|
| 383 | (_size_read_queue [i], |
---|
| 384 | _size_reservation_station [i], |
---|
| 385 | _nb_context , |
---|
| 386 | _nb_front_end , |
---|
| 387 | _nb_ooo_engine , |
---|
| 388 | _nb_packet , |
---|
[88] | 389 | size_general_data , |
---|
| 390 | size_special_data , |
---|
[78] | 391 | _max_nb_general_register , |
---|
| 392 | _max_nb_special_register , |
---|
| 393 | 1*_read_unit_nb_register_write [i], |
---|
| 394 | 1*_read_unit_nb_register_write [i], |
---|
| 395 | _max_size_store_queue , |
---|
| 396 | _max_size_load_queue , |
---|
| 397 | _nb_inst_retire [i], |
---|
| 398 | _read_unit_nb_bypass_write [i], |
---|
| 399 | _read_unit_nb_bypass_memory [i]); |
---|
| 400 | |
---|
[88] | 401 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execute_unit"); |
---|
| 402 | |
---|
[78] | 403 | _param_functionnal_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters * [_nb_functionnal_unit]; |
---|
| 404 | _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]; |
---|
| 405 | |
---|
| 406 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
[88] | 407 | { |
---|
| 408 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 409 | if (_is_load_store_unit [i] == false) |
---|
[78] | 410 | _param_functionnal_unit [x] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters |
---|
| 411 | (_nb_context , |
---|
| 412 | _nb_front_end , |
---|
| 413 | _nb_ooo_engine , |
---|
| 414 | _nb_packet , |
---|
[88] | 415 | size_general_data , |
---|
[78] | 416 | _max_nb_general_register , |
---|
[88] | 417 | size_special_data , |
---|
[78] | 418 | _max_nb_special_register , |
---|
| 419 | _max_size_store_queue , |
---|
| 420 | _max_size_load_queue , |
---|
[88] | 421 | _timing [x], |
---|
[78] | 422 | _get_custom_information ); |
---|
[88] | 423 | else |
---|
| 424 | _param_load_store_unit [x] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters |
---|
| 425 | (_size_store_queue [x], |
---|
| 426 | _size_load_queue [x], |
---|
| 427 | _size_speculative_access_queue [x], |
---|
| 428 | _nb_port_check [x], |
---|
| 429 | _speculative_load [x], |
---|
| 430 | _nb_bypass_memory [x], |
---|
| 431 | _nb_cache_port [x], |
---|
| 432 | _nb_inst_memory [x], |
---|
[78] | 433 | _nb_context , |
---|
| 434 | _nb_front_end , |
---|
| 435 | _nb_ooo_engine , |
---|
| 436 | _nb_packet , |
---|
[88] | 437 | size_general_data , |
---|
| 438 | size_special_data , |
---|
[78] | 439 | _max_nb_special_register , |
---|
| 440 | _max_nb_general_register ); |
---|
[88] | 441 | } |
---|
[78] | 442 | |
---|
[88] | 443 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : write_unit"); |
---|
| 444 | |
---|
[78] | 445 | _param_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * [_nb_write_unit]; |
---|
| 446 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 447 | _param_write_unit [i] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters |
---|
| 448 | (_size_write_queue [i], |
---|
| 449 | _size_execute_queue [i], |
---|
| 450 | _nb_context , |
---|
| 451 | _nb_front_end , |
---|
| 452 | _nb_ooo_engine , |
---|
| 453 | _nb_packet , |
---|
[88] | 454 | size_general_data , |
---|
[78] | 455 | _max_nb_general_register , |
---|
[88] | 456 | size_special_data , |
---|
[78] | 457 | _max_nb_special_register , |
---|
| 458 | _nb_bypass_write [i]); |
---|
| 459 | |
---|
| 460 | |
---|
[88] | 461 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : read_unit_to_execution_unit"); |
---|
| 462 | |
---|
[78] | 463 | _param_read_unit_to_execution_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Parameters |
---|
| 464 | (_nb_read_unit , |
---|
[88] | 465 | _nb_inst_retire , |
---|
[78] | 466 | _nb_execute_unit , |
---|
[88] | 467 | _nb_execute_unit_port , |
---|
[78] | 468 | _nb_context , |
---|
| 469 | _nb_front_end , |
---|
| 470 | _nb_ooo_engine , |
---|
| 471 | _nb_packet , |
---|
[88] | 472 | size_general_data , |
---|
| 473 | size_special_data , |
---|
[78] | 474 | _max_nb_general_register , |
---|
| 475 | _max_nb_special_register , |
---|
| 476 | _max_size_store_queue , |
---|
| 477 | _max_size_load_queue , |
---|
| 478 | _read_unit_to_execution_unit_priority , |
---|
| 479 | _read_unit_to_execution_unit_table_routing , |
---|
| 480 | _read_unit_to_execution_unit_table_execute_type, |
---|
| 481 | _read_unit_to_execution_unit_table_thread ); |
---|
| 482 | |
---|
[88] | 483 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execution_unit_to_write_unit"); |
---|
| 484 | |
---|
[78] | 485 | _param_execution_unit_to_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::execution_unit_to_write_unit::Parameters |
---|
| 486 | (_nb_execute_unit , |
---|
[88] | 487 | _nb_execute_unit_port , |
---|
[78] | 488 | _nb_write_unit , |
---|
| 489 | _nb_context , |
---|
| 490 | _nb_front_end , |
---|
| 491 | _nb_ooo_engine , |
---|
| 492 | _nb_packet , |
---|
[88] | 493 | size_general_data , |
---|
| 494 | size_special_data , |
---|
[78] | 495 | _max_nb_general_register , |
---|
| 496 | _max_nb_special_register , |
---|
| 497 | _execution_unit_to_write_unit_priority , |
---|
| 498 | _execution_unit_to_write_unit_table_routing, |
---|
| 499 | _execution_unit_to_write_unit_table_thread ); |
---|
| 500 | |
---|
[88] | 501 | log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : register_unit"); |
---|
| 502 | |
---|
[78] | 503 | _param_register_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::Parameters |
---|
| 504 | (_nb_ooo_engine , |
---|
[88] | 505 | size_general_data , |
---|
| 506 | size_special_data , |
---|
[78] | 507 | _nb_gpr_read , |
---|
| 508 | _nb_gpr_write , |
---|
| 509 | _nb_gpr_bank , |
---|
| 510 | _nb_gpr_port_read_by_bank , |
---|
| 511 | _nb_gpr_port_write_by_bank , |
---|
| 512 | _nb_spr_read , |
---|
| 513 | _nb_spr_write , |
---|
| 514 | _nb_spr_bank , |
---|
| 515 | _nb_spr_port_read_by_bank , |
---|
| 516 | _nb_spr_port_write_by_bank , |
---|
| 517 | _nb_general_register , |
---|
| 518 | _nb_special_register , |
---|
| 519 | _nb_inst_insert_rob , |
---|
| 520 | _nb_inst_retire_rob ); |
---|
| 521 | |
---|
| 522 | _max_size_dcache_context_id = 0; |
---|
| 523 | _max_size_dcache_packet_id = 0; |
---|
| 524 | |
---|
| 525 | for (uint32_t i=0; i<_nb_load_store_unit; i++) |
---|
| 526 | { |
---|
| 527 | 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; |
---|
| 528 | 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; |
---|
| 529 | } |
---|
| 530 | |
---|
| 531 | _have_port_dcache_context_id = (_max_size_dcache_context_id>1); |
---|
| 532 | |
---|
[88] | 533 | |
---|
| 534 | if (is_toplevel) |
---|
| 535 | { |
---|
[97] | 536 | _size_instruction_address= size_general_data-2; |
---|
[88] | 537 | _size_context_id = log2(nb_context); |
---|
| 538 | _size_front_end_id = log2(nb_front_end); |
---|
| 539 | _size_ooo_engine_id = size_ooo_engine_id; |
---|
| 540 | _size_rob_ptr = log2(nb_packet); |
---|
| 541 | _size_general_data = size_general_data; |
---|
| 542 | _size_special_data = size_special_data; |
---|
| 543 | _size_general_register = size_general_register; |
---|
| 544 | _size_special_register = size_special_register; |
---|
| 545 | |
---|
| 546 | _size_store_queue_ptr = log2(_max_size_store_queue); |
---|
| 547 | _size_load_queue_ptr = log2(_max_size_load_queue ); |
---|
| 548 | |
---|
| 549 | _have_port_context_id = _size_context_id > 0; |
---|
| 550 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
| 551 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
| 552 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
| 553 | _have_port_load_queue_ptr= _size_load_queue_ptr > 0; |
---|
| 554 | |
---|
| 555 | copy(); |
---|
| 556 | } |
---|
| 557 | |
---|
[78] | 558 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 559 | }; |
---|
| 560 | |
---|
| 561 | // #undef FUNCTION |
---|
| 562 | // #define FUNCTION "Execute_loop::Parameters (copy)" |
---|
| 563 | // Parameters::Parameters (Parameters & param) |
---|
| 564 | // { |
---|
| 565 | // log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 566 | |
---|
| 567 | // test(); |
---|
| 568 | |
---|
| 569 | // log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 570 | // }; |
---|
| 571 | |
---|
| 572 | #undef FUNCTION |
---|
| 573 | #define FUNCTION "Execute_loop::~Parameters" |
---|
[88] | 574 | Parameters::~Parameters (void) |
---|
[78] | 575 | { |
---|
| 576 | log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 577 | |
---|
[88] | 578 | delete _param_glue; |
---|
| 579 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 580 | delete _param_read_unit [i]; |
---|
[78] | 581 | delete [] _param_read_unit; |
---|
[88] | 582 | |
---|
| 583 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
| 584 | { |
---|
| 585 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 586 | |
---|
| 587 | if (_is_load_store_unit [i] == false) |
---|
| 588 | delete _param_functionnal_unit [x]; |
---|
| 589 | else |
---|
| 590 | delete _param_load_store_unit [x]; |
---|
| 591 | } |
---|
[78] | 592 | delete [] _param_functionnal_unit; |
---|
| 593 | delete [] _param_load_store_unit; |
---|
[88] | 594 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 595 | delete _param_write_unit [i]; |
---|
[78] | 596 | delete [] _param_write_unit; |
---|
| 597 | delete _param_read_unit_to_execution_unit; |
---|
| 598 | delete _param_execution_unit_to_write_unit; |
---|
| 599 | delete _param_register_unit; |
---|
| 600 | |
---|
| 601 | delete [] _read_unit_to_execution_unit_table_execute_type; |
---|
| 602 | delete [] _read_unit_nb_register_write; |
---|
| 603 | delete [] _read_unit_nb_bypass_write; |
---|
| 604 | delete [] _read_unit_nb_bypass_memory; |
---|
| 605 | delete [] _set_read_unit_source_register_write ; |
---|
| 606 | delete [] _set_read_unit_source_bypass_write ; |
---|
| 607 | delete [] _set_read_unit_source_bypass_memory ; |
---|
| 608 | delete [] _link_read_unit_with_load_store_unit; |
---|
| 609 | delete [] _link_read_unit_with_write_unit; |
---|
| 610 | delete [] _link_read_unit_with_thread; |
---|
| 611 | delete [] _is_load_store_unit; |
---|
| 612 | delete [] _translate_num_execute_unit; |
---|
[88] | 613 | delete [] _nb_execute_unit_port; |
---|
| 614 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 615 | }; |
---|
[78] | 616 | |
---|
[88] | 617 | |
---|
| 618 | #undef FUNCTION |
---|
| 619 | #define FUNCTION "Execute_loop::copy" |
---|
| 620 | void Parameters::copy (void) |
---|
| 621 | { |
---|
| 622 | log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); |
---|
| 623 | |
---|
| 624 | COPY(_param_glue); |
---|
| 625 | for (uint32_t i=0; i<_nb_read_unit; i++) |
---|
| 626 | COPY(_param_read_unit [i]); |
---|
| 627 | |
---|
| 628 | for (uint32_t i=0; i<_nb_execute_unit; i++) |
---|
| 629 | { |
---|
| 630 | uint32_t x = _translate_num_execute_unit [i]; |
---|
| 631 | |
---|
| 632 | if (_is_load_store_unit [i] == false) |
---|
| 633 | COPY(_param_functionnal_unit [x]); |
---|
| 634 | else |
---|
| 635 | COPY(_param_load_store_unit [x]); |
---|
| 636 | } |
---|
| 637 | for (uint32_t i=0; i<_nb_write_unit; i++) |
---|
| 638 | COPY(_param_write_unit [i]); |
---|
| 639 | COPY(_param_read_unit_to_execution_unit); |
---|
| 640 | COPY(_param_execution_unit_to_write_unit); |
---|
| 641 | COPY(_param_register_unit); |
---|
| 642 | |
---|
[78] | 643 | log_printf(FUNC,Execute_loop,FUNCTION,"End"); |
---|
| 644 | }; |
---|
| 645 | |
---|
| 646 | }; // end namespace execute_loop |
---|
| 647 | }; // end namespace multi_execute_loop |
---|
| 648 | }; // end namespace core |
---|
| 649 | |
---|
| 650 | }; // end namespace behavioural |
---|
| 651 | }; // end namespace morpheo |
---|