diff --git a/Changes b/Changes index 5582bb781..1bf99b727 100644 --- a/Changes +++ b/Changes @@ -34,6 +34,7 @@ Verilator 5.041 devel * Change developer coverage flow and add configure `--enable-dev-gcov` (#6526). [Geza Lore] * Change `verilator_difftree` to return exit code 1 on mismatch, 2 on error. * Change default thread pool sizes to respect processor affinity (#6604). [Geza Lore] +* Change `--preproc-comments` to be new name of `--pp-comments` option. * Support modports referencing clocking blocks (#4555) (#6436). [Ryszard Rozak, Antmicro Ltd.] * Support class package reference on pattern keys (#5653). [Todd Strader] * Support digits in `$sscanf` field width formats (#6083). [Iztok Jeras] diff --git a/bin/verilator b/bin/verilator index 503c29e7f..ec6c5bcd9 100755 --- a/bin/verilator +++ b/bin/verilator @@ -453,8 +453,8 @@ detailed descriptions of these arguments. --pins-uint8 Specify types for top-level ports --no-pins64 Don't use uint64_t's for 33-64 bit sigs --pipe-filter Filter all input through a script - --pp-comments Show preprocessor comments with -E --prefix Name of top-level class + --preproc-comments Include preprocessor comments in the output with -E --preproc-resolve Include all found modules in the output with -E --preproc-token-limit Maximum tokens on a line allowed by preprocessor --private Debugging; see docs diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 03a5de617..de9185386 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -539,8 +539,8 @@ Summary: out. Beware of enabling debugging messages, as they will also go to standard out. See :vlopt:`--no-std`, which is implied by this. - See also :vlopt:`--dump-defines`, :vlopt:`-P`, :vlopt:`--pp-comments` - and :vlopt:`--preproc-resolve` options. + See also :vlopt:`--dump-defines`, :vlopt:`-P`, + :vlopt:`--preproc-comments` and :vlopt:`--preproc-resolve` options. .. option:: --emit-accessors @@ -1267,7 +1267,8 @@ Summary: .. option:: --pp-comments - With :vlopt:`-E`, show comments in preprocessor output. + Deprecated. In versions before 5.042, the name for + :vlopt:`--preproc-comments`. .. option:: --prefix @@ -1275,6 +1276,10 @@ Summary: prepended to the name of the :vlopt:`--top` option, or V prepended to the first Verilog filename passed on the command line. +.. option:: --preproc-comments + + With :vlopt:`-E`, show comments in preprocessor output. + .. option:: --preproc-resolve With :vlopt:`-E`, resolve referenced instance modules, to include diff --git a/src/V3Options.cpp b/src/V3Options.cpp index e42a1d645..0b66446a5 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1612,11 +1612,12 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, }); DECL_OPTION("-pins-uint8", OnOff, &m_pinsUint8); DECL_OPTION("-pipe-filter", Set, &m_pipeFilter); - DECL_OPTION("-pp-comments", OnOff, &m_ppComments); + DECL_OPTION("-pp-comments", OnOff, &m_preprocComments).undocumented(); // Renamed DECL_OPTION("-prefix", CbVal, [this, fl](const char* valp) { validateIdentifier(fl, valp, "--prefix"); m_prefix = valp; }); + DECL_OPTION("-preproc-comments", OnOff, &m_preprocComments); DECL_OPTION("-preproc-resolve", OnOff, &m_preprocResolve); DECL_OPTION("-preproc-token-limit", CbVal, [this, fl](const char* valp) { m_preprocTokenLimit = std::atoi(valp); diff --git a/src/V3Options.h b/src/V3Options.h index 551b0a815..fe00ec2f5 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -267,7 +267,7 @@ private: bool m_pinsScUintBool = false; // main switch: --pins-sc-uint-bool bool m_pinsScBigUint = false; // main switch: --pins-sc-biguint bool m_pinsUint8 = false; // main switch: --pins-uint8 - bool m_ppComments = false; // main switch: --pp-comments + bool m_preprocComments = false; // main switch: --preproc-comments bool m_profC = false; // main switch: --prof-c bool m_profCFuncs = false; // main switch: --prof-cfuncs bool m_profExec = false; // main switch: --prof-exec @@ -554,7 +554,7 @@ public: bool pinsScUintBool() const { return m_pinsScUintBool; } bool pinsScBigUint() const VL_MT_SAFE { return m_pinsScBigUint; } bool pinsUint8() const { return m_pinsUint8; } - bool ppComments() const { return m_ppComments; } + bool preprocComments() const { return m_preprocComments; } bool profC() const { return m_profC; } bool profCFuncs() const { return m_profCFuncs; } bool profExec() const { return m_profExec; } diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 5fd727637..167ac6c59 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -444,7 +444,7 @@ bool V3PreProcImp::commentTokenMatch(string& cmdr, const char* strg) { void V3PreProcImp::comment(const string& text) { // Comment detected. Only keep relevant data. bool printed = false; - if (v3Global.opt.preprocOnly() && v3Global.opt.ppComments()) { + if (v3Global.opt.preprocOnly() && v3Global.opt.preprocComments()) { insertUnreadback(text); printed = true; } diff --git a/test_regress/t/t_dist_docs_options.py b/test_regress/t/t_dist_docs_options.py index 4ba77526e..e02e9603d 100755 --- a/test_regress/t/t_dist_docs_options.py +++ b/test_regress/t/t_dist_docs_options.py @@ -18,6 +18,7 @@ Doc_Waivers = [ '-clk', # Deprecated '-lineno', # Deprecated '-order-clock-delay', # Deprecated + '-pp-comments', # Deprecated '-prof-threads', # Deprecated ] diff --git a/test_regress/t/t_preproc_comments.py b/test_regress/t/t_preproc_comments.py index 87b6cbeb8..54493536f 100755 --- a/test_regress/t/t_preproc_comments.py +++ b/test_regress/t/t_preproc_comments.py @@ -14,7 +14,7 @@ test.top_filename = "t/t_preproc.v" stdout_filename = os.path.join(test.obj_dir, test.name + "__test.vpp") -test.compile(verilator_flags2=['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --pp-comments'], +test.compile(verilator_flags2=['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --preproc-comments'], verilator_make_gmake=False, make_top_shell=False, make_main=False,