Line 23... |
Line 23... |
use work.axi.all;
|
use work.axi.all;
|
use work.ipv4_types.all;
|
use work.ipv4_types.all;
|
use work.arp_types.all;
|
use work.arp_types.all;
|
|
|
entity IP_complete is
|
entity IP_complete is
|
|
generic (
|
|
CLOCK_FREQ : integer := 125000000; -- freq of data_in_clk -- needed to timout cntr
|
|
ARP_TIMEOUT : integer := 60 -- ARP response timeout (s)
|
|
);
|
Port (
|
Port (
|
-- IP Layer signals
|
-- IP Layer signals
|
ip_tx_start : in std_logic;
|
ip_tx_start : in std_logic;
|
ip_tx : in ipv4_tx_type; -- IP tx cxns
|
ip_tx : in ipv4_tx_type; -- IP tx cxns
|
ip_tx_result : out std_logic_vector (1 downto 0); -- tx status (changes during transmission)
|
ip_tx_result : out std_logic_vector (1 downto 0); -- tx status (changes during transmission)
|
Line 38... |
Line 42... |
clk_in_n : in std_logic;
|
clk_in_n : in std_logic;
|
clk_out : out std_logic;
|
clk_out : out std_logic;
|
reset : in STD_LOGIC;
|
reset : in STD_LOGIC;
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
our_mac_address : in std_logic_vector (47 downto 0);
|
our_mac_address : in std_logic_vector (47 downto 0);
|
|
control : in ip_control_type;
|
-- status signals
|
-- status signals
|
arp_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- count of arp pkts received
|
arp_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- count of arp pkts received
|
ip_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- number of IP pkts received for us
|
ip_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- number of IP pkts received for us
|
-- GMII Interface
|
-- GMII Interface
|
phy_resetn : out std_logic;
|
phy_resetn : out std_logic;
|
Line 64... |
Line 69... |
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Component Declaration for the IP layer
|
-- Component Declaration for the IP layer
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
COMPONENT IP_complete_nomac
|
COMPONENT IP_complete_nomac
|
PORT(
|
generic (
|
|
CLOCK_FREQ : integer := 125000000; -- freq of data_in_clk -- needed to timout cntr
|
|
ARP_TIMEOUT : integer := 60 -- ARP response timeout (s)
|
|
);
|
|
Port (
|
-- IP Layer signals
|
-- IP Layer signals
|
ip_tx_start : in std_logic;
|
ip_tx_start : in std_logic;
|
ip_tx : in ipv4_tx_type; -- IP tx cxns
|
ip_tx : in ipv4_tx_type; -- IP tx cxns
|
ip_tx_result : out std_logic_vector (1 downto 0); -- tx status (changes during transmission)
|
ip_tx_result : out std_logic_vector (1 downto 0); -- tx status (changes during transmission)
|
ip_tx_data_out_ready : out std_logic; -- indicates IP TX is ready to take data
|
ip_tx_data_out_ready : out std_logic; -- indicates IP TX is ready to take data
|
Line 78... |
Line 87... |
rx_clk : in STD_LOGIC;
|
rx_clk : in STD_LOGIC;
|
tx_clk : in STD_LOGIC;
|
tx_clk : in STD_LOGIC;
|
reset : in STD_LOGIC;
|
reset : in STD_LOGIC;
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
our_mac_address : in std_logic_vector (47 downto 0);
|
our_mac_address : in std_logic_vector (47 downto 0);
|
|
control : in ip_control_type;
|
-- status signals
|
-- status signals
|
arp_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- count of arp pkts received
|
arp_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- count of arp pkts received
|
ip_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- number of IP pkts received for us
|
ip_pkt_count : out STD_LOGIC_VECTOR(7 downto 0); -- number of IP pkts received for us
|
-- MAC Transmitter
|
-- MAC Transmitter
|
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx
|
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx
|
Line 169... |
Line 179... |
|
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Instantiate the IP layer
|
-- Instantiate the IP layer
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
|
|
IP_layer : IP_complete_nomac PORT MAP
|
IP_layer : IP_complete_nomac
|
(
|
generic map (
|
|
CLOCK_FREQ => CLOCK_FREQ,
|
|
ARP_TIMEOUT => ARP_TIMEOUT
|
|
)
|
|
PORT MAP (
|
-- IP Layer signals
|
-- IP Layer signals
|
ip_tx_start => ip_tx_start,
|
ip_tx_start => ip_tx_start,
|
ip_tx => ip_tx,
|
ip_tx => ip_tx,
|
ip_tx_result => ip_tx_result,
|
ip_tx_result => ip_tx_result,
|
ip_tx_data_out_ready => ip_tx_data_out_ready,
|
ip_tx_data_out_ready => ip_tx_data_out_ready,
|
Line 184... |
Line 198... |
rx_clk => mac_rx_clock,
|
rx_clk => mac_rx_clock,
|
tx_clk => mac_rx_clock,
|
tx_clk => mac_rx_clock,
|
reset => reset,
|
reset => reset,
|
our_ip_address => our_ip_address,
|
our_ip_address => our_ip_address,
|
our_mac_address => our_mac_address,
|
our_mac_address => our_mac_address,
|
|
control => control,
|
-- status signals
|
-- status signals
|
arp_pkt_count => arp_pkt_count,
|
arp_pkt_count => arp_pkt_count,
|
ip_pkt_count => ip_pkt_count,
|
ip_pkt_count => ip_pkt_count,
|
-- MAC Transmitter
|
-- MAC Transmitter
|
mac_tx_tready => mac_tx_tready_int,
|
mac_tx_tready => mac_tx_tready_int,
|