2015-10-24 00:13:25 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
|
|
|
|
// This file ONLY is placed into the Public Domain, for any use,
|
|
|
|
|
// without warranty, 2015 by Johan Bjork.
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2015-10-24 00:13:25 +02:00
|
|
|
|
|
|
|
|
module t;
|
2025-08-30 00:33:14 +02:00
|
|
|
localparam STR = "string";
|
2015-10-24 00:13:25 +02:00
|
|
|
function logic checkParameter(input logic [8:0] N);
|
2025-09-17 02:48:23 +02:00
|
|
|
$info("For %m, x is %d.", N);
|
2015-10-24 00:13:25 +02:00
|
|
|
if (N == 1)
|
|
|
|
|
return 0;
|
2025-08-30 00:33:14 +02:00
|
|
|
$fatal(1, "Parameter %d is invalid...%s and %s", N, STR, "constant both work");
|
2015-10-24 00:13:25 +02:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
`ifdef FAILING_ASSERTIONS
|
2025-08-30 00:33:14 +02:00
|
|
|
localparam X = checkParameter(5);
|
2015-10-24 00:13:25 +02:00
|
|
|
`else
|
2025-08-30 00:33:14 +02:00
|
|
|
localparam X = checkParameter(1);
|
2015-10-24 00:13:25 +02:00
|
|
|
`endif
|
|
|
|
|
|
2025-09-17 02:48:23 +02:00
|
|
|
generate
|
|
|
|
|
$info("%m: In generate"); // Issue 6445
|
|
|
|
|
endgenerate
|
|
|
|
|
|
2015-10-24 00:13:25 +02:00
|
|
|
initial begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
|
|
|
|
endmodule
|