Files
lucisv/crates/vlog_linter/tests/cases/parameter_placement.lint
T
lucioandClaude Fable 5 8adb6c8ac1 Linter expansion, wave 3: the remaining nineteen Verible rules, forbidden-macro, void-cast's forbidden calls, and the e2e options case
TODO section 35 (54 -> 73 rules: every rule in Verible's published
list but forbid-implicit-declarations).
module-begin-block, legacy-generate-region, legacy-genvar-declaration,
v2001-generate-begin, explicit-function-lifetime,
explicit-task-lifetime (both exempt out-of-body definitions after a
census showed 948 of 960 findings were exactly that shape),
positive-meaning-parameter-name, suggest-parentheses (safe fix,
truth-tabled), unpacked-dimensions-range-ordering, uvm-macro-semicolon,
create-object-name-match, numeric-format-string-style,
macro-string-concatenation, disable-statement, forbidden-macro,
endif-comment (safe fix), forbid-line-continuations, dff-name-style,
proper-parameter-declaration. Verible's forbidden-symbol is the
source-file name of invalid-system-task-function (read in its
rule .cc), so it is that rule's symbols option, nothing fires twice;
void-cast gains forbidden_calls. Shared readers: walk_items_scoped,
exprs.rs, preproc.rs. A checked-in e2e case drives lucisv.lint.options
over the wire. Two rules fire on an error leaf because the parser
refuses a module-scope begin/end and a bare generate begin - filed as
docs/topo.md 2.9-25.
3 695 tests / 48 binaries; corpus 814/820 byte-identical to 0.38.0;
opentitan default-set census 1 053 -> 1 169, the arithmetic balancing
to the six default-on additions; timing unchanged.

docs/features/linter-expansion-3/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-04 04:55:10 -05:00

40 lines
1.1 KiB
Plaintext

#select positive-meaning-parameter-name
# a parameter named for what it turns off
module m #(
parameter int DisableEcc = 0
//^ 17 positive-meaning-parameter-name
) ();
localparam int disable_crc = 1;
//^ 18 positive-meaning-parameter-name
localparam int EnableEcc = 1;
endmodule
====
#select proper-parameter-declaration
# `parameter` in a body, `localparam` in a formal list
module m #(
parameter int Width = 8,
localparam int Half = Width / 2
) ();
parameter int Depth = 4;
//^ 17 proper-parameter-declaration
localparam int Mask = 3;
endmodule
====
#select proper-parameter-declaration
# a package takes `localparam` by default and `parameter` only when told to
package p;
localparam int A = 1;
parameter int B = 2;
//^ 17 proper-parameter-declaration
endpackage
====
#select proper-parameter-declaration
#options proper-parameter-declaration.package_allow_parameter = true
#options proper-parameter-declaration.package_allow_localparam = false
# the two options move the line in opposite directions
package p;
localparam int A = 1;
//^ 18 proper-parameter-declaration
parameter int B = 2;
endpackage