phy: rx: Introduce simple glitch filter

This commit is contained in:
Markus Koch 2021-08-28 14:22:28 +02:00
parent 08bd5f166b
commit 5d6df0219b

View File

@ -39,6 +39,7 @@ begin
-- Signal conditioning
signal rx : std_logic;
signal rx_last : std_logic;
signal rx_last_static : std_logic;
signal rx_edge : std_logic;
-- Bit recovery
@ -61,11 +62,23 @@ begin
data_out => rx
);
-- Edge detector for RX
rx_last <= '0' when rst
else rx when rising_edge(clk)
;
rx_edge <= rx_last xor rx;
-- Edge detector for RX (+glitch filter)
edgedet : process(clk, rst) is
begin
if rst then
rx_last <= '0';
rx_last_static <= '0';
rx_edge <= '0';
elsif rising_edge(clk) then
rx_edge <= '0';
if (rx_last = rx) then
rx_edge <= rx_last_static xor rx;
rx_last_static <= rx;
end if;
rx_last <= rx;
end if;
end process edgedet;
demanchestizer : block
-- Transition detector