Line 25... |
Line 25... |
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_nomac is
|
entity IP_complete_nomac 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 39... |
Line 43... |
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 94... |
Line 99... |
mac_data_out : out std_logic_vector (7 downto 0) -- ethernet frame (from dst mac addr through to last byte of frame)
|
mac_data_out : out std_logic_vector (7 downto 0) -- ethernet frame (from dst mac addr through to last byte of frame)
|
);
|
);
|
END COMPONENT;
|
END COMPONENT;
|
|
|
COMPONENT arp
|
COMPONENT arp
|
PORT(
|
generic (
|
|
CLOCK_FREQ : integer := 125000000; -- freq of data_in_clk -- needed to timout cntr
|
|
ARP_TIMEOUT : integer := 60 -- ARP response timeout (s)
|
|
);
|
|
Port (
|
-- lookup request signals
|
-- lookup request signals
|
arp_req_req : in arp_req_req_type;
|
arp_req_req : in arp_req_req_type;
|
arp_req_rslt : out arp_req_rslt_type;
|
arp_req_rslt : out arp_req_rslt_type;
|
-- MAC layer RX signals
|
-- MAC layer RX signals
|
data_in_clk : in STD_LOGIC;
|
data_in_clk : in STD_LOGIC;
|
Line 116... |
Line 125... |
data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame
|
data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame
|
data_out : out std_logic_vector (7 downto 0); -- ethernet frame (from dst mac addr through to last byte of frame)
|
data_out : out std_logic_vector (7 downto 0); -- ethernet frame (from dst mac addr through to last byte of frame)
|
-- system signals
|
-- system signals
|
our_mac_address : in STD_LOGIC_VECTOR (47 downto 0);
|
our_mac_address : in STD_LOGIC_VECTOR (47 downto 0);
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0);
|
|
control : in arp_control_type;
|
req_count : out STD_LOGIC_VECTOR(7 downto 0) -- count of arp pkts received
|
req_count : out STD_LOGIC_VECTOR(7 downto 0) -- count of arp pkts received
|
);
|
);
|
END COMPONENT;
|
END COMPONENT;
|
|
|
COMPONENT tx_arbitrator
|
COMPONENT tx_arbitrator
|
Line 224... |
Line 234... |
|
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
-- Instantiate the ARP layer
|
-- Instantiate the ARP layer
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
arp_layer : arp
|
arp_layer : arp
|
|
generic map (
|
|
CLOCK_FREQ => CLOCK_FREQ,
|
|
ARP_TIMEOUT => ARP_TIMEOUT
|
|
)
|
Port map(
|
Port map(
|
-- request signals
|
-- request signals
|
arp_req_req => arp_req_req_int,
|
arp_req_req => arp_req_req_int,
|
arp_req_rslt => arp_req_rslt_int,
|
arp_req_rslt => arp_req_rslt_int,
|
-- rx signals
|
-- rx signals
|
Line 246... |
Line 260... |
data_out_last => arp_mac_last,
|
data_out_last => arp_mac_last,
|
data_out => arp_mac_data_out,
|
data_out => arp_mac_data_out,
|
-- system signals
|
-- system signals
|
our_mac_address => our_mac_address,
|
our_mac_address => our_mac_address,
|
our_ip_address => our_ip_address,
|
our_ip_address => our_ip_address,
|
|
control => control.arp_controls,
|
req_count => arp_pkt_count
|
req_count => arp_pkt_count
|
);
|
);
|
|
|
|
|
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|