2008-06-10 01:25:10 +00:00
|
|
|
|
// -*- C++ -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//*************************************************************************
|
|
|
|
|
// DESCRIPTION: Verilator: Command line options
|
|
|
|
|
//
|
2008-04-25 12:14:27 +00:00
|
|
|
|
// Code available from: http://www.veripool.org/verilator
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
// AUTHORS: Wilson Snyder with Paul Wasson, Duane Gabli
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2010-01-06 02:15:06 +00:00
|
|
|
|
// Copyright 2003-2010 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
// Verilator is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
|
|
#ifndef _V3OPTIONS_H_
|
|
|
|
|
#define _V3OPTIONS_H_ 1
|
|
|
|
|
|
2006-12-18 19:20:45 +00:00
|
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2006-08-26 11:35:28 +00:00
|
|
|
|
#include <string>
|
2008-04-09 14:17:03 +00:00
|
|
|
|
#include <vector>
|
2009-01-21 21:56:50 +00:00
|
|
|
|
#include <map>
|
2006-08-26 11:35:28 +00:00
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
#include "V3Global.h"
|
|
|
|
|
|
2008-03-28 20:41:21 +00:00
|
|
|
|
//######################################################################
|
|
|
|
|
|
|
|
|
|
class V3LangCode {
|
|
|
|
|
public:
|
|
|
|
|
enum en {
|
2010-02-01 11:40:30 +00:00
|
|
|
|
L_ERROR, // Must be first.
|
2008-03-28 20:41:21 +00:00
|
|
|
|
L1364_1995,
|
|
|
|
|
L1364_2001,
|
|
|
|
|
L1364_2005,
|
|
|
|
|
L1800_2005,
|
2010-01-22 02:58:45 +00:00
|
|
|
|
L1800_2009,
|
2008-03-28 20:41:21 +00:00
|
|
|
|
// ***Add new elements below also***
|
2010-02-02 01:15:48 +00:00
|
|
|
|
_ENUM_END
|
2008-03-28 20:41:21 +00:00
|
|
|
|
};
|
|
|
|
|
const char* ascii() const {
|
|
|
|
|
const char* names[] = {
|
|
|
|
|
// These must match the `begin_keywords values.
|
|
|
|
|
" ERROR",
|
|
|
|
|
"1364-1995",
|
|
|
|
|
"1364-2001",
|
|
|
|
|
"1364-2005",
|
2010-01-22 02:58:45 +00:00
|
|
|
|
"1800-2005",
|
|
|
|
|
"1800-2009"
|
2008-03-28 20:41:21 +00:00
|
|
|
|
};
|
|
|
|
|
return names[m_e];
|
|
|
|
|
};
|
2010-01-22 02:58:45 +00:00
|
|
|
|
static V3LangCode mostRecent() { return V3LangCode(L1800_2009); }
|
2010-02-01 11:40:30 +00:00
|
|
|
|
bool legal() const { return m_e != L_ERROR; }
|
2008-03-28 20:41:21 +00:00
|
|
|
|
//
|
|
|
|
|
enum en m_e;
|
2010-02-01 11:40:30 +00:00
|
|
|
|
inline V3LangCode () : m_e(L_ERROR) {}
|
2009-07-22 18:38:20 +00:00
|
|
|
|
inline V3LangCode (en _e) : m_e(_e) {}
|
2008-03-28 20:41:21 +00:00
|
|
|
|
V3LangCode (const char* textp); // Return matching code or ERROR
|
2009-07-22 18:38:20 +00:00
|
|
|
|
explicit inline V3LangCode (int _e) : m_e(static_cast<en>(_e)) {}
|
|
|
|
|
operator en () const { return m_e; }
|
2008-03-28 20:41:21 +00:00
|
|
|
|
};
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//######################################################################
|
|
|
|
|
// V3Options - Command line options
|
|
|
|
|
|
|
|
|
|
class V3OptionsImp;
|
|
|
|
|
class FileLine;
|
|
|
|
|
|
2008-04-09 14:17:03 +00:00
|
|
|
|
typedef vector<string> V3StringList;
|
2006-08-26 11:35:28 +00:00
|
|
|
|
typedef set<string> V3StringSet;
|
|
|
|
|
|
|
|
|
|
class V3Options {
|
2009-01-21 21:56:50 +00:00
|
|
|
|
// TYPES
|
|
|
|
|
typedef map<string,int> DebugSrcMap;
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// MEMBERS (general options)
|
|
|
|
|
V3OptionsImp* m_impp; // Slow hidden options
|
|
|
|
|
|
2008-03-19 14:22:05 +00:00
|
|
|
|
V3StringSet m_cppFiles; // argument: C++ files to link against
|
2010-01-29 00:33:02 +00:00
|
|
|
|
V3StringSet m_cFlags; // argument: user CFLAGS
|
|
|
|
|
V3StringSet m_ldLibs; // argument: user LDFLAGS
|
2008-07-22 18:27:34 +00:00
|
|
|
|
V3StringSet m_futures; // argument: -Wfuture- list
|
2008-03-19 14:22:05 +00:00
|
|
|
|
V3StringSet m_libraryFiles; // argument: Verilog -v files
|
2008-04-09 14:17:03 +00:00
|
|
|
|
V3StringList m_vFiles; // argument: Verilog files to read
|
2009-01-21 21:56:50 +00:00
|
|
|
|
DebugSrcMap m_debugSrcs; // argument: --debugi-<srcfile>=<level>
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
bool m_preprocOnly; // main switch: -E
|
2006-08-31 15:29:15 +00:00
|
|
|
|
bool m_makeDepend; // main switch: -MMD
|
|
|
|
|
bool m_makePhony; // main switch: -MP
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_assert; // main switch: --assert
|
2008-07-16 18:06:08 +00:00
|
|
|
|
bool m_autoflush; // main switch: --autoflush
|
2009-09-16 13:28:09 +00:00
|
|
|
|
bool m_bboxSys; // main switch: --bbox-sys
|
2009-12-16 16:45:28 +00:00
|
|
|
|
bool m_bboxUnsup; // main switch: --bbox-unsup
|
2010-01-07 21:41:19 +00:00
|
|
|
|
bool m_cdc; // main switch: --cdc
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_coverageLine; // main switch: --coverage-block
|
2008-12-12 20:34:02 +00:00
|
|
|
|
bool m_coverageToggle;// main switch: --coverage-toggle
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_coverageUser; // main switch: --coverage-func
|
2006-10-02 17:09:56 +00:00
|
|
|
|
bool m_debugCheck; // main switch: --debug-check
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_dumpTree; // main switch: --dump-tree
|
|
|
|
|
bool m_exe; // main switch: --exe
|
|
|
|
|
bool m_ignc; // main switch: --ignc
|
2006-08-29 00:27:04 +00:00
|
|
|
|
bool m_inhibitSim; // main switch: --inhibit-sim
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_l2Name; // main switch: --l2name
|
2007-04-18 18:26:38 +00:00
|
|
|
|
bool m_lintOnly; // main switch: --lint-only
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_outFormatOk; // main switch: --cc, --sc or --sp was specified
|
2009-06-29 13:21:21 +00:00
|
|
|
|
bool m_pinsUint8; // main switch: --pins-uint8
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_profileCFuncs;// main switch: --profile-cfuncs
|
|
|
|
|
bool m_psl; // main switch: --psl
|
|
|
|
|
bool m_public; // main switch: --public
|
|
|
|
|
bool m_systemC; // main switch: --sc: System C instead of simple C++
|
|
|
|
|
bool m_skipIdentical;// main switch: --skip-identical
|
|
|
|
|
bool m_systemPerl; // main switch: --sp: System Perl instead of SystemC (m_systemC also set)
|
|
|
|
|
bool m_stats; // main switch: --stats
|
|
|
|
|
bool m_trace; // main switch: --trace
|
|
|
|
|
bool m_traceDups; // main switch: --trace-dups
|
2009-11-24 00:08:25 +00:00
|
|
|
|
bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2008-03-20 00:14:26 +00:00
|
|
|
|
int m_errorLimit; // main switch: --error-limit
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int m_inlineMult; // main switch: --inline-mult
|
|
|
|
|
int m_outputSplit; // main switch: --output-split
|
2006-10-26 01:08:44 +00:00
|
|
|
|
int m_outputSplitCFuncs;// main switch: --output-split-cfuncs
|
2008-11-17 22:13:57 +00:00
|
|
|
|
int m_outputSplitCTrace;// main switch: --output-split-ctrace
|
2009-03-13 18:17:30 +00:00
|
|
|
|
int m_pinsBv; // main switch: --pins-bv
|
2007-01-18 18:31:49 +00:00
|
|
|
|
int m_traceDepth; // main switch: --trace-depth
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int m_unrollCount; // main switch: --unroll-count
|
|
|
|
|
int m_unrollStmts; // main switch: --unroll-stmts
|
|
|
|
|
|
2007-04-19 18:20:16 +00:00
|
|
|
|
int m_compLimitBlocks; // compiler selection options
|
|
|
|
|
int m_compLimitParens; // compiler selection options
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string m_bin; // main switch: --bin {binary}
|
2010-01-30 14:42:44 +00:00
|
|
|
|
string m_exeName; // main switch: -o {name}
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string m_flags; // main switch: -f {name}
|
|
|
|
|
string m_makeDir; // main switch: -Mdir
|
|
|
|
|
string m_modPrefix; // main switch: --mod-prefix
|
2010-01-20 12:15:51 +00:00
|
|
|
|
string m_pipeFilter; // main switch: --pipe-filter
|
|
|
|
|
string m_prefix; // main switch: --prefix
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string m_xAssign; // main switch: --x-assign
|
2008-03-25 19:57:41 +00:00
|
|
|
|
string m_topModule; // main switch: --top-module
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2008-03-28 20:41:21 +00:00
|
|
|
|
V3LangCode m_language; // main switch: --language
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// MEMBERS (optimizations)
|
|
|
|
|
// // main switch: -Op: --public
|
|
|
|
|
bool m_oAcycSimp; // main switch: -Oy: acyclic pre-optimizations
|
|
|
|
|
bool m_oCase; // main switch: -Oe: case tree conversion
|
|
|
|
|
bool m_oCombine; // main switch: -Ob: common icode packing
|
|
|
|
|
bool m_oConst; // main switch: -Oc: constant folding
|
|
|
|
|
bool m_oExpand; // main switch: -Ox: expansion of C macros
|
2008-11-20 14:04:29 +00:00
|
|
|
|
bool m_oFlopGater; // main switch: -Of: flop gater detection
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_oGate; // main switch: -Og: gate wire elimination
|
|
|
|
|
bool m_oLife; // main switch: -Ol: variable lifetime
|
|
|
|
|
bool m_oLifePost; // main switch: -Ot: delayed assignment elimination
|
|
|
|
|
bool m_oLocalize; // main switch: -Oz: convert temps to local variables
|
|
|
|
|
bool m_oInline; // main switch: -Oi: module inlining
|
|
|
|
|
bool m_oReorder; // main switch: -Or: reorder assignments in blocks
|
|
|
|
|
bool m_oSplit; // main switch: -Os: always assignment splitting
|
|
|
|
|
bool m_oSubst; // main switch: -Ou: substitute expression temp values
|
|
|
|
|
bool m_oSubstConst; // main switch: -Ok: final constant substitution
|
|
|
|
|
bool m_oTable; // main switch: -Oa: lookup table creation
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// METHODS
|
|
|
|
|
void addArg(const string& incdir);
|
2008-07-22 18:27:34 +00:00
|
|
|
|
void addDefine(const string& defline);
|
|
|
|
|
void addFuture(const string& flag);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
void addIncDir(const string& incdir);
|
|
|
|
|
void addLibExt(const string& libext);
|
|
|
|
|
void optimize(int level);
|
2009-06-25 23:53:26 +00:00
|
|
|
|
void showVersion(bool verbose);
|
2008-12-12 20:34:02 +00:00
|
|
|
|
void coverage(bool flag) { m_coverageLine = m_coverageToggle = m_coverageUser = flag; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool onoff(const char* sw, const char* arg, bool& flag);
|
2010-01-29 00:33:02 +00:00
|
|
|
|
bool suffixed(const char* sw, const char* arg);
|
2009-06-25 23:53:26 +00:00
|
|
|
|
|
2008-01-31 13:50:06 +00:00
|
|
|
|
static bool wildmatchi(const char* s, const char* p);
|
2009-03-28 13:15:13 +00:00
|
|
|
|
static string getenvStr(const string& envvar, const string& defaultValue);
|
|
|
|
|
static void setenvStr(const string& envvar, const string& value, const string& why);
|
2009-03-28 14:18:53 +00:00
|
|
|
|
static string getenvSYSTEMPERLGuts();
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// CREATORS
|
|
|
|
|
V3Options();
|
|
|
|
|
~V3Options();
|
|
|
|
|
void setDebugMode(int level);
|
2009-01-21 21:56:50 +00:00
|
|
|
|
void setDebugSrcLevel(const string& srcfile, int level);
|
|
|
|
|
int debugSrcLevel(const string& srcfile, int default_level=V3Error::debugDefault());
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
// METHODS
|
|
|
|
|
void addCppFile(const string& filename);
|
2010-01-29 00:33:02 +00:00
|
|
|
|
void addCFlags(const string& filename);
|
|
|
|
|
void addLdLibs(const string& filename);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
void addLibraryFile(const string& filename);
|
2008-03-19 14:22:05 +00:00
|
|
|
|
void addVFile(const string& filename);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
// ACCESSORS (options)
|
|
|
|
|
bool preprocOnly() const { return m_preprocOnly; }
|
2006-08-31 15:29:15 +00:00
|
|
|
|
bool makeDepend() const { return m_makeDepend; }
|
|
|
|
|
bool makePhony() const { return m_makePhony; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool underlineZero() const { return m_underlineZero; }
|
|
|
|
|
string bin() const { return m_bin; }
|
|
|
|
|
string flags() const { return m_flags; }
|
|
|
|
|
bool systemC() const { return m_systemC; }
|
|
|
|
|
bool systemPerl() const { return m_systemPerl; }
|
2009-03-28 14:18:53 +00:00
|
|
|
|
bool usingSystemCLibs() const { return !lintOnly() && (systemPerl() || systemC()); }
|
2010-01-24 23:37:01 +00:00
|
|
|
|
bool usingSystemPerlLibs() const { return !lintOnly() && (systemPerl() || coverage()); }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool skipIdentical() const { return m_skipIdentical; }
|
|
|
|
|
bool stats() const { return m_stats; }
|
2009-01-21 21:56:50 +00:00
|
|
|
|
bool assertOn() const { return m_assert; } // assertOn as __FILE__ may be defined
|
2008-07-16 18:06:08 +00:00
|
|
|
|
bool autoflush() const { return m_autoflush; }
|
2009-09-16 13:28:09 +00:00
|
|
|
|
bool bboxSys() const { return m_bboxSys; }
|
2009-12-16 16:45:28 +00:00
|
|
|
|
bool bboxUnsup() const { return m_bboxUnsup; }
|
2010-01-07 21:41:19 +00:00
|
|
|
|
bool cdc() const { return m_cdc; }
|
2008-12-12 20:34:02 +00:00
|
|
|
|
bool coverage() const { return m_coverageLine || m_coverageToggle || m_coverageUser; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool coverageLine() const { return m_coverageLine; }
|
2008-12-12 20:34:02 +00:00
|
|
|
|
bool coverageToggle() const { return m_coverageToggle; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool coverageUser() const { return m_coverageUser; }
|
2006-10-02 17:09:56 +00:00
|
|
|
|
bool debugCheck() const { return m_debugCheck; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool dumpTree() const { return m_dumpTree; }
|
|
|
|
|
bool exe() const { return m_exe; }
|
|
|
|
|
bool trace() const { return m_trace; }
|
|
|
|
|
bool traceDups() const { return m_traceDups; }
|
|
|
|
|
bool outFormatOk() const { return m_outFormatOk; }
|
2006-10-12 14:01:06 +00:00
|
|
|
|
bool keepTempFiles() const { return (V3Error::debugDefault()!=0); }
|
2009-06-29 13:21:21 +00:00
|
|
|
|
bool pinsUint8() const { return m_pinsUint8; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool profileCFuncs() const { return m_profileCFuncs; }
|
|
|
|
|
bool psl() const { return m_psl; }
|
|
|
|
|
bool allPublic() const { return m_public; }
|
|
|
|
|
bool l2Name() const { return m_l2Name; }
|
2007-04-18 18:26:38 +00:00
|
|
|
|
bool lintOnly() const { return m_lintOnly; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool ignc() const { return m_ignc; }
|
2006-08-29 00:27:04 +00:00
|
|
|
|
bool inhibitSim() const { return m_inhibitSim; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2008-03-20 00:14:26 +00:00
|
|
|
|
int errorLimit() const { return m_errorLimit; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int inlineMult() const { return m_inlineMult; }
|
|
|
|
|
int outputSplit() const { return m_outputSplit; }
|
2006-10-26 01:08:44 +00:00
|
|
|
|
int outputSplitCFuncs() const { return m_outputSplitCFuncs; }
|
2008-11-17 22:13:57 +00:00
|
|
|
|
int outputSplitCTrace() const { return m_outputSplitCTrace; }
|
2009-03-13 18:17:30 +00:00
|
|
|
|
int pinsBv() const { return m_pinsBv; }
|
2007-01-18 18:31:49 +00:00
|
|
|
|
int traceDepth() const { return m_traceDepth; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int unrollCount() const { return m_unrollCount; }
|
|
|
|
|
int unrollStmts() const { return m_unrollStmts; }
|
|
|
|
|
|
2007-04-19 18:20:16 +00:00
|
|
|
|
int compLimitBlocks() const { return m_compLimitBlocks; }
|
|
|
|
|
int compLimitParens() const { return m_compLimitParens; }
|
|
|
|
|
|
2010-01-30 14:42:44 +00:00
|
|
|
|
string exeName() const { return m_exeName!="" ? m_exeName : prefix(); }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string makeDir() const { return m_makeDir; }
|
|
|
|
|
string modPrefix() const { return m_modPrefix; }
|
2010-01-20 12:15:51 +00:00
|
|
|
|
string pipeFilter() const { return m_pipeFilter; }
|
|
|
|
|
string prefix() const { return m_prefix; }
|
2008-03-25 19:57:41 +00:00
|
|
|
|
string topModule() const { return m_topModule; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string xAssign() const { return m_xAssign; }
|
2008-07-22 18:27:34 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
const V3StringSet& cppFiles() const { return m_cppFiles; }
|
2010-01-29 00:33:02 +00:00
|
|
|
|
const V3StringSet& cFlags() const { return m_cFlags; }
|
|
|
|
|
const V3StringSet& ldLibs() const { return m_ldLibs; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
const V3StringSet& libraryFiles() const { return m_libraryFiles; }
|
2008-04-09 14:17:03 +00:00
|
|
|
|
const V3StringList& vFiles() const { return m_vFiles; }
|
2008-03-28 20:41:21 +00:00
|
|
|
|
const V3LangCode& language() const { return m_language; }
|
2007-04-19 18:20:16 +00:00
|
|
|
|
|
2008-07-22 18:27:34 +00:00
|
|
|
|
bool isFuture(const string& flag) const;
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// ACCESSORS (optimization options)
|
|
|
|
|
bool oAcycSimp() const { return m_oAcycSimp; }
|
|
|
|
|
bool oCase() const { return m_oCase; }
|
|
|
|
|
bool oCombine() const { return m_oCombine; }
|
|
|
|
|
bool oConst() const { return m_oConst; }
|
|
|
|
|
bool oExpand() const { return m_oExpand; }
|
2008-11-20 14:04:29 +00:00
|
|
|
|
bool oFlopGater() const { return m_oFlopGater; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool oGate() const { return m_oGate; }
|
|
|
|
|
bool oDup() const { return oLife(); }
|
|
|
|
|
bool oLife() const { return m_oLife; }
|
|
|
|
|
bool oLifePost() const { return m_oLifePost; }
|
|
|
|
|
bool oLocalize() const { return m_oLocalize; }
|
|
|
|
|
bool oInline() const { return m_oInline; }
|
|
|
|
|
bool oReorder() const { return m_oReorder; }
|
|
|
|
|
bool oSplit() const { return m_oSplit; }
|
|
|
|
|
bool oSubst() const { return m_oSubst; }
|
|
|
|
|
bool oSubstConst() const { return m_oSubstConst; }
|
|
|
|
|
bool oTable() const { return m_oTable; }
|
|
|
|
|
|
2010-01-24 23:37:01 +00:00
|
|
|
|
// METHODS (uses above)
|
|
|
|
|
string traceClassBase() const { return systemPerl() ? "SpTraceVcd" : "VerilatedVcd"; }
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// METHODS (from main)
|
|
|
|
|
static string version();
|
|
|
|
|
static string argString(int argc, char** argv); ///< Return list of arguments as simple string
|
|
|
|
|
string allArgsString(); ///< Return all passed arguments as simple string
|
2006-09-30 00:27:05 +00:00
|
|
|
|
void bin(const string& flag) { m_bin = flag; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
void parseOpts(FileLine* fl, int argc, char** argv);
|
|
|
|
|
void parseOptsList (FileLine* fl, int argc, char** argv);
|
|
|
|
|
void parseOptsFile (FileLine* fl, const string& filename);
|
|
|
|
|
|
2008-01-31 13:50:06 +00:00
|
|
|
|
// METHODS (generic string utilities)
|
|
|
|
|
static bool wildmatch(const char* s, const char* p);
|
2008-03-18 15:21:13 +00:00
|
|
|
|
static string downcase(const string& str);
|
2008-01-31 13:50:06 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// METHODS (generic file utilities)
|
|
|
|
|
static string filenameFromDirBase (const string& dir, const string& basename);
|
|
|
|
|
static string filenameNonDir (const string& filename); ///< Return non-directory part of filename
|
|
|
|
|
static string filenameNonExt (const string& filename); ///< Return non-extensioned (no .) part of filename
|
|
|
|
|
static string filenameNonDirExt (const string& filename) { return filenameNonExt(filenameNonDir(filename)); } ///< Return basename of filename
|
|
|
|
|
static string filenameDir (const string& filename); ///< Return directory part of filename
|
2008-09-29 19:51:45 +00:00
|
|
|
|
static string filenameSubstitute (const string& filename); ///< Return filename with env vars removed
|
2008-01-31 13:50:06 +00:00
|
|
|
|
static void unlinkRegexp(const string& dir, const string& regexp);
|
2008-03-18 15:21:13 +00:00
|
|
|
|
|
2008-03-18 20:26:37 +00:00
|
|
|
|
// 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
|
2009-06-25 23:53:26 +00:00
|
|
|
|
// Also add to V3Options::showVersion()
|
2008-03-18 15:21:13 +00:00
|
|
|
|
static string getenvPERL() { return getenvStr("PERL","perl"); }
|
|
|
|
|
static string getenvSYSTEMC();
|
|
|
|
|
static string getenvSYSTEMC_ARCH();
|
|
|
|
|
static string getenvSYSTEMPERL();
|
2009-03-28 14:18:53 +00:00
|
|
|
|
static string getenvSYSTEMPERL_INCLUDE();
|
2008-03-18 15:21:13 +00:00
|
|
|
|
static string getenvVERILATOR_ROOT();
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
// METHODS (file utilities using these options)
|
|
|
|
|
string fileExists (const string& filename);
|
|
|
|
|
string filePath (FileLine* fl, const string& modname, const string& errmsg);
|
2008-03-18 15:21:13 +00:00
|
|
|
|
static bool fileStatDir (const string& filename);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
static bool fileStatNormal (const string& filename);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
|
|
|
|
|
#endif // guard
|