From 92d70cafec026fb25bf45b020c138e5244bb8cdc Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 20 Jan 2020 16:42:17 -0800 Subject: [PATCH] +/cmp2lcu.v to work efficiently for fully/partially constant inputs --- tests/techmap/cmp2lcu.ys | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tests/techmap/cmp2lcu.ys b/tests/techmap/cmp2lcu.ys index 620996549..7c8a63692 100644 --- a/tests/techmap/cmp2lcu.ys +++ b/tests/techmap/cmp2lcu.ys @@ -10,15 +10,43 @@ 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-count 8 t:$lcu r:WIDTH=5 %i 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-count 8 t:$lcu r:WIDTH=7 %i +select -assert-none t:$gt t:$ge t:$lt t:$le + + +design -reset +read_verilog < d; +assign gts = $signed(c) > $signed(d); +assign ltu = c < d; +assign lts = $signed(c) < $signed(d); +assign geu = c >= d; +assign ges = $signed(c) >= $signed(d); +assign leu = c <= d; +assign les = $signed(c) <= $signed(d); +endmodule +EOT +design -save gold + +equiv_opt -assert techmap -map +/cmp2lcu.v -D LUT_WIDTH=5 +design -load postopt +select -assert-count 8 t:$lcu r:WIDTH=2 %i +select -assert-none t:$gt t:$ge t:$lt t:$le + +design -load preopt +equiv_opt -assert techmap -map +/cmp2lcu.v -D LUT_WIDTH=3 +design -load postopt +select -assert-count 8 t:$lcu r:WIDTH=4 %i select -assert-none t:$gt t:$ge t:$lt t:$le -- 2.30.2