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
|
|
|
|
//
|
2019-11-08 03:33:59 +00:00
|
|
|
// Code available from: https://verilator.org
|
2006-08-26 11:35:28 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
|
|
|
//
|
2020-03-21 15:24:24 +00:00
|
|
|
// Copyright 2003-2020 by Wilson Snyder. This program is free software; you
|
|
|
|
// can 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.
|
2020-03-21 15:24:24 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
2006-08-26 11:35:28 +00:00
|
|
|
//
|
|
|
|
//*************************************************************************
|
2019-10-05 00:17:11 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
#ifndef _V3OPTIONS_H_
|
|
|
|
#define _V3OPTIONS_H_ 1
|
|
|
|
|
2006-12-18 19:20:45 +00:00
|
|
|
#include "config_build.h"
|
|
|
|
#include "verilatedos.h"
|
2018-10-14 17:43:24 +00:00
|
|
|
|
|
|
|
#include "V3Global.h"
|
|
|
|
#include "V3LangCode.h"
|
|
|
|
|
2009-01-21 21:56:50 +00:00
|
|
|
#include <map>
|
2006-08-26 11:35:28 +00:00
|
|
|
#include <set>
|
2018-10-14 22:39:33 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
class V3OptionsImp;
|
|
|
|
class FileLine;
|
|
|
|
|
2018-08-28 10:41:17 +00:00
|
|
|
//######################################################################
|
|
|
|
|
2019-11-01 00:59:52 +00:00
|
|
|
class VOptionBool {
|
|
|
|
// Class to track options that are either not specified (and default
|
|
|
|
// true/false), versus user setting the option to true or false
|
|
|
|
public:
|
|
|
|
enum en {
|
|
|
|
OPT_DEFAULT_FALSE = 0,
|
|
|
|
OPT_DEFAULT_TRUE,
|
|
|
|
OPT_TRUE,
|
|
|
|
OPT_FALSE,
|
|
|
|
_ENUM_END
|
|
|
|
};
|
|
|
|
enum en m_e;
|
|
|
|
inline VOptionBool() : m_e(OPT_DEFAULT_FALSE) {}
|
|
|
|
// cppcheck-suppress noExplicitConstructor
|
|
|
|
inline VOptionBool(en _e) : m_e(_e) {}
|
|
|
|
explicit inline VOptionBool(int _e) : m_e(static_cast<en>(_e)) {}
|
|
|
|
operator en() const { return m_e; }
|
|
|
|
bool isDefault() const { return m_e == OPT_DEFAULT_FALSE || m_e == OPT_DEFAULT_TRUE; }
|
|
|
|
bool isTrue() const { return m_e == OPT_TRUE || m_e == OPT_DEFAULT_TRUE; }
|
|
|
|
bool isFalse() const { return m_e == OPT_FALSE || m_e == OPT_DEFAULT_FALSE; }
|
|
|
|
void setTrueOrFalse(bool flag) { m_e = flag ? OPT_TRUE : OPT_FALSE; }
|
|
|
|
const char* ascii() const {
|
|
|
|
static const char* const names[] = {
|
|
|
|
"DEFAULT_FALSE", "DEFAULT_TRUE", "TRUE", "FALSE"};
|
|
|
|
return names[m_e]; }
|
2020-02-02 15:34:29 +00:00
|
|
|
};
|
|
|
|
inline bool operator==(const VOptionBool& lhs, const VOptionBool& rhs) {
|
|
|
|
return lhs.m_e == rhs.m_e;
|
|
|
|
}
|
|
|
|
inline bool operator==(const VOptionBool& lhs, VOptionBool::en rhs) { return lhs.m_e == rhs; }
|
|
|
|
inline bool operator==(VOptionBool::en lhs, const VOptionBool& rhs) { return lhs == rhs.m_e; }
|
|
|
|
inline std::ostream& operator<<(std::ostream& os, const VOptionBool& rhs) {
|
|
|
|
return os << rhs.ascii();
|
|
|
|
}
|
2019-11-01 00:59:52 +00:00
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
2018-08-28 10:41:17 +00:00
|
|
|
class TraceFormat {
|
|
|
|
public:
|
|
|
|
enum en {
|
|
|
|
VCD = 0,
|
2019-05-03 00:33:05 +00:00
|
|
|
FST,
|
|
|
|
FST_THREAD
|
2018-08-28 10:41:17 +00:00
|
|
|
} m_e;
|
|
|
|
inline TraceFormat(en _e = VCD) : m_e(_e) {}
|
|
|
|
explicit inline TraceFormat(int _e) : m_e(static_cast<en>(_e)) {}
|
|
|
|
operator en() const { return m_e; }
|
2019-05-03 00:33:05 +00:00
|
|
|
bool fstFlavor() const { return m_e == FST || m_e == FST_THREAD; }
|
|
|
|
bool threaded() const { return m_e == FST_THREAD; }
|
2018-08-28 10:41:17 +00:00
|
|
|
string classBase() const {
|
|
|
|
static const char* const names[] = {
|
|
|
|
"VerilatedVcd",
|
2019-05-03 00:33:05 +00:00
|
|
|
"VerilatedFst",
|
2018-10-02 22:42:53 +00:00
|
|
|
"VerilatedFst"
|
2018-08-28 10:41:17 +00:00
|
|
|
};
|
|
|
|
return names[m_e];
|
|
|
|
}
|
|
|
|
string sourceName() const {
|
|
|
|
static const char* const names[] = {
|
|
|
|
"verilated_vcd",
|
2019-05-03 00:33:05 +00:00
|
|
|
"verilated_fst",
|
2018-10-02 22:42:53 +00:00
|
|
|
"verilated_fst"
|
2018-08-28 10:41:17 +00:00
|
|
|
};
|
|
|
|
return names[m_e];
|
|
|
|
}
|
|
|
|
};
|
2020-02-02 15:34:29 +00:00
|
|
|
inline bool operator==(const TraceFormat& lhs, const TraceFormat& rhs) {
|
|
|
|
return lhs.m_e == rhs.m_e;
|
|
|
|
}
|
|
|
|
inline bool operator==(const TraceFormat& lhs, TraceFormat::en rhs) { return lhs.m_e == rhs; }
|
|
|
|
inline bool operator==(TraceFormat::en lhs, const TraceFormat& rhs) { return lhs == rhs.m_e; }
|
2018-08-28 10:41:17 +00:00
|
|
|
|
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
|
|
|
|
2018-08-28 10:41:17 +00:00
|
|
|
//######################################################################
|
|
|
|
// V3Options - Command line options
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
class V3Options {
|
2018-08-28 10:41:17 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
private:
|
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)
|
2019-05-19 20:13:13 +00:00
|
|
|
V3OptionsImp* m_impp; // Slow hidden options
|
|
|
|
|
|
|
|
V3StringSet m_cppFiles; // argument: C++ files to link against
|
|
|
|
V3StringList m_cFlags; // argument: user CFLAGS
|
|
|
|
V3StringList m_ldLibs; // argument: user LDFLAGS
|
|
|
|
V3StringSet m_futures; // argument: -Wfuture- list
|
|
|
|
V3StringSet m_libraryFiles; // argument: Verilog -v files
|
|
|
|
V3StringSet m_clockers; // argument: Verilog -clk signals
|
|
|
|
V3StringSet m_noClockers; // argument: Verilog -noclk signals
|
|
|
|
V3StringList m_vFiles; // argument: Verilog files to read
|
|
|
|
V3StringList m_forceIncs; // argument: -FI
|
|
|
|
DebugSrcMap m_debugSrcs; // argument: --debugi-<srcfile>=<level>
|
|
|
|
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
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_preprocOnly; // main switch: -E
|
|
|
|
bool m_makePhony; // main switch: -MP
|
|
|
|
bool m_preprocNoLine;// main switch: -P
|
|
|
|
bool m_assert; // main switch: --assert
|
|
|
|
bool m_autoflush; // main switch: --autoflush
|
|
|
|
bool m_bboxSys; // main switch: --bbox-sys
|
|
|
|
bool m_bboxUnsup; // main switch: --bbox-unsup
|
|
|
|
bool m_cdc; // main switch: --cdc
|
2019-10-17 23:44:10 +00:00
|
|
|
bool m_cmake; // main switch: --make cmake
|
2019-11-23 15:39:36 +00:00
|
|
|
bool m_context; // main switch: --Wcontext
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_coverageLine; // main switch: --coverage-block
|
|
|
|
bool m_coverageToggle;// main switch: --coverage-toggle
|
|
|
|
bool m_coverageUnderscore;// main switch: --coverage-underscore
|
|
|
|
bool m_coverageUser; // main switch: --coverage-func
|
|
|
|
bool m_debugCheck; // main switch: --debug-check
|
2019-05-18 00:50:57 +00:00
|
|
|
bool m_debugCollision; // main switch: --debug-collision
|
2018-07-23 00:54:28 +00:00
|
|
|
bool m_debugLeak; // main switch: --debug-leak
|
|
|
|
bool m_debugNondeterminism; // main switch: --debug-nondeterminism
|
|
|
|
bool m_debugPartition; // main switch: --debug-partition
|
2019-10-06 17:24:21 +00:00
|
|
|
bool m_debugProtect; // main switch: --debug-protect
|
2018-07-23 00:54:28 +00:00
|
|
|
bool m_debugSelfTest; // main switch: --debug-self-test
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_decoration; // main switch: --decoration
|
2019-08-28 01:36:59 +00:00
|
|
|
bool m_dpiHdrOnly; // main switch: --dpi-hdr-only
|
2018-10-25 23:45:06 +00:00
|
|
|
bool m_dumpDefines; // main switch: --dump-defines
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_exe; // main switch: --exe
|
|
|
|
bool m_ignc; // main switch: --ignc
|
|
|
|
bool m_inhibitSim; // main switch: --inhibit-sim
|
|
|
|
bool m_lintOnly; // main switch: --lint-only
|
2019-10-17 23:44:10 +00:00
|
|
|
bool m_gmake; // main switch: --make gmake
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_orderClockDly;// main switch: --order-clock-delay
|
|
|
|
bool m_outFormatOk; // main switch: --cc, --sc or --sp was specified
|
2019-11-16 16:59:21 +00:00
|
|
|
bool m_pedantic; // main switch: --Wpedantic
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_pinsScUint; // main switch: --pins-sc-uint
|
|
|
|
bool m_pinsScBigUint;// main switch: --pins-sc-biguint
|
|
|
|
bool m_pinsUint8; // main switch: --pins-uint8
|
2018-10-26 01:17:25 +00:00
|
|
|
bool m_ppComments; // main switch: --pp-comments
|
2018-05-20 13:12:29 +00:00
|
|
|
bool m_profCFuncs; // main switch: --prof-cfuncs
|
2018-07-23 00:54:28 +00:00
|
|
|
bool m_profThreads; // main switch: --prof-threads
|
2019-10-06 17:24:21 +00:00
|
|
|
bool m_protectIds; // main switch: --protect-ids
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_public; // main switch: --public
|
2019-09-23 11:56:07 +00:00
|
|
|
bool m_publicFlatRW; // main switch: --public-flat-rw
|
2020-03-15 12:09:51 +00:00
|
|
|
bool m_quietExit; // main switch: --quiet-exit
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_relativeCFuncs; // main switch: --relative-cfuncs
|
|
|
|
bool m_relativeIncludes; // main switch: --relative-includes
|
|
|
|
bool m_reportUnoptflat; // main switch: --report-unoptflat
|
|
|
|
bool m_savable; // main switch: --savable
|
2020-03-07 15:51:06 +00:00
|
|
|
bool m_structsPacked; // main switch: --structs-packed
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_systemC; // main switch: --sc: System C instead of simple C++
|
|
|
|
bool m_stats; // main switch: --stats
|
|
|
|
bool m_statsVars; // main switch: --stats-vars
|
2018-07-23 00:54:28 +00:00
|
|
|
bool m_threadsCoarsen; // main switch: --threads-coarsen
|
|
|
|
bool m_threadsDpiPure; // main switch: --threads-dpi all/pure
|
|
|
|
bool m_threadsDpiUnpure; // main switch: --threads-dpi all
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_trace; // main switch: --trace
|
2019-10-27 13:27:18 +00:00
|
|
|
bool m_traceCoverage; // main switch: --trace-coverage
|
2019-05-19 20:13:13 +00:00
|
|
|
bool m_traceDups; // main switch: --trace-dups
|
|
|
|
bool m_traceParams; // main switch: --trace-params
|
|
|
|
bool m_traceStructs; // main switch: --trace-structs
|
|
|
|
bool m_traceUnderscore;// main switch: --trace-underscore
|
|
|
|
bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2
|
|
|
|
bool m_vpi; // main switch: --vpi
|
|
|
|
bool m_xInitialEdge; // main switch: --x-initial-edge
|
|
|
|
bool m_xmlOnly; // main switch: --xml-netlist
|
|
|
|
|
|
|
|
int m_convergeLimit;// main switch: --converge-limit
|
|
|
|
int m_dumpTree; // main switch: --dump-tree
|
2018-01-27 20:06:51 +00:00
|
|
|
int m_gateStmts; // main switch: --gate-stmts
|
2019-05-19 20:13:13 +00:00
|
|
|
int m_ifDepth; // main switch: --if-depth
|
|
|
|
int m_inlineMult; // main switch: --inline-mult
|
2019-11-01 00:59:52 +00:00
|
|
|
VOptionBool m_makeDepend; // main switch: -MMD
|
2020-01-21 11:17:31 +00:00
|
|
|
int m_maxNumWidth; // main switch: --max-num-width
|
2019-05-19 20:13:13 +00:00
|
|
|
int m_moduleRecursion;// main switch: --module-recursion-depth
|
|
|
|
int m_outputSplit; // main switch: --output-split
|
|
|
|
int m_outputSplitCFuncs;// main switch: --output-split-cfuncs
|
|
|
|
int m_outputSplitCTrace;// main switch: --output-split-ctrace
|
|
|
|
int m_pinsBv; // main switch: --pins-bv
|
2019-11-01 00:59:52 +00:00
|
|
|
VOptionBool m_skipIdentical; // main switch: --skip-identical
|
2019-05-19 20:13:13 +00:00
|
|
|
int m_threads; // main switch: --threads (0 == --no-threads)
|
2018-07-23 00:54:28 +00:00
|
|
|
int m_threadsMaxMTasks; // main switch: --threads-max-mtasks
|
2018-12-07 00:06:20 +00:00
|
|
|
int m_traceDepth; // main switch: --trace-depth
|
|
|
|
TraceFormat m_traceFormat; // main switch: --trace or --trace-fst
|
|
|
|
int m_traceMaxArray;// main switch: --trace-max-array
|
2019-05-19 20:13:13 +00:00
|
|
|
int m_traceMaxWidth;// main switch: --trace-max-width
|
|
|
|
int m_unrollCount; // main switch: --unroll-count
|
|
|
|
int m_unrollStmts; // main switch: --unroll-stmts
|
2006-08-26 11:35:28 +00:00
|
|
|
|
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
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
string m_bin; // main switch: --bin {binary}
|
|
|
|
string m_exeName; // main switch: -o {name}
|
|
|
|
string m_flags; // main switch: -f {name}
|
|
|
|
string m_l2Name; // main switch: --l2name; "" for top-module's name
|
|
|
|
string m_makeDir; // main switch: -Mdir
|
|
|
|
string m_modPrefix; // main switch: --mod-prefix
|
|
|
|
string m_pipeFilter; // main switch: --pipe-filter
|
|
|
|
string m_prefix; // main switch: --prefix
|
2019-10-06 17:24:21 +00:00
|
|
|
string m_protectKey; // main switch: --protect-key
|
2019-10-09 10:47:26 +00:00
|
|
|
string m_protectLib; // main switch: --protect-lib {lib_name}
|
2019-05-19 20:13:13 +00:00
|
|
|
string m_topModule; // main switch: --top-module
|
|
|
|
string m_unusedRegexp; // main switch: --unused-regexp
|
|
|
|
string m_xAssign; // main switch: --x-assign
|
|
|
|
string m_xInitial; // main switch: --x-initial
|
2019-11-01 01:17:05 +00:00
|
|
|
string m_xmlOutput; // main switch: --xml-output
|
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.
|
2019-05-19 20:13:13 +00:00
|
|
|
V3LangCode m_defaultLanguage; // main switch: --language
|
2008-03-28 20:41:21 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
// MEMBERS (optimizations)
|
2019-05-19 20:13:13 +00:00
|
|
|
// // 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_oDedupe; // main switch: -Od: logic deduplication
|
|
|
|
bool m_oAssemble; // main switch: -Om: assign assemble
|
|
|
|
bool m_oExpand; // main switch: -Ox: expansion of C macros
|
|
|
|
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
|
2019-05-19 20:13:13 +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
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// METHODS
|
2018-10-14 22:39:33 +00:00
|
|
|
void addArg(const string& arg);
|
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);
|
2019-11-01 00:59:52 +00:00
|
|
|
bool onoffb(const char* sw, const char* arg, VOptionBool& 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);
|
2018-10-14 22:39:33 +00:00
|
|
|
int debugSrcLevel(const string& srcfile_path, int default_level=V3Error::debugDefault());
|
2015-03-12 23:47:54 +00:00
|
|
|
void setDumpTreeLevel(const string& srcfile, int level);
|
2018-10-14 22:39:33 +00:00
|
|
|
int dumpTreeLevel(const string& srcfile_path);
|
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);
|
2019-10-04 02:18:29 +00:00
|
|
|
void notify();
|
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 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 stats() const { return m_stats; }
|
2014-12-20 13:28:31 +00:00
|
|
|
bool statsVars() const { return m_statsVars; }
|
2020-03-07 15:51:06 +00:00
|
|
|
bool structsPacked() const { return m_structsPacked; }
|
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; }
|
2019-10-17 23:44:10 +00:00
|
|
|
bool cmake() const { return m_cmake; }
|
2019-11-23 15:39:36 +00:00
|
|
|
bool context() const { return m_context; }
|
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; }
|
2019-05-18 00:50:57 +00:00
|
|
|
bool debugCollision() const { return m_debugCollision; }
|
2018-03-10 17:18:19 +00:00
|
|
|
bool debugLeak() const { return m_debugLeak; }
|
2018-07-23 00:54:28 +00:00
|
|
|
bool debugNondeterminism() const { return m_debugNondeterminism; }
|
|
|
|
bool debugPartition() const { return m_debugPartition; }
|
2019-10-06 17:24:21 +00:00
|
|
|
bool debugProtect() const { return m_debugProtect; }
|
2018-07-23 00:54:28 +00:00
|
|
|
bool debugSelfTest() const { return m_debugSelfTest; }
|
2016-09-14 02:28:07 +00:00
|
|
|
bool decoration() const { return m_decoration; }
|
2019-08-28 01:36:59 +00:00
|
|
|
bool dpiHdrOnly() const { return m_dpiHdrOnly; }
|
2018-10-25 23:45:06 +00:00
|
|
|
bool dumpDefines() const { return m_dumpDefines; }
|
2006-08-26 11:35:28 +00:00
|
|
|
bool exe() const { return m_exe; }
|
2019-10-17 23:44:10 +00:00
|
|
|
bool gmake() const { return m_gmake; }
|
2018-07-23 00:54:28 +00:00
|
|
|
bool threadsDpiPure() const { return m_threadsDpiPure; }
|
|
|
|
bool threadsDpiUnpure() const { return m_threadsDpiUnpure; }
|
|
|
|
bool threadsCoarsen() const { return m_threadsCoarsen; }
|
2006-08-26 11:35:28 +00:00
|
|
|
bool trace() const { return m_trace; }
|
2019-10-27 13:27:18 +00:00
|
|
|
bool traceCoverage() const { return m_traceCoverage; }
|
2006-08-26 11:35:28 +00:00
|
|
|
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); }
|
2019-11-16 16:59:21 +00:00
|
|
|
bool pedantic() const { return m_pedantic; }
|
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-10-26 01:17:25 +00:00
|
|
|
bool ppComments() const { return m_ppComments; }
|
2018-05-20 13:12:29 +00:00
|
|
|
bool profCFuncs() const { return m_profCFuncs; }
|
2018-07-23 00:54:28 +00:00
|
|
|
bool profThreads() const { return m_profThreads; }
|
2019-10-06 17:24:21 +00:00
|
|
|
bool protectIds() const { return m_protectIds; }
|
2006-08-26 11:35:28 +00:00
|
|
|
bool allPublic() const { return m_public; }
|
2019-09-23 11:56:07 +00:00
|
|
|
bool publicFlatRW() const { return m_publicFlatRW; }
|
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; }
|
2020-03-15 12:09:51 +00:00
|
|
|
bool quietExit() const { return m_quietExit; }
|
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
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
int convergeLimit() const { return m_convergeLimit; }
|
|
|
|
int dumpTree() const { return m_dumpTree; }
|
|
|
|
int gateStmts() const { return m_gateStmts; }
|
|
|
|
int ifDepth() const { return m_ifDepth; }
|
|
|
|
int inlineMult() const { return m_inlineMult; }
|
2019-11-01 00:59:52 +00:00
|
|
|
VOptionBool makeDepend() const { return m_makeDepend; }
|
2020-01-21 11:17:31 +00:00
|
|
|
int maxNumWidth() const { return m_maxNumWidth; }
|
2019-05-19 20:13:13 +00:00
|
|
|
int moduleRecursionDepth() const { return m_moduleRecursion; }
|
|
|
|
int outputSplit() const { return m_outputSplit; }
|
|
|
|
int outputSplitCFuncs() const { return m_outputSplitCFuncs; }
|
|
|
|
int outputSplitCTrace() const { return m_outputSplitCTrace; }
|
|
|
|
int pinsBv() const { return m_pinsBv; }
|
2019-11-01 00:59:52 +00:00
|
|
|
VOptionBool skipIdentical() const { return m_skipIdentical; }
|
2018-05-29 23:49:27 +00:00
|
|
|
int threads() const { return m_threads; }
|
2018-07-23 00:54:28 +00:00
|
|
|
int threadsMaxMTasks() const { return m_threadsMaxMTasks; }
|
2018-05-29 23:49:27 +00:00
|
|
|
bool mtasks() const { return (m_threads > 1); }
|
2018-08-28 10:41:17 +00:00
|
|
|
int traceDepth() const { return m_traceDepth; }
|
|
|
|
TraceFormat traceFormat() const { return m_traceFormat; }
|
2019-05-19 20:13:13 +00:00
|
|
|
int traceMaxArray() const { return m_traceMaxArray; }
|
|
|
|
int traceMaxWidth() const { return m_traceMaxWidth; }
|
|
|
|
int unrollCount() const { return m_unrollCount; }
|
|
|
|
int unrollStmts() const { return m_unrollStmts; }
|
2006-08-26 11:35:28 +00:00
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
int compLimitBlocks() const { return m_compLimitBlocks; }
|
|
|
|
int compLimitMembers() const { return m_compLimitMembers; }
|
|
|
|
int compLimitParens() const { return m_compLimitParens; }
|
2007-04-19 18:20:16 +00:00
|
|
|
|
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; }
|
2019-10-06 17:24:21 +00:00
|
|
|
string protectKey() const { return m_protectKey; }
|
|
|
|
string protectKeyDefaulted(); // Set default key if not set by user
|
2019-10-09 10:47:26 +00:00
|
|
|
string protectLib() const { return m_protectLib; }
|
|
|
|
string protectLibName(bool shared) {
|
|
|
|
string libName = "lib"+protectLib();
|
|
|
|
if (shared) {
|
|
|
|
libName += ".so";
|
|
|
|
} else {
|
|
|
|
libName += ".a";
|
|
|
|
}
|
|
|
|
return libName;
|
|
|
|
}
|
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; }
|
2019-11-01 01:17:05 +00:00
|
|
|
string xmlOutput() const { return m_xmlOutput; }
|
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; }
|
|
|
|
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; }
|
|
|
|
|
2018-08-28 10:41:17 +00:00
|
|
|
string traceClassBase() const { return m_traceFormat.classBase(); }
|
2020-03-02 02:39:23 +00:00
|
|
|
string traceClassLang() const { return m_traceFormat.classBase() + (systemC() ? "Sc" : "C"); }
|
|
|
|
string traceSourceBase() const { return m_traceFormat.sourceName(); }
|
|
|
|
string traceSourceLang() const {
|
|
|
|
return m_traceFormat.sourceName() + (systemC() ? "_sc" : "_c");
|
|
|
|
}
|
2010-01-24 23:37:01 +00:00
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
// METHODS (from main)
|
|
|
|
static string version();
|
2019-05-19 20:13:13 +00:00
|
|
|
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);
|
2018-08-25 13:52:45 +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)
|
2018-08-25 13:52:45 +00:00
|
|
|
string fileExists(const string& filename);
|
2019-05-19 20:13:13 +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);
|
2018-08-25 13:52:45 +00:00
|
|
|
static bool fileStatDir(const string& filename);
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
2019-05-19 20:13:13 +00:00
|
|
|
#endif // guard
|