aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lut/check_map.ys6
-rw-r--r--tests/lut/map_cmp.v29
-rwxr-xr-x[-rw-r--r--]tests/lut/run-test.sh0
-rw-r--r--tests/opt/opt_lut_elim.il19
-rw-r--r--tests/opt/opt_lut_elim.ys3
-rw-r--r--tests/opt/opt_lut_port.ys1
-rw-r--r--tests/sva/basic01.sv2
7 files changed, 57 insertions, 3 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
diff --git a/tests/opt/opt_lut_elim.il b/tests/opt/opt_lut_elim.il
new file mode 100644
index 000000000..75675d983
--- /dev/null
+++ b/tests/opt/opt_lut_elim.il
@@ -0,0 +1,19 @@
+module \test
+ wire input 1 \i
+
+ wire output 2 \o1
+ cell $lut $1
+ parameter \LUT 16'0110100110010110
+ parameter \WIDTH 4
+ connect \A { \i 3'000 }
+ connect \Y \o1
+ end
+
+ wire output 2 \o2
+ cell $lut $2
+ parameter \LUT 16'0110100010010110
+ parameter \WIDTH 4
+ connect \A { \i 3'000 }
+ connect \Y \o2
+ end
+end
diff --git a/tests/opt/opt_lut_elim.ys b/tests/opt/opt_lut_elim.ys
new file mode 100644
index 000000000..8e5e23aea
--- /dev/null
+++ b/tests/opt/opt_lut_elim.ys
@@ -0,0 +1,3 @@
+read_ilang opt_lut_elim.il
+opt_lut
+select -assert-count 0 t:$lut
diff --git a/tests/opt/opt_lut_port.ys b/tests/opt/opt_lut_port.ys
index 51dfd988b..3cb4ecb23 100644
--- a/tests/opt/opt_lut_port.ys
+++ b/tests/opt/opt_lut_port.ys
@@ -1,2 +1,3 @@
read_ilang opt_lut_port.il
+opt_lut
select -assert-count 2 t:$lut
diff --git a/tests/sva/basic01.sv b/tests/sva/basic01.sv
index 74ab93430..d5ad497dd 100644
--- a/tests/sva/basic01.sv
+++ b/tests/sva/basic01.sv
@@ -6,7 +6,7 @@ module top (input logic clock, ctrl);
write <= ctrl;
ready <= write;
end
-
+
a_rw: assert property ( @(posedge clock) !(read && write) );
`ifdef FAIL
a_wr: assert property ( @(posedge clock) write |-> ready );