Closed M0stafaRady closed 9 months ago
The glitch filter is supposed to produce "1" or "0" when it sees a number of consecutive 1s or 0s based on the sampling rate. Your scenario does not honor the sampling rate. @M0stafaRady
The glitch filter assumes that the glitches are happening as the signal changes its level.
The glitch filter logic don't ignore the effect of the glitches in all the possible cases. From the wave form below a glitch of 1 is inserted in a bit of 0 and that makes the out value to be 1 instead of 0. Because the
all_zeros
andall_ones
conditions aren't valid the value doesn't change and this kept the old/wrong value. arrow point to the glitchfilter code used: https://github.com/shalan/IP_Utilities/blob/259117368d3fb0638032219220550962a80af2f6/rtl/aucohl_lib.v#L105-L141
suggested fix: update the filter to get rid of the glitch by ignoring small pulse widths. Like the code below generated by AI
`module uart_glitch_filter ( input wire clk, // Clock input input wire reset, // Reset input input wire rx_in, // UART RX input output reg rx_out // Filtered UART RX output );
endmodule `