verilator/test_regress/t/t_lint_latch_6.v
2023-09-15 18:12:11 -04:00

27 lines
543 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module for issue #221
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2023 by Julien Margetts (Originally provided by Adrien Le Masle)
// SPDX-License-Identifier: Unlicense
module verilator_latch
(
input logic state,
output logic [31:0] b
);
function logic [31:0 ] toto ();
logic [31:0] res;
res = 10;
return res;
endfunction
always_comb
begin
b = 0;
if (state)
b = toto();
end
endmodule;