mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 03:14:10 +02:00
Check that function calls with empty arguments are supported. Check the general case and special cases such as calling a function with empty arguments as part of a module port binding or force statements in automatic contexts. Also check that calling a function with too many trailing empty arguments as well as passing an empty argument for a port without a default value is an error. Signed-off-by: Lars-Peter Clausen <[email protected]>
30 lines
580 B
Verilog
30 lines
580 B
Verilog
// Check that it is possible to call functins with empty arguments if they have
|
|
// default values. Check that this works if the function call is in a module
|
|
// port binding expression.
|
|
|
|
module M (input [31:0] x, input [31:0] y);
|
|
|
|
initial begin
|
|
#1
|
|
if (x === 623 && y == 624) begin
|
|
$display("PASSED");
|
|
end else begin
|
|
$display("FAILED");
|
|
end
|
|
end
|
|
|
|
endmodule
|
|
|
|
module test;
|
|
|
|
function [31:0] f(reg [31:0] a, reg [31:0] b = 2, reg [31:0] c = 3);
|
|
return a * 100 + b * 10 + c;
|
|
endfunction
|
|
|
|
M i_m (
|
|
.x(f(6, )),
|
|
.y(f(6, , 4))
|
|
);
|
|
|
|
endmodule
|