aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-29 22:10:45 -0700
committerGitHub <noreply@github.com>2019-08-29 22:10:45 -0700
commit694e30a35426b9582a1f2db730528d4d34305795 (patch)
tree288296dac088f7b9fa27e7feebc1af6d8a7f2f70 /tests
parent14677610602ee18bcf1a41a0c54a626965e6bb06 (diff)
parent25b1670a8425198abfcef4602a3d1ddcc0ca5d40 (diff)
downloadyosys-694e30a35426b9582a1f2db730528d4d34305795.tar.gz
yosys-694e30a35426b9582a1f2db730528d4d34305795.tar.bz2
yosys-694e30a35426b9582a1f2db730528d4d34305795.zip
Merge pull request #1337 from YosysHQ/eddie/fix_carry_wrapper
Fix $__ICE40_CARRY_WRAPPER, restore abc9 functionality
Diffstat (limited to 'tests')
-rw-r--r--tests/ice40/ice40_opt.ys26
-rwxr-xr-xtests/ice40/run-test.sh20
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/ice40/ice40_opt.ys b/tests/ice40/ice40_opt.ys
new file mode 100644
index 000000000..b17c69c91
--- /dev/null
+++ b/tests/ice40/ice40_opt.ys
@@ -0,0 +1,26 @@
+read_verilog -icells -formal <<EOT
+module top(input CI, I0, output [1:0] CO, output O);
+ wire A = 1'b0, B = 1'b0;
+ \$__ICE40_CARRY_WRAPPER #(
+ // A[0]: 1010 1010 1010 1010
+ // A[1]: 1100 1100 1100 1100
+ // A[2]: 1111 0000 1111 0000
+ // A[3]: 1111 1111 0000 0000
+ .LUT(~16'b 0110_1001_1001_0110)
+ ) u0 (
+ .A(A),
+ .B(B),
+ .CI(CI),
+ .I0(I0),
+ .I3(CI),
+ .CO(CO[0]),
+ .O(O)
+ );
+ SB_CARRY u1 (.I0(~A), .I1(~B), .CI(CI), .CO(CO[1]));
+endmodule
+EOT
+
+equiv_opt -assert -map +/ice40/cells_map.v -map +/ice40/cells_sim.v ice40_opt
+design -load postopt
+select -assert-count 1 t:*
+select -assert-count 1 t:$lut
diff --git a/tests/ice40/run-test.sh b/tests/ice40/run-test.sh
new file mode 100755
index 000000000..ea56b70f0
--- /dev/null
+++ b/tests/ice40/run-test.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+set -e
+{
+echo "all::"
+for x in *.ys; do
+ echo "all:: run-$x"
+ echo "run-$x:"
+ echo " @echo 'Running $x..'"
+ echo " @../../yosys -ql ${x%.ys}.log $x"
+done
+for s in *.sh; do
+ if [ "$s" != "run-test.sh" ]; then
+ echo "all:: run-$s"
+ echo "run-$s:"
+ echo " @echo 'Running $s..'"
+ echo " @bash $s"
+ fi
+done
+} > run-test.mk
+exec ${MAKE:-make} -f run-test.mk