mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-05 10:50:25 +00:00
gate2lut: new techlib, for converting Yosys gates to FPGA LUTs.
This commit is contained in:
parent
12596b5003
commit
9ef078848a
10 changed files with 133 additions and 0 deletions
1
tests/lut/.gitignore
vendored
Normal file
1
tests/lut/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.log
|
13
tests/lut/check_map.ys
Normal file
13
tests/lut/check_map.ys
Normal 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
tests/lut/map_and.v
Normal file
5
tests/lut/map_and.v
Normal file
|
@ -0,0 +1,5 @@
|
|||
module top(...);
|
||||
input a, b;
|
||||
output y;
|
||||
assign y = a&b;
|
||||
endmodule
|
5
tests/lut/map_mux.v
Normal file
5
tests/lut/map_mux.v
Normal file
|
@ -0,0 +1,5 @@
|
|||
module top(...);
|
||||
input a, b, s;
|
||||
output y;
|
||||
assign y = s?a:b;
|
||||
endmodule
|
5
tests/lut/map_not.v
Normal file
5
tests/lut/map_not.v
Normal file
|
@ -0,0 +1,5 @@
|
|||
module top(...);
|
||||
input a;
|
||||
output y;
|
||||
assign y = ~a;
|
||||
endmodule
|
5
tests/lut/map_or.v
Normal file
5
tests/lut/map_or.v
Normal file
|
@ -0,0 +1,5 @@
|
|||
module top(...);
|
||||
input a, b;
|
||||
output y;
|
||||
assign y = a|b;
|
||||
endmodule
|
5
tests/lut/map_xor.v
Normal file
5
tests/lut/map_xor.v
Normal file
|
@ -0,0 +1,5 @@
|
|||
module top(...);
|
||||
input a, b;
|
||||
output y;
|
||||
assign y = a^b;
|
||||
endmodule
|
6
tests/lut/run-test.sh
Normal file
6
tests/lut/run-test.sh
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue