int
sc_elab_and_sim( int argc, char* argv[] )
{
    int status = 1;
    argc_copy = argc;
    argv_copy = argv;
    std::vector<char*> argv_call;
    for ( int i = 0; i < argc; i++ ) 
        argv_call.push_back(argv[i]);

    try
    {
        pln();

        // Perform initialization here
        sc_in_action = true;

        status = sc_main( argc, &argv_call[0] );

        // Perform cleanup here
        sc_in_action = false;
    }
    catch( const sc_report& x )
    {
	message_function( x.what() );
    }
    catch( ... )
    {
        // translate other escaping exceptions
        sc_report*  err_p = sc_handle_exception();
        if( err_p ) message_function( err_p->what() );
        delete err_p;
    }

    // IF DEPRECATION WARNINGS WERE ISSUED TELL THE USER HOW TO TURN THEM OFF 

    if ( sc_report_handler::get_count("/IEEE_Std_1666/deprecated") > 0 )
    {
        SC_REPORT_INFO("/IEEE_Std_1666/deprecated",
          "You can turn off warnings about\n" \
		  "             IEEE 1666 deprecated features by placing this method " \
		  "call as the\n" \
		  "             first statement in your sc_main() function:\n" \
          "\n  sc_report_handler::set_actions(\"/IEEE_Std_1666/deprecated\", " \
          "SC_DO_NOTHING);\n\n" );
    }

    return status;
}
예제 #2
0
extern "C" void dMessage (int num, const char *msg, ...)
{
  va_list ap;
  va_start (ap,msg);
  if (message_function) message_function (num,msg,ap);
  else printMessage (num,"ODE Message",msg,ap);
}