diff options
author | Patrick Urban <patrick.urban@web.de> | 2021-09-24 16:00:59 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2021-11-13 21:53:25 +0100 |
commit | 0a72952d5f259a23f9d1122d936d3d4d60ce224d (patch) | |
tree | 45c12931e95aade5618088a70d2f0187bd1fdeb2 /techlibs/gatemate/mul_map.v | |
parent | cfcc38582a4464b0a0551b842ea7a22c6f9a559d (diff) | |
download | yosys-0a72952d5f259a23f9d1122d936d3d4d60ce224d.tar.gz yosys-0a72952d5f259a23f9d1122d936d3d4d60ce224d.tar.bz2 yosys-0a72952d5f259a23f9d1122d936d3d4d60ce224d.zip |
synth_gatemate: Apply review remarks
* remove unused techmap models in `map_regs.v`
* replace RAM initilization loops with 320-bit-writes
* add script to test targets in top-level Makefile
* remove `MAXWIDTH` parameter and treat both vector widths individually in `mult_map.v`
* iterate over all modules in `gatemate_bramopt` pass
Diffstat (limited to 'techlibs/gatemate/mul_map.v')
-rw-r--r-- | techlibs/gatemate/mul_map.v | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/techlibs/gatemate/mul_map.v b/techlibs/gatemate/mul_map.v index 123a1e631..026509c75 100644 --- a/techlibs/gatemate/mul_map.v +++ b/techlibs/gatemate/mul_map.v @@ -36,27 +36,28 @@ module \$__MULMXN (A, B, Y); (* force_downto *) output [Y_WIDTH-1:0] Y; - localparam MAXWIDTH = `MAX(A_WIDTH, B_WIDTH) + ((A_SIGNED || B_SIGNED) ? 0 : 1); + localparam A_MAXWIDTH = A_WIDTH + (A_SIGNED ? 0 : 1); + localparam B_MAXWIDTH = B_WIDTH + (B_SIGNED ? 0 : 1); generate if (A_SIGNED) begin: blkA - wire signed [MAXWIDTH-1:0] Aext = $signed(A); + wire signed [A_MAXWIDTH-1:0] Aext = $signed(A); end else begin: blkA - wire [MAXWIDTH-1:0] Aext = A; + wire [A_MAXWIDTH-1:0] Aext = A; end if (B_SIGNED) begin: blkB - wire signed [MAXWIDTH-1:0] Bext = $signed(B); + wire signed [B_MAXWIDTH-1:0] Bext = $signed(B); end else begin: blkB - wire [MAXWIDTH-1:0] Bext = B; + wire [B_MAXWIDTH-1:0] Bext = B; end if (A_WIDTH >= B_WIDTH) begin CC_MULT #( - .A_WIDTH(MAXWIDTH), - .B_WIDTH(MAXWIDTH), - .P_WIDTH(`MIN(Y_WIDTH,MAXWIDTH+MAXWIDTH)), + .A_WIDTH(A_MAXWIDTH), + .B_WIDTH(B_MAXWIDTH), + .P_WIDTH(Y_WIDTH), ) _TECHMAP_REPLACE_ ( .A(blkA.Aext), .B(blkB.Bext), @@ -65,9 +66,9 @@ module \$__MULMXN (A, B, Y); end else begin // swap A,B CC_MULT #( - .A_WIDTH(MAXWIDTH), - .B_WIDTH(MAXWIDTH), - .P_WIDTH(`MIN(Y_WIDTH,MAXWIDTH+MAXWIDTH)), + .A_WIDTH(A_MAXWIDTH), + .B_WIDTH(B_MAXWIDTH), + .P_WIDTH(Y_WIDTH), ) _TECHMAP_REPLACE_ ( .A(blkB.Bext), .B(blkA.Aext), |