mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add --instr-count-dpi option, change default to 200
This replaces the former static AstNode::INSTR_COUNT_DPI, and makes it user adjustable to fit the design. Fixes #3068.
This commit is contained in:
@@ -1524,7 +1524,6 @@ public:
|
||||
static constexpr int INSTR_COUNT_STR = 100; // String ops
|
||||
static constexpr int INSTR_COUNT_TIME = INSTR_COUNT_CALL + 5; // Determine simulation time
|
||||
static constexpr int INSTR_COUNT_PLI = 20; // PLI routines
|
||||
static constexpr int INSTR_COUNT_DPI = 1000; // DPI import function
|
||||
|
||||
// ACCESSORS
|
||||
virtual string name() const { return ""; }
|
||||
|
||||
+3
-1
@@ -8788,7 +8788,9 @@ public:
|
||||
}
|
||||
//
|
||||
virtual void name(const string& name) override { m_name = name; }
|
||||
virtual int instrCount() const override { return dpiImportPrototype() ? INSTR_COUNT_DPI : 0; }
|
||||
virtual int instrCount() const override {
|
||||
return dpiImportPrototype() ? v3Global.opt.instrCountDpi() : 0;
|
||||
}
|
||||
VBoolOrUnknown isConst() const { return m_isConst; }
|
||||
void isConst(bool flag) { m_isConst.setTrueOrFalse(flag); }
|
||||
void isConst(VBoolOrUnknown flag) { m_isConst = flag; }
|
||||
|
||||
@@ -1101,6 +1101,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||
DECL_OPTION("-if-depth", Set, &m_ifDepth);
|
||||
DECL_OPTION("-ignc", OnOff, &m_ignc);
|
||||
DECL_OPTION("-inline-mult", Set, &m_inlineMult);
|
||||
DECL_OPTION("-instr-count-dpi", CbVal, [this, fl](int val) {
|
||||
m_instrCountDpi = val;
|
||||
if (m_instrCountDpi < 0) fl->v3fatal("--instr-count-dpi must be non-negative: " << val);
|
||||
});
|
||||
|
||||
DECL_OPTION("-LDFLAGS", CbVal, callStrSetter(&V3Options::addLdLibs));
|
||||
const auto setLang = [this, fl](const char* valp) {
|
||||
|
||||
@@ -289,6 +289,7 @@ private:
|
||||
int m_gateStmts = 100; // main switch: --gate-stmts
|
||||
int m_ifDepth = 0; // main switch: --if-depth
|
||||
int m_inlineMult = 2000; // main switch: --inline-mult
|
||||
int m_instrCountDpi = 200; // main switch: --instr-count-dpi
|
||||
VOptionBool m_makeDepend; // main switch: -MMD
|
||||
int m_maxNumWidth = 65536; // main switch: --max-num-width
|
||||
int m_moduleRecursion = 100; // main switch: --module-recursion-depth
|
||||
@@ -489,6 +490,7 @@ public:
|
||||
int gateStmts() const { return m_gateStmts; }
|
||||
int ifDepth() const { return m_ifDepth; }
|
||||
int inlineMult() const { return m_inlineMult; }
|
||||
int instrCountDpi() const { return m_instrCountDpi; }
|
||||
VOptionBool makeDepend() const { return m_makeDepend; }
|
||||
int maxNumWidth() const { return m_maxNumWidth; }
|
||||
int moduleRecursionDepth() const { return m_moduleRecursion; }
|
||||
|
||||
Reference in New Issue
Block a user