3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-06 17:44:09 +00:00

synth_gatemate: Rename multiplier factor parameters

This commit is contained in:
Patrick Urban 2021-09-24 21:53:39 +02:00 committed by Marcelina Kościelnicka
parent 6825de6343
commit d592bd93b8

View file

@ -17,9 +17,6 @@
* *
*/ */
`define MAX(a,b) ((a) > (b) ? (a) : (b))
`define MIN(a,b) ((a) < (b) ? (a) : (b))
(* techmap_celltype = "$mul $__mul" *) (* techmap_celltype = "$mul $__mul" *)
module \$__MULMXN (A, B, Y); module \$__MULMXN (A, B, Y);
@ -36,27 +33,27 @@ module \$__MULMXN (A, B, Y);
(* force_downto *) (* force_downto *)
output [Y_WIDTH-1:0] Y; output [Y_WIDTH-1:0] Y;
localparam A_MAXWIDTH = A_WIDTH + (A_SIGNED ? 0 : 1); localparam A_ADJWIDTH = A_WIDTH + (A_SIGNED ? 0 : 1);
localparam B_MAXWIDTH = B_WIDTH + (B_SIGNED ? 0 : 1); localparam B_ADJWIDTH = B_WIDTH + (B_SIGNED ? 0 : 1);
generate generate
if (A_SIGNED) begin: blkA if (A_SIGNED) begin: blkA
wire signed [A_MAXWIDTH-1:0] Aext = $signed(A); wire signed [A_ADJWIDTH-1:0] Aext = $signed(A);
end end
else begin: blkA else begin: blkA
wire [A_MAXWIDTH-1:0] Aext = A; wire [A_ADJWIDTH-1:0] Aext = A;
end end
if (B_SIGNED) begin: blkB if (B_SIGNED) begin: blkB
wire signed [B_MAXWIDTH-1:0] Bext = $signed(B); wire signed [B_ADJWIDTH-1:0] Bext = $signed(B);
end end
else begin: blkB else begin: blkB
wire [B_MAXWIDTH-1:0] Bext = B; wire [B_ADJWIDTH-1:0] Bext = B;
end end
if (A_WIDTH >= B_WIDTH) begin if (A_WIDTH >= B_WIDTH) begin
CC_MULT #( CC_MULT #(
.A_WIDTH(A_MAXWIDTH), .A_WIDTH(A_ADJWIDTH),
.B_WIDTH(B_MAXWIDTH), .B_WIDTH(B_ADJWIDTH),
.P_WIDTH(Y_WIDTH), .P_WIDTH(Y_WIDTH),
) _TECHMAP_REPLACE_ ( ) _TECHMAP_REPLACE_ (
.A(blkA.Aext), .A(blkA.Aext),
@ -66,8 +63,8 @@ module \$__MULMXN (A, B, Y);
end end
else begin // swap A,B else begin // swap A,B
CC_MULT #( CC_MULT #(
.A_WIDTH(A_MAXWIDTH), .A_WIDTH(B_ADJWIDTH),
.B_WIDTH(B_MAXWIDTH), .B_WIDTH(A_ADJWIDTH),
.P_WIDTH(Y_WIDTH), .P_WIDTH(Y_WIDTH),
) _TECHMAP_REPLACE_ ( ) _TECHMAP_REPLACE_ (
.A(blkB.Bext), .A(blkB.Bext),