Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Parameters.cpp
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Parameters.cpp
r81 r88 7 7 8 8 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/include/Parameters.h" 9 #include "Common/include/Max.h" 9 10 10 11 namespace morpheo { … … 29 30 uint32_t size_special_data , 30 31 31 uint32_t * size_read_queue , 32 uint32_t * size_reservation_station , 33 uint32_t * nb_inst_retire , 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), 34 39 35 execute_timing_t *** timing , 36 morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t), 37 38 uint32_t * size_store_queue , 39 uint32_t * size_load_queue , 40 uint32_t * size_speculative_access_queue , 41 uint32_t * nb_port_check , 42 Tspeculative_load_t * speculative_load , 43 uint32_t * nb_bypass_memory , 44 45 uint32_t * size_write_queue , 46 uint32_t * size_execute_queue , 47 uint32_t * nb_bypass_write , 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] 48 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] 48 52 49 53 uint32_t nb_gpr_bank , … … 53 57 uint32_t nb_spr_port_read_by_bank , 54 58 uint32_t nb_spr_port_write_by_bank , 55 uint32_t * nb_general_register , 56 uint32_t * nb_special_register , 57 uint32_t * nb_inst_insert_rob , 58 uint32_t * nb_inst_retire_rob , 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] 59 63 60 64 Tpriority_t execution_unit_to_write_unit_priority , 61 bool ** execution_unit_to_write_unit_table_routing, 62 bool ** execution_unit_to_write_unit_table_thread , 63 64 Tpriority_t read_unit_to_execution_unit_priority , 65 bool ** read_unit_to_execution_unit_table_routing , 66 bool ** read_unit_to_execution_unit_table_thread 67 ) 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 ) 68 77 { 69 78 log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); 70 79 71 _nb_read_unit = nb_read_unit ; 72 _nb_functionnal_unit = nb_functionnal_unit ; 73 _nb_load_store_unit = nb_load_store_unit ; 74 _nb_write_unit = nb_write_unit ; 75 76 _nb_context = nb_context ; 77 _nb_front_end = nb_front_end ; 78 _nb_ooo_engine = nb_ooo_engine ; 79 _nb_packet = nb_packet ; 80 _size_general_data = size_general_data ; 81 _size_special_data = size_special_data ; 82 83 _size_read_queue = size_read_queue ; 84 _size_reservation_station = size_reservation_station ; 85 _nb_inst_retire = nb_inst_retire ; 86 87 _timing = timing ; 88 _get_custom_information = get_custom_information ; 89 90 _size_store_queue = size_store_queue ; 91 _size_load_queue = size_load_queue ; 92 _size_speculative_access_queue = size_speculative_access_queue ; 93 _nb_port_check = nb_port_check ; 94 _speculative_load = speculative_load ; 95 _nb_bypass_memory = nb_bypass_memory ; 96 97 _size_write_queue = size_write_queue ; 98 _size_execute_queue = size_execute_queue ; 99 _nb_bypass_write = nb_bypass_write ; 100 101 _nb_gpr_bank = nb_gpr_bank ; 102 _nb_gpr_port_read_by_bank = nb_gpr_port_read_by_bank ; 103 _nb_gpr_port_write_by_bank = nb_gpr_port_write_by_bank ; 104 _nb_spr_bank = nb_spr_bank ; 105 _nb_spr_port_read_by_bank = nb_spr_port_read_by_bank ; 106 _nb_spr_port_write_by_bank = nb_spr_port_write_by_bank ; 107 _nb_general_register = nb_general_register ; 108 _nb_special_register = nb_special_register ; 109 _nb_inst_insert_rob = nb_inst_insert_rob ; 110 _nb_inst_retire_rob = nb_inst_retire_rob ; 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 ; 111 121 112 122 _execution_unit_to_write_unit_priority = execution_unit_to_write_unit_priority; … … 114 124 _execution_unit_to_write_unit_table_thread = execution_unit_to_write_unit_table_thread ; 115 125 116 _read_unit_to_execution_unit_priority = read_unit_to_execution_unit_priority ;126 _read_unit_to_execution_unit_priority = read_unit_to_execution_unit_priority ; 117 127 _read_unit_to_execution_unit_table_routing = read_unit_to_execution_unit_table_routing ; 118 128 _read_unit_to_execution_unit_table_thread = read_unit_to_execution_unit_table_thread ; 119 129 120 _nb_execute_unit = _nb_functionnal_unit + _nb_load_store_unit; 121 122 _size_context_id = log2(nb_context ); 123 _size_front_end_id = log2(nb_front_end ); 124 _size_ooo_engine_id = log2(nb_ooo_engine ); 125 _size_packet_id = log2(nb_packet ); 126 127 _have_port_context_id = _size_context_id >= 1; 128 _have_port_front_end_id = _size_front_end_id >= 1; 129 _have_port_ooo_engine_id = _size_ooo_engine_id >= 1; 130 _have_port_packet_id = _size_packet_id >= 1; 131 132 _is_load_store_unit = new bool [_nb_execute_unit]; 133 _translate_num_execute_unit = new uint32_t [_nb_execute_unit]; 134 130 _is_load_store_unit = is_load_store_unit ; 131 _translate_num_execute_unit = translate_num_execute_unit; 132 133 _nb_execute_unit = _nb_functionnal_unit + _nb_load_store_unit; 134 135 _nb_execute_unit_port = new uint32_t [_nb_execute_unit]; 136 135 137 _read_unit_to_execution_unit_table_execute_type = new bool * [_nb_execute_unit]; 136 138 for (uint32_t i=0; i<_nb_execute_unit; i++) 137 139 { 138 _is_load_store_unit [i] = false;139 140 _read_unit_to_execution_unit_table_execute_type [i] = new bool [_nb_type]; 140 141 for (uint32_t j=0; j<_nb_type; j++) … … 144 145 // Fill execute_type 145 146 for (uint32_t i=0; i<_nb_execute_unit; i++) 146 for (uint32_t j=0; j<_nb_type; j++) 147 for (uint32_t k=0; k<_nb_operation; k++) 148 // Test if operation is implemnted 149 if (timing[i][j][k]._latence > 0) 150 { 151 _read_unit_to_execution_unit_table_execute_type [i][j] = true; 152 _is_load_store_unit [i] = (j == TYPE_MEMORY); 153 break; 154 } 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 } 155 163 156 164 for (uint32_t i=0; i<_nb_execute_unit; i++) 157 if (_is_load_store_unit [i]) 158 log_printf(TRACE,Execute_loop,FUNCTION,"Execute unit '%d' is a Load Store unit",i); 159 else 160 log_printf(TRACE,Execute_loop,FUNCTION,"Execute unit '%d' is a Functionnal unit",i); 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 } 161 173 162 174 _nb_gpr_read = 2*_nb_read_unit; … … 165 177 _nb_spr_write = 1*_nb_write_unit; 166 178 167 _max_nb_general_register = 0; 168 _max_nb_special_register = 0; 169 for (uint32_t i=0; i<nb_ooo_engine; i++) 170 { 171 if (_nb_general_register[i] > _max_nb_general_register) _max_nb_general_register = _nb_general_register[i]; 172 if (_nb_special_register[i] > _max_nb_special_register) _max_nb_special_register = _nb_special_register[i]; 173 } 174 175 _max_size_store_queue = 0; 176 _max_size_load_queue = 0; 177 for (uint32_t i=0; i<nb_load_store_unit; i++) 178 { 179 if (_size_store_queue[i] > _max_size_store_queue) _max_size_store_queue = _size_store_queue[i]; 180 if (_size_load_queue [i] > _max_size_load_queue ) _max_size_load_queue = _size_load_queue [i]; 181 } 182 183 _have_port_load_queue_ptr= _max_size_load_queue >= 2; 184 185 _size_general_register = log2(_max_nb_general_register); 186 _size_special_register = log2(_max_nb_special_register); 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); 181 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); 187 184 188 185 uint32_t _nb_thread = get_nb_thread(_nb_context, … … 190 187 _nb_ooo_engine); 191 188 189 uint32_t _max_nb_inst_memory = max<uint32_t>(_nb_inst_memory,_nb_load_store_unit); 190 192 191 _set_read_unit_source_register_write = new std::set<uint32_t> [_nb_read_unit]; 193 192 _set_read_unit_source_bypass_write = new std::set<uint32_t> [_nb_read_unit]; … … 198 197 _read_unit_nb_bypass_memory = new uint32_t [_nb_read_unit]; 199 198 200 _link_read_unit_with_load_store_unit = new bool * [nb_read_unit];201 _link_read_unit_with_write_unit = new bool * [nb_read_unit];202 _link_read_unit_with_thread = new bool * [nb_read_unit];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]; 203 202 204 203 for (uint32_t i=0; i<_nb_read_unit; i++) … … 208 207 _read_unit_nb_bypass_memory [i] = 0; 209 208 210 _link_read_unit_with_load_store_unit [i] = new bool [_nb_execute_unit];211 _link_read_unit_with_write_unit [i] = new bool [_nb_write_unit];212 _link_read_unit_with_thread [i] = new bool [_nb_thread];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]; 213 212 214 213 for (uint32_t j=0; j<_nb_execute_unit; j++) 215 _link_read_unit_with_load_store_unit [i][j] = false; 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 } 216 220 for (uint32_t j=0; j<_nb_write_unit; j++) 217 221 _link_read_unit_with_write_unit [i][j] = false; … … 220 224 221 225 // fill link array 222 for (uint32_t j=0; j<_nb_execute_unit; j++) 223 { 224 // Test if this read unit can send operation at this execute_unit 225 if (_read_unit_to_execution_unit_table_routing [i][j]) 226 { 227 if (_is_load_store_unit [j]) 228 { 229 _link_read_unit_with_load_store_unit [i][j] = true; 230 } 231 232 for (uint32_t k=0; k<_nb_thread; k++) 233 { 234 if (_read_unit_to_execution_unit_table_thread [j][k]) 235 { 236 _link_read_unit_with_thread [i][k] = true; 237 } 238 } 239 // Scearch associed write_unit 240 for (uint32_t k=0; k<_nb_write_unit; k++) 241 { 242 // Test if this execute_unit can send operation at this write_unit 243 // 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) 244 if (_execution_unit_to_write_unit_table_routing [j][k] and 245 not _link_read_unit_with_write_unit [i][k]) 246 // if yes : this write_unit can have operation sended by this read_unit 247 { 248 _link_read_unit_with_write_unit [i][k] = true; 249 } 250 } 251 } 252 } 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 } 253 258 } 254 259 … … 258 263 259 264 260 std::cout << "_link_......." << std::endl; 261 std::cout << "_link_read_unit_with_load_store_unit" << std::endl; 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 // } 291 292 // std::cout << "_set_......." << std::endl; 293 262 294 for (uint32_t i=0; i<_nb_read_unit; i++) 263 295 { 264 std::cout << "\t" << std::endl; 265 for (uint32_t j=0; j<_nb_execute_unit; j++) 266 std::cout << _link_read_unit_with_load_store_unit [i][j] << " "; 267 std::cout << std::endl; 268 } 269 std::cout << "_link_read_unit_with_write_unit" << std::endl; 270 for (uint32_t i=0; i<_nb_read_unit; i++) 271 { 272 std::cout << "\t" << std::endl; 273 for (uint32_t j=0; j<_nb_write_unit; j++) 274 std::cout << _link_read_unit_with_write_unit [i][j] << " "; 275 std::cout << std::endl; 276 } 277 std::cout << "_link_read_unit_with_thread" << std::endl; 278 for (uint32_t i=0; i<_nb_read_unit; i++) 279 { 280 std::cout << "\t" << std::endl; 281 for (uint32_t j=0; j<_nb_thread; j++) 282 std::cout << _link_read_unit_with_thread [i][j] << " "; 283 std::cout << std::endl; 284 } 285 286 std::cout << "_set_......." << std::endl; 287 288 for (uint32_t i=0; i<_nb_read_unit; i++) 289 { 290 std::cout << " * Read_unit[" << i << "]" << std::endl; 296 // std::cout << " * Read_unit[" << i << "]" << std::endl; 291 297 for (uint32_t j=0; j<_nb_write_unit; j++) 292 298 { 293 std::cout << " * Write_unit[" << j << "]" << std::endl;299 // std::cout << " * Write_unit[" << j << "]" << std::endl; 294 300 // Test the thread executed on this write_unit 295 301 for (uint32_t k=0; k<_nb_thread; k++) 296 302 { 297 std::cout << " * Thread[" << k << "]" << std::endl;303 // std::cout << " * Thread[" << k << "]" << std::endl; 298 304 if ( (_execution_unit_to_write_unit_table_thread [j][k]) and 299 305 (_link_read_unit_with_thread [i][k])) 300 306 { 301 std::cout << " * Find !!!!" << std::endl;302 std::cout << " * Read_unit "+toString(i)+" must take the gpr_write with write_unit "+toString(j)+"." << std::endl;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; 303 309 _set_read_unit_source_register_write[i].insert(j); 304 310 _read_unit_nb_register_write [i] ++; 305 311 306 std::cout << " * bypass_write : " << _nb_bypass_write [j] << std::endl;307 std::cout << " * Read_unit "+toString(i)+" must take the bypass_write with write_unit "+toString(j)+"." << std::endl;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; 308 314 _set_read_unit_source_bypass_write [i].insert(j); 309 315 _read_unit_nb_bypass_write [i] += _nb_bypass_write [j]; … … 316 322 for (uint32_t i=0; i<_nb_read_unit; i++) 317 323 { 318 std::cout << " * Read_unit[" << i << "]" << std::endl;324 // std::cout << " * Read_unit[" << i << "]" << std::endl; 319 325 for (uint32_t j=0; j<_nb_execute_unit; j++) 320 326 { 321 std::cout << " * Execute_unit[" << j << "]" << std::endl; 327 uint32_t x = translate_num_execute_unit [j]; 328 329 // std::cout << " * Execute_unit[" << j << "]" << std::endl; 322 330 // Test the thread executed on this execute_unit 323 331 for (uint32_t k=0; k<_nb_thread; k++) 324 332 { 325 std::cout << " * Thread[" << k << "]" << std::endl;333 // std::cout << " * Thread[" << k << "]" << std::endl; 326 334 if ((_read_unit_to_execution_unit_table_thread [j][k]) and 327 335 (_link_read_unit_with_thread [i][k]) and 328 336 (_is_load_store_unit [j])) 329 337 { 330 std::cout << " * Find !!!!" << std::endl;331 std::cout << " * Bypass_memory !!!!" << std::endl;332 std::cout << " * Read_unit "+toString(i)+" must take the bypass_memory with load_store_unit "+toString(j)+"." << std::endl;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; 333 341 334 342 _set_read_unit_source_bypass_memory [i].insert(j); 335 _read_unit_nb_bypass_memory [i] += _nb_bypass_memory [j]; 336 break; 343 _read_unit_nb_bypass_memory [i] += _nb_bypass_memory [x]; 344 345 break; // loop on thread 337 346 } 338 347 } … … 340 349 } 341 350 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 342 355 test(); 356 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"); 343 369 344 370 _param_read_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters * [_nb_read_unit]; … … 351 377 _nb_ooo_engine , 352 378 _nb_packet , 353 _size_general_data ,354 _size_special_data ,379 size_general_data , 380 size_special_data , 355 381 _max_nb_general_register , 356 382 _max_nb_special_register , … … 363 389 _read_unit_nb_bypass_memory [i]); 364 390 391 log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execute_unit"); 392 365 393 _param_functionnal_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters * [_nb_functionnal_unit]; 366 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]; 367 395 368 uint32_t x=0;369 uint32_t y=0;370 371 396 for (uint32_t i=0; i<_nb_execute_unit; i++) 372 if (_is_load_store_unit [i] == false) 373 { 374 _translate_num_execute_unit [i] = x; 375 397 { 398 uint32_t x = _translate_num_execute_unit [i]; 399 if (_is_load_store_unit [i] == false) 376 400 _param_functionnal_unit [x] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters 377 401 (_nb_context , … … 379 403 _nb_ooo_engine , 380 404 _nb_packet , 381 _size_general_data ,405 size_general_data , 382 406 _max_nb_general_register , 383 _size_special_data ,407 size_special_data , 384 408 _max_nb_special_register , 385 409 _max_size_store_queue , 386 410 _max_size_load_queue , 387 _timing [ i],411 _timing [x], 388 412 _get_custom_information ); 389 390 x++; 391 } 392 else 393 { 394 _translate_num_execute_unit [i] = y; 395 396 _param_load_store_unit [y] = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters 397 (_size_store_queue [y], 398 _size_load_queue [y], 399 _size_speculative_access_queue [y], 400 _nb_port_check [y], 401 _speculative_load [y], 402 _nb_bypass_memory [y], 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], 403 423 _nb_context , 404 424 _nb_front_end , 405 425 _nb_ooo_engine , 406 426 _nb_packet , 407 _size_general_data ,408 _size_special_data ,427 size_general_data , 428 size_special_data , 409 429 _max_nb_special_register , 410 430 _max_nb_general_register ); 411 412 y ++; 413 } 414 415 for (uint32_t i=0; i<_nb_load_store_unit; i++) 416 431 } 432 433 log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : write_unit"); 434 417 435 _param_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::Parameters * [_nb_write_unit]; 418 436 for (uint32_t i=0; i<_nb_write_unit; i++) … … 424 442 _nb_ooo_engine , 425 443 _nb_packet , 426 _size_general_data ,444 size_general_data , 427 445 _max_nb_general_register , 428 _size_special_data ,446 size_special_data , 429 447 _max_nb_special_register , 430 448 _nb_bypass_write [i]); 431 449 432 450 451 log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : read_unit_to_execution_unit"); 452 433 453 _param_read_unit_to_execution_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::read_unit_to_execution_unit::Parameters 434 454 (_nb_read_unit , 455 _nb_inst_retire , 435 456 _nb_execute_unit , 457 _nb_execute_unit_port , 436 458 _nb_context , 437 459 _nb_front_end , 438 460 _nb_ooo_engine , 439 461 _nb_packet , 440 _size_general_data ,441 _size_special_data ,462 size_general_data , 463 size_special_data , 442 464 _max_nb_general_register , 443 465 _max_nb_special_register , … … 449 471 _read_unit_to_execution_unit_table_thread ); 450 472 473 log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : execution_unit_to_write_unit"); 474 451 475 _param_execution_unit_to_write_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::execution_unit_to_write_unit::Parameters 452 476 (_nb_execute_unit , 477 _nb_execute_unit_port , 453 478 _nb_write_unit , 454 479 _nb_context , … … 456 481 _nb_ooo_engine , 457 482 _nb_packet , 458 _size_general_data ,459 _size_special_data ,483 size_general_data , 484 size_special_data , 460 485 _max_nb_general_register , 461 486 _max_nb_special_register , … … 464 489 _execution_unit_to_write_unit_table_thread ); 465 490 491 log_printf(TRACE,Execute_loop,FUNCTION,"Parameters : register_unit"); 492 466 493 _param_register_unit = new morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::Parameters 467 494 (_nb_ooo_engine , 468 _size_general_data ,469 _size_special_data ,495 size_general_data , 496 size_special_data , 470 497 _nb_gpr_read , 471 498 _nb_gpr_write , … … 483 510 _nb_inst_retire_rob ); 484 511 485 486 512 _max_size_dcache_context_id = 0; 487 513 _max_size_dcache_packet_id = 0; … … 494 520 495 521 _have_port_dcache_context_id = (_max_size_dcache_context_id>1); 522 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 } 496 546 497 547 log_printf(FUNC,Execute_loop,FUNCTION,"End"); … … 511 561 #undef FUNCTION 512 562 #define FUNCTION "Execute_loop::~Parameters" 513 Parameters::~Parameters ( )563 Parameters::~Parameters (void) 514 564 { 515 565 log_printf(FUNC,Execute_loop,FUNCTION,"Begin"); 516 566 567 delete _param_glue; 568 for (uint32_t i=0; i<_nb_read_unit; i++) 569 delete _param_read_unit [i]; 517 570 delete [] _param_read_unit; 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 } 518 581 delete [] _param_functionnal_unit; 519 582 delete [] _param_load_store_unit; 583 for (uint32_t i=0; i<_nb_write_unit; i++) 584 delete _param_write_unit [i]; 520 585 delete [] _param_write_unit; 521 586 delete _param_read_unit_to_execution_unit; … … 535 600 delete [] _is_load_store_unit; 536 601 delete [] _translate_num_execute_unit; 602 delete [] _nb_execute_unit_port; 603 log_printf(FUNC,Execute_loop,FUNCTION,"End"); 604 }; 605 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); 537 631 538 632 log_printf(FUNC,Execute_loop,FUNCTION,"End");
Note: See TracChangeset
for help on using the changeset viewer.