From 812538a036f380b613d1cd3fe2f182e376150d16 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 12 Oct 2018 14:22:21 +0100 Subject: [PATCH] BRAM improvements Signed-off-by: David Shah --- techlibs/ecp5/brams_map.v | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/techlibs/ecp5/brams_map.v b/techlibs/ecp5/brams_map.v index 61dee7054..7f40f8458 100644 --- a/techlibs/ecp5/brams_map.v +++ b/techlibs/ecp5/brams_map.v @@ -22,7 +22,7 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); localparam CLKAMUX = CLKPOL2 ? "CLKA" : "INV"; localparam CLKBMUX = CLKPOL3 ? "CLKB" : "INV"; - localparam WRITEMODE_A = TRANSP2 ? "WRITETHROUGH" : "NORMAL"; + localparam WRITEMODE_A = TRANSP2 ? "WRITETHROUGH" : "READBEFOREWRITE"; generate if (CFG_DBITS == 1) begin DP16KD #( @@ -32,12 +32,13 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); .CLKAMUX(CLKAMUX), .CLKBMUX(CLKBMUX), .WRITEMODE_A(WRITEMODE_A), + .WRITEMODE_B("READBEFOREWRITE"), .GSR("DISABLED") ) _TECHMAP_REPLACE_ ( `include "bram_conn_1.vh" .CLKA(CLK2), .CLKB(CLK3), - .WEA(1'b1), .CEA(|A1EN), .OCEA(1'b1), - .WEB(1'b0), .CEB(B1EN), .OCEB(1'b1), + .WEA(|A1EN), .CEA(1'b1), .OCEA(1'b1), + .WEB(1'b0), .CEB(1'b1), .OCEB(B1EN), .RSTA(1'b0), .RSTB(1'b0) ); end else if (CFG_DBITS == 2) begin @@ -48,12 +49,13 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); .CLKAMUX(CLKAMUX), .CLKBMUX(CLKBMUX), .WRITEMODE_A(WRITEMODE_A), + .WRITEMODE_B("READBEFOREWRITE"), .GSR("DISABLED") ) _TECHMAP_REPLACE_ ( `include "bram_conn_2.vh" .CLKA(CLK2), .CLKB(CLK3), - .WEA(1'b1), .CEA(|A1EN), .OCEA(1'b1), - .WEB(1'b0), .CEB(B1EN), .OCEB(1'b1), + .WEA(|A1EN), .CEA(1'b1), .OCEA(1'b1), + .WEB(1'b0), .CEB(1'b1), .OCEB(B1EN), .RSTA(1'b0), .RSTB(1'b0) ); end else if (CFG_DBITS <= 4) begin @@ -64,12 +66,13 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); .CLKAMUX(CLKAMUX), .CLKBMUX(CLKBMUX), .WRITEMODE_A(WRITEMODE_A), + .WRITEMODE_B("READBEFOREWRITE"), .GSR("DISABLED") ) _TECHMAP_REPLACE_ ( `include "bram_conn_4.vh" .CLKA(CLK2), .CLKB(CLK3), - .WEA(1'b1), .CEA(|A1EN), .OCEA(1'b1), - .WEB(1'b0), .CEB(B1EN), .OCEB(1'b1), + .WEA(|A1EN), .CEA(1'b1), .OCEA(1'b1), + .WEB(1'b0), .CEB(1'b1), .OCEB(B1EN), .RSTA(1'b0), .RSTB(1'b0) ); end else if (CFG_DBITS <= 9) begin @@ -80,12 +83,13 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); .CLKAMUX(CLKAMUX), .CLKBMUX(CLKBMUX), .WRITEMODE_A(WRITEMODE_A), + .WRITEMODE_B("READBEFOREWRITE"), .GSR("DISABLED") ) _TECHMAP_REPLACE_ ( `include "bram_conn_9.vh" .CLKA(CLK2), .CLKB(CLK3), - .WEA(1'b1), .CEA(|A1EN), .OCEA(1'b1), - .WEB(1'b0), .CEB(B1EN), .OCEB(1'b1), + .WEA(|A1EN), .CEA(1'b1), .OCEA(1'b1), + .WEB(1'b0), .CEB(1'b1), .OCEB(B1EN), .RSTA(1'b0), .RSTB(1'b0) ); end else if (CFG_DBITS <= 18) begin @@ -96,12 +100,13 @@ module \$__ECP5_DP16KD (CLK2, CLK3, A1ADDR, A1DATA, A1EN, B1ADDR, B1DATA, B1EN); .CLKAMUX(CLKAMUX), .CLKBMUX(CLKBMUX), .WRITEMODE_A(WRITEMODE_A), + .WRITEMODE_B("READBEFOREWRITE"), .GSR("DISABLED") ) _TECHMAP_REPLACE_ ( `include "bram_conn_18.vh" .CLKA(CLK2), .CLKB(CLK3), - .WEA(1'b1), .CEA(|A1EN), .OCEA(1'b1), - .WEB(1'b0), .CEB(B1EN), .OCEB(1'b1), + .WEA(|A1EN), .CEA(1'b1), .OCEA(1'b1), + .WEB(1'b0), .CEB(1'b1), .OCEB(B1EN), .RSTA(1'b0), .RSTB(1'b0) ); end else begin -- 2.30.2