From ccc15324a6aea80d6790a0f4f4bc125e8d5bfa9c Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 9 Jun 2019 18:46:49 -0700 Subject: [PATCH] Fix bad frame mask --- rtl/axis_async_fifo.v | 2 +- rtl/axis_fifo.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl/axis_async_fifo.v b/rtl/axis_async_fifo.v index 659b2698d..d1b9fb4a4 100644 --- a/rtl/axis_async_fifo.v +++ b/rtl/axis_async_fifo.v @@ -302,7 +302,7 @@ always @* begin wr_ptr_cur_gray_next = wr_ptr_cur_next ^ (wr_ptr_cur_next >> 1); if (s_axis_tlast) begin // end of frame - if (DROP_BAD_FRAME && (USER_BAD_FRAME_MASK & s_axis_tuser == USER_BAD_FRAME_VALUE)) begin + if (DROP_BAD_FRAME && USER_BAD_FRAME_MASK & ~(s_axis_tuser ^ USER_BAD_FRAME_VALUE)) begin // bad packet, reset write pointer wr_ptr_cur_next = wr_ptr_reg; wr_ptr_cur_gray_next = wr_ptr_cur_next ^ (wr_ptr_cur_next >> 1); diff --git a/rtl/axis_fifo.v b/rtl/axis_fifo.v index 83d89900d..d6329b1d9 100644 --- a/rtl/axis_fifo.v +++ b/rtl/axis_fifo.v @@ -207,7 +207,7 @@ always @* begin wr_ptr_cur_next = wr_ptr_cur_reg + 1; if (s_axis_tlast) begin // end of frame - if (DROP_BAD_FRAME && (USER_BAD_FRAME_MASK & s_axis_tuser == USER_BAD_FRAME_VALUE)) begin + if (DROP_BAD_FRAME && USER_BAD_FRAME_MASK & ~(s_axis_tuser ^ USER_BAD_FRAME_VALUE)) begin // bad packet, reset write pointer wr_ptr_cur_next = wr_ptr_reg; bad_frame_next = 1'b1;