Fix reserved keywords reaching emitter (#7666)
This commit is contained in:
parent
3bc7021211
commit
70045433c9
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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()
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue