From 93988ef5df8a477b0e880c3fe4c7c4e450816761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Mon, 10 Jul 2023 12:40:50 +0200 Subject: [PATCH] tests: Extend aigmap.ys with SAT comparison Extend the aigmap.ys test with SAT-based comparison of the original cells and their AIG implementations. This tests both the usual cells and the single-bit Yosys gates. --- tests/techmap/aigmap.ys | 115 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/tests/techmap/aigmap.ys b/tests/techmap/aigmap.ys index a40aa39f1..6f6cdd1f2 100644 --- a/tests/techmap/aigmap.ys +++ b/tests/techmap/aigmap.ys @@ -1,3 +1,118 @@ +read_verilog -icells <, 3, 3, 1) +`BIOP(logic_ge, >=, 3, 3, 1) +`UNOP(pos, +, 3) +`UNOP(neg, ~, 3) +`UNOP_REDUCE(logic_not, !, 3) +`UNOP_REDUCE(reduce_and, &, 3) +`UNOP_REDUCE(reduce_or, |, 3) +`UNOP_REDUCE(reduce_xor, ^, 3) +`UNOP_REDUCE(reduce_xnor, ~^, 3) + +wire [3:0] mux_a, mux_b, mux_s, mux_y; +assign mux_y = mux_s ? mux_b : mux_a; +endmodule +EOF + +expose -input c:* %ci* w:* %i +expose c:* %co* w:* %i +copy test gold +aigmap test +select -assert-none test/t:$_AND_ test/t:$_NOT_ %% test/c:* %D +miter -equiv -flatten gold test miter +sat -verify -prove trigger 0 miter + + +design -reset read_verilog <