From a25323b2462c1a3399d84b40c484a7d5f19ee33b Mon Sep 17 00:00:00 2001 From: Laszlo Nagy Date: Mon, 2 Dec 2019 13:14:20 +0000 Subject: [PATCH] util_adcfifo: fix read pointer Read pointer should be always behind the write pointer except when it reaches the last memory location where the writer stops. --- library/util_adcfifo/util_adcfifo.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/util_adcfifo/util_adcfifo.v b/library/util_adcfifo/util_adcfifo.v index e942478e0..422950f73 100644 --- a/library/util_adcfifo/util_adcfifo.v +++ b/library/util_adcfifo/util_adcfifo.v @@ -185,7 +185,7 @@ module util_adcfifo #( assign dma_read_rst_s = ~dma_xfer_req; assign dma_wready_s = (DMA_READY_ENABLE == 0) ? 1'b1 : dma_wready; - assign dma_rd_s = (dma_raddr <= {1'b0, dma_waddr_int}) ? dma_wready_s : 1'b0; + assign dma_rd_s = ((dma_raddr < {1'b0, dma_waddr_int}) || &dma_waddr_int) & dma_wready_s; always @(posedge dma_clk) begin if (dma_read_rst_s == 1'b1) begin