From d559190e9ecbad96229ca962ba5e0293ea086769 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 17 Feb 2021 22:57:52 -0500 Subject: [PATCH] Tests for future concat select (#2721) --- test_regress/t/t_concat_sel.out | 43 +++++++++++++++++++ ...math_concat_sel_bad.pl => t_concat_sel.pl} | 11 +++-- ...t_math_concat_sel_bad.v => t_concat_sel.v} | 15 +++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 test_regress/t/t_concat_sel.out rename test_regress/t/{t_math_concat_sel_bad.pl => t_concat_sel.pl} (72%) rename test_regress/t/{t_math_concat_sel_bad.v => t_concat_sel.v} (75%) diff --git a/test_regress/t/t_concat_sel.out b/test_regress/t/t_concat_sel.out new file mode 100644 index 000000000..8df3350c0 --- /dev/null +++ b/test_regress/t/t_concat_sel.out @@ -0,0 +1,43 @@ +%Error-UNSUPPORTED: t/t_concat_sel.v:22:28: Unsupported: Select of concatenation + 22 | wire [3:0] out1 = {a,b}[2 +: 4]; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:23:28: Unsupported: Select of concatenation + 23 | wire [3:0] out2 = {a,b}[5 -: 4]; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:24:28: Unsupported: Select of concatenation + 24 | wire [3:0] out3 = {a,b}[5 : 2]; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:25:28: Unsupported: Select of concatenation + 25 | wire [0:0] out4 = {a,b}[2]; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:31:21: Unsupported: Select of concatenation + 31 | if ({16'h1234}[0] != 1'b0) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:32:21: Unsupported: Select of concatenation + 32 | if ({16'h1234}[2] != 1'b1) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:33:21: Unsupported: Select of concatenation + 33 | if ({16'h1234}[11:4] != 8'h23) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:34:21: Unsupported: Select of concatenation + 34 | if ({16'h1234}[4+:8] != 8'h23) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:35:21: Unsupported: Select of concatenation + 35 | if ({16'h1234}[11-:8] != 8'h23) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:36:25: Unsupported: Select of concatenation + 36 | if ({8'h12, 8'h34}[0] != 1'b0) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:37:25: Unsupported: Select of concatenation + 37 | if ({8'h12, 8'h34}[2] != 1'b1) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:38:25: Unsupported: Select of concatenation + 38 | if ({8'h12, 8'h34}[11:4] != 8'h23) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:39:25: Unsupported: Select of concatenation + 39 | if ({8'h12, 8'h34}[4+:8] != 8'h23) $stop; + | ^ +%Error-UNSUPPORTED: t/t_concat_sel.v:40:25: Unsupported: Select of concatenation + 40 | if ({8'h12, 8'h34}[11-:8] != 8'h23) $stop; + | ^ +%Error: Exiting due to diff --git a/test_regress/t/t_math_concat_sel_bad.pl b/test_regress/t/t_concat_sel.pl similarity index 72% rename from test_regress/t/t_math_concat_sel_bad.pl rename to test_regress/t/t_concat_sel.pl index f3e3b1181..40f69d41d 100755 --- a/test_regress/t/t_math_concat_sel_bad.pl +++ b/test_regress/t/t_concat_sel.pl @@ -8,11 +8,16 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Version 2.0. # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -scenarios(linter => 1); +scenarios(simulator => 1); -lint( - fails => 1, +compile( + fails => $Self->{vlt_all}, + expect_filename => $Self->{golden_filename}, ); +execute( + check_finished => 1, + ) if !$Self->{vlt_all}; + ok(1); 1; diff --git a/test_regress/t/t_math_concat_sel_bad.v b/test_regress/t/t_concat_sel.v similarity index 75% rename from test_regress/t/t_math_concat_sel_bad.v rename to test_regress/t/t_concat_sel.v index 88620ca3d..33dc12a99 100644 --- a/test_regress/t/t_math_concat_sel_bad.v +++ b/test_regress/t/t_concat_sel.v @@ -27,6 +27,21 @@ module t (/*AUTOARG*/ // Aggregate outputs into a single result vector wire [63:0] result = {51'h0, out4, out3, out2, out1}; + initial begin + if ({16'h1234}[0] != 1'b0) $stop; + if ({16'h1234}[2] != 1'b1) $stop; + if ({16'h1234}[11:4] != 8'h23) $stop; + if ({16'h1234}[4+:8] != 8'h23) $stop; + if ({16'h1234}[11-:8] != 8'h23) $stop; + if ({8'h12, 8'h34}[0] != 1'b0) $stop; + if ({8'h12, 8'h34}[2] != 1'b1) $stop; + if ({8'h12, 8'h34}[11:4] != 8'h23) $stop; + if ({8'h12, 8'h34}[4+:8] != 8'h23) $stop; + if ({8'h12, 8'h34}[11-:8] != 8'h23) $stop; + $write("*-* All Finished *-*\n"); + $finish; + end + // Test loop always @ (posedge clk) begin `ifdef TEST_VERBOSE