3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-25 20:46:04 +00:00

Add ice40_wrapcarry pass, rename $__ICE40_FULL_ADDER -> CARRY_WRAPPER

This commit is contained in:
Eddie Hung 2019-08-07 16:27:24 -07:00
parent cc331cf70d
commit 675c1d4218
6 changed files with 128 additions and 10 deletions

View file

@ -63,7 +63,8 @@ endmodule
`endif
`ifndef NO_ADDER
module \$__ICE40_FULL_ADDER (output CO, O, input A, B, CI);
module \$__ICE40_CARRY_WRAPPER (output CO, O, input A, B, CI, I0, I3);
parameter LUT = 0;
SB_CARRY carry (
.I0(A),
.I1(B),
@ -72,13 +73,9 @@ module \$__ICE40_FULL_ADDER (output CO, O, input A, B, CI);
);
\$lut #(
.WIDTH(4),
// 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)
) adder (
.A({CI,B,A,1'b0}),
.LUT(LUT)
) lut (
.A({I3,B,A,I0}),
.Y(O)
);
endmodule