Changeset 38 for sources/src
- Timestamp:
- Jul 21, 2009, 3:28:11 PM (15 years ago)
- Location:
- sources/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/gen_code.cc
r36 r38 74 74 typedef void (*CASC_ENTRY_FUNC) (void *); 75 75 typedef union { unsigned long long int integer; SC_ENTRY_FUNC pmf; CASC_ENTRY_FUNC pf; } fct; 76 76 77 const char * 78 get_pmf_type () 79 { 80 switch (sizeof (SC_ENTRY_FUNC)) { 81 case 4: 82 // G4 pointer-to-member-function style 83 return "unsigned long int"; 84 case 8: 85 // PC pointer-to-member-function style 86 return "unsigned long long int"; 87 default: 88 cerr << "Internal Error : Unsupported pointer-to-member-function" 89 "(size: " << sizeof (SC_ENTRY_FUNC) << ").\n" 90 "Please try --nodynamiclink option.\n"; 91 exit(21072009); 92 }; 93 } 77 94 78 95 static … … 278 295 << " typedef void (sc_module::*SC_ENTRY_FUNC)();\n" 279 296 << " typedef void (*CASC_ENTRY_FUNC)(void *);\n"; 280 const char *pmf_type = (sizeof (SC_ENTRY_FUNC) == 4)? 281 // G4 pointer-to-member-function style 282 "unsigned long int": 283 // PC pointer-to-member-function style 284 "unsigned long long int"; 297 298 const char *pmf_type = get_pmf_type (); 299 285 300 o << " typedef union { " 286 301 << pmf_type … … 375 390 { 376 391 if (dump_stage) 377 cerr << "Compiling C code for scheduling...\n";392 cerr << "Compiling C/C++ code for scheduling...\n"; 378 393 char compil_str[512]; 379 const char *compiler = getenv (" GCC");394 const char *compiler = getenv ("CXX"); 380 395 const char *systemc_dir = getenv ("SYSTEMCASS"); 381 396 // const char *target_arch = getenv ("TARGET_ARCH"); … … 431 446 #endif 432 447 ; 448 449 string cflags = casc_cflags; 450 if (use_openmp) 451 cflags += " -fopenmp"; 452 433 453 sprintf(compil_str, 434 454 commandline_template, 435 455 temporary_dir, 436 456 compiler, 437 c asc_cflags,457 cflags.c_str(), 438 458 systemc_dir, 439 459 target_name, -
sources/src/internal.h
r12 r38 58 58 extern int scheduling_method; 59 59 extern bool use_port_dependency; 60 extern bool use_openmp; 60 61 61 62 #define NO_SCHEDULING 0 -
sources/src/sc_main.cc
r35 r38 87 87 bool use_port_dependency = false; 88 88 89 #ifdef _OPENMP 90 bool use_openmp = true; 91 #else 92 bool use_openmp = false; 93 #endif 94 95 const char *HELP_STRING = \ 96 "\n" 97 "--a\n" 98 " almost static scheduling (use sensitivity list instead of port\n" 99 " dependency information\n" 100 "\n" 101 "--c\n" 102 " print schedule at simulation time (stderr)\n" 103 "\n" 104 "--d\n" 105 " check port dependencies (stderr)\n" 106 "\n" 107 "--edit\n" 108 " edit schedule before simulation (run $EDITOR or vim by default)\n" 109 "\n" 110 "--f\n" 111 " print function list (stderr)\n" 112 "\n" 113 "--h\n" 114 " display help screen and exit (stdout)\n" 115 "\n" 116 "--i\n" 117 " print instances list, signals list and statistics if available (stderr)\n" 118 "\n" 119 "--k\n" 120 " dump generated scheduling code\n" 121 " (generated_by_systemcass/scheduling-xx.cc)\n" 122 "\n" 123 "--m\n" 124 " Mouchard's static scheduling (use port dependency information instead\n" 125 " of sensitivity list)\n" 126 "\n" 127 "--modules <filename>\n" 128 " dump module hierarchy graph into specified dot file (tons of bugs\n" 129 " inside)\n" 130 "\n" 131 "--nobanner\n" 132 " do not print SystemCASS splash screen\n" 133 "\n" 134 "--dynamiclink\n" 135 " dynamically link the scheduling code\n" 136 "\n" 137 "--nosim\n" 138 " run until elaboration stage. Don't simulate\n" 139 "\n" 140 "--notrace\n" 141 " disable all tracing functions\n" 142 "\n" 143 "--p\n" 144 " entirely static scheduling (use port dependency information instead of\n" 145 " sensitivity list)\n" 146 "\n" 147 "--s\n" 148 " print stage (stderr)\n" 149 "\n" 150 "--save_on_exit <name>\n" 151 " save simulation state saved into <name> file when SystemCASS exits\n" 152 " (SOCVIEW format)\n" 153 "\n" 154 /* WARNING : we can't avoid destructors execution before saving */ 155 "--t\n" 156 " dump either module graph, or signal dependency graph, signal order,\n" 157 " and module evalutation order into dot files\n" 158 "\n" 159 "--tracestart <n>\n" 160 " start tracing functions at #n cycle\n" 161 "\n" 162 "--usage\n" 163 " print user time elapsed (sec), simulation cycles done (cycles),\n" 164 " and simulator performance (cycles/second) (stderr)\n" 165 "\n" 166 "--v\n" 167 " print internal SystemCASS kernel options (stderr)\n" 168 "\n"; 169 170 89 171 static 90 172 void … … 93 175 // Display once 94 176 if (nobanner == false) 95 177 cerr << get_splash_screen (); 96 178 nobanner = true; 97 179 } … … 173 255 print_splash_screen (); 174 256 cerr << "Usage : " 175 << argv[0] << " [--c] [--edit] [--d] [--f] [--h] [--i] [--k] [--modules filename] [--nobanner] [-- nodynamiclink] [--nosim] [--notrace] [--s] [--t] [--tracestart n] [--usage] [--v] [--p|m|a] [others parameters processed by sc_main]\n"257 << argv[0] << " [--c] [--edit] [--d] [--f] [--h] [--i] [--k] [--modules filename] [--nobanner] [--[no]dynamiclink] [--nosim] [--notrace] [--s] [--t] [--tracestart n] [--usage] [--v] [--p|m|a] [others parameters processed by sc_main]\n" 176 258 << "Thoses options are processed by SystemCASS library. All the remaining options are passed to sc_main.\n" 177 259 << "sc_main function retrieves last parameters.\n" 178 << "a : almost static scheduling (use sensitivity list instead of port dependency information)\n" 179 << "c : print schedule at simulation time (stderr)\n" 180 << "d : check port dependencies (stderr)\n" 181 << "edit : edit schedule before simulation (run $EDITOR or vim by default)\n" 182 << "f : print function list (stderr)\n" 183 << "h : display help screen and exit (stdout)\n" 184 << "i : print instances list, signals list and statistics if available (stderr)\n" 185 << "k : dump generated scheduling code (generated_by_systemcass/scheduling-xx.cc)\n" 186 << "m : Mouchard's static scheduling (use port dependency information instead of sensitivity list)\n" 187 << "modules filename : dump module hierarchy graph into specified dot file (tons of bugs inside)\n" 188 << "nobanner: do not print SystemCASS splash screen\n" 189 << "dynamiclink: dynamically link the scheduling code\n" 190 << "nosim : run until elaboration stage. Don't simulate\n" 191 << "notrace : disable all tracing functions\n" 192 << "p : entirely static scheduling (use port dependency information instead of sensitivity list)\n" 193 << "s : print stage (stderr)\n" 194 << "save_on_exit <name> : save simulation state saved into <name> file when SystemCASS exits (SOCVIEW format)\n" 195 /* WARNING : we can't avoid destructors execution before saving */ 196 << "t : dump either module graph, or signal dependency graph, signal order, and module evalutation order into dot files\n" 197 << "tracestart n : start tracing functions at #n cycle\n" 198 << "usage : print user time elapsed (sec), simulation cycles done (cycles), and simulator performance (cycles/second) (stderr)\n" 199 << "v : print internal SystemCASS kernel options (stderr)\n"; 260 << HELP_STRING; 200 261 noinitialization = true; 201 262 nosimulation = true; … … 227 288 print_schedule = true; 228 289 continue; 229 290 case 'd' : 230 291 if (strcmp (argv[i]+2, "dynamiclink") == 0) 231 292 dynamic_link_of_scheduling_code = true; 232 293 else 233 294 check_port_dependencies = true; 234 295 continue; … … 321 382 print_splash_screen (); 322 383 check_parameters (); 384 323 385 if (noinitialization) 324 386 { 325 387 return 255; 326 388 } 389 327 390 int ret = sc_main(argc, argv); 328 391 free (pending_write_vector); 329 392 close_systemcass (); 393 330 394 if (have_to_stop) 331 395 { … … 333 397 return 1; 334 398 } 399 335 400 return ret; 336 401 } -
sources/src/sc_ver.cc
r27 r38 74 74 " E-mail support: Richard.Buchmann@asim.lip6.fr\n" 75 75 " Contributors : Richard Buchmann, Sami Taktak,\n" 76 " Paul-Jerome Kingbo, Fr édéric Pétrot,\n"76 " Paul-Jerome Kingbo, Frederic Pétrot,\n" 77 77 " Nicolas Pouillon\n" 78 78 "\n" -
sources/src/schedulers.cc
r33 r38 201 201 } 202 202 203 203 SignalDependencyGraph* sig_graph = MakeSignalDependencyGraph (); 204 204 205 205 if (dump_all_graph) 206 206 SignalDependencyGraph2dot ("signal_graph",*sig_graph); 207 207 208 209 210 208 if (!Check (*sig_graph)) 209 { 210 cerr << "The signal dependency graph is not valid.\n"; 211 211 exit (29092004); 212 212 } 213 213 214 214 #if 1 … … 219 219 } 220 220 #endif 221 222 221 222 // There is a cycle in the signal dependency graph ? 223 223 Graph *sig_knuth = makegraph (*sig_graph); 224 224 strong_component_list_t *s = strong_component(sig_knuth); 225 225 226 226 if (dump_all_graph) 227 227 SignalDependencyOrder2txt ("signal_order",*s); 228 228 229 230 231 229 if (has_cycle (*s)) 230 { 231 cerr << "Error : There is a cycle in the signal dependency graph.\n"; 232 232 #if 0 233 233 print_cycle (cerr, get_cycle (*s)); 234 234 #endif 235 235 exit (24092004); 236 236 } 237 237 return sig_graph; 238 238 } … … 249 249 250 250 if (dump_all_graph) 251 252 253 251 ProcessDependencyList2dot ("process_order",*process_list); 252 253 return process_list; 254 254 } 255 255 … … 260 260 SignalDependencyGraph *sig_graph = MakeAcyclicSignalDependencyGraph (); 261 261 // Create the process evaluation list 262 262 ProcessDependencyList* process_list = MakeProcessDependencyList (*sig_graph); 263 263 264 264 if (dump_all_graph) 265 266 267 265 ProcessDependencyList2dot ("process_order",*process_list); 266 267 return process_list; 268 268 } 269 269 … … 290 290 // Uses port dependancies like Dr. Mouchard. 291 291 ProcessDependencyList* process_list = BuchmannScheduling (); 292 293 294 295 292 if (dynamic_link_of_scheduling_code) 293 base_name = gen_scheduling_code_for_dynamic_link (transition_func_list, moore_func_list,*process_list); 294 else 295 gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list); 296 296 break; 297 297 } … … 303 303 // and does not use an event-driven scheduler. 304 304 ProcessDependencyList* process_list = MouchardScheduling (); 305 306 307 308 305 if (dynamic_link_of_scheduling_code) 306 base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*process_list); 307 else 308 gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list); 309 309 break; 310 310 } … … 317 317 graph2dot("module_graph", *g); 318 318 strong_component_list_t *strong_list = strong_component (g); 319 320 321 322 319 if (dynamic_link_of_scheduling_code) 320 base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list,*strong_list); 321 else 322 gen_scheduling_code_for_quasistatic_func (transition_func_list, moore_func_list, *strong_list); 323 323 break; 324 324 }
Note: See TracChangeset
for help on using the changeset viewer.