Fix reserved keywords reaching emitter (#7666)

This commit is contained in:
Pawel Kojma 2026-05-28 16:04:14 +02:00 committed by GitHub
parent 3bc7021211
commit 70045433c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 42 additions and 0 deletions

View File

@ -83,6 +83,7 @@ class NameVisitor final : public VNVisitorConst {
VL_RESTORER(m_modp);
m_modp = nodep;
iterateChildrenConst(nodep);
rename(nodep, false);
}
// Add __PVT__ to names of local signals
void visit(AstVar* nodep) override {

View File

@ -0,0 +1,7 @@
%Warning-SYMRSVDWORD: t/t_module_reserved_keyword.v:7:8: Symbol matches C++ common word: 'interrupt'
: ... note: In instance 'interrupt'
7 | module interrupt (
| ^~~~~~~~~
... For warning description see https://verilator.org/warn/SYMRSVDWORD?v=latest
... Use "/* verilator lint_off SYMRSVDWORD */" and lint_on around source to disable this message.
%Error: Exiting due to

View File

@ -0,0 +1,23 @@
#!/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("simulator")
test.compile(
verilator_flags2=[
"-fno-inline",
"--coverage",
],
fails=True,
expect_filename=test.golden_filename,
)
test.passes()

View File

@ -0,0 +1,11 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2026 Antmicro
// SPDX-License-Identifier: CC0-1.0
module interrupt (
input logic clk_i = 1,
input logic rst_ni = 1
);
endmodule