Fix not reporting class reference with extra parameters (#5467).

This commit is contained in:
Wilson Snyder 2024-10-04 05:38:36 -04:00
parent d06f986b51
commit fd9f5ab34e
5 changed files with 44 additions and 0 deletions

View File

@ -63,6 +63,7 @@ Verilator 5.029 devel
* Fix foreach colliding index names (#5444). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix fault on defparam with UNSUPPORTED ignored (#5450). [Luiza de Melo]
* Fix class reference with pin that is a class reference (#5454).
* Fix not reporting class reference with extra parameters (#5467).
* Fix user-type parameter overlap (#5469). [Todd Strader]
* Fix tracing when name() is empty (#5470). [Sam Shahrestani]
* Fix timing mode not exiting on empty events (#5472).

View File

@ -3943,6 +3943,7 @@ class LinkDotResolveVisitor final : public VNVisitor {
UINFO(5, indent() << "visit " << nodep << endl);
if (AstNode* const cpackagep = nodep->classOrPackageOpp()) {
if (AstClassOrPackageRef* const cpackagerefp = VN_CAST(cpackagep, ClassOrPackageRef)) {
iterate(cpackagerefp);
const AstClass* const clsp = VN_CAST(cpackagerefp->classOrPackageNodep(), Class);
if (clsp && clsp->isParameterized()) {
// Unable to link before the instantiation of parameter classes.

View File

@ -0,0 +1,11 @@
%Error-PINNOTFOUND: t/t_class_param_extra_bad.v:13:21: Parameter not found: '__paramNumber1'
13 | localparam Cls1#(123, integer, "text")::bool_t PARAM = 1;
| ^~~
... For error description see https://verilator.org/warn/PINNOTFOUND?v=latest
%Error-PINNOTFOUND: t/t_class_param_extra_bad.v:13:26: Parameter not found: '__paramNumber2'
13 | localparam Cls1#(123, integer, "text")::bool_t PARAM = 1;
| ^~~~~~~
%Error-PINNOTFOUND: t/t_class_param_extra_bad.v:13:35: Parameter not found: '__paramNumber3'
13 | localparam Cls1#(123, integer, "text")::bool_t PARAM = 1;
| ^~~~~~
%Error: Exiting due to

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python3
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2024 by Wilson Snyder. 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-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,15 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2024 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t;
class Cls1;
typedef bit bool_t;
endclass
localparam Cls1#(123, integer, "text")::bool_t PARAM = 1;
endmodule