URL
https://opencores.org/ocsvn/udp_ip_stack/udp_ip_stack/trunk
Subversion Repositories udp_ip_stack
Compare Revisions
- This comparison shows the changes necessary to convert path
/udp_ip_stack/trunk/rtl
- from Rev 4 to Rev 2
- ↔ Reverse comparison
Rev 4 → Rev 2
/vhdl/IPv4.vhd
21,7 → 21,6
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - separated RX and TX clocks |
-- Revision 0.03 - Added mac_data_out_first |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
61,7 → 60,6
mac_tx_granted : in std_logic; -- indicates that access to channel has been granted |
mac_data_out_ready : in std_logic; -- indicates system ready to consume data |
mac_data_out_valid : out std_logic; -- indicates data out is valid |
mac_data_out_first : out std_logic; -- with data out valid indicates the first byte of a frame |
mac_data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame |
mac_data_out : out std_logic_vector (7 downto 0) -- ethernet frame (from dst mac addr through to last byte of frame) |
); |
76,9 → 74,8
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_data_out_ready : out std_logic; -- indicates IP TX is ready to take data |
|
-- system signals |
clk : in STD_LOGIC; -- same clock used to clock mac data and ip data |
-- system control signals |
clk : in STD_LOGIC; |
reset : in STD_LOGIC; |
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0); |
our_mac_address : in std_logic_vector (47 downto 0); |
89,10 → 86,9
mac_tx_req : out std_logic; -- indicates that ip wants access to channel (stays up for as long as tx) |
mac_tx_granted : in std_logic; -- indicates that access to channel has been granted |
mac_data_out_ready : in std_logic; -- indicates system ready to consume data |
mac_data_out_valid : out std_logic; -- indicates data out is valid |
mac_data_out_first : out std_logic; -- with data out valid indicates the first byte of a frame |
mac_data_out_valid : out std_logic; -- indicates data out is valid |
mac_data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame |
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; |
|
130,7 → 126,6
mac_tx_granted => mac_tx_granted, |
mac_data_out_ready => mac_data_out_ready, |
mac_data_out_valid => mac_data_out_valid, |
mac_data_out_first => mac_data_out_first, |
mac_data_out_last => mac_data_out_last, |
mac_data_out => mac_data_out |
); |
/vhdl/arp.vhd
21,9 → 21,7
-- |
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - Added req for mac tx and wait for grant |
-- Revision 0.03 - Added data_out_first |
|
-- Revision 0.02 - Added req for mac tx and wait for grant |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
49,7 → 47,6
data_out_clk : in std_logic; |
data_out_ready : in std_logic; -- indicates system ready to consume data |
data_out_valid : out std_logic; -- indicates data out is valid |
data_out_first : out std_logic; -- with data out valid indicates the first 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) |
-- system signals |
556,11 → 553,8
set_chn_reqd, clear_reply_req) |
begin |
-- set output followers |
mac_tx_req <= tx_mac_chn_reqd; |
mac_tx_req <= tx_mac_chn_reqd; |
|
-- set initial values for combinatorial outputs |
data_out_first <= '0'; |
|
case tx_state is |
when SEND => |
if data_out_ready = '1' and kill_data_out_valid = '0' then |
610,10 → 604,7
tx_count_mode <= INCR; |
end if; |
case tx_count is |
when x"00" => |
data_out_first <= data_out_ready; |
data_out <= x"ff"; -- dst = broadcast |
|
when x"00" => data_out <= x"ff"; -- dst = broadcast |
when x"01" => data_out <= x"ff"; |
when x"02" => data_out <= x"ff"; |
when x"03" => data_out <= x"ff"; |
/vhdl/ml605/IP_complete.vhd
75,8 → 75,7
ip_rx_start : out std_logic; -- indicates receipt of ip frame. |
ip_rx : out ipv4_rx_type; |
-- system signals |
rx_clk : in STD_LOGIC; |
tx_clk : in STD_LOGIC; |
clk : in std_logic; |
reset : in STD_LOGIC; |
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0); |
our_mac_address : in std_logic_vector (47 downto 0); |
87,13 → 86,12
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tfirst : out std_logic; -- indicates first byte of frame |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
-- MAC Receiver |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
mac_rx_tvalid : in std_logic; -- indicates tdata is valid |
mac_rx_tready : out std_logic; -- tells mac that we are ready to take data |
mac_rx_tlast : in std_logic -- indicates last byte of the trame |
mac_rx_tlast : in std_logic -- indicates last byte of the trame |
); |
END COMPONENT; |
|
181,8 → 179,7
ip_rx_start => ip_rx_start, |
ip_rx => ip_rx, |
-- system signals |
rx_clk => mac_rx_clock, |
tx_clk => mac_rx_clock, |
clk => mac_rx_clock, |
reset => reset, |
our_ip_address => our_ip_address, |
our_mac_address => our_mac_address, |
192,7 → 189,6
-- MAC Transmitter |
mac_tx_tready => mac_tx_tready_int, |
mac_tx_tvalid => mac_tx_tvalid, |
mac_tx_tfirst => open, |
mac_tx_tlast => mac_tx_tlast, |
mac_tx_tdata => mac_tx_tdata, |
-- MAC Receiver |
/vhdl/ml605/UDP_Complete.vhd
94,7 → 94,6
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tfirst : out std_logic; -- indicates first byte of frame |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
-- MAC Receiver |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
209,7 → 208,6
-- MAC Transmitter |
mac_tx_tready => mac_tx_tready_int, |
mac_tx_tvalid => mac_tx_tvalid, |
mac_tx_tfirst => open, |
mac_tx_tlast => mac_tx_tlast, |
mac_tx_tdata => mac_tx_tdata, |
-- MAC Receiver |
/vhdl/tx_arbitrator.vhd
16,7 → 16,6
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - Made sticky on port M1 to optimise access on this port and allow immediate grant |
-- Revision 0.03 - Added first |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
33,7 → 32,6
grant_1 : out std_logic; |
data_1 : in std_logic_vector(7 downto 0); -- data byte to tx |
valid_1 : in std_logic; -- tdata is valid |
first_1 : in std_logic; -- indicates first byte of frame |
last_1 : in std_logic; -- indicates last byte of frame |
|
req_2 : in std_logic; |
40,12 → 38,10
grant_2 : out std_logic; |
data_2 : in std_logic_vector(7 downto 0); -- data byte to tx |
valid_2 : in std_logic; -- tdata is valid |
first_2 : in std_logic; -- indicates first byte of frame |
last_2 : in std_logic; -- indicates last byte of frame |
|
data : out std_logic_vector(7 downto 0); -- data byte to tx |
valid : out std_logic; -- tdata is valid |
first : out std_logic; -- indicates first byte of frame |
last : out std_logic -- indicates last byte of frame |
); |
end tx_arbitrator; |
59,8 → 55,8
begin |
combinatorial : process ( |
grant, |
data_1, valid_1, first_1, last_1, |
data_2, valid_2, first_2, last_2 |
data_1, valid_1, last_1, |
data_2, valid_2, last_2 |
) |
begin |
-- grant outputs |
77,12 → 73,10
if grant = M1 then |
data <= data_1; |
valid <= valid_1; |
first <= first_1; |
last <= last_1; |
else |
data <= data_2; |
valid <= valid_2; |
first <= first_2; |
last <= last_2; |
end if; |
end process; |
/vhdl/IP_complete_nomac.vhd
15,7 → 15,6
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - separated RX and TX clocks |
-- Revision 0.03 - Added mac_tx_tfirst |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
48,7 → 47,6
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tfirst : out std_logic; -- indicates first byte of frame |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
-- MAC Receiver |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
89,7 → 87,6
mac_tx_granted : in std_logic; -- indicates that access to channel has been granted |
mac_data_out_ready : in std_logic; -- indicates system ready to consume data |
mac_data_out_valid : out std_logic; -- indicates data out is valid |
mac_data_out_first : out std_logic; -- with data out valid indicates the first byte of a frame |
mac_data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame |
mac_data_out : out std_logic_vector (7 downto 0) -- ethernet frame (from dst mac addr through to last byte of frame) |
); |
112,7 → 109,6
data_out_clk : in std_logic; |
data_out_ready : in std_logic; -- indicates system ready to consume data |
data_out_valid : out std_logic; -- indicates data out is valid |
data_out_first : out std_logic; -- with data out valid indicates the first 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) |
-- system signals |
131,7 → 127,6
grant_1 : out std_logic; |
data_1 : in std_logic_vector(7 downto 0); -- data byte to tx |
valid_1 : in std_logic; -- tdata is valid |
first_1 : in std_logic; -- indicates first byte of frame |
last_1 : in std_logic; -- indicates last byte of frame |
|
req_2 : in std_logic; |
138,12 → 133,10
grant_2 : out std_logic; |
data_2 : in std_logic_vector(7 downto 0); -- data byte to tx |
valid_2 : in std_logic; -- tdata is valid |
first_2 : in std_logic; -- indicates first byte of frame |
last_2 : in std_logic; -- indicates last byte of frame |
|
data : out std_logic_vector(7 downto 0); -- data byte to tx |
valid : out std_logic; -- tdata is valid |
first : out std_logic; -- indicates first byte of frame |
last : out std_logic -- indicates last byte of frame |
); |
END COMPONENT; |
160,13 → 153,11
signal ip_mac_grant : std_logic; |
signal ip_mac_data_out : std_logic_vector (7 downto 0); |
signal ip_mac_valid : std_logic; |
signal ip_mac_first : std_logic; |
signal ip_mac_last : std_logic; |
signal arp_mac_req : std_logic; |
signal arp_mac_grant : std_logic; |
signal arp_mac_data_out : std_logic_vector (7 downto 0); |
signal arp_mac_valid : std_logic; |
signal arp_mac_first : std_logic; |
signal arp_mac_last : std_logic; |
-- MAC RX bus |
signal mac_rx_tready_int : std_logic; |
173,7 → 164,6
-- MAC TX bus |
signal mac_tx_tdata_int : std_logic_vector (7 downto 0); |
signal mac_tx_tvalid_int : std_logic; |
signal mac_tx_tfirst_int : std_logic; |
signal mac_tx_tlast_int : std_logic; |
-- control signals |
signal mac_tx_granted_int : std_logic; |
185,7 → 175,6
-- set followers |
mac_tx_tdata <= mac_tx_tdata_int; |
mac_tx_tvalid <= mac_tx_tvalid_int; |
mac_tx_tfirst <= mac_tx_tfirst_int; |
mac_tx_tlast <= mac_tx_tlast_int; |
|
mac_rx_tready <= mac_rx_tready_int; |
214,7 → 203,6
mac_tx_granted => ip_mac_grant, |
mac_data_out_ready => mac_tx_tready, |
mac_data_out_valid => ip_mac_valid, |
mac_data_out_first => ip_mac_first, |
mac_data_out_last => ip_mac_last, |
mac_data_out => ip_mac_data_out, |
mac_data_in => mac_rx_tdata, |
242,7 → 230,6
data_out_clk => tx_clk, |
data_out_ready => mac_tx_tready, |
data_out_valid => arp_mac_valid, |
data_out_first => arp_mac_first, |
data_out_last => arp_mac_last, |
data_out => arp_mac_data_out, |
-- system signals |
264,7 → 251,6
grant_1 => ip_mac_grant, |
data_1 => ip_mac_data_out, |
valid_1 => ip_mac_valid, |
first_1 => ip_mac_first, |
last_1 => ip_mac_last, |
|
req_2 => arp_mac_req, |
271,12 → 257,10
grant_2 => arp_mac_grant, |
data_2 => arp_mac_data_out, |
valid_2 => arp_mac_valid, |
first_2 => arp_mac_first, |
last_2 => arp_mac_last, |
|
data => mac_tx_tdata_int, |
valid => mac_tx_tvalid_int, |
first => mac_tx_tfirst_int, |
last => mac_tx_tlast_int |
); |
|
/vhdl/UDP_Complete_nomac.vhd
15,7 → 15,6
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - separated RX and TX clocks |
-- Revision 0.03 - Added mac_tx_tfirst |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
51,7 → 50,6
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tfirst : out std_logic; -- indicates first byte of frame |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
-- MAC Receiver |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
124,19 → 122,18
our_ip_address : in STD_LOGIC_VECTOR (31 downto 0); |
our_mac_address : in std_logic_vector (47 downto 0); |
-- status signals |
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 |
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 |
-- MAC Transmitter |
mac_tx_tdata : out std_logic_vector(7 downto 0); -- data byte to tx |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tfirst : out std_logic; -- indicates first byte of frame |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
mac_tx_tvalid : out std_logic; -- tdata is valid |
mac_tx_tready : in std_logic; -- mac is ready to accept data |
mac_tx_tlast : out std_logic; -- indicates last byte of frame |
-- MAC Receiver |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
mac_rx_tvalid : in std_logic; -- indicates tdata is valid |
mac_rx_tready : out std_logic; -- tells mac that we are ready to take data |
mac_rx_tlast : in std_logic -- indicates last byte of the trame |
mac_rx_tdata : in std_logic_vector(7 downto 0); -- data byte received |
mac_rx_tvalid : in std_logic; -- indicates tdata is valid |
mac_rx_tready : out std_logic; -- tells mac that we are ready to take data |
mac_rx_tlast : in std_logic -- indicates last byte of the trame |
); |
end component; |
|
211,7 → 208,6
mac_tx_tdata => mac_tx_tdata, |
mac_tx_tvalid => mac_tx_tvalid, |
mac_tx_tready => mac_tx_tready, |
mac_tx_tfirst => mac_tx_tfirst, |
mac_tx_tlast => mac_tx_tlast, |
-- MAC Receiver |
mac_rx_tdata => mac_rx_tdata, |
/vhdl/IPv4_TX.vhd
18,7 → 18,6
-- Revision: |
-- Revision 0.01 - File Created |
-- Revision 0.02 - fixed up setting of tx_result control defaults |
-- Revision 0.03 - Added data_out_first |
-- Additional Comments: |
-- |
---------------------------------------------------------------------------------- |
50,7 → 49,6
mac_tx_granted : in std_logic; -- indicates that access to channel has been granted |
mac_data_out_ready : in std_logic; -- indicates system ready to consume data |
mac_data_out_valid : out std_logic; -- indicates data out is valid |
mac_data_out_first : out std_logic; -- with data out valid indicates the first byte of a frame |
mac_data_out_last : out std_logic; -- with data out valid indicates the last byte of a frame |
mac_data_out : out std_logic_vector (7 downto 0) -- ethernet frame (from dst mac addr through to last byte of frame) |
); |
174,9 → 172,6
arp_req_req.lookup_req <= mac_lookup_req; |
arp_req_req.ip <= arp_req_ip_reg; |
|
-- set initial values for combinatorial outputs |
mac_data_out_first <= '0'; |
|
case tx_state is |
when SEND_ETH_HDR | SEND_IP_HDR => |
mac_data_out <= tx_data; |
281,10 → 276,7
tx_count_mode <= INCR; |
end if; |
case tx_count is |
when x"000" => |
mac_data_out_first <= mac_data_out_ready; |
tx_data <= tx_mac (47 downto 40); -- trg = mac from ARP lookup |
|
when x"000" => tx_data <= tx_mac (47 downto 40); -- trg = mac from ARP lookup |
when x"001" => tx_data <= tx_mac (39 downto 32); |
when x"002" => tx_data <= tx_mac (31 downto 24); |
when x"003" => tx_data <= tx_mac (23 downto 16); |
391,8 → 383,6
tx_result_reg <= IPTX_RESULT_NONE; |
tx_mac <= (others => '0'); |
tx_mac_chn_reqd <= '0'; |
mac_lookup_req <= '0'; |
|
else |
-- Next tx_state processing |
if set_tx_state = '1' then |