OpenCores
URL https://opencores.org/ocsvn/udp_ip_stack/udp_ip_stack/trunk

Subversion Repositories udp_ip_stack

[/] [udp_ip_stack/] [trunk/] [contrib/] [from_tim/] [udp_ip_stack/] [tags/] [v1.2/] [rtl/] [vhdl/] [UDP_Complete_nomac.vhd] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 pjf
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    09:38:49 06/13/2011 
6
-- Design Name: 
7
-- Module Name:    UDP_Complete_nomac - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Revision 0.02 - separated RX and TX clocks
18
-- Revision 0.03 - Added mac_tx_tfirst
19
-- Additional Comments: 
20
--
21
----------------------------------------------------------------------------------
22
library IEEE;
23
use IEEE.STD_LOGIC_1164.ALL;
24
use IEEE.NUMERIC_STD.ALL;
25
use work.axi.all;
26
use work.ipv4_types.all;
27
use work.arp_types.all;
28
 
29
entity UDP_Complete_nomac is
30
    Port (
31
                        -- UDP TX signals
32
                        udp_tx_start                    : in std_logic;                                                 -- indicates req to tx UDP
33
                        udp_txi                                 : in udp_tx_type;                                                       -- UDP tx cxns
34
                        udp_tx_result                   : out std_logic_vector (1 downto 0);-- tx status (changes during transmission)
35
                        udp_tx_data_out_ready: out std_logic;                                                   -- indicates udp_tx is ready to take data
36
                        -- UDP RX signals
37
                        udp_rx_start                    : out std_logic;                                                        -- indicates receipt of udp header
38
                        udp_rxo                                 : out udp_rx_type;
39
                        -- IP RX signals
40
                        ip_rx_hdr                               : out ipv4_rx_header_type;
41
                        -- system signals
42
                        rx_clk                                  : in  STD_LOGIC;
43
                        tx_clk                                  : in  STD_LOGIC;
44
                        reset                                   : in  STD_LOGIC;
45
                        our_ip_address          : in STD_LOGIC_VECTOR (31 downto 0);
46
                        our_mac_address                 : in std_logic_vector (47 downto 0);
47
                        -- status signals
48
                        arp_pkt_count                   : out STD_LOGIC_VECTOR(7 downto 0);                      -- count of arp pkts received
49
                        ip_pkt_count                    : out STD_LOGIC_VECTOR(7 downto 0);                      -- number of IP pkts received for us
50
                        -- MAC Transmitter
51
                        mac_tx_tdata         : out  std_logic_vector(7 downto 0);        -- data byte to tx
52
                        mac_tx_tvalid        : out  std_logic;                                                  -- tdata is valid
53
                        mac_tx_tready        : in std_logic;                                                    -- mac is ready to accept data
54
                        mac_tx_tfirst        : out  std_logic;                                                  -- indicates first byte of frame
55
                        mac_tx_tlast         : out  std_logic;                                                  -- indicates last byte of frame
56
                        -- MAC Receiver
57
                        mac_rx_tdata         : in std_logic_vector(7 downto 0);  -- data byte received
58
                        mac_rx_tvalid        : in std_logic;                                                    -- indicates tdata is valid
59
                        mac_rx_tready        : out  std_logic;                                                  -- tells mac that we are ready to take data
60
                        mac_rx_tlast         : in std_logic                                                             -- indicates last byte of the trame
61
                        );
62
end UDP_Complete_nomac;
63
 
64
 
65
architecture structural of UDP_Complete_nomac is
66
 
67
  ------------------------------------------------------------------------------
68
  -- Component Declaration for UDP TX
69
  ------------------------------------------------------------------------------
70
 
71
    COMPONENT UDP_TX
