aboutsummaryrefslogtreecommitdiffstats
path: root/tests/opt
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-01-01 11:13:48 +0100
committerGitHub <noreply@github.com>2019-01-01 11:13:48 +0100
commit4b9f619349e6b7452739631635ab3b5a4d94b522 (patch)
treec794e925cb1c97324c6a0be573fc1b916ad4ddb2 /tests/opt
parent0a840dd88334c382314db3aafc2f1da2a1969df2 (diff)
parent42c356c49c04a735fe27e672ff31452170f84b40 (diff)
downloadyosys-4b9f619349e6b7452739631635ab3b5a4d94b522.tar.gz
yosys-4b9f619349e6b7452739631635ab3b5a4d94b522.tar.bz2
yosys-4b9f619349e6b7452739631635ab3b5a4d94b522.zip
Merge pull request #768 from whitequark/opt_lut_elim
opt_lut: eliminate LUTs evaluating to constants or inputs
Diffstat (limited to 'tests/opt')
-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
3 files changed, 23 insertions, 0 deletions
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