From 687abbd0300a08d421f930870220b1dd5c349a1b Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 1 Feb 2022 19:15:01 -0800 Subject: [PATCH] Fix localparam_implicit.v test The localparam_implicit.v test was broken by a recent commit. Fix the test, since the commit is correct and the test really is broken. --- ivtest/ivltests/localparam_implicit.v | 4 ++-- ivtest/ivltests/localparam_implicit2.v | 30 ++++++++++++++++++++++++++ ivtest/regress-sv.list | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ivtest/ivltests/localparam_implicit2.v diff --git a/ivtest/ivltests/localparam_implicit.v b/ivtest/ivltests/localparam_implicit.v index 98e73edc3..28e50fa40 100644 --- a/ivtest/ivltests/localparam_implicit.v +++ b/ivtest/ivltests/localparam_implicit.v @@ -22,8 +22,8 @@ module b; a #( .A(10), .B(20), - .C(30), - .D(40), + // Cannot override localparam .C(30), + // Cannot override localparam .D(40), .E(50) ) i_a(); diff --git a/ivtest/ivltests/localparam_implicit2.v b/ivtest/ivltests/localparam_implicit2.v new file mode 100644 index 000000000..6c005ec31 --- /dev/null +++ b/ivtest/ivltests/localparam_implicit2.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), // This will cause an error + .D(40), // This will cause an error + .E(50) + ) i_a(); + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index 59d001f83..9a64bde65 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -301,6 +301,7 @@ 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_implicit2 CE,-g2005-sv ivltests localparam_query normal,-g2005-sv ivltests localparam_type2 normal,-g2009 ivltests logical_short_circuit normal,-g2012 ivltests