2017-03-22 00:27:42 +01:00
|
|
|
// DESCRIPTION: Verilator: Test for warning (not error) on improperly width'ed
|
|
|
|
|
// default function argument
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2015 Todd Strader
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2017-03-22 00:27:42 +01:00
|
|
|
|
2023-01-05 23:42:05 +01:00
|
|
|
function automatic logic foo
|
2017-03-22 00:27:42 +01:00
|
|
|
(
|
|
|
|
|
// Intentionally provide a non-width'ed default value
|
|
|
|
|
// This should warn, not error out
|
|
|
|
|
input logic x = 0
|
|
|
|
|
);
|
|
|
|
|
return x;
|
|
|
|
|
endfunction
|
|
|
|
|
|
2025-09-13 15:28:43 +02:00
|
|
|
module t;
|
2017-03-22 00:27:42 +01:00
|
|
|
logic foo_val;
|
|
|
|
|
|
|
|
|
|
initial begin
|
|
|
|
|
foo_val = foo();
|
|
|
|
|
if (foo_val != 1'b0) $stop;
|
|
|
|
|
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
endmodule
|