2019-10-04 13:04:10 -05:00
|
|
|
(* abc9_box_id = 1, lib_whitebox *)
|
2019-10-04 12:34:16 -05:00
|
|
|
module \$__ICE40_CARRY_WRAPPER (
|
2019-10-04 13:04:10 -05:00
|
|
|
(* abc9_carry *)
|
2019-10-04 12:34:16 -05:00
|
|
|
output CO,
|
|
|
|
output O,
|
|
|
|
input A, B,
|
2019-10-04 13:04:10 -05:00
|
|
|
(* abc9_carry *)
|
2019-10-04 12:34:16 -05:00
|
|
|
input CI,
|
|
|
|
input I0, I3
|
|
|
|
);
|
|
|
|
parameter LUT = 0;
|
2020-01-24 13:59:48 -06:00
|
|
|
parameter I3_IS_CI = 0;
|
|
|
|
wire I3_OR_CI = I3_IS_CI ? CI : I3;
|
2019-10-04 12:34:16 -05:00
|
|
|
SB_CARRY carry (
|
|
|
|
.I0(A),
|
|
|
|
.I1(B),
|
|
|
|
.CI(CI),
|
|
|
|
.CO(CO)
|
|
|
|
);
|
|
|
|
SB_LUT4 #(
|
|
|
|
.LUT_INIT(LUT)
|
|
|
|
) adder (
|
|
|
|
.I0(I0),
|
|
|
|
.I1(A),
|
|
|
|
.I2(B),
|
2020-01-24 13:59:48 -06:00
|
|
|
.I3(I3_OR_CI),
|
2019-10-04 12:34:16 -05:00
|
|
|
.O(O)
|
|
|
|
);
|
|
|
|
endmodule
|