Skip to content

Commit

Permalink
Suggestion: Move parameter into module in number_test
Browse files Browse the repository at this point in the history
I'm working on validating a parser for Verilog-AMS, which is
basically vanilla verilog + extensions + some backports from
SystemVerilog. Because of this shared heritage, quite a number
of the tests in this repository are applicable and helpful.
The number_test tests are useful also, because they test
lexing of numberic literals. There are two tests (_3 and _4)
that test SystemVerilog extensions, but the remainder are
Vanilla verilog modulo the fact that `parameter` statements
can't appear at top level in vanilla Verilog. By moving
the parameter statements inside the model, the test would
be valid in both vanilla and System Verilog. I understand
that this is not a Verilog-AMS test suite, but I was hoping
you might be open to generalizing the test files where the
particular feature being tested itself is not a SystemVerilog
extension, such that we may share some of these testcases
between this repository and our Verilog-AMS test suite.
  • Loading branch information
Keno committed Jan 28, 2021
1 parent 3aa74ac commit b04b325
Show file tree
Hide file tree
Showing 55 changed files with 55 additions and 110 deletions.
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_0.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter foo = 0;

module test;
parameter foo = 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_1.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 0;

module test;
parameter integer foo = 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_10.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 1'bx;

module test;
parameter integer foo = 1'bx;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_11.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 1 'b x;

module test;
parameter integer foo = 1 'b x;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_12.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 1'bz;

module test;
parameter integer foo = 1'bz;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_13.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 4'bxxxx;

module test;
parameter integer foo = 4'bxxxx;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_14.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 4'bzzzz;

module test;
parameter integer foo = 4'bzzzz;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_15.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 4'sb1111;

module test;
parameter integer foo = 4'sb1111;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_16.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 4'Sb0000;

module test;
parameter integer foo = 4'Sb0000;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_2.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = '0;

module test;
parameter integer foo = '0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_24.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'd0;

module test;
parameter integer foo = 'd0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_25.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'd 0;

module test;
parameter integer foo = 'd 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_26.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'd1;

module test;
parameter integer foo = 32'd1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_27.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'D1;

module test;
parameter integer foo = 32'D1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_28.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32 'd 1;

module test;
parameter integer foo = 32 'd 1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_29.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'sd1;

module test;
parameter integer foo = 32'sd1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_3.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = '1;

module test;
parameter integer foo = '1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_30.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'Sd1;

module test;
parameter integer foo = 32'Sd1;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_31.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dx;

module test;
parameter integer foo = 32'dx;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_32.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dx_;

module test;
parameter integer foo = 32'dx_;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_33.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dx__;

module test;
parameter integer foo = 32'dx__;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_34.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dX;

module test;
parameter integer foo = 32'dX;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_35.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dz;

module test;
parameter integer foo = 32'dz;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_36.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'dZ;

module test;
parameter integer foo = 32'dZ;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_4.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'b0;

module test;
parameter integer foo = 'b0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_42.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'o0;

module test;
parameter integer foo = 'o0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_43.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'o 0;

module test;
parameter integer foo = 'o 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_44.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'o7;

module test;
parameter integer foo = 32'o7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_45.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'o7_7_7;

module test;
parameter integer foo = 32'o7_7_7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_46.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'O7;

module test;
parameter integer foo = 32'O7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_47.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32 'o 7;

module test;
parameter integer foo = 32 'o 7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_48.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'so7;

module test;
parameter integer foo = 32'so7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_49.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'So7;

module test;
parameter integer foo = 32'So7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_5.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'b 0;

module test;
parameter integer foo = 'b 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_50.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'oxxx;

module test;
parameter integer foo = 32'oxxx;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_51.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'oXX;

module test;
parameter integer foo = 32'oXX;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_52.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'ozz;

module test;
parameter integer foo = 32'ozz;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_53.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'oZZ;

module test;
parameter integer foo = 32'oZZ;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_59.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'h0;

module test;
parameter integer foo = 'h0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_6.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 1'b0;

module test;
parameter integer foo = 1'b0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_60.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 'h 0;

module test;
parameter integer foo = 'h 0;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_61.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'h7;

module test;
parameter integer foo = 32'h7;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_62.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'H7fFF;

module test;
parameter integer foo = 32'H7fFF;
endmodule
3 changes: 1 addition & 2 deletions tests/generic/number/number_test_64.sv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:description: Test
:tags: 5.6.4 5.7.1 5.7.2
*/
parameter int foo = 32'hdeadbeef;

module test;
parameter integer foo = 32'hdeadbeef;
endmodule
Loading

0 comments on commit b04b325

Please sign in to comment.