Add the -h flag for help. (Stephan Boettcher)
This commit is contained in:
parent
69a2331791
commit
60c22aefeb
33
vvp/main.cc
33
vvp/main.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: main.cc,v 1.17 2001/07/16 18:40:19 steve Exp $"
|
#ident "$Id: main.cc,v 1.18 2001/07/21 21:18:55 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -84,10 +84,23 @@ int main(int argc, char*argv[])
|
||||||
char *logfile_name = 0x0;
|
char *logfile_name = 0x0;
|
||||||
FILE *logfile = 0x0;
|
FILE *logfile = 0x0;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "dl:M:m:v")) != EOF) switch (opt) {
|
while ((opt = getopt(argc, argv, "dhl:M:m:v")) != EOF) switch (opt) {
|
||||||
case 'd':
|
case 'd':
|
||||||
debug_flag = true;
|
debug_flag = true;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
fprintf(stderr,
|
||||||
|
"Usage: vvp [options] input-file\n"
|
||||||
|
"Options:\n"
|
||||||
|
#if defined(WITH_DEBUG)
|
||||||
|
" -d\t\t" "Enter the debugger.\n"
|
||||||
|
#endif
|
||||||
|
" -h\t\t" "Print this help message.\n"
|
||||||
|
" -l file\t" "Logfile, '-' for <stderr>.\n"
|
||||||
|
" -M path\t" "VPI module directory path.\n"
|
||||||
|
" -m module\t" "Load vpi module.\n"
|
||||||
|
" -v\t\t" "Verbose progress messages.\n" );
|
||||||
|
exit(0);
|
||||||
case 'l':
|
case 'l':
|
||||||
logfile_name = optarg;
|
logfile_name = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
@ -132,6 +145,8 @@ int main(int argc, char*argv[])
|
||||||
if (verbose_flag) {
|
if (verbose_flag) {
|
||||||
times(cycles+0);
|
times(cycles+0);
|
||||||
fprintf(stderr, "Compiling VVP ...\n");
|
fprintf(stderr, "Compiling VVP ...\n");
|
||||||
|
if (logfile && logfile != stderr)
|
||||||
|
fprintf(logfile, "Compiling VVP ...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
vpi_mcd_init(logfile);
|
vpi_mcd_init(logfile);
|
||||||
|
|
@ -153,11 +168,19 @@ int main(int argc, char*argv[])
|
||||||
" ... %G seconds\n"
|
" ... %G seconds\n"
|
||||||
"Running ...\n",
|
"Running ...\n",
|
||||||
cycles_diff(cycles+1, cycles+0));
|
cycles_diff(cycles+1, cycles+0));
|
||||||
|
if (logfile && logfile != stderr)
|
||||||
|
fprintf(logfile,
|
||||||
|
" ... %G seconds\n"
|
||||||
|
"Running ...\n",
|
||||||
|
cycles_diff(cycles+1, cycles+0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compile_errors > 0) {
|
if (compile_errors > 0) {
|
||||||
fprintf(stderr, "%s: Program not runnable, %u errors.\n",
|
fprintf(stderr, "%s: Program not runnable, %u errors.\n",
|
||||||
design_path, compile_errors);
|
design_path, compile_errors);
|
||||||
|
if (logfile && logfile != stderr)
|
||||||
|
fprintf(logfile, "%s: Program not runnable, %u errors.\n",
|
||||||
|
design_path, compile_errors);
|
||||||
return compile_errors;
|
return compile_errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,6 +195,9 @@ int main(int argc, char*argv[])
|
||||||
times(cycles+2);
|
times(cycles+2);
|
||||||
fprintf(stderr, " ... %G seconds\n",
|
fprintf(stderr, " ... %G seconds\n",
|
||||||
cycles_diff(cycles+2, cycles+1));
|
cycles_diff(cycles+2, cycles+1));
|
||||||
|
if (logfile && logfile != stderr)
|
||||||
|
fprintf(logfile, " ... %G seconds\n",
|
||||||
|
cycles_diff(cycles+2, cycles+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -179,6 +205,9 @@ int main(int argc, char*argv[])
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: main.cc,v $
|
* $Log: main.cc,v $
|
||||||
|
* Revision 1.18 2001/07/21 21:18:55 steve
|
||||||
|
* Add the -h flag for help. (Stephan Boettcher)
|
||||||
|
*
|
||||||
* Revision 1.17 2001/07/16 18:40:19 steve
|
* Revision 1.17 2001/07/16 18:40:19 steve
|
||||||
* Add a stdlog output for vvp, and vvp options
|
* Add a stdlog output for vvp, and vvp options
|
||||||
* to direct them around. (Stephan Boettcher.)
|
* to direct them around. (Stephan Boettcher.)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue