From c21079e046412b36137476f76d58905cfcdc0cee Mon Sep 17 00:00:00 2001 From: KrystalDelusion Date: Thu, 2 Jun 2022 12:13:07 +1200 Subject: [PATCH 1/2] Regression testing for read-over-write emulation --- tests/arch/ecp5/memories.ys | 1 + tests/arch/gatemate/memory.ys | 3 +++ tests/arch/ice40/memories.ys | 2 ++ 3 files changed, 6 insertions(+) diff --git a/tests/arch/ecp5/memories.ys b/tests/arch/ecp5/memories.ys index 5cddcb952..a7a62b644 100644 --- a/tests/arch/ecp5/memories.ys +++ b/tests/arch/ecp5/memories.ys @@ -6,6 +6,7 @@ chparam -set ADDRESS_WIDTH 9 -set DATA_WIDTH 36 sync_ram_sdp hierarchy -top sync_ram_sdp synth_ecp5 -top sync_ram_sdp; cd sync_ram_sdp select -assert-count 1 t:DP16KD +select -assert-none t:LUT4 ## With parameters diff --git a/tests/arch/gatemate/memory.ys b/tests/arch/gatemate/memory.ys index e919920f8..6fddfe79e 100644 --- a/tests/arch/gatemate/memory.ys +++ b/tests/arch/gatemate/memory.ys @@ -5,6 +5,9 @@ synth_gatemate -top sync_ram_sdp -noiopad cd sync_ram_sdp select -assert-count 1 t:CC_BUFG select -assert-count 1 t:CC_BRAM_20K +select -assert-none t:CC_LUT3 +select -assert-none t:CC_LUT4 +select -assert-none t:CC_DFF # 512 x 80 bit -> CC_BRAM_40K SDP RAM design -reset diff --git a/tests/arch/ice40/memories.ys b/tests/arch/ice40/memories.ys index d480a3abe..3b6ac5624 100644 --- a/tests/arch/ice40/memories.ys +++ b/tests/arch/ice40/memories.ys @@ -6,6 +6,8 @@ chparam -set ADDRESS_WIDTH 11 -set DATA_WIDTH 2 sync_ram_sdp hierarchy -top sync_ram_sdp synth_ice40 -top sync_ram_sdp; cd sync_ram_sdp select -assert-count 1 t:SB_RAM40_4K +select -assert-none t:SB_LUT4 +select -assert-none t:SB_DFF design -reset; read_verilog -defer ../common/blockram.v chparam -set ADDRESS_WIDTH 10 -set DATA_WIDTH 4 sync_ram_sdp From 5f1aa4ff8a4843323dbbaa6ccfee97d84a32d5f6 Mon Sep 17 00:00:00 2001 From: KrystalDelusion Date: Fri, 3 Jun 2022 14:10:18 +1200 Subject: [PATCH 2/2] Using no_rw_check to achieve parity --- tests/arch/common/blockram.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/arch/common/blockram.v b/tests/arch/common/blockram.v index 5ed0736d0..8234d2f2c 100644 --- a/tests/arch/common/blockram.v +++ b/tests/arch/common/blockram.v @@ -33,6 +33,8 @@ module sync_ram_sdp #(parameter DATA_WIDTH=8, ADDRESS_WIDTH=10) localparam DEPTH = (2**ADDRESS_WIDTH-1); reg [WORD:0] data_out_r; + + (* no_rw_check *) reg [WORD:0] memory [0:DEPTH]; always @(posedge clk) begin