Files
iverilog/ivtest/ivltests/localparam_implicit3.v
T
Lars-Peter Clausen 7f40e120c8 Add regression tests for omitting parameter in parameter port list
SystemVerilog allows to completely omit the `parameter` or `localparam`
keyword in the parameter list. Both at the beginning and before redefining
the parameter data type. This is not support in Verilog.

Add regression tests that check that this is supported when in
SystemVerilog mode.

It is not valid to use an implicit data type e.g. just `signed` when
`parameter` was omitted, add regression tests to check for this as well.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2022-02-11 11:09:59 +01:00

31 lines
595 B
Verilog

// Check that all parameters in a parameter port list after a `localparam` get
// elaborated as localparams, until the next `parameter`. Check that this is the
// case even when the data type of the parameter is redefined.
module a #(
parameter A = 1, B = 2,
localparam C = 3, real D = 4,
parameter E = 5
);
initial begin
if (A == 10 && B == 20 && C == 3 && D == 4 && E == 50) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule
module b;
a #(
.A(10),
.B(20),
.D(40), // This will cause an error
.E(50)
) i_a();
endmodule