From f25d7a74bc37aa3ab3dd112fb60e9211a34178f7 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 23 Jan 2022 21:11:19 +0100 Subject: [PATCH] Add regression test for implicit `localparam` Check that all parameters in a parameter port list after a `localparam` get elaborated as localparams, until the next `parameter`. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/localparam_implicit.v | 30 +++++++++++++++++++++++++++ ivtest/regress-sv.list | 1 + 2 files changed, 31 insertions(+) create mode 100644 ivtest/ivltests/localparam_implicit.v diff --git a/ivtest/ivltests/localparam_implicit.v b/ivtest/ivltests/localparam_implicit.v new file mode 100644 index 000000000..98e73edc3 --- /dev/null +++ b/ivtest/ivltests/localparam_implicit.v @@ -0,0 +1,30 @@ +// Check that all parameters in a parameter port list after a `localparam` get +// elaborated as localparams, until the next `parameter`. + +module a #( + parameter A = 1, B = 2, + localparam C = 3, 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), + .C(30), + .D(40), + .E(50) + ) i_a(); + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index a0bfc15e6..1841e5bfa 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -300,6 +300,7 @@ l_equiv normal,-g2005-sv ivltests l_equiv_ca normal,-g2005-sv ivltests l_equiv_const normal,-g2005-sv ivltests line_directive normal,-g2009,-I./ivltests ivltests gold=line_directive.gold +localparam_implicit normal,-g2005-sv ivltests localparam_query normal,-g2005-sv ivltests localparam_type2 normal,-g2009 ivltests logical_short_circuit normal,-g2012 ivltests