verilator/test_regress/t/t_genvar_misuse_bad.v

27 lines
591 B
Systemverilog
Raw Normal View History

2012-03-10 01:34:02 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2012 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
2012-03-10 01:34:02 +01:00
// See bug408
module top (
output logic [1:0] q,
input logic [1:0] d,
input logic clk
);
genvar i;
assign q[i] = d[i]; // <--- Error: Misusing genvar i
genvar a, b, c;
for (a = 0; a < 2; ++a) begin
if (a);
for (b = 0; b < 2; ++b) begin
if (a);
if (b);
if (c); // <--- Error: Misusing genvar c
end
end
2012-03-10 01:34:02 +01:00
endmodule