opt_lut: eliminate LUTs evaluating to constants or inputs.

This commit is contained in:
whitequark
2018-12-31 23:55:40 +00:00
parent 0a840dd883
commit 42c356c49c
4 changed files with 104 additions and 0 deletions
+19
View File
@@ -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
+3
View File
@@ -0,0 +1,3 @@
read_ilang opt_lut_elim.il
opt_lut
select -assert-count 0 t:$lut
+1
View File
@@ -1,2 +1,3 @@
read_ilang opt_lut_port.il
opt_lut
select -assert-count 2 t:$lut