Add test for pmux2shiftx
authorClifford Wolf <clifford@clifford.at>
Fri, 19 Apr 2019 18:23:09 +0000 (20:23 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 19 Apr 2019 22:38:25 +0000 (00:38 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
tests/various/pmux2shiftx.v [new file with mode: 0644]
tests/various/pmux2shiftx.ys [new file with mode: 0644]

diff --git a/tests/various/pmux2shiftx.v b/tests/various/pmux2shiftx.v
new file mode 100644 (file)
index 0000000..ac61c5c
--- /dev/null
@@ -0,0 +1,28 @@
+module pmux2shiftx_test (
+       input [2:0] S1,
+       input [5:0] S2,
+       input [9:0] A, B, C, D, D, E, F,
+       input [9:0] G, H, I, J, K, L, M, N,
+       output reg [9:0] X
+);
+       always @* begin
+               case (S1)
+                       3'd0: X = A;
+                       3'd1: X = B;
+                       3'd2: X = C;
+                       3'd3: X = D;
+                       3'd4: X = E;
+                       3'd5: X = F;
+                       3'd6: X = G;
+                       3'd7: X = H;
+               endcase
+               case (S2)
+                       6'd46: X = I;
+                       6'd47: X = J;
+                       6'd48: X = K;
+                       6'd52: X = L;
+                       6'd53: X = M;
+                       6'd54: X = N;
+               endcase
+       end
+endmodule
diff --git a/tests/various/pmux2shiftx.ys b/tests/various/pmux2shiftx.ys
new file mode 100644 (file)
index 0000000..16618ac
--- /dev/null
@@ -0,0 +1,24 @@
+read_verilog pmux2shiftx.v
+prep
+design -save gold
+
+pmux2shiftx
+opt
+# show -width
+select -assert-count 1 t:$mux
+select -assert-count 1 t:$shift
+select -assert-count 2 t:$shiftx
+select -assert-count 1 t:$sub
+design -stash gate
+
+design -import gold -as gold
+design -import gate -as gate
+
+miter -equiv -flatten -make_assert -make_outputs gold gate miter
+sat -verify -prove-asserts -show-ports miter
+
+design -load gold
+stat
+
+design -load gate
+stat