Add verilator -V option, to show verbose version.

This commit is contained in:
Wilson Snyder 2009-06-25 19:53:26 -04:00
parent ec0947ef7e
commit 8b20d777b0
4 changed files with 51 additions and 3 deletions

View File

@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks!
* Verilator 3.711 2009/**
**** Add verilator -V option, to show verbose version.
**** Add BLKLOOPINIT error code, and describe --unroll-count. [Jeff Winston]
* Verilator 3.711 2009/06/23

View File

@ -227,6 +227,7 @@ descriptions in the next sections for more information.
--trace-depth <levels> Depth of tracing
-U<var> Undefine preprocessor define
--underline-zero Zero signals with leading _'s
-V Verbose version and config
-v <filename> Verilog library
-Werror-<message> Convert warning to error
-Wfuture-<message> Disable unknown message warnings
@ -696,6 +697,11 @@ example module I<x> is referenced, look in I<x>.I<ext>.
Undefines the given preprocessor symbol.
=item -V
Shows the verbose version, including configuration information compiled
into Verilator. (Similar to perl -V.)
=item -v I<filename>
Read the filename as a Verilog library. Any modules in the file may be

View File

@ -624,9 +624,12 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) {
shift;
V3Options::addLibraryFile(filenameSubstitute(argv[i]));
}
else if ( !strcmp (sw, "-V") ) {
showVersion(true);
exit(0);
}
else if ( !strcmp (sw, "-version") ) {
cout <<version();
cout <<endl;
showVersion(false);
exit(0);
}
// Single switches
@ -886,6 +889,41 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename) {
//======================================================================
void V3Options::showVersion(bool verbose) {
cout <<version();
cout <<endl;
if (!verbose) return;
cout <<endl;
cout << "Copyright 2003-2009 by Wilson Snyder. Verilator is free software; you can\n";
cout << "redistribute it and/or modify the Verilator internals under the terms of\n";
cout << "either the GNU Lesser General Public License Version 3 or the Perl Artistic\n";
cout << "License Version 2.0.\n";
cout <<endl;
cout << "See http://www.veripool.org/verilator for documentation\n";
cout <<endl;
cout << "Summary of configuration:\n";
cout << " Compiled in defaults if not in environment:\n";
cout << " SYSTEMC = " << DEFENV_SYSTEMC<<endl;
cout << " SYSTEMC_ARCH = " << DEFENV_SYSTEMC_ARCH<<endl;
cout << " SYSTEMPERL = " << DEFENV_SYSTEMPERL<<endl;
cout << " SYSTEMPERL_INCLUDE = " << DEFENV_SYSTEMPERL_INCLUDE<<endl;
cout << " VERILATOR_ROOT = " << DEFENV_VERILATOR_ROOT<<endl;
cout <<endl;
cout << "Environment:\n";
cout << " PERL = " << getenvStr("PERL","")<<endl;
cout << " SYSTEMC = " << getenvStr("SYSTEMC","")<<endl;
cout << " SYSTEMC_ARCH = " << getenvStr("SYSTEMC_ARCH","")<<endl;
cout << " SYSTEMPERL = " << getenvStr("SYSTEMPERL","")<<endl;
cout << " SYSTEMPERL_INCLUDE = " << getenvStr("SYSTEMPERL_INCLUDE","")<<endl;
cout << " VERILATOR_ROOT = " << getenvStr("VERILATOR_ROOT","")<<endl;
}
//======================================================================
V3Options::V3Options() {
m_impp = new V3OptionsImp;

View File

@ -166,8 +166,10 @@ class V3Options {
void addIncDir(const string& incdir);
void addLibExt(const string& libext);
void optimize(int level);
void showVersion(bool verbose);
void coverage(bool flag) { m_coverageLine = m_coverageToggle = m_coverageUser = flag; }
bool onoff(const char* sw, const char* arg, bool& flag);
static bool wildmatchi(const char* s, const char* p);
static string getenvStr(const string& envvar, const string& defaultValue);
static void setenvStr(const string& envvar, const string& value, const string& why);
@ -290,13 +292,13 @@ class V3Options {
// METHODS (environment)
// Most of these may be built into the executable with --enable-defenv,
// see the README. If adding new variables, also see src/Makefile_obj.in
// Also add to V3Options::showVersion()
static string getenvPERL() { return getenvStr("PERL","perl"); }
static string getenvSYSTEMC();
static string getenvSYSTEMC_ARCH();
static string getenvSYSTEMPERL();
static string getenvSYSTEMPERL_INCLUDE();
static string getenvVERILATOR_ROOT();
static string getenvW() { return getenvStr("W",""); }
// METHODS (file utilities using these options)
string fileExists (const string& filename);