Pass -v compiler option to vvp in the output file shebang line.

Slightly modified version of the patch contributed by Stephan
Böttcheron iverilog-devel.
This commit is contained in:
Martin Whitaker 2014-12-16 21:22:19 +00:00
parent 5df179cd5f
commit 71c4ea36e8
3 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
.TH iverilog 1 "February 26th, 2014" "" "Version %M.%m.%n %E"
.TH iverilog 1 "December 16th, 2014" "" "Version %M.%m.%n %E"
.SH NAME
iverilog - Icarus Verilog compiler
@ -213,6 +213,12 @@ a reference to a key temporary file that passes information to the
compiler proper. To keep that file from being deleted at the end
of the process, provide a file name of your own in the environment
variable \fBIVERILOG_ICONFIG\fP.
If the selected target is \fIvvp\fP, the \fB\-v\fP switch is appended
to the shebang line in the compiler output file, so directly executing
the compiler output file will turn on verbose messages in \fIvvp\fP.
This extra verbosity can be avoided by using the \fIvvp\fP command to
indirectly execute the compiler output file.
.TP 8
.B -V
Print the version of the compiler, and exit.

View File

@ -859,6 +859,7 @@ int main(int argc, char*argv[])
# if defined(HAVE_TIMES)
times_flag = true;
# endif
flags["VVP_EXTRA_ARGS"] = strdup(" -v");
break;
case 'V':
version_flag = true;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com)
* Copyright (c) 2001-2014 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -59,7 +59,10 @@ __inline__ static void draw_execute_header(ivl_design_t des)
{
const char*cp = ivl_design_flag(des, "VVP_EXECUTABLE");
if (cp) {
fprintf(vvp_out, "#! %s\n", cp);
const char *extra_args = ivl_design_flag(des, "VVP_EXTRA_ARGS");
if (!extra_args)
extra_args = "";
fprintf(vvp_out, "#! %s%s\n", cp, extra_args);
#if !defined(__MINGW32__)
fchmod(fileno(vvp_out), 0755);
#endif