1 |
35 |
pjf |
--------------------------------------------------------------------------------
|
2 |
|
|
-- Title : 10/100/1G Ethernet FIFO
|
3 |
|
|
-- Version : 1.2
|
4 |
|
|
-- Project : Tri-Mode Ethernet MAC
|
5 |
|
|
--------------------------------------------------------------------------------
|
6 |
|
|
-- File : ten_100_1g_eth_fifo.vhd
|
7 |
|
|
-- Author : Xilinx Inc.
|
8 |
|
|
-- Project : Virtex-6 Embedded Tri-Mode Ethernet MAC Wrapper
|
9 |
|
|
-- File : ten_100_1g_eth_fifo.vhd
|
10 |
|
|
-- Version : 2.1
|
11 |
|
|
-------------------------------------------------------------------------------
|
12 |
|
|
--
|
13 |
|
|
-- (c) Copyright 2004-2008 Xilinx, Inc. All rights reserved.
|
14 |
|
|
--
|
15 |
|
|
-- This file contains confidential and proprietary information
|
16 |
|
|
-- of Xilinx, Inc. and is protected under U.S. and
|
17 |
|
|
-- international copyright and other intellectual property
|
18 |
|
|
-- laws.
|
19 |
|
|
--
|
20 |
|
|
-- DISCLAIMER
|
21 |
|
|
-- This disclaimer is not a license and does not grant any
|
22 |
|
|
-- rights to the materials distributed herewith. Except as
|
23 |
|
|
-- otherwise provided in a valid license issued to you by
|
24 |
|
|
-- Xilinx, and to the maximum extent permitted by applicable
|
25 |
|
|
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
26 |
|
|
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
27 |
|
|
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
28 |
|
|
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
29 |
|
|
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
30 |
|
|
-- (2) Xilinx shall not be liable (whether in contract or tort,
|
31 |
|
|
-- including negligence, or under any other theory of
|
32 |
|
|
-- liability) for any loss or damage of any kind or nature
|
33 |
|
|
-- related to, arising under or in connection with these
|
34 |
|
|
-- materials, including for any direct, or any indirect,
|
35 |
|
|
-- special, incidental, or consequential loss or damage
|
36 |
|
|
-- (including loss of data, profits, goodwill, or any type of
|
37 |
|
|
-- loss or damage suffered as a result of any action brought
|
38 |
|
|
-- by a third party) even if such damage or loss was
|
39 |
|
|
-- reasonably foreseeable or Xilinx had been advised of the
|
40 |
|
|
-- possibility of the same.
|
41 |
|
|
--
|
42 |
|
|
-- CRITICAL APPLICATIONS
|
43 |
|
|
-- Xilinx products are not designed or intended to be fail-
|
44 |
|
|
-- safe, or for use in any application requiring fail-safe
|
45 |
|
|
-- performance, such as life-support or safety devices or
|
46 |
|
|
-- systems, Class III medical devices, nuclear facilities,
|
47 |
|
|
-- applications related to the deployment of airbags, or any
|
48 |
|
|
-- other applications that could lead to death, personal
|
49 |
|
|
-- injury, or severe property or environmental damage
|
50 |
|
|
-- (individually and collectively, "Critical
|
51 |
|
|
-- Applications"). Customer assumes the sole risk and
|
52 |
|
|
-- liability of any use of Xilinx products in Critical
|
53 |
|
|
-- Applications, subject only to applicable laws and
|
54 |
|
|
-- regulations governing limitations on product liability.
|
55 |
|
|
--
|
56 |
|
|
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
57 |
|
|
-- PART OF THIS FILE AT ALL TIMES.
|
58 |
|
|
--
|
59 |
|
|
-- Description: This is the top level wrapper for the 10/100/1G Ethernet FIFO.
|
60 |
|
|
-- The top level wrapper consists of individual FIFOs on the
|
61 |
|
|
-- transmitter path and on the receiver path.
|
62 |
|
|
--
|
63 |
|
|
-- Each path consists of an 8 bit local link to 8 bit client
|
64 |
|
|
-- interface FIFO.
|
65 |
|
|
--------------------------------------------------------------------------------
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
library unisim;
|
69 |
|
|
use unisim.vcomponents.all;
|
70 |
|
|
|
71 |
|
|
library ieee;
|
72 |
|
|
use ieee.std_logic_1164.all;
|
73 |
|
|
use ieee.std_logic_unsigned.all;
|
74 |
|
|
use ieee.numeric_std.all;
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
--------------------------------------------------------------------------------
|
78 |
|
|
-- The entity declaration for the FIFO
|
79 |
|
|
--------------------------------------------------------------------------------
|
80 |
|
|
|
81 |
|
|
entity ten_100_1g_eth_fifo is
|
82 |
|
|
generic (
|
83 |
|
|
FULL_DUPLEX_ONLY : boolean := false); -- If fifo is to be used only in full
|
84 |
|
|
-- duplex set to true for optimised implementation
|
85 |
|
|
|
86 |
|
|
port (
|
87 |
|
|
tx_fifo_aclk : in std_logic;
|
88 |
|
|
tx_fifo_resetn : in std_logic;
|
89 |
|
|
tx_axis_fifo_tdata : in std_logic_vector(7 downto 0);
|
90 |
|
|
tx_axis_fifo_tvalid : in std_logic;
|
91 |
|
|
tx_axis_fifo_tlast : in std_logic;
|
92 |
|
|
tx_axis_fifo_tready : out std_logic;
|
93 |
|
|
|
94 |
|
|
tx_mac_aclk : in std_logic;
|
95 |
|
|
tx_mac_resetn : in std_logic;
|
96 |
|
|
tx_axis_mac_tdata : out std_logic_vector(7 downto 0);
|
97 |
|
|
tx_axis_mac_tvalid : out std_logic;
|
98 |
|
|
tx_axis_mac_tlast : out std_logic;
|
99 |
|
|
tx_axis_mac_tready : in std_logic;
|
100 |
|
|
tx_axis_mac_tuser : out std_logic;
|
101 |
|
|
tx_fifo_overflow : out std_logic;
|
102 |
|
|
tx_fifo_status : out std_logic_vector(3 downto 0);
|
103 |
|
|
tx_collision : in std_logic;
|
104 |
|
|
tx_retransmit : in std_logic;
|
105 |
|
|
|
106 |
|
|
rx_fifo_aclk : in std_logic;
|
107 |
|
|
rx_fifo_resetn : in std_logic;
|
108 |
|
|
rx_axis_fifo_tdata : out std_logic_vector(7 downto 0);
|
109 |
|
|
rx_axis_fifo_tvalid : out std_logic;
|
110 |
|
|
rx_axis_fifo_tlast : out std_logic;
|
111 |
|
|
rx_axis_fifo_tready : in std_logic;
|
112 |
|
|
|
113 |
|
|
rx_mac_aclk : in std_logic;
|
114 |
|
|
rx_mac_resetn : in std_logic;
|
115 |
|
|
rx_axis_mac_tdata : in std_logic_vector(7 downto 0);
|
116 |
|
|
rx_axis_mac_tvalid : in std_logic;
|
117 |
|
|
rx_axis_mac_tlast : in std_logic;
|
118 |
|
|
rx_axis_mac_tready : out std_logic;
|
119 |
|
|
rx_axis_mac_tuser : in std_logic;
|
120 |
|
|
rx_fifo_status : out std_logic_vector(3 downto 0);
|
121 |
|
|
rx_fifo_overflow : out std_logic
|
122 |
|
|
);
|
123 |
|
|
end ten_100_1g_eth_fifo;
|
124 |
|
|
|
125 |
|
|
architecture RTL of ten_100_1g_eth_fifo is
|
126 |
|
|
|
127 |
|
|
component rx_client_fifo
|
128 |
|
|
port (
|
129 |
|
|
-- User-side (read-side) AxiStream interface
|
130 |
|
|
rx_fifo_aclk : in std_logic;
|
131 |
|
|
rx_fifo_resetn : in std_logic;
|
132 |
|
|
rx_axis_fifo_tdata : out std_logic_vector(7 downto 0);
|
133 |
|
|
rx_axis_fifo_tvalid : out std_logic;
|
134 |
|
|
rx_axis_fifo_tlast : out std_logic;
|
135 |
|
|
rx_axis_fifo_tready : in std_logic;
|
136 |
|
|
|
137 |
|
|
-- MAC-side (write-side) AxiStream interface
|
138 |
|
|
rx_mac_aclk : in std_logic;
|
139 |
|
|
rx_mac_resetn : in std_logic;
|
140 |
|
|
rx_axis_mac_tdata : in std_logic_vector(7 downto 0);
|
141 |
|
|
rx_axis_mac_tvalid : in std_logic;
|
142 |
|
|
rx_axis_mac_tlast : in std_logic;
|
143 |
|
|
rx_axis_mac_tready : out std_logic;
|
144 |
|
|
rx_axis_mac_tuser : in std_logic;
|
145 |
|
|
|
146 |
|
|
-- FIFO status and overflow indication,
|
147 |
|
|
-- synchronous to write-side (rx_mac_aclk) interface
|
148 |
|
|
fifo_status : out std_logic_vector(3 downto 0);
|
149 |
|
|
fifo_overflow : out std_logic
|
150 |
|
|
);
|
151 |
|
|
end component;
|
152 |
|
|
|
153 |
|
|
component tx_client_fifo
|
154 |
|
|
generic (
|
155 |
|
|
FULL_DUPLEX_ONLY : boolean := false);
|
156 |
|
|
port (
|
157 |
|
|
-- User-side (write-side) AxiStream interface
|
158 |
|
|
tx_fifo_aclk : in std_logic;
|
159 |
|
|
tx_fifo_resetn : in std_logic;
|
160 |
|
|
tx_axis_fifo_tdata : in std_logic_vector(7 downto 0);
|
161 |
|
|
tx_axis_fifo_tvalid : in std_logic;
|
162 |
|
|
tx_axis_fifo_tlast : in std_logic;
|
163 |
|
|
tx_axis_fifo_tready : out std_logic;
|
164 |
|
|
|
165 |
|
|
-- MAC-side (read-side) AxiStream interface
|
166 |
|
|
tx_mac_aclk : in std_logic;
|
167 |
|
|
tx_mac_resetn : in std_logic;
|
168 |
|
|
tx_axis_mac_tdata : out std_logic_vector(7 downto 0);
|
169 |
|
|
tx_axis_mac_tvalid : out std_logic;
|
170 |
|
|
tx_axis_mac_tlast : out std_logic;
|
171 |
|
|
tx_axis_mac_tready : in std_logic;
|
172 |
|
|
tx_axis_mac_tuser : out std_logic;
|
173 |
|
|
|
174 |
|
|
-- FIFO status and overflow indication,
|
175 |
|
|
-- synchronous to write-side (tx_user_aclk) interface
|
176 |
|
|
fifo_overflow : out std_logic;
|
177 |
|
|
fifo_status : out std_logic_vector(3 downto 0);
|
178 |
|
|
|
179 |
|
|
-- FIFO collision and retransmission requests from MAC
|
180 |
|
|
tx_collision : in std_logic;
|
181 |
|
|
tx_retransmit : in std_logic
|
182 |
|
|
);
|
183 |
|
|
end component;
|
184 |
|
|
|
185 |
|
|
begin
|
186 |
|
|
|
187 |
|
|
------------------------------------------------------------------------------
|
188 |
|
|
-- Instantiate the Transmitter FIFO
|
189 |
|
|
------------------------------------------------------------------------------
|
190 |
|
|
tx_fifo_i : tx_client_fifo
|
191 |
|
|
generic map(
|
192 |
|
|
FULL_DUPLEX_ONLY => FULL_DUPLEX_ONLY
|
193 |
|
|
)
|
194 |
|
|
port map(
|
195 |
|
|
tx_fifo_aclk => tx_fifo_aclk,
|
196 |
|
|
tx_fifo_resetn => tx_fifo_resetn,
|
197 |
|
|
tx_axis_fifo_tdata => tx_axis_fifo_tdata,
|
198 |
|
|
tx_axis_fifo_tvalid => tx_axis_fifo_tvalid,
|
199 |
|
|
tx_axis_fifo_tlast => tx_axis_fifo_tlast,
|
200 |
|
|
tx_axis_fifo_tready => tx_axis_fifo_tready,
|
201 |
|
|
|
202 |
|
|
tx_mac_aclk => tx_mac_aclk,
|
203 |
|
|
tx_mac_resetn => tx_mac_resetn,
|
204 |
|
|
tx_axis_mac_tdata => tx_axis_mac_tdata,
|
205 |
|
|
tx_axis_mac_tvalid => tx_axis_mac_tvalid,
|
206 |
|
|
tx_axis_mac_tlast => tx_axis_mac_tlast,
|
207 |
|
|
tx_axis_mac_tready => tx_axis_mac_tready,
|
208 |
|
|
tx_axis_mac_tuser => tx_axis_mac_tuser,
|
209 |
|
|
|
210 |
|
|
fifo_overflow => tx_fifo_overflow,
|
211 |
|
|
fifo_status => tx_fifo_status,
|
212 |
|
|
|
213 |
|
|
tx_collision => tx_collision,
|
214 |
|
|
tx_retransmit => tx_retransmit
|
215 |
|
|
);
|
216 |
|
|
|
217 |
|
|
|
218 |
|
|
------------------------------------------------------------------------------
|
219 |
|
|
-- Instantiate the Receiver FIFO
|
220 |
|
|
------------------------------------------------------------------------------
|
221 |
|
|
rx_fifo_i : rx_client_fifo
|
222 |
|
|
port map(
|
223 |
|
|
|
224 |
|
|
rx_fifo_aclk => rx_fifo_aclk,
|
225 |
|
|
rx_fifo_resetn => rx_fifo_resetn,
|
226 |
|
|
rx_axis_fifo_tdata => rx_axis_fifo_tdata,
|
227 |
|
|
rx_axis_fifo_tvalid => rx_axis_fifo_tvalid,
|
228 |
|
|
rx_axis_fifo_tlast => rx_axis_fifo_tlast,
|
229 |
|
|
rx_axis_fifo_tready => rx_axis_fifo_tready,
|
230 |
|
|
|
231 |
|
|
rx_mac_aclk => rx_mac_aclk,
|
232 |
|
|
rx_mac_resetn => rx_mac_resetn,
|
233 |
|
|
rx_axis_mac_tdata => rx_axis_mac_tdata,
|
234 |
|
|
rx_axis_mac_tvalid => rx_axis_mac_tvalid,
|
235 |
|
|
rx_axis_mac_tlast => rx_axis_mac_tlast,
|
236 |
|
|
rx_axis_mac_tready => rx_axis_mac_tready,
|
237 |
|
|
rx_axis_mac_tuser => rx_axis_mac_tuser,
|
238 |
|
|
|
239 |
|
|
fifo_status => rx_fifo_status,
|
240 |
|
|
fifo_overflow => rx_fifo_overflow
|
241 |
|
|
);
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
end RTL;
|