assign Y = partial_sum[n-1];\r
end\r
else begin \r
+ if (A_SIGNED)\r
+ wire signed [`DSP_A_MAXWIDTH-1:0] Aext = $signed(A);\r
+ else\r
+ wire [`DSP_A_MAXWIDTH-1:0] Aext = A;\r
+ if (B_SIGNED)\r
+ wire signed [`DSP_B_MAXWIDTH-1:0] Bext = $signed(B);\r
+ else\r
+ wire [`DSP_B_MAXWIDTH-1:0] Bext = B;\r
+\r
`DSP_NAME #(\r
.A_SIGNED(A_SIGNED),\r
.B_SIGNED(B_SIGNED),\r
- .A_WIDTH(A_WIDTH),\r
- .B_WIDTH(B_WIDTH),\r
- .Y_WIDTH(`MIN(Y_WIDTH,A_WIDTH+B_WIDTH)),\r
+ .A_WIDTH(`DSP_A_MAXWIDTH),\r
+ .B_WIDTH(`DSP_B_MAXWIDTH),\r
+ .Y_WIDTH(`MIN(Y_WIDTH,`DSP_A_MAXWIDTH+`DSP_B_MAXWIDTH)),\r
) _TECHMAP_REPLACE_ (\r
- .A(A),\r
- .B(B),\r
+ .A(Aext),\r
+ .B(Bext),\r
.Y(Y)\r
);\r
end\r