From 9b6370067858aa37825e7a030cd204726f0b58f9 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 17 Jan 2020 10:51:27 -0800 Subject: techmap +/cmp2lcu.v for decomposing arithmetic compares to $lcu --- tests/techmap/cmp2lcu.ys | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/techmap/cmp2lcu.ys (limited to 'tests/techmap') diff --git a/tests/techmap/cmp2lcu.ys b/tests/techmap/cmp2lcu.ys new file mode 100644 index 000000000..e7a422e2f --- /dev/null +++ b/tests/techmap/cmp2lcu.ys @@ -0,0 +1,24 @@ +read_verilog < b; +assign gts = $signed(a) > $signed(b); +assign ltu = a < b; +assign lts = $signed(a) < $signed(b); +assign geu = a >= b; +assign ges = $signed(a) >= $signed(b); +assign leu = a <= b; +assign les = $signed(a) <= $signed(b); +endmodule +EOT +proc + +equiv_opt -assert techmap -map +/cmp2lcu.v -D LUT_WIDTH=6 +design -load postopt +select -assert-count 8 t:$lcu +select -assert-none t:$gt t:$ge t:$lt t:$le + +design -load preopt +equiv_opt -assert techmap -map +/cmp2lcu.v -D LUT_WIDTH=4 +design -load postopt +select -assert-count 8 t:$lcu +select -assert-none t:$gt t:$ge t:$lt t:$le -- cgit v1.2.3