synth_gatemate: Rename multiplier factor parameters
authorPatrick Urban <patrick.urban@web.de>
Fri, 24 Sep 2021 19:53:39 +0000 (21:53 +0200)
committerMarcelina Koƛcielnicka <mwk@0x04.net>
Sat, 13 Nov 2021 20:53:25 +0000 (21:53 +0100)
techlibs/gatemate/mul_map.v

index 026509c7576eadcd960532e9ec72cc0aca599708..c2dd0a9b431568a1604357dbcbe23ce16f22f6e3 100644 (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" *)
 module \$__MULMXN (A, B, Y);
 
@@ -36,27 +33,27 @@ module \$__MULMXN (A, B, Y);
        (* force_downto *)
        output [Y_WIDTH-1:0] Y;
 
-       localparam A_MAXWIDTH = A_WIDTH + (A_SIGNED ? 0 : 1);
-       localparam B_MAXWIDTH = B_WIDTH + (B_SIGNED ? 0 : 1);
+       localparam A_ADJWIDTH = A_WIDTH + (A_SIGNED ? 0 : 1);
+       localparam B_ADJWIDTH = B_WIDTH + (B_SIGNED ? 0 : 1);
 
        generate
                if (A_SIGNED) begin: blkA
-                       wire signed [A_MAXWIDTH-1:0] Aext = $signed(A);
+                       wire signed [A_ADJWIDTH-1:0] Aext = $signed(A);
                end
                else begin: blkA
-                       wire [A_MAXWIDTH-1:0] Aext = A;
+                       wire [A_ADJWIDTH-1:0] Aext = A;
                end
                if (B_SIGNED) begin: blkB
-                       wire signed [B_MAXWIDTH-1:0] Bext = $signed(B);
+                       wire signed [B_ADJWIDTH-1:0] Bext = $signed(B);
                end
                else begin: blkB
-                       wire [B_MAXWIDTH-1:0] Bext = B;
+                       wire [B_ADJWIDTH-1:0] Bext = B;
                end
 
                if (A_WIDTH >= B_WIDTH) begin
                        CC_MULT #(
-                               .A_WIDTH(A_MAXWIDTH),
-                               .B_WIDTH(B_MAXWIDTH),
+                               .A_WIDTH(A_ADJWIDTH),
+                               .B_WIDTH(B_ADJWIDTH),
                                .P_WIDTH(Y_WIDTH),
                        ) _TECHMAP_REPLACE_ (
                                .A(blkA.Aext),
@@ -66,8 +63,8 @@ module \$__MULMXN (A, B, Y);
                end
                else begin // swap A,B
                        CC_MULT #(
-                               .A_WIDTH(A_MAXWIDTH),
-                               .B_WIDTH(B_MAXWIDTH),
+                               .A_WIDTH(B_ADJWIDTH),
+                               .B_WIDTH(A_ADJWIDTH),
                                .P_WIDTH(Y_WIDTH),
                        ) _TECHMAP_REPLACE_ (
                                .A(blkB.Bext),