aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ice40
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2019-10-18 10:53:56 +0200
committerGitHub <noreply@github.com>2019-10-18 10:53:56 +0200
commit66fca65b58bfb944cad45da5836613726498e4b7 (patch)
treea78b5d92952ea9f95623bb3daf8028d2402d023b /tests/ice40
parent46af9a0ff7727c2d47b1dc12501e3328cba1f2e9 (diff)
parent5ffb0053ec7d53ffc5c57e3277bfbab5d3fddb54 (diff)
downloadyosys-66fca65b58bfb944cad45da5836613726498e4b7.tar.gz
yosys-66fca65b58bfb944cad45da5836613726498e4b7.tar.bz2
yosys-66fca65b58bfb944cad45da5836613726498e4b7.zip
Merge branch 'master' into mmicko/anlogic
Diffstat (limited to 'tests/ice40')
-rw-r--r--tests/ice40/latches.ys9
-rw-r--r--tests/ice40/wrapcarry.ys22
2 files changed, 25 insertions, 6 deletions
diff --git a/tests/ice40/latches.ys b/tests/ice40/latches.ys
index f3562559e..708734e44 100644
--- a/tests/ice40/latches.ys
+++ b/tests/ice40/latches.ys
@@ -1,14 +1,11 @@
read_verilog latches.v
-design -save read
proc
-async2sync # converts latches to a 'sync' variant clocked by a 'super'-clock
flatten
-synth_ice40
-equiv_opt -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
-design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
+# Can't run any sort of equivalence check because latches are blown to LUTs
+#equiv_opt -async2sync -assert -map +/ice40/cells_sim.v synth_ice40 # equivalency check
-design -load read
+#design -load preopt
synth_ice40
cd top
select -assert-count 4 t:SB_LUT4
diff --git a/tests/ice40/wrapcarry.ys b/tests/ice40/wrapcarry.ys
new file mode 100644
index 000000000..10c029e68
--- /dev/null
+++ b/tests/ice40/wrapcarry.ys
@@ -0,0 +1,22 @@
+read_verilog <<EOT
+module top(input A, B, CI, output O, CO);
+ SB_CARRY carry (
+ .I0(A),
+ .I1(B),
+ .CI(CI),
+ .CO(CO)
+ );
+ SB_LUT4 #(
+ .LUT_INIT(16'b 0110_1001_1001_0110)
+ ) adder (
+ .I0(1'b0),
+ .I1(A),
+ .I2(B),
+ .I3(1'b0),
+ .O(O)
+ );
+endmodule
+EOT
+
+ice40_wrapcarry
+select -assert-count 1 t:$__ICE40_CARRY_WRAPPER