Commentary/Tests: Describe PARAMNODEFAULT as top.

Fixes #7441.
This commit is contained in:
Wilson Snyder 2026-04-18 11:34:19 -04:00
parent 0537999b1d
commit 707dcea914
4 changed files with 39 additions and 3 deletions

View File

@ -1524,7 +1524,12 @@ List Of Warnings
ANSI-style `#(...)` declarations. IEEE 1800-2023 6.20.1 requires this
error, but some simulators accept this syntax.
Faulty example:
Also issued with ANSI format where a parameter without default is
present in the top-level module, and as such Verilator cannot know how
to process that module. For such cases suggest adding a default so the
module can lint cleanly.
Faulty non-ANSI example:
.. include:: ../../docs/gen/ex_PARAMNODEFAULT_faulty.rst
@ -1534,8 +1539,8 @@ List Of Warnings
To fix the issue, move to an ANSI-style declaration.
Suppressing this error will only suppress the IEEE-required check; it
will simulate correctly.
For the non-ANSI case, suppressing this error will only suppress the
IEEE-required check; it will simulate correctly.
.. option:: PINCONNECTEMPTY

View File

@ -0,0 +1,6 @@
%Error: t/t_lint_paramnodefault_top_bad.v:8:13: Parameter without default value is never given value (IEEE 1800-2023 6.20.1): 'NODEF'
: ... note: In instance 't'
8 | parameter NODEF);
| ^~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: Exiting due to

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of either the GNU Lesser General Public License Version 3
# or the Perl Artistic License Version 2.0.
# SPDX-FileCopyrightText: 2024 Wilson Snyder
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
import vltest_bootstrap
test.scenarios('linter')
test.lint(fails=True, expect_filename=test.golden_filename)
test.passes()

View File

@ -0,0 +1,9 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2025 Wilson Snyder
// SPDX-License-Identifier: CC0-1.0
module t #(
parameter NODEF); //<--- Warning
endmodule