72
    PORT(
73
                        -- UDP Layer signals
74
                        udp_tx_start                    : in std_logic;                                                 -- indicates req to tx UDP
75
                        udp_txi                                 : in udp_tx_type;                                                       -- UDP tx cxns
76
                        udp_tx_result                   : out std_logic_vector (1 downto 0);-- tx status (changes during transmission)
77
                        udp_tx_data_out_ready: out std_logic;                                                   -- indicates udp_tx is ready to take data
78
                        -- system signals
79
                        clk                                             : in  STD_LOGIC;                                                        -- same clock used to clock mac data and ip data
80
                        reset                                   : in  STD_LOGIC;
81
                        -- IP layer TX signals
82
                        ip_tx_start                             : out std_logic;
83
                        ip_tx                                           : out ipv4_tx_type;                                                     -- IP tx cxns
84
                        ip_tx_result                    : in std_logic_vector (1 downto 0);              -- tx status (changes during transmission)
85
                        ip_tx_data_out_ready    : in std_logic                                                                  -- indicates IP TX is ready to take data
86
                        );
87
    END COMPONENT;
88
 
89
  ------------------------------------------------------------------------------
90
  -- Component Declaration for UDP RX
91
  ------------------------------------------------------------------------------
92
 
93
    COMPONENT UDP_RX
94
    PORT(
95
                        -- UDP Layer signals
96
                        udp_rx_start                    : out std_logic;                                                        -- indicates receipt of udp header
97
                        udp_rxo                                 : out udp_rx_type;
98
                        -- system signals
99
                        clk                                             : in  STD_LOGIC;
100
                        reset                                   : in  STD_LOGIC;
101
                        -- IP layer RX signals
102
                        ip_rx_start                             : in std_logic;                                                 -- indicates receipt of ip header
103
                        ip_rx                                           : in ipv4_rx_type
104
                        );
105
    END COMPONENT;
106
 
107
  ------------------------------------------------------------------------------
108
  -- Component Declaration for the IP layer
109
  ------------------------------------------------------------------------------
110
 
111
component IP_complete_nomac
112
    Port (
113
                        -- IP Layer signals
114
                        ip_tx_start                             : in std_logic;
115
                        ip_tx                                           : in ipv4_tx_type;                                                              -- IP tx cxns
116
                        ip_tx_result                    : out std_logic_vector (1 downto 0);             -- tx status (changes during transmission)
117
                        ip_tx_data_out_ready    : out std_logic;                                                                        -- indicates IP TX is ready to take data
118
                        ip_rx_start                             : out std_logic;                                                                        -- indicates receipt of ip frame.
119
                        ip_rx                                           : out ipv4_rx_type;
120
                        -- system signals
121
                        rx_clk                                  : in  STD_LOGIC;
122
                        tx_clk                                  : in  STD_LOGIC;
123
                        reset                                   : in  STD_LOGIC;
124
                        our_ip_address          : in STD_LOGIC_VECTOR (31 downto 0);
125
                        our_mac_address                 : in std_logic_vector (47 downto 0);
126
                        -- status signals
127
                        arp_pkt_count                   : out STD_LOGIC_VECTOR(7 downto 0);                      -- count of arp pkts received
128
                        ip_pkt_count                    : out STD_LOGIC_VECTOR(7 downto 0);                      -- number of IP pkts received for us
129
                        -- MAC Transmitter
130
                        mac_tx_tdata         : out  std_logic_vector(7 downto 0);        -- data byte to tx
131
                        mac_tx_tvalid        : out  std_logic;                                                  -- tdata is valid
132
                        mac_tx_tready        : in std_logic;                                                    -- mac is ready to accept data
133
                        mac_tx_tfirst        : out  std_logic;                                                  -- indicates first byte of frame
134
                        mac_tx_tlast         : out  std_logic;                                                  -- indicates last byte of frame
135
                        -- MAC Receiver
136
                        mac_rx_tdata         : in std_logic_vector(7 downto 0);  -- data byte received
137
                        mac_rx_tvalid        : in std_logic;                                                    -- indicates tdata is valid
138
                        mac_rx_tready        : out  std_logic;                                                  -- tells mac that we are ready to take data
139
                        mac_rx_tlast         : in std_logic                                                             -- indicates last byte of the trame
140
                        );
