verilator/test_regress/t/t_assert_elab.v
Johan Bjork 65be2448dc Fix elaboration-time display warnings, bug1032.
Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
2016-02-04 18:38:59 -05:00

26 lines
625 B
Verilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2015 by Johan Bjork.
module t;
localparam str = "string";
function logic checkParameter(input logic [8:0] N);
$display("x is %d.", N);
if (N == 1)
return 0;
$fatal(1, "Parameter %d is invalid...%s and %s", N, str, "constant both work");
endfunction
`ifdef FAILING_ASSERTIONS
localparam x = checkParameter(5);
`else
localparam x = checkParameter(1);
`endif
initial begin
$write("*-* All Finished *-*\n");
$finish;
end
endmodule