Change `--lint-only` and `--json-only` to imply `--timing` (#6790).

This commit is contained in:
Wilson Snyder 2025-12-17 19:24:43 -05:00
parent 12ff481689
commit b90865a08a
50 changed files with 685 additions and 377 deletions

View File

@ -15,6 +15,7 @@ Verilator 5.043 devel
* This is the last release supporting the deprecated `--xml-only` and * This is the last release supporting the deprecated `--xml-only` and
`--make cmake` options. `--make cmake` options.
* Change `--lint-only` and `--json-only` to imply `--timing` (#6790).
**Other:** **Other:**

View File

@ -1006,6 +1006,8 @@ Summary:
You may also want the :vlopt:`-Wall` option to enable messages You may also want the :vlopt:`-Wall` option to enable messages
considered stylistic and not enabled by default. considered stylistic and not enabled by default.
Implies :vlopt:`--timing` unless :vlopt:`--no-timing` was used.
If the design is not to be completely Verilated, see also the If the design is not to be completely Verilated, see also the
:vlopt:`--bbox-sys` and :vlopt:`--bbox-unsup` options. :vlopt:`--bbox-sys` and :vlopt:`--bbox-unsup` options.

View File

@ -1039,6 +1039,10 @@ void V3Options::notify() VL_MT_DISABLED {
&& !v3Global.opt.serializeOnly()); && !v3Global.opt.serializeOnly());
} }
if (m_timing.isDefault()
&& (v3Global.opt.jsonOnly() || v3Global.opt.lintOnly() || v3Global.opt.xmlOnly()))
v3Global.opt.m_timing.setTrueOrFalse(true);
if (trace()) { if (trace()) {
// With --trace-vcd, --trace-threads is ignored // With --trace-vcd, --trace-threads is ignored
if (traceEnabledVcd()) m_traceThreads = 1; if (traceEnabledVcd()) m_traceThreads = 1;

View File

@ -11,7 +11,7 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.extract(in_filename=test.top_filename, test.extract(in_filename=test.top_filename,
out_filename=test.root + "/docs/gen/ex_SUPERNFIRST_faulty.rst", out_filename=test.root + "/docs/gen/ex_SUPERNFIRST_faulty.rst",

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -12,7 +12,7 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--lint-only", "-libmap t/t_config_libmap_inc.map"], test.lint(verilator_flags2=["-libmap t/t_config_libmap_inc.map"],
fails=test.vlt_all, fails=test.vlt_all,
expect_filename=test.golden_filename) expect_filename=test.golden_filename)

View File

@ -15,7 +15,7 @@ test.lint(
# We also have dump-tree turned on, so hit a lot of AstNode*::dump() functions # We also have dump-tree turned on, so hit a lot of AstNode*::dump() functions
# Likewise XML # Likewise XML
v_flags=[ v_flags=[
"--lint-only --timing", "--lint-only",
"--dumpi-tree 9 --dumpi-V3EmitV 9 --debug-emitv", # Dev coverage of the V3EmitV code "--dumpi-tree 9 --dumpi-V3EmitV 9 --debug-emitv", # Dev coverage of the V3EmitV code
"--dump-graph --dumpi-tree-json 9 --no-json-ids" "--dump-graph --dumpi-tree-json 9 --no-json-ids"
]) ])

View File

@ -15,6 +15,6 @@ test.top_filename = "t/t_debug_emitv.v"
test.lint( test.lint(
# We also have dump-tree turned on, so hit a lot of AstNode*::dump() functions # We also have dump-tree turned on, so hit a lot of AstNode*::dump() functions
# Likewise XML # Likewise XML
v_flags=["--lint-only --dumpi-tree 9 --dump-tree-addrids --timing"]) v_flags=["--lint-only --dumpi-tree 9 --dump-tree-addrids"])
test.passes() test.passes()

View File

@ -11,8 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--lint-only --timing'], test.lint(fails=True, expect_filename=test.golden_filename)
fails=True,
expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -12,7 +12,7 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.top_filename = 't/t_event_control_star_never.v' test.top_filename = 't/t_event_control_star_never.v'
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.extract(in_filename=test.top_filename, test.extract(in_filename=test.top_filename,
out_filename=test.root + "/docs/gen/ex_ALWNEVER_faulty.rst", out_filename=test.root + "/docs/gen/ex_ALWNEVER_faulty.rst",

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.lint(expect_filename=test.golden_filename, verilator_flags2=['--assert --timing'], fails=True) test.lint(expect_filename=test.golden_filename, verilator_flags2=['--assert'], fails=True)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('simulator') test.scenarios('simulator')
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -1,3 +1,8 @@
%Warning-RISEFALLDLY: t/t_gate_basic.v:26:12: Unsupported: rising/falling/turn-off delays. Using the first delay
26 | nand #(2,3) ND0 (nd0, a[0], b[0], b[1]);
| ^
... For warning description see https://verilator.org/warn/RISEFALLDLY?v=latest
... Use "/* verilator lint_off RISEFALLDLY */" and lint_on around source to disable this message.
%Warning-SPECIFYIGN: t/t_gate_basic.v:50:27: Ignoring unsupported: specify block construct %Warning-SPECIFYIGN: t/t_gate_basic.v:50:27: Ignoring unsupported: specify block construct
50 | (nt0 *> nt0) = (0, 0); 50 | (nt0 *> nt0) = (0, 0);
| ^ | ^
@ -6,17 +11,4 @@
%Warning-SPECIFYIGN: t/t_gate_basic.v:60:32: Ignoring unsupported: specify block construct %Warning-SPECIFYIGN: t/t_gate_basic.v:60:32: Ignoring unsupported: specify block construct
60 | (A1 *> Q) = (a$A1$Y, a$A1$Y); 60 | (A1 *> Q) = (a$A1$Y, a$A1$Y);
| ^ | ^
%Error-NEEDTIMINGOPT: t/t_gate_basic.v:24:10: Use --timing or --no-timing to specify how timing controls should be handled
: ... note: In instance 't'
24 | not #(0.108) NT0 (nt0, a[0]);
| ^
... For error description see https://verilator.org/warn/NEEDTIMINGOPT?v=latest
%Error-NEEDTIMINGOPT: t/t_gate_basic.v:25:10: Use --timing or --no-timing to specify how timing controls should be handled
: ... note: In instance 't'
25 | and #1 AN0 (an0, a[0], b[0]);
| ^
%Error-NEEDTIMINGOPT: t/t_gate_basic.v:26:10: Use --timing or --no-timing to specify how timing controls should be handled
: ... note: In instance 't'
26 | nand #(2,3) ND0 (nd0, a[0], b[0], b[1]);
| ^
%Error: Exiting due to %Error: Exiting due to

View File

@ -12,9 +12,7 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.top_filename = "t/t_gate_basic.v" test.top_filename = "t/t_gate_basic.v"
test.lint(verilator_flags2=[ test.lint(verilator_flags2=["-Wall", "-Wno-DECLFILENAME -Wno-SPECIFYIGN -Wno-UNUSED"],
"--lint-only --timing -Wall", "-Wno-DECLFILENAME -Wno-SPECIFYIGN -Wno-UNUSED"
],
fails=True, fails=True,
expect_filename=test.golden_filename) expect_filename=test.golden_filename)

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,7 +11,7 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=test.vlt_all, expect_filename=test.golden_filename) test.lint(fails=test.vlt_all, expect_filename=test.golden_filename)
test.extract(in_filename=test.top_filename, test.extract(in_filename=test.top_filename,
out_filename=test.root + "/docs/gen/ex_FUNCTIMECTL_faulty.rst", out_filename=test.root + "/docs/gen/ex_FUNCTIMECTL_faulty.rst",

View File

@ -12,6 +12,6 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.top_filename = "t/t_timing_wait1.v" test.top_filename = "t/t_timing_wait1.v"
test.lint(verilator_flags2=["--timing"], expect_filename=test.golden_filename, fails=True) test.lint(expect_filename=test.golden_filename, fails=True)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.lint(expect_filename=test.golden_filename, verilator_flags2=['--timing'], fails=True) test.lint(expect_filename=test.golden_filename, fails=True)
test.passes() test.passes()

View File

@ -12,6 +12,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.top_filename = "t/t_timing_clkgen1.v" test.top_filename = "t/t_timing_clkgen1.v"
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -12,6 +12,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.top_filename = "t/t_timing_dpi_unsup.v" test.top_filename = "t/t_timing_dpi_unsup.v"
test.lint(verilator_flags2=["--timing"], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.lint(verilator_flags2=["--timing"]) test.lint()
test.passes() test.passes()

View File

@ -12,9 +12,10 @@ import vltest_bootstrap
test.scenarios('vlt') test.scenarios('vlt')
test.top_filename = "t/t_vlt_match_error.v" test.top_filename = "t/t_vlt_match_error.v"
test.lint( test.compile(verilator_flags2=[
verilator_flags2=["-DT_VLT_MATCH_ERROR_3 -Wall t/t_vlt_match_error.v t/t_vlt_match_error.vlt"], "-DT_VLT_MATCH_ERROR_3 --cc -Wall t/t_vlt_match_error.v t/t_vlt_match_error.vlt"
fails=True, ],
expect_filename=test.golden_filename) fails=True,
expect_filename=test.golden_filename)
test.passes() test.passes()

View File

@ -11,6 +11,6 @@ import vltest_bootstrap
test.scenarios('linter') test.scenarios('linter')
test.lint(verilator_flags2=['--timing'], fails=True, expect_filename=test.golden_filename) test.lint(fails=True, expect_filename=test.golden_filename)
test.passes() test.passes()