diff --git a/src/V3Param.cpp b/src/V3Param.cpp index 63c6ecfee..076d2400a 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -159,6 +159,7 @@ private: nodep->deleteTree(); nodep=NULL; } virtual void visit(AstGenIf* nodep, AstNUser*) { + UINFO(9," GENIF "<condp()->iterateAndNext(*this); V3Width::widthParamsEdit(nodep); // Param typed widthing will NOT recurse the body V3Const::constifyParamsEdit(nodep->condp()); // condp may change @@ -181,11 +182,13 @@ private: virtual void visit(AstGenFor* nodep, AstNUser*) { // We parse a very limited form of FOR, so we don't need to do a full // simulation to unroll the loop + UINFO(9," GENFOR "<exprp()->iterateAndNext(*this); V3Case::caseLint(nodep); diff --git a/test_regress/t/t_genvar_misuse_bad.pl b/test_regress/t/t_genvar_misuse_bad.pl new file mode 100755 index 000000000..157752980 --- /dev/null +++ b/test_regress/t/t_genvar_misuse_bad.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2003 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. + +$Self->{vlt} and $Self->skip("Verilator unsupported, bug408"); + +compile ( + v_flags2 => ["--lint-only"], + fails=>1, + expect=> +'.*%Error: t/t_genvar_misuse_bad.v:\d+: Use of genvar where not convertible to constant: i +%Error: Exiting due to.*', + ); + +ok(1); +1; diff --git a/test_regress/t/t_genvar_misuse_bad.v b/test_regress/t/t_genvar_misuse_bad.v new file mode 100644 index 000000000..9a7239df7 --- /dev/null +++ b/test_regress/t/t_genvar_misuse_bad.v @@ -0,0 +1,17 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed into the Public Domain, for any use, +// without warranty, 2012 by Wilson Snyder. +// See bug408 + +module top + ( + output logic [1:0] q, + input logic [1:0] d, + input logic clk + ); + + genvar i; + assign q[i] = d[i]; +endmodule +