141
end component;
142
 
143
        -- IP TX connectivity
144
   signal ip_tx_int                                             : ipv4_tx_type;
145
   signal ip_tx_start_int                               : std_logic;
146
        signal ip_tx_result_int                         : std_logic_vector (1 downto 0);
147
        signal ip_tx_data_out_ready_int : std_logic;
148
 
149
        -- IP RX connectivity
150
   signal ip_rx_int                     : ipv4_rx_type;
151
   signal ip_rx_start_int       : std_logic := '0';
152
 
153
 
154
begin
155
 
156
        -- output followers
157
        ip_rx_hdr <= ip_rx_int.hdr;
158
 
159
        -- Instantiate the UDP TX block
160
   udp_tx_block: UDP_TX PORT MAP (
161
                                -- UDP Layer signals
162
                                udp_tx_start                    => udp_tx_start,
163
                                udp_txi                                         => udp_txi,
164
                                udp_tx_result                   => udp_tx_result,
165
                                udp_tx_data_out_ready=> udp_tx_data_out_ready,
166
                                -- system signals
167
                                clk                                             => tx_clk,
168
                                reset                                   => reset,
169
                                -- IP layer TX signals
170
                                ip_tx_start                     => ip_tx_start_int,
171
                                ip_tx                                   => ip_tx_int,
172
                                ip_tx_result                    => ip_tx_result_int,
173
                                ip_tx_data_out_ready    => ip_tx_data_out_ready_int
174
        );
175
 
176
        -- Instantiate the UDP RX block
177
   udp_rx_block: UDP_RX PORT MAP (
178
                                 -- UDP Layer signals
179
                                 udp_rxo                                => udp_rxo,
180
                                 udp_rx_start                   => udp_rx_start,
181
                                 -- system signals
182
                                 clk                                            => rx_clk,
183
                                 reset                                  => reset,
184
                                 -- IP layer RX signals
185
                                 ip_rx_start                    => ip_rx_start_int,
186
                                 ip_rx                                  => ip_rx_int
187
        );
188
 
189
   ------------------------------------------------------------------------------
190
   -- Instantiate the IP layer
191
   ------------------------------------------------------------------------------
192
    IP_block : IP_complete_nomac PORT MAP
193
                (
194
                                -- IP interface
195
                                ip_tx_start                     => ip_tx_start_int,
196
                                ip_tx                                   => ip_tx_int,
197
                                ip_tx_result                    => ip_tx_result_int,
198
                                ip_tx_data_out_ready    => ip_tx_data_out_ready_int,
199
                                ip_rx_start                     => ip_rx_start_int,
200
                                ip_rx                                   => ip_rx_int,
201
                                -- System interface
202
                                rx_clk                                  => rx_clk,
203
                                tx_clk                                  => tx_clk,
204
                                reset                                   => reset,
205
                                our_ip_address          => our_ip_address,
206
                                our_mac_address                 => our_mac_address,
207
                                -- status signals
208
                                arp_pkt_count                   => arp_pkt_count,
209
                                ip_pkt_count                    => ip_pkt_count,
210
                                -- MAC Transmitter
211
                                mac_tx_tdata                    => mac_tx_tdata,
212
                                mac_tx_tvalid                   => mac_tx_tvalid,
213
                                mac_tx_tready                   => mac_tx_tready,
214
                                mac_tx_tfirst                   => mac_tx_tfirst,
215
                                mac_tx_tlast                    => mac_tx_tlast,
216
                                -- MAC Receiver
217
                                mac_rx_tdata                    => mac_rx_tdata,
218
                                mac_rx_tvalid                   => mac_rx_tvalid,
219
                                mac_rx_tready                   => mac_rx_tready,
220
                                mac_rx_tlast                    => mac_rx_tlast
221
        );
222
 
223
 
224
end structural;
225
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.