Add xor-assignment test
authorKamil Rakoczy <krakoczy@antmicro.com>
Wed, 24 Jun 2020 12:38:03 +0000 (14:38 +0200)
committerKamil Rakoczy <krakoczy@antmicro.com>
Wed, 24 Jun 2020 12:46:21 +0000 (14:46 +0200)
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
tests/opt/opt_expr_xor_assignment.ys [new file with mode: 0644]

diff --git a/tests/opt/opt_expr_xor_assignment.ys b/tests/opt/opt_expr_xor_assignment.ys
new file mode 100644 (file)
index 0000000..924185e
--- /dev/null
@@ -0,0 +1,15 @@
+read_verilog -sv <<EOT
+module opt_expr_xor_test(input [3:0] i, input [7:0] j, output [8:0] o);
+wire[8:0] a = 8'b0;
+initial begin
+       a ^= i;
+       a ^= j;
+end
+    assign o = a;
+endmodule
+EOT
+proc
+equiv_opt -assert opt_expr -fine
+design -load postopt
+
+select -assert-count 1 t:$xor r:A_WIDTH=4 r:B_WIDTH=4 r:Y_WIDTH=4 %i %i %i