2012-04-13 01:08:20 +00:00
|
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
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
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2018-01-02 23:05:06 +00:00
|
|
|
|
// Copyright 2003-2018 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"
|
2012-11-14 01:12:23 +00:00
|
|
|
|
#include "V3LangCode.h"
|
2008-03-28 20:41:21 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//######################################################################
|
|
|
|
|
// V3Options - Command line options
|
|
|
|
|
|
|
|
|
|
class V3OptionsImp;
|
|
|
|
|
class FileLine;
|
|
|
|
|
|
2018-02-02 02:24:41 +00:00
|
|
|
|
typedef std::vector<string> V3StringList;
|
|
|
|
|
typedef std::set<string> V3StringSet;
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
class V3Options {
|
2009-01-21 21:56:50 +00:00
|
|
|
|
// TYPES
|
2018-02-02 02:24:41 +00:00
|
|
|
|
typedef std::map<string,int> DebugSrcMap;
|
2009-01-21 21:56:50 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// MEMBERS (general options)
|
|
|
|
|
V3OptionsImp* m_impp; // Slow hidden options
|
|
|
|
|
|
2017-02-13 23:11:40 +00:00
|
|
|
|
V3StringSet m_cppFiles; // argument: C++ files to link against
|
|
|
|
|
V3StringList m_cFlags; // argument: user CFLAGS
|
|
|
|
|
V3StringList 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
|
2015-03-12 23:20:46 +00:00
|
|
|
|
V3StringSet m_clockers; // argument: Verilog -clk signals
|
|
|
|
|
V3StringSet m_noClockers; // argument: Verilog -noclk signals
|
2008-04-09 14:17:03 +00:00
|
|
|
|
V3StringList m_vFiles; // argument: Verilog files to read
|
2017-02-09 12:43:43 +00:00
|
|
|
|
V3StringList m_forceIncs; // argument: -FI
|
2009-01-21 21:56:50 +00:00
|
|
|
|
DebugSrcMap m_debugSrcs; // argument: --debugi-<srcfile>=<level>
|
2015-03-12 23:47:54 +00:00
|
|
|
|
DebugSrcMap m_dumpTrees; // argument: --dump-treei-<srcfile>=<level>
|
2018-02-02 02:24:41 +00:00
|
|
|
|
std::map<string,string> m_parameters; // Parameters
|
2016-03-24 23:14:15 +00:00
|
|
|
|
|
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
|
2014-06-07 00:22:20 +00:00
|
|
|
|
bool m_preprocNoLine;// main switch: -P
|
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
|
2010-08-29 23:28:46 +00:00
|
|
|
|
bool m_coverageUnderscore;// main switch: --coverage-underscore
|
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
|
2018-03-10 17:18:19 +00:00
|
|
|
|
bool m_debugLeak; // main switch: --debug-leak
|
2016-09-14 02:28:07 +00:00
|
|
|
|
bool m_decoration; // main switch: --decoration
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
2007-04-18 18:26:38 +00:00
|
|
|
|
bool m_lintOnly; // main switch: --lint-only
|
2013-09-30 20:52:43 +00:00
|
|
|
|
bool m_orderClockDly;// main switch: --order-clock-delay
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_outFormatOk; // main switch: --cc, --sc or --sp was specified
|
2013-04-27 01:02:32 +00:00
|
|
|
|
bool m_pinsScUint; // main switch: --pins-sc-uint
|
|
|
|
|
bool m_pinsScBigUint;// main switch: --pins-sc-biguint
|
2009-06-29 13:21:21 +00:00
|
|
|
|
bool m_pinsUint8; // main switch: --pins-uint8
|
2018-05-20 13:12:29 +00:00
|
|
|
|
bool m_profCFuncs; // main switch: --prof-cfuncs
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_public; // main switch: --public
|
2017-10-05 22:18:11 +00:00
|
|
|
|
bool m_relativeCFuncs; // main switch: --relative-cfuncs
|
2017-02-09 23:33:18 +00:00
|
|
|
|
bool m_relativeIncludes; // main switch: --relative-includes
|
2017-10-05 22:18:11 +00:00
|
|
|
|
bool m_reportUnoptflat; // main switch: --report-unoptflat
|
2012-08-27 01:13:47 +00:00
|
|
|
|
bool m_savable; // main switch: --savable
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_systemC; // main switch: --sc: System C instead of simple C++
|
|
|
|
|
bool m_skipIdentical;// main switch: --skip-identical
|
|
|
|
|
bool m_stats; // main switch: --stats
|
2014-12-20 13:28:31 +00:00
|
|
|
|
bool m_statsVars; // main switch: --stats-vars
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool m_trace; // main switch: --trace
|
|
|
|
|
bool m_traceDups; // main switch: --trace-dups
|
2014-03-14 00:08:43 +00:00
|
|
|
|
bool m_traceParams; // main switch: --trace-params
|
2013-12-15 00:13:31 +00:00
|
|
|
|
bool m_traceStructs; // main switch: --trace-structs
|
2010-08-29 23:28:46 +00:00
|
|
|
|
bool m_traceUnderscore;// main switch: --trace-underscore
|
2009-11-24 00:08:25 +00:00
|
|
|
|
bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2
|
2015-09-26 02:57:28 +00:00
|
|
|
|
bool m_vpi; // main switch: --vpi
|
2012-11-02 23:55:34 +00:00
|
|
|
|
bool m_xInitialEdge; // main switch: --x-initial-edge
|
2012-03-20 20:13:10 +00:00
|
|
|
|
bool m_xmlOnly; // main switch: --xml-netlist
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2012-05-31 22:56:31 +00:00
|
|
|
|
int m_convergeLimit;// main switch: --converge-limit
|
2012-03-21 02:45:35 +00:00
|
|
|
|
int m_dumpTree; // main switch: --dump-tree
|
2018-01-27 20:06:51 +00:00
|
|
|
|
int m_gateStmts; // main switch: --gate-stmts
|
2010-12-26 14:31:09 +00:00
|
|
|
|
int m_ifDepth; // main switch: --if-depth
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int m_inlineMult; // main switch: --inline-mult
|
2017-11-18 22:42:35 +00:00
|
|
|
|
int m_moduleRecursion;// main switch: --module-recursion-depth
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
2017-10-21 20:41:43 +00:00
|
|
|
|
int m_threads; // main switch: --threads (0 == --no-threads)
|
2007-01-18 18:31:49 +00:00
|
|
|
|
int m_traceDepth; // main switch: --trace-depth
|
2011-02-24 02:58:27 +00:00
|
|
|
|
int m_traceMaxArray;// main switch: --trace-max-array
|
|
|
|
|
int m_traceMaxWidth;// main switch: --trace-max-width
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int m_unrollCount; // main switch: --unroll-count
|
|
|
|
|
int m_unrollStmts; // main switch: --unroll-stmts
|
|
|
|
|
|
2017-12-09 16:52:35 +00:00
|
|
|
|
int m_compLimitBlocks; // compiler selection; number of nested blocks
|
|
|
|
|
int m_compLimitMembers; // compiler selection; number of members in struct before make anon array
|
|
|
|
|
int m_compLimitParens; // compiler selection; number of nested parens
|
2007-04-19 18:20:16 +00:00
|
|
|
|
|
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}
|
2016-05-07 18:01:02 +00:00
|
|
|
|
string m_l2Name; // main switch: --l2name; "" for top-module's name
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
2008-03-25 19:57:41 +00:00
|
|
|
|
string m_topModule; // main switch: --top-module
|
2011-01-02 00:43:22 +00:00
|
|
|
|
string m_unusedRegexp; // main switch: --unused-regexp
|
|
|
|
|
string m_xAssign; // main switch: --x-assign
|
2017-10-02 01:31:40 +00:00
|
|
|
|
string m_xInitial; // main switch: --x-initial
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2012-11-14 01:12:23 +00:00
|
|
|
|
// Language is now held in FileLine, on a per-node basis. However we still
|
|
|
|
|
// have a concept of the default language at a global level.
|
|
|
|
|
V3LangCode m_defaultLanguage; // main switch: --language
|
2008-03-28 20:41:21 +00:00
|
|
|
|
|
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
|
2013-02-21 01:14:15 +00:00
|
|
|
|
bool m_oDedupe; // main switch: -Od: logic deduplication
|
2017-09-11 23:18:58 +00:00
|
|
|
|
bool m_oAssemble; // main switch: -Om: assign assemble
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
2018-06-23 21:07:22 +00:00
|
|
|
|
bool m_oReloop; // main switch: -Ov: reform loops
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
2011-10-28 22:57:40 +00:00
|
|
|
|
void addArg(const string& flag);
|
2014-11-14 00:05:07 +00:00
|
|
|
|
void addDefine(const string& defline, bool allowPlus);
|
2008-07-22 18:27:34 +00:00
|
|
|
|
void addFuture(const string& flag);
|
2011-10-28 22:57:40 +00:00
|
|
|
|
void addIncDirUser(const string& incdir); // User requested
|
|
|
|
|
void addIncDirFallback(const string& incdir); // Low priority if not found otherwise
|
2016-03-24 23:14:15 +00:00
|
|
|
|
void addParameter(const string& paramline, bool allowPlus);
|
2013-02-03 18:27:37 +00:00
|
|
|
|
void addLangExt(const string& langext, const V3LangCode& lc);
|
2012-02-12 01:40:58 +00:00
|
|
|
|
void addLibExtV(const string& libext);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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);
|
2015-10-30 02:19:51 +00:00
|
|
|
|
bool suffixed(const string& sw, const char* arg);
|
2010-11-03 11:02:32 +00:00
|
|
|
|
string parseFileArg(const string& optdir, const string& relfilename);
|
2013-02-03 18:27:37 +00:00
|
|
|
|
bool parseLangExt(const char* swp, const char* langswp, const V3LangCode& lc);
|
2011-10-28 22:57:40 +00:00
|
|
|
|
string filePathCheckOneDir(const string& modname, const string& dirname);
|
2009-06-25 23:53:26 +00:00
|
|
|
|
|
2017-11-01 22:51:41 +00:00
|
|
|
|
// CONSTRUCTORS
|
|
|
|
|
VL_UNCOPYABLE(V3Options);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
public:
|
|
|
|
|
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());
|
2015-03-12 23:47:54 +00:00
|
|
|
|
void setDumpTreeLevel(const string& srcfile, int level);
|
|
|
|
|
int dumpTreeLevel(const string& srcfile);
|
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);
|
2015-03-12 23:20:46 +00:00
|
|
|
|
void addClocker(const string& signame);
|
|
|
|
|
void addNoClocker(const string& signame);
|
2008-03-19 14:22:05 +00:00
|
|
|
|
void addVFile(const string& filename);
|
2017-02-09 12:43:43 +00:00
|
|
|
|
void addForceInc(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; }
|
2014-06-07 00:22:20 +00:00
|
|
|
|
bool preprocNoLine() const { return m_preprocNoLine; }
|
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; }
|
2017-09-08 01:08:49 +00:00
|
|
|
|
bool usingSystemCLibs() const { return !lintOnly() && systemC(); }
|
2012-08-27 01:13:47 +00:00
|
|
|
|
bool savable() const { return m_savable; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool skipIdentical() const { return m_skipIdentical; }
|
|
|
|
|
bool stats() const { return m_stats; }
|
2014-12-20 13:28:31 +00:00
|
|
|
|
bool statsVars() const { return m_statsVars; }
|
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; }
|
2010-08-29 23:28:46 +00:00
|
|
|
|
bool coverageUnderscore() const { return m_coverageUnderscore; }
|
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; }
|
2018-03-10 17:18:19 +00:00
|
|
|
|
bool debugLeak() const { return m_debugLeak; }
|
2016-09-14 02:28:07 +00:00
|
|
|
|
bool decoration() const { return m_decoration; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool exe() const { return m_exe; }
|
|
|
|
|
bool trace() const { return m_trace; }
|
|
|
|
|
bool traceDups() const { return m_traceDups; }
|
2014-03-14 00:08:43 +00:00
|
|
|
|
bool traceParams() const { return m_traceParams; }
|
2013-12-15 00:13:31 +00:00
|
|
|
|
bool traceStructs() const { return m_traceStructs; }
|
2010-08-29 23:28:46 +00:00
|
|
|
|
bool traceUnderscore() const { return m_traceUnderscore; }
|
2013-09-30 20:52:43 +00:00
|
|
|
|
bool orderClockDly() const { return m_orderClockDly; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool outFormatOk() const { return m_outFormatOk; }
|
2006-10-12 14:01:06 +00:00
|
|
|
|
bool keepTempFiles() const { return (V3Error::debugDefault()!=0); }
|
2013-04-27 01:02:32 +00:00
|
|
|
|
bool pinsScUint() const { return m_pinsScUint; }
|
|
|
|
|
bool pinsScBigUint() const { return m_pinsScBigUint; }
|
2009-06-29 13:21:21 +00:00
|
|
|
|
bool pinsUint8() const { return m_pinsUint8; }
|
2018-05-20 13:12:29 +00:00
|
|
|
|
bool profCFuncs() const { return m_profCFuncs; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
bool allPublic() const { return m_public; }
|
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; }
|
2017-10-05 22:18:11 +00:00
|
|
|
|
bool relativeCFuncs() const { return m_relativeCFuncs; }
|
2013-02-27 03:26:47 +00:00
|
|
|
|
bool reportUnoptflat() const { return m_reportUnoptflat; }
|
2015-09-26 02:57:28 +00:00
|
|
|
|
bool vpi() const { return m_vpi; }
|
2012-11-02 23:55:34 +00:00
|
|
|
|
bool xInitialEdge() const { return m_xInitialEdge; }
|
2012-03-20 20:13:10 +00:00
|
|
|
|
bool xmlOnly() const { return m_xmlOnly; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
2012-05-31 22:56:31 +00:00
|
|
|
|
int convergeLimit() const { return m_convergeLimit; }
|
2012-03-21 02:45:35 +00:00
|
|
|
|
int dumpTree() const { return m_dumpTree; }
|
2018-01-27 20:06:51 +00:00
|
|
|
|
int gateStmts() const { return m_gateStmts; }
|
2010-12-26 14:31:09 +00:00
|
|
|
|
int ifDepth() const { return m_ifDepth; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
int inlineMult() const { return m_inlineMult; }
|
2017-11-18 22:42:35 +00:00
|
|
|
|
int moduleRecursionDepth() const { return m_moduleRecursion; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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; }
|
2018-05-29 23:49:27 +00:00
|
|
|
|
int threads() const { return m_threads; }
|
|
|
|
|
bool mtasks() const { return (m_threads > 1); }
|
2007-01-18 18:31:49 +00:00
|
|
|
|
int traceDepth() const { return m_traceDepth; }
|
2011-02-24 02:58:27 +00:00
|
|
|
|
int traceMaxArray() const { return m_traceMaxArray; }
|
|
|
|
|
int traceMaxWidth() const { return m_traceMaxWidth; }
|
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; }
|
2017-12-09 16:52:35 +00:00
|
|
|
|
int compLimitMembers() const { return m_compLimitMembers; }
|
2007-04-19 18:20:16 +00:00
|
|
|
|
int compLimitParens() const { return m_compLimitParens; }
|
|
|
|
|
|
2010-01-30 14:42:44 +00:00
|
|
|
|
string exeName() const { return m_exeName!="" ? m_exeName : prefix(); }
|
2016-05-07 18:01:02 +00:00
|
|
|
|
string l2Name() const { return m_l2Name; }
|
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; }
|
2011-01-02 00:43:22 +00:00
|
|
|
|
string unusedRegexp() const { return m_unusedRegexp; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
string xAssign() const { return m_xAssign; }
|
2017-10-02 01:31:40 +00:00
|
|
|
|
string xInitial() const { return m_xInitial; }
|
2008-07-22 18:27:34 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
const V3StringSet& cppFiles() const { return m_cppFiles; }
|
2017-02-13 23:11:40 +00:00
|
|
|
|
const V3StringList& cFlags() const { return m_cFlags; }
|
|
|
|
|
const V3StringList& 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; }
|
2017-02-09 12:43:43 +00:00
|
|
|
|
const V3StringList& forceIncs() const { return m_forceIncs; }
|
2012-11-14 01:12:23 +00:00
|
|
|
|
const V3LangCode& defaultLanguage() const { return m_defaultLanguage; }
|
2007-04-19 18:20:16 +00:00
|
|
|
|
|
2018-02-08 00:31:21 +00:00
|
|
|
|
bool hasParameter(const string& name);
|
|
|
|
|
string parameter(const string& name);
|
2016-03-24 23:14:15 +00:00
|
|
|
|
void checkParameters();
|
|
|
|
|
|
2008-07-22 18:27:34 +00:00
|
|
|
|
bool isFuture(const string& flag) const;
|
2010-12-30 00:34:33 +00:00
|
|
|
|
bool isLibraryFile(const string& filename) const;
|
2015-03-12 23:20:46 +00:00
|
|
|
|
bool isClocker(const string& signame) const;
|
|
|
|
|
bool isNoClocker(const string& signame) const;
|
2008-07-22 18:27:34 +00:00
|
|
|
|
|
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; }
|
2013-02-21 01:14:15 +00:00
|
|
|
|
bool oDedupe() const { return m_oDedupe; }
|
2014-10-23 01:44:41 +00:00
|
|
|
|
bool oAssemble() const { return m_oAssemble; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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; }
|
2018-06-23 21:07:22 +00:00
|
|
|
|
bool oReloop() const { return m_oReloop; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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)
|
2017-09-08 01:08:49 +00:00
|
|
|
|
string traceClassBase() const { return "VerilatedVcd"; }
|
2010-01-24 23:37:01 +00:00
|
|
|
|
|
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);
|
2010-11-03 11:02:32 +00:00
|
|
|
|
void parseOptsList (FileLine* fl, const string& optdir, int argc, char** argv);
|
|
|
|
|
void parseOptsFile (FileLine* fl, const string& filename, bool rel);
|
2006-08-26 11:35:28 +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()
|
2017-09-23 22:03:39 +00:00
|
|
|
|
static string getenvBuiltins(const string& var);
|
2010-12-18 00:40:08 +00:00
|
|
|
|
static string getenvPERL();
|
2008-03-18 15:21:13 +00:00
|
|
|
|
static string getenvSYSTEMC();
|
|
|
|
|
static string getenvSYSTEMC_ARCH();
|
2012-01-20 01:30:41 +00:00
|
|
|
|
static string getenvSYSTEMC_INCLUDE();
|
|
|
|
|
static string getenvSYSTEMC_LIBDIR();
|
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);
|
2017-02-09 23:33:18 +00:00
|
|
|
|
string filePath(FileLine* fl, const string& modname, const string& lastpath, const string& errmsg);
|
2011-10-28 00:56:38 +00:00
|
|
|
|
void filePathLookedMsg(FileLine* fl, const string& modname);
|
2012-11-14 01:12:23 +00:00
|
|
|
|
V3LangCode fileLanguage(const string &filename);
|
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);
|
2013-02-05 02:21:55 +00:00
|
|
|
|
static void fileNfsFlush(const string& filename);
|
2011-08-05 01:58:45 +00:00
|
|
|
|
|
|
|
|
|
// METHODS (other OS)
|
|
|
|
|
static void throwSigsegv();
|
2006-08-26 11:35:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
|
|
|
|
|
#endif // guard
|