With -Wpendantic allow circular assigns
This commit is contained in:
parent
5064a5ee65
commit
c1d1b333ac
|
|
@ -2229,7 +2229,9 @@ class ConstVisitor final : public VNVisitor {
|
|||
&& !VN_IS(nodep, AssignDly)) {
|
||||
// X = X. Quite pointless, though X <= X may override another earlier assignment
|
||||
if (VN_IS(nodep, AssignW)) {
|
||||
nodep->v3error("Wire inputs its own output, creating circular logic (wire x=x)");
|
||||
if (!v3Global.opt.pedantic())
|
||||
nodep->v3error(
|
||||
"Wire inputs its own output, creating circular logic (wire x=x)");
|
||||
return false; // Don't delete the assign, or V3Gate will freak out
|
||||
} else {
|
||||
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ for s in [
|
|||
'Unsupported: Size-changing cast on non-basic data type',
|
||||
'Unsupported: Slice of non-constant bounds',
|
||||
'Unsupported: Stream operation on a variable of a type',
|
||||
'Unsupported: Unclocked assertion',
|
||||
'Unsupported: Using --protect-ids with public function',
|
||||
'Unsupported: Verilog 1995 gate primitive:',
|
||||
'Unsupported: [] dimensions',
|
||||
|
|
@ -153,7 +152,6 @@ for s in [
|
|||
'Unsupported: super',
|
||||
'Unsupported: with[] stream expression',
|
||||
'expected non-complex non-double',
|
||||
'is not an unpacked array, but is in an unpacked array context',
|
||||
'loading other than unpacked-array variable',
|
||||
'loading other than unpacked/associative-array variable',
|
||||
]:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
#!/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_st')
|
||||
|
||||
test.compile(verilator_flags2=['--binary --Wpedantic'])
|
||||
|
||||
test.execute()
|
||||
|
||||
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 Wilson Snyder
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t;
|
||||
wire w;
|
||||
assign w = w;
|
||||
initial $finish;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
%Error: t/t_lint_wireloop.v:9:12: Wire inputs its own output, creating circular logic (wire x=x)
|
||||
9 | assign w = w;
|
||||
| ^
|
||||
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
|
||||
%Error: Exiting due to
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/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('linter')
|
||||
test.top_filename = "t/t_lint_wireloop.v"
|
||||
|
||||
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||
|
||||
test.passes()
|
||||
Loading…
Reference in New Issue