Fix emitting unbounded parameters (#6912).

Fixes #6912.
This commit is contained in:
Wilson Snyder 2026-01-12 22:56:23 -05:00
parent 8a24897c13
commit 09ca7ea8d1
3 changed files with 20 additions and 14 deletions

View File

@ -389,6 +389,7 @@ Verilator 5.040 2025-08-30
* Fix wide select expansion and substitution (#6341) (#6345). [Geza Lore] * Fix wide select expansion and substitution (#6341) (#6345). [Geza Lore]
* Fix upcasting class type parameters (#6344). [Krzysztof Bieganski, Antmicro Ltd.] * Fix upcasting class type parameters (#6344). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix undefined weak link for Apple GCC etc (#6348). [Congcong Cai] * Fix undefined weak link for Apple GCC etc (#6348). [Congcong Cai]
* Fix emitting unbounded parameters (#6912).
* Fix syntax error on unsupported defparam array (#6915). * Fix syntax error on unsupported defparam array (#6915).

View File

@ -99,6 +99,11 @@ protected:
UASSERT_OBJ(!num.isFourState(), nodep, "4-state value in constant pool"); UASSERT_OBJ(!num.isFourState(), nodep, "4-state value in constant pool");
putns(nodep, num.emitC()); putns(nodep, num.emitC());
} }
void visit(AstUnbounded* nodep) override {
// e.g. when emitting a public parameter's "$" value
// But Unbounded is only special during elaboration, so just use zero
putns(nodep, "0");
}
// Default // Default
void visit(AstNode* nodep) override { // LCOV_EXCL_START void visit(AstNode* nodep) override { // LCOV_EXCL_START

View File

@ -4,9 +4,9 @@
// any use, without warranty, 2014 by Wilson Snyder. // any use, without warranty, 2014 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0 // SPDX-License-Identifier: CC0-1.0
module t(); module t;
localparam UNB = $; parameter int UNB /*verilator public*/ = $;
localparam int UNB2 = $; localparam int UNB2 = $;
localparam SIX = 6; localparam SIX = 6;