mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 01:13:47 +02:00
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]>
31 lines
595 B
Verilog
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
|