gate2lut: new techlib, for converting Yosys gates to FPGA LUTs.

This commit is contained in:
whitequark
2018-12-05 17:13:27 +00:00
parent 12596b5003
commit 9ef078848a
10 changed files with 133 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
*.log
+13
View File
@@ -0,0 +1,13 @@
design -save preopt
simplemap
techmap -map +/gate2lut.v -D LUT_WIDTH=4
select -assert-count 1 t:$lut
design -stash postopt
design -copy-from preopt -as preopt top
design -copy-from postopt -as postopt top
equiv_make preopt postopt equiv
prep -flatten -top equiv
equiv_induct
equiv_status -assert
+5
View File
@@ -0,0 +1,5 @@
module top(...);
input a, b;
output y;
assign y = a&b;
endmodule
+5
View File
@@ -0,0 +1,5 @@
module top(...);
input a, b, s;
output y;
assign y = s?a:b;
endmodule
+5
View File
@@ -0,0 +1,5 @@
module top(...);
input a;
output y;
assign y = ~a;
endmodule
+5
View File
@@ -0,0 +1,5 @@
module top(...);
input a, b;
output y;
assign y = a|b;
endmodule
+5
View File
@@ -0,0 +1,5 @@
module top(...);
input a, b;
output y;
assign y = a^b;
endmodule
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
for x in *.v; do
echo "Running $x.."
../../yosys -q -s check_map.ys -l ${x%.v}.log $x
done