From 24827c4b42e769ffb3b4e23cd9d8a46e24a7da78 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 19 Nov 2008 16:45:17 -0800 Subject: [PATCH] Add a -V flag to the runtime and update the manual pages. This patch adds a -V flag to the runtime to print version information. It also updates the manual page to document this and makes some minor changes to the iverilog an iverilog-vpi manual pages. --- driver/iverilog.man | 2 +- iverilog-vpi.man | 4 ++-- vvp/Makefile.in | 4 +++- vvp/main.cc | 32 ++++++++++++++++++++++++++++++-- vvp/vvp.man | 7 +++++-- 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/driver/iverilog.man b/driver/iverilog.man index a365b8967..9db60b4d8 100644 --- a/driver/iverilog.man +++ b/driver/iverilog.man @@ -1,4 +1,4 @@ -.TH iverilog 1 "April 22nd, 2008" Version "0.9.devel" +.TH iverilog 1 "April 22nd, 2008" "" "Version 0.9.devel" .SH NAME iverilog - Icarus Verilog compiler diff --git a/iverilog-vpi.man b/iverilog-vpi.man index fb559691f..5cfd082ba 100644 --- a/iverilog-vpi.man +++ b/iverilog-vpi.man @@ -1,4 +1,4 @@ -.TH iverilog-vpi 1 "$Date: 2004/10/04 01:10:53 $" Version "$Date: 2004/10/04 01:10:53 $" +.TH iverilog-vpi 1 "November 19th, 2008" "" "Version 0.9.devel" .SH NAME iverilog-vpi - Compile front end for VPI modules @@ -129,7 +129,7 @@ iverilog(1), vvp(1), .SH COPYRIGHT .nf -Copyright \(co 2002 Stephen Williams +Copyright \(co 2002-2008 Stephen Williams This document can be freely redistributed according to the terms of the GNU General Public License version 2.0 diff --git a/vvp/Makefile.in b/vvp/Makefile.in index 17cf2face..ad4f066ce 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -21,6 +21,8 @@ # SHELL = /bin/sh +VERSION = 0.0 + suffix = @install_suffix@ prefix = @prefix@ @@ -48,7 +50,7 @@ YACC = @YACC@ MAN = @MAN@ PS2PDF = @PS2PDF@ -CPPFLAGS = @ident_support@ -I. -I.. -I $(srcdir) -I$(srcdir)/.. @CPPFLAGS@ @DEFS@ +CPPFLAGS = @ident_support@ -I. -I.. -I $(srcdir) -I$(srcdir)/.. -DVERSION='"$(VERSION)"' @CPPFLAGS@ @DEFS@ CXXFLAGS = -Wall @CXXFLAGS@ LDFLAGS = @rdynamic@ @LDFLAGS@ LIBS = @LIBS@ @EXTRALIBS@ diff --git a/vvp/main.cc b/vvp/main.cc index 111273400..ddf7aacd4 100644 --- a/vvp/main.cc +++ b/vvp/main.cc @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +# include "version.h" # include "config.h" # include "parse_misc.h" # include "compile.h" @@ -66,6 +67,7 @@ extern "C" long int lround(double x) #endif bool verbose_flag = false; +bool version_flag = false; static int vvp_return_value = 0; void vpip_set_return_value(int value) @@ -166,7 +168,7 @@ int main(int argc, char*argv[]) /* For non-interactive runs we do not want to run the interactive * debugger, so make $stop just execute a $finish. */ stop_is_finish = false; - while ((opt = getopt(argc, argv, "+hl:M:m:nsv")) != EOF) switch (opt) { + while ((opt = getopt(argc, argv, "+hl:M:m:nsvV")) != EOF) switch (opt) { case 'h': fprintf(stderr, "Usage: vvp [options] input-file [+plusargs...]\n" @@ -178,7 +180,8 @@ int main(int argc, char*argv[]) " -m module Load vpi module.\n" " -n Non-interactive ($stop = $finish).\n" " -s $stop right away.\n" - " -v Verbose progress messages.\n" ); + " -v Verbose progress messages.\n" + " -V Print the version information.\n" ); exit(0); case 'l': logfile_name = optarg; @@ -203,6 +206,9 @@ int main(int argc, char*argv[]) case 'v': verbose_flag = true; break; + case 'V': + version_flag = true; + break; default: flag_errors += 1; } @@ -210,6 +216,28 @@ int main(int argc, char*argv[]) if (flag_errors) return flag_errors; + if (version_flag) { + fprintf(stderr, "Icarus Verilog runtime version " VERSION " (" + VERSION_TAG ")\n\n"); + fprintf(stderr, "Copyright 1998-2008 Stephen Williams\n\n"); + fprintf(stderr, +" This program is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" This program is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +" GNU General Public License for more details.\n" +"\n" +" You should have received a copy of the GNU General Public License along\n" +" with this program; if not, write to the Free Software Foundation, Inc.,\n" +" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n\n" +); + return 0; + } + if (optind == argc) { fprintf(stderr, "%s: no input file.\n", argv[0]); return -1; diff --git a/vvp/vvp.man b/vvp/vvp.man index 491cfa4da..3cb2d8ffc 100644 --- a/vvp/vvp.man +++ b/vvp/vvp.man @@ -1,4 +1,4 @@ -.TH vvp 1 "$Date: 2005/01/29 06:28:19 $" Version "$Date: 2005/01/29 06:28:19 $" +.TH vvp 1 "November 19th, 2008" "" "Version 0.9.devel" .SH NAME vvp - Icarus Verilog vvp runtime engine @@ -54,6 +54,9 @@ hold of the simulation just before it starts. .B -v Turn on verbose messages. This will cause information about run time progress to be printed to standard out. +.TP 8 +.B -V +Print the version of the runtime, and exit. .SH EXTENDED ARGUMENTS .PP @@ -151,7 +154,7 @@ iverilog-vpi(1), .SH COPYRIGHT .nf -Copyright \(co 2001-2003 Stephen Williams +Copyright \(co 2001-2008 Stephen Williams This document can be freely redistributed according to the terms of the GNU General Public License version 2.0