16.1.9 MACC_PA

The MACC_PA macro implements multiplication, multiply-add, and multiply-accumulate functions. The MACC_PA block can accumulate the current multiplication product with a previous result, a constant, a dynamic value, or a result from another MACC_PA block. Each MACC_PA block can also be configured to perform a Dot-product operation. All the signals of the MACC_PA block have optional registers.

16.1.9.1 Features

The main features of the MACC_PA block are as follows:

  • Native 18 x 18 signed multiplication and supports 17 x 17 unsigned multiplication.
  • Independent third input C of data width 48 bits along with a CARRYIN, optionally registered.
  • Pre-adder of B with an independent fourth input D of data width 18 bits, optionally registered.
  • Internal cascade signals (48-bit CDIN and CDOUT) enable cascading of the Math blocks to support larger accumulator, adder, and subtracter without extra logic.
  • Normal addition/subtraction: CARRYIN + C[47:0] + E[47:0] ± { ( B[17:0] ± D[17:0]) x A[17:0] }.
  • Dot product mode: (B[8:0] ± D[8:0]) x A[17:9] ± (B[17:9] ± D[17:9]) x A[8:0].
  • SIMD mode for dual independent multiplication of two pairs of 9-bit operands.
  • Supports both registered and unregistered inputs and outputs.
  • Arithmetic right-shift by 17 bits of the loopback of CDIN.

The following figure shows a simplified block diagram of the MACC_PA block.

Figure 16-69. Simplified Block Diagram of MACC_PA
Table 16-141. MACC_PA Pin Descriptions
Port NameDirectionTypePolarityDescription
DOTPInputStaticHighDot-product mode.

When DOTP = 1, MACC_PA block performs Dot- product of two pairs of 9-bit operands.

  • SIMD must not be 1.
  • C[8:0] must be connected to CARRYIN.
SIMDInputStaticHighSIMD mode.

When SIMD = 1, MACC_PA block performs dual independent multiplication of two pairs of 9-bit operands.

  • DOTP must not be 1.
  • ARSHFT17 must be 0.
  • D[8:0] must be 0.
  • C[17:0] must be 0.
  • E[17:0] must be 0.

    Refer to Table 16-142 to see how operand E is obtained from P, CDIN or 0.

OVFL_CARRYOUT_SELInputStaticHighGenerate OVERFLOW or CARRYOUT with result P.
  • OVERFLOW when OVFL_CARRYOUT_SEL = 0
  • CARRYOUT when OVFL_CARRYOUT_SEL = 1
CLKInputDynamicRising edgeClock for A, B, C, CARRYIN, D, P, OVFL_CARRYOUT, ARSHFT17, CDIN_FDBK_SEL, PASUB and SUB registers.
AL_NInputDynamicLowAsynchronous load for A, B, P, OVFL_CARRYOUT, ARSHFT17, CDIN_FDBK_SEL, PASUB and SUB registers. Connect to 1, if none are registered.

When asserted, A, B, P and OVFL_CARRYOUT registers are loaded with zero, while the ARSHFT17, CDIN_FDBK_SEL, PASUB and SUB registers are loaded with the complementary. value of the respective _AD_N.

A[17:0]InputDynamicHighInput data A.
A_BYPASSInputStaticHighBypass data A registers. Connect to 1, if not registered. See Table 16-146.
A_SRST_NInputDynamicLowSynchronous reset for data A registers. Connect to

1, if not registered. See Table 16-146.

A_ENInputDynamicHighEnable for data A registers. Connect to 1, if not registered. See Table 16-146.
B[17:0]InputDynamicHighInput data B to Pre-adder with data D.
B_BYPASSInputStaticHighBypass data B registers. Connect to 1, if not registered. See Table 16-146.
B_SRST_NInputDynamicLowSynchronous reset for data B registers. Connect to 1, if not registered. See Table 16-146.
B_ENInputDynamicHighEnable for data B registers. Connect to 1, if not registered. See Table 16-146.
D[17:0]InputDynamicHighInput data D to Pre-adder with data B. When SIMD = 1, connect D[8:0] to 0.
D_BYPASSInputStaticHighBypass data D registers. Connect to 1, if not registered. See Table 16-147.
D_ARST_NInputDynamicLowAsynchronous reset for data D registers. Connect to 1, if not registered. See Table 16-147.
D_SRST_NInputDynamicLowSynchronous reset for data D registers. Connect to 1, if not registered. See Table 16-147.
D_ENInputDynamicHighEnable for data D registers. Connect to 1, if not registered. See Table 16-147.
CARRYINInputDynamicHighCARRYIN for input data C.
C[47:0]InputDynamicHighInput data C.

When DOTP = 1, connect C[8:0] to CARRYIN. When SIMD = 1, connect C[8:0] to 0.

