-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathudp_do_rx_reset.vhd
51 lines (43 loc) · 1.14 KB
/
udp_do_rx_reset.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-- Generates reset for Ethernet RX logic
--
-- Dave Sankey, July 2012
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity udp_do_rx_reset is
port (
mac_clk: in std_logic;
rst_macclk: in std_logic;
mac_rx_last: in std_logic;
mac_rx_valid: in std_logic;
rx_reset: out std_logic
);
end udp_do_rx_reset;
architecture rtl of udp_do_rx_reset is
signal rx_reset_sig: std_logic;
begin
rx_reset <= rx_reset_sig and not mac_rx_valid;
rx_reset_buf: process (mac_clk)
variable reset_buf: std_logic_vector(11 downto 0);
variable reset_latch: std_logic;
begin
if rising_edge(mac_clk) then
if rst_macclk = '1' then
reset_buf := x"800";
else
-- NB we qualify the real mac_rx_last with mac_rx_valid in udp_if_flat!
reset_buf := reset_buf(10 downto 0) & mac_rx_last;
end if;
if reset_buf(11) = '1' then
reset_latch := '1';
elsif mac_rx_valid = '1' then
reset_latch := '0';
end if;
rx_reset_sig <= reset_latch
-- pragma translate_off
after 4 ns
-- pragma translate_on
;
end if;
end process rx_reset_buf;
end architecture rtl;