Changeset 62 for sources/src/schedulers.cc
- Timestamp:
- Feb 16, 2017, 3:46:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/schedulers.cc
r61 r62 64 64 method_process_list_t * transition_func_list; 65 65 method_process_list_t * moore_func_list; 66 #ifdef USE_OPENMP 66 67 #pragma omp threadprivate(transition_func_list, moore_func_list) 68 #endif 67 69 method_process_list_t combinational_func_list; 68 70 /* ***************************** */ … … 120 122 void sort_functions() { 121 123 method_process_list_t::const_iterator m; 124 #ifdef USE_OPENMP 122 125 #pragma omp parallel 123 126 #pragma omp critical 127 #endif 124 128 { 125 129 transition_func_list = new method_process_list_t; 126 130 moore_func_list = new method_process_list_t; 127 131 for (m = method_process_list.begin(); m != method_process_list.end(); ++m) { 128 #ifdef _OPENMP132 #ifdef USE_OPENMP 129 133 if ((*m)->omp_threadnum == omp_get_thread_num()) 130 134 #endif … … 189 193 exit (24092004); 190 194 } 195 delete s; 191 196 return sig_graph; 192 197 } … … 229 234 230 235 sort_functions(); 236 #ifdef USE_OPENMP 231 237 #pragma omp parallel 232 238 #pragma omp critical 239 #endif 233 240 { 234 241 if (dump_funclist_info) { 235 #ifdef _OPENMP242 #ifdef USE_OPENMP 236 243 cerr << "Thread " << omp_get_thread_num() << "\n"; 237 244 #endif 238 245 cerr << " Transition functions : " << *transition_func_list << "\n"; 239 246 cerr << " Moore generation functions : " << *moore_func_list << "\n"; 247 #ifdef USE_OPENMP 240 248 #pragma omp master 249 #endif 241 250 { 242 251 if (!combinational_func_list.empty()) { … … 247 256 248 257 /* Schedule */ 249 switch (scheduling_method) { 250 case BUCHMANN_SCHEDULING : 251 { 252 // Generate the scheduled code, compile and link. 253 // Buchmann's thesis explains this scheduling method. 254 // Uses port dependancies like Dr. Mouchard. 255 ProcessDependencyList * process_list = BuchmannScheduling(); 256 if (dynamic_link_of_scheduling_code) { 257 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list); 258 } 259 else { 260 gen_scheduling_code_for_static_func(*transition_func_list, *moore_func_list, *process_list); 261 } 262 break; 258 switch (scheduling_method) { 259 case BUCHMANN_SCHEDULING : 260 { 261 // Generate the scheduled code, compile and link. 262 // Buchmann's thesis explains this scheduling method. 263 // Uses port dependancies like Dr. Mouchard. 264 ProcessDependencyList * process_list = BuchmannScheduling(); 265 if (dynamic_link_of_scheduling_code) { 266 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list); 267 } 268 else { 269 gen_scheduling_code_for_static_func(*transition_func_list, *moore_func_list, *process_list); 270 } 271 break; 272 } 273 274 case MOUCHARD_SCHEDULING : 275 { 276 // Generate the scheduled code, compile and link. 277 // Mouchard's thesis explains this scheduling method. 278 // Uses port dependancies like Dr. Mouchard. 279 // CAUTION : unlike FastSysC, this scheduling is totally static 280 // and does not use an event-driven scheduler. 281 ProcessDependencyList * process_list = MouchardScheduling(); 282 if (dynamic_link_of_scheduling_code) { 283 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list); 284 } 285 else { 286 gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list); 287 } 288 break; 289 } 290 291 case CASS_SCHEDULING : 292 { 293 // Generate the scheduled code, compile and link 294 // Hommais's thesis explains this scheduling method (like CASS strategy) 295 // Doesn't use port dependancies 296 strong_component_list_t * strong_list = NULL; 297 #ifdef USE_OPENMP 298 #pragma omp master 299 #endif 300 { 301 Graph * g = makegraph (&combinational_func_list); 302 if (dump_all_graph && g) { 303 graph2dot("module_graph", *g); 304 } 305 strong_list = strong_component(g); 306 } 307 if (dynamic_link_of_scheduling_code) { 308 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, strong_list); 309 } 310 else { 311 gen_scheduling_code_for_quasistatic_func (*transition_func_list, *moore_func_list, strong_list); 312 } 313 // free the void_lists in strong_list 314 //for ( strong_component_list_t::iterator i = strong_list->begin(); i < strong_list->end(); i++) { 315 // delete *i; 316 //} 317 #ifdef USE_OPENMP 318 #pragma omp master 319 #endif 320 { 321 delete strong_list; 322 } 323 break; 324 } 325 default : 326 cerr << "Error : Unable to schedule SystemC process." 327 "Please select a scheduling method.\n"; 328 exit (35); 263 329 } 264 265 case MOUCHARD_SCHEDULING :266 {267 // Generate the scheduled code, compile and link.268 // Mouchard's thesis explains this scheduling method.269 // Uses port dependancies like Dr. Mouchard.270 // CAUTION : unlike FastSysC, this scheduling is totally static271 // and does not use an event-driven scheduler.272 ProcessDependencyList * process_list = MouchardScheduling();273 if (dynamic_link_of_scheduling_code) {274 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list);275 }276 else {277 gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list);278 }279 break;280 }281 282 case CASS_SCHEDULING :283 {284 // Generate the scheduled code, compile and link285 // Hommais's thesis explains this scheduling method (like CASS strategy)286 // Doesn't use port dependancies287 strong_component_list_t * strong_list = NULL;288 #pragma omp master289 {290 Graph * g = makegraph (&combinational_func_list);291 if (dump_all_graph && g) {292 graph2dot("module_graph", *g);293 }294 strong_list = strong_component(g);295 }296 if (dynamic_link_of_scheduling_code) {297 base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, strong_list);298 }299 else {300 gen_scheduling_code_for_quasistatic_func (*transition_func_list, *moore_func_list, strong_list);301 }302 break;303 }304 default :305 cerr << "Error : Unable to schedule SystemC process."306 "Please select a scheduling method.\n";307 exit (35);308 }309 330 } 310 331 return base_name;
Note: See TracChangeset
for help on using the changeset viewer.