diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-01-02 15:43:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-02 15:43:10 +0100 |
commit | 00330c741a52a96e7ec9ed53fde7de591e9f9c46 (patch) | |
tree | 652d853619b69babe0e4595cd717e459f9e3ad69 /tests | |
parent | 50b09de03320843660636c663629c649ab242321 (diff) | |
parent | a91892bba422bbe8de080a105a6fb4b44f96df1a (diff) | |
download | yosys-00330c741a52a96e7ec9ed53fde7de591e9f9c46.tar.gz yosys-00330c741a52a96e7ec9ed53fde7de591e9f9c46.tar.bz2 yosys-00330c741a52a96e7ec9ed53fde7de591e9f9c46.zip |
Merge pull request #771 from whitequark/techmap_cmp2lut
cmp2lut: new techmap pass
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lut/check_map.ys | 6 | ||||
-rw-r--r-- | tests/lut/map_cmp.v | 29 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/lut/run-test.sh | 0 |
3 files changed, 33 insertions, 2 deletions
diff --git a/tests/lut/check_map.ys b/tests/lut/check_map.ys index dc0aaffc2..46854e82e 100644 --- a/tests/lut/check_map.ys +++ b/tests/lut/check_map.ys @@ -1,4 +1,6 @@ simplemap -equiv_opt -assert techmap -map +/gate2lut.v -D LUT_WIDTH=4 +equiv_opt -assert techmap -D LUT_WIDTH=4 -map +/cmp2lut.v design -load postopt -select -assert-count 1 t:$lut +equiv_opt -assert techmap -D LUT_WIDTH=4 -map +/gate2lut.v +design -load postopt +select -assert-count 0 t:* t:$lut %d diff --git a/tests/lut/map_cmp.v b/tests/lut/map_cmp.v new file mode 100644 index 000000000..5e413f894 --- /dev/null +++ b/tests/lut/map_cmp.v @@ -0,0 +1,29 @@ +module top(...); + input [3:0] a; + + output o1_1 = 4'b1010 <= a; + output o1_2 = 4'b1010 < a; + output o1_3 = 4'b1010 >= a; + output o1_4 = 4'b1010 > a; + output o1_5 = 4'b1010 == a; + output o1_6 = 4'b1010 != a; + + output o2_1 = a <= 4'b1010; + output o2_2 = a < 4'b1010; + output o2_3 = a >= 4'b1010; + output o2_4 = a > 4'b1010; + output o2_5 = a == 4'b1010; + output o2_6 = a != 4'b1010; + + output o3_1 = 4'sb0101 <= $signed(a); + output o3_2 = 4'sb0101 < $signed(a); + output o3_3 = 4'sb0101 >= $signed(a); + output o3_4 = 4'sb0101 > $signed(a); + output o3_5 = 4'sb0101 == $signed(a); + output o3_6 = 4'sb0101 != $signed(a); + + output o4_1 = $signed(a) <= 4'sb0000; + output o4_2 = $signed(a) < 4'sb0000; + output o4_3 = $signed(a) >= 4'sb0000; + output o4_4 = $signed(a) > 4'sb0000; +endmodule diff --git a/tests/lut/run-test.sh b/tests/lut/run-test.sh index 207417fa6..207417fa6 100644..100755 --- a/tests/lut/run-test.sh +++ b/tests/lut/run-test.sh |