From 7654d874ae235afcf6c2f9665d81ef4d6910f4ee Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 11 Feb 2019 19:30:57 -0800 Subject: [PATCH] Fix out of range access due to off by one error --- rtl/axi_dma_wr.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/axi_dma_wr.v b/rtl/axi_dma_wr.v index 0798d42..2d3d31b 100644 --- a/rtl/axi_dma_wr.v +++ b/rtl/axi_dma_wr.v @@ -494,7 +494,7 @@ always @* begin if (AXIS_KEEP_ENABLE) begin cycle_size = AXIS_KEEP_WIDTH_INT; - for (i = AXIS_KEEP_WIDTH_INT; i >= 0; i = i - 1) begin + for (i = AXIS_KEEP_WIDTH_INT-1; i >= 0; i = i - 1) begin if (!shift_axis_tkeep[i] && (!first_cycle_reg || i >= offset_reg)) begin cycle_size = i; end