C_BYPASSInputStaticHighBypass CARRYIN and C registers. Connect to 1, if not registered. See Table 16-147.
C_ARST_NInputDynamicLowAsynchronous reset for CARRYIN and C registers. Connect to 1, if not registered. See Table 16-147.
C_SRST_NInputDynamicLowSynchronous reset for CARRYIN and C registers. Connect to 1, if not registered. See Table 16-147.
C_ENInputDynamicHighEnable for CARRYIN and C registers. Connect to 1, if not registered. See Table 16-147.
CDIN[47:0]InputCascadeHighCascaded input for operand E.

The entire bus must be driven by an entire CDOUT of another MACC_PA or MACC_PA_BC_ROM block. In Dot-product mode, the driving CDOUT must also be generated by a MACC_PA or MACC_PA_BC_ROM block in Dot-product mode. Refer to Table 16-142 to see how CDIN is propagated to operand E.

P[47:0]OutputHighResult data. See Table 16-143.
OVFL_CARRYOUTOutputHighOVERFLOW or CARRYOUT. See Table 16-144.
P_BYPASSInputStaticHighBypass P and OVFL_CARRYOUT registers. Connect to 1, if not registered. See Table 16-146.

P_BYPASS must be 0 when CDIN_FDBK_SEL[0] = 1. See Table 16-142.

P_SRST_NInputDynamicLowSynchronous reset for P and OVFL_CARRYOUT registers. Connect to 1, if not registered. See Table 16-146.
P_ENInputDynamicHighEnable for P and OVFL_CARRYOUT registers. Connect to 1, if not registered. See Table 16-146.
CDOUT[47:0]OutputCascadeHighCascade output of result P. See Table 16-143.

Value of CDOUT is the same as P. The entire bus must either be dangling or drive an entire CDIN of another MACC_PA or MACC_PA_BC_ROM block in cascaded mode.

PASUBInputDynamicHighSubtract operation for Pre-adder of B and D.
PASUB_BYPASSInputStaticHighBypass PASUB register. Connect to 1, if not registered. See Table 16-145.
PASUB_AD_NInputStaticLowAsynchronous load data for PASUB register. See Table 16-145.
PASUB_SL_NInputDynamicLowSynchronous load for PASUB register. Connect to

1, if not registered. See Table 16-145.

PASUB_SD_NInputStaticLowSynchronous load data for PASUB register. See

Table 16-145.

PASUB_ENInputDynamicHighEnable for PASUB register. Connect to 1, if not registered. See Table 16-145.
CDIN_FDBK_SEL[1:0]InputDynamicHighSelect CDIN, P or 0 for operand E. See Table 16-142.
CDIN_FDBK_SEL_BYPASSInputStaticHighBypass CDIN_FDBK_SEL register. Connect to 1, if not registered. See Table 16-145.
CDIN_FDBK_SEL_AD_N[1:0]

[1:0]

InputStaticLowAsynchronous load data for CDIN_FDBK_SEL

register. See Table 16-145.

CDIN_FDBK_SEL_SL_NInputDynamicLowSynchronous load for CDIN_FDBK_SEL register. Connect to 1, if not registered. See Table 16-145.
CDIN_FDBK_SEL_SD_N[1:0]

[1:0]

CDIN_FDBK_SEL_SD_N

[1:0]

InputStaticLowSynchronous load data for CDIN_FDBK_SEL

register. See Table 16-145.

CDIN_FDBK_SEL_ENInputDynamicHighEnable for CDIN_FDBK_SEL register. Connect to 1, if not registered. See Table 16-145.
ARSHFT17InputDynamicHighArithmetic right-shift for operand E.

When asserted, a 17-bit arithmetic right-shift is performed on operand E. Refer to Table 16-142 to see how operand E is obtained from P, CDIN or 0. When SIMD = 1, ARSHFT17 must be 0.

