mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-07 01:56:52 +02:00
Check that automatic 2-state variables get initialized to 0. Signed-off-by: Lars-Peter Clausen <[email protected]>
36 lines
491 B
Verilog
36 lines
491 B
Verilog
// Check that automatic 2-state variables are initialized to 0.
|
|
|
|
module test;
|
|
|
|
bit failed = 1'b0;
|
|
|
|
function automatic int f(int x);
|
|
int a;
|
|
if (a !== 0) begin
|
|
failed = 1'b1;
|
|
end
|
|
return x;
|
|
endfunction
|
|
|
|
task automatic t;
|
|
int a;
|
|
if (a !== 0) begin
|
|
failed = 1'b1;
|
|
end
|
|
endtask
|
|
|
|
initial begin
|
|
int x;
|
|
|
|
t;
|
|
x = f(10);
|
|
|
|
if (failed) begin
|
|
$display("FAILED");
|
|
end else begin
|
|
$display("PASSED");
|
|
end
|
|
end
|
|
|
|
endmodule
|