verilator/test_regress/t/t_lint_latch_4.v

28 lines
537 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module for Issue#2938
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2021 by Julien Margetts (Originally provided by YanJiun)
module test (
input [2:0] a,
input [3:0] c,
output reg [7:0] b
);
integer i;
always @ (*)
begin
case(a)
{3'b000}: b = 8'd1;
{3'b001}:
for(i=0;i<4;i=i+1) b[i*2+:2] = 2'(c[i]);
{3'b010}: b = 8'd3;
{3'b011}: b = 8'd4;
default : b = 0;
endcase
end
endmodule