ARSHFT17_BYPASSInputStaticHighBypass ARSHFT17 register. Connect to 1, if not registered. See Table 16-145.
ARSHFT17_AD_NInputStaticLowAsynchronous load data for ARSHFT17 register. See Table 16-145.
ARSHFT17_SL_NInputDynamicLowSynchronous load for ARSHFT17 register. Connect to 1, if not registered. See Table 16-145.
ARSHFT17_SD_NInputStaticLowSynchronous load data for ARSHFT17 register. See Table 16-145.
ARSHFT17_ENInputDynamicHighEnable for ARSHFT17 register. Connect to 1, if not registered. See Table 16-145.
SUBInputDynamicHighSubtract operation.
SUB_BYPASSInputStaticHighBypass SUB register. Connect to 1, if not registered. See Table 16-145.
SUB_AD_NInputStaticLowAsynchronous load data for SUB register. See Table 16-145
SUB_SL_NInputDynamicLowSynchronous load for SUB register. Connect to 1, if not registered. See Table 16-145.
SUB_SD_NInputStaticLowSynchronous load data for SUB register. See Table 16-145.
SUB_ENInputDynamicHighEnable for SUB register. Connect to 1, if not registered. See Table 16-145.
Tip: Static inputs are defined at design time and need to be tied to 0 or 1.
Table 16-142. Truth Table—Propagating Data to Operand E
CDIN_FDBK_SEL[1]CDIN_FDBK_SEL[0]ARSHFT17Operand E
00X48'b0
010P[47:0]
011{{17{P[47]}},P[47:17]}
1X0CDIN[47:0]
1X1{{17{CDIN[47]}},CDIN[47:17]}
Table 16-143. Truth Table—Computation of Result P and CDOUT
SIMDDOTPSUBPASUBResult P and CDOUT
0000CARRYIN + C[47:0] + E[47:0] + { (B[17:0] + D[17:0]) x A[17:0] }
0001CARRYIN + C[47:0] + E[47:0] + { (B[17:0] - D[17:0]) x A[17:0] }
0010CARRYIN + C[47:0] + E[47:0] - { (B[17:0] + D[17:0]) x A[17:0] }
0011CARRYIN + C[47:0] + E[47:0] - { (B[17:0] - D[17:0]) x A[17:0] }
0100CARRYIN + C[47:0] + E[47:0] +

{ (B[8:0] + D[8:0]) x A[17:9] + (B[17:9] + D[17:9]) x A[8:0] } x 29

0101CARRYIN + C[47:0] + E[47:0] +

{ (B[8:0] - D[8:0]) x A[17:9] + (B[17:9] - D[17:9]) x A[8:0] } x 29

0110CARRYIN + C[47:0] + E[47:0] +

{ (B[8:0] + D[8:0]) x A[17:9] - (B[17:9] + D[17:9]) x A[8:0] } x 29

0111CARRYIN + C[47:0] + E[47:0] +

{ (B[8:0] - D[8:0]) x A[17:9] - (B[17:9] - D[17:9]) x A[8:0] } x 29

1000P[17:0] = CARRYIN + { B[8:0] x A[8:0] }

P[47:18] = C[47:18] + E[47:18] + { (B[17:9] + D[17:9]) x A[17:9] }

1001P[17:0] = CARRYIN + { B[8:0] x A[8:0] }

P[47:18] = C[47:18] + E[47:18] + { (B[17:9] - D[17:9]) x A[17:9] }

1010P[17:0] = CARRYIN + { B[8:0] x A[8:0] }

P[47:18] = C[47:18] + E[47:18] - { (B[17:9] + D[17:9]) x A[17:9] }

1011P[17:0] = CARRYIN + { B[8:0] x A[8:0] }

P[47:18] = C[47:18] + E[47:18] - { (B[17:9] - D[17:9]) x A[17:9] }

Table 16-144. Truth Table—Computation of OVFL_CARRYOUT
OVFL_CARRYOUT_SELOVFL_CARRYOUTDescription
0(SUM[49] ^ SUM[48]) | (SUM[48] ^ SUM[47])True if overflow or underflow occurred.
1C[47] ^ E[47] ^ SUM[48]A signal that can be used to extend the final adder in the fabric.

SUM[49:0] is defined similarly to P[47:0] as shown in Table 16-143, except that SUM is a 50-bit quantity so that no overflow can occur. SUM[48] is the carry out bit of a 48-bit final adder producing P[47:0].

Table 16-145. Truth Table for Control Registers ARSHFT17, CDIN_FDBK_SEL, PASUB, and SUB
AL_N_AD_N_BYPASSCLK_EN_SL_N_SD_NDQn+1
0AD_N0XXXXX!AD_N
1X0Not risingXXXXQn
1X0?0XXXQn
1X0?10SD_NX!SD_N
1X0?11XDD
XX1X0XXXQn
XX1X10SD_NX!SD_N
XX1X11XDD
Table 16-146. Truth Table—Data Registers A, B, P, and OVFL_CARRYOUT
AL_N_BYPASSCLK_EN_SRST_NDQn+1
00XXXX0
10Not risingXXXQn
10?0XXQn
10?10X0
10?11DD
X1X0XXQn
X1X10X0
X1X11DD
Table 16-147. Truth Table—Data Registers C, CARRYIN, and D
_ARST_N_BYPASSCLK_EN_SRST_NDQn+1
00XXXX0
10Not risingXXXQn
10?0XXQn
10?10X0
10?11DD
X1X0XXQn
X1X10X0
X1X11DD