Changeset 38 for sources/src/sc_main.cc


Ignore:
Timestamp:
Jul 21, 2009, 3:28:11 PM (15 years ago)
Author:
buchmann
Message:

Now detects if SystemCASS correctly handles runtime compilation with the current architecture. SystemCASS exits if runtime compilation is not supported. Use --nodynamiclink options if it exits. This may occur on 64 bits machines.

Usage help is more readable.

Code cleanup.

Add some code for the coming soon openMP feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/sc_main.cc

    r35 r38  
    8787bool        use_port_dependency     = false;
    8888
     89#ifdef _OPENMP
     90bool        use_openmp              = true;
     91#else
     92bool        use_openmp              = false;
     93#endif
     94
     95const 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
    89171static
    90172void
     
    93175  // Display once
    94176  if (nobanner == false)
    95         cerr << get_splash_screen ();
     177    cerr << get_splash_screen ();
    96178  nobanner = true;
    97179}
     
    173255            print_splash_screen ();
    174256            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"
    176258                 << "Thoses options are processed by SystemCASS library. All the remaining options are passed to sc_main.\n"
    177259                 << "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;
    200261            noinitialization = true;
    201262            nosimulation = true;
     
    227288            print_schedule = true;
    228289            continue;
    229           case 'd' :
     290          case 'd' :
    230291            if (strcmp (argv[i]+2, "dynamiclink") == 0)
    231292              dynamic_link_of_scheduling_code = true;
    232             else
     293            else
    233294              check_port_dependencies = true;
    234295            continue;
     
    321382  print_splash_screen ();
    322383  check_parameters ();
     384
    323385  if (noinitialization)
    324386  {
    325387    return 255;
    326388  }
     389
    327390  int ret = sc_main(argc, argv);
    328         free (pending_write_vector);
     391  free (pending_write_vector);
    329392  close_systemcass ();
     393
    330394  if (have_to_stop)
    331395  {
     
    333397    return 1;
    334398  }
     399
    335400  return ret;
    336401}
Note: See TracChangeset for help on using the changeset viewer.