1 |
4 |
kuzmi4 |
//------------------------------------------------------------------------------
|
2 |
|
|
// File : tri_mode_ethernet_mac_0_fifo_block.v
|
3 |
|
|
// Author : Xilinx Inc.
|
4 |
|
|
// -----------------------------------------------------------------------------
|
5 |
|
|
// (c) Copyright 2004-2013 Xilinx, Inc. All rights reserved.
|
6 |
|
|
//
|
7 |
|
|
// This file contains confidential and proprietary information
|
8 |
|
|
// of Xilinx, Inc. and is protected under U.S. and
|
9 |
|
|
// international copyright and other intellectual property
|
10 |
|
|
// laws.
|
11 |
|
|
//
|
12 |
|
|
// DISCLAIMER
|
13 |
|
|
// This disclaimer is not a license and does not grant any
|
14 |
|
|
// rights to the materials distributed herewith. Except as
|
15 |
|
|
// otherwise provided in a valid license issued to you by
|
16 |
|
|
// Xilinx, and to the maximum extent permitted by applicable
|
17 |
|
|
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
18 |
|
|
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
19 |
|
|
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
20 |
|
|
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
21 |
|
|
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
22 |
|
|
// (2) Xilinx shall not be liable (whether in contract or tort,
|
23 |
|
|
// including negligence, or under any other theory of
|
24 |
|
|
// liability) for any loss or damage of any kind or nature
|
25 |
|
|
// related to, arising under or in connection with these
|
26 |
|
|
// materials, including for any direct, or any indirect,
|
27 |
|
|
// special, incidental, or consequential loss or damage
|
28 |
|
|
// (including loss of data, profits, goodwill, or any type of
|
29 |
|
|
// loss or damage suffered as a result of any action brought
|
30 |
|
|
// by a third party) even if such damage or loss was
|
31 |
|
|
// reasonably foreseeable or Xilinx had been advised of the
|
32 |
|
|
// possibility of the same.
|
33 |
|
|
//
|
34 |
|
|
// CRITICAL APPLICATIONS
|
35 |
|
|
// Xilinx products are not designed or intended to be fail-
|
36 |
|
|
// safe, or for use in any application requiring fail-safe
|
37 |
|
|
// performance, such as life-support or safety devices or
|
38 |
|
|
// systems, Class III medical devices, nuclear facilities,
|
39 |
|
|
// applications related to the deployment of airbags, or any
|
40 |
|
|
// other applications that could lead to death, personal
|
41 |
|
|
// injury, or severe property or environmental damage
|
42 |
|
|
// (individually and collectively, "Critical
|
43 |
|
|
// Applications"). Customer assumes the sole risk and
|
44 |
|
|
// liability of any use of Xilinx products in Critical
|
45 |
|
|
// Applications, subject only to applicable laws and
|
46 |
|
|
// regulations governing limitations on product liability.
|
47 |
|
|
//
|
48 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
49 |
|
|
// PART OF THIS FILE AT ALL TIMES.
|
50 |
|
|
// -----------------------------------------------------------------------------
|
51 |
|
|
// Description: This is the FIFO Block level vhdl wrapper for the Tri-Mode
|
52 |
|
|
// Ethernet MAC core. This wrapper enhances the standard MAC core
|
53 |
|
|
// with an example FIFO. The interface to this FIFO is
|
54 |
|
|
// designed to the AXI-S specification.
|
55 |
|
|
// Please refer to core documentation for
|
56 |
|
|
// additional FIFO and AXI-S information.
|
57 |
|
|
//
|
58 |
|
|
// _________________________________________________________
|
59 |
|
|
// | |
|
60 |
|
|
// | FIFO BLOCK LEVEL WRAPPER |
|
61 |
|
|
// | |
|
62 |
|
|
// | _____________________ ______________________ |
|
63 |
|
|
// | | _________________ | | | |
|
64 |
|
|
// | | | | | | | |
|
65 |
|
|
// -------->| | TX AXI FIFO | |---->| Tx Tx |--------->
|
66 |
|
|
// | | | | | | AXI-S PHY | |
|
67 |
|
|
// | | |_________________| | | I/F I/F | |
|
68 |
|
|
// | | | | | |
|
69 |
|
|
// AXI | | 10/100/1G | | TRI-MODE ETHERNET | |
|
70 |
|
|
// Stream | | ETHERNET FIFO | | MAC | | PHY I/F
|
71 |
|
|
// | | | | SUPPORT LEVEL | |
|
72 |
|
|
// | | _________________ | | | |
|
73 |
|
|
// | | | | | | | |
|
74 |
|
|
// <--------| | RX AXI FIFO | |<----| Rx Rx |<---------
|
75 |
|
|
// | | | | | | AXI-S PHY | |
|
76 |
|
|
// | | |_________________| | | I/F I/F | |
|
77 |
|
|
// | |_____________________| |______________________| |
|
78 |
|
|
// | |
|
79 |
|
|
// |_________________________________________________________|
|
80 |
|
|
|
81 |
|
|
`timescale 1 ps/1 ps
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
//------------------------------------------------------------------------------
|
85 |
|
|
// The module declaration for the FIFO Block level wrapper.
|
86 |
|
|
//------------------------------------------------------------------------------
|
87 |
|
|
|
88 |
|
|
(* DowngradeIPIdentifiedWarnings = "yes" *)
|
89 |
|
|
module tri_mode_ethernet_mac_0_fifo_block (
|
90 |
|
|
input gtx_clk,
|
91 |
|
|
// asynchronous reset
|
92 |
|
|
input glbl_rstn,
|
93 |
|
|
input rx_axi_rstn,
|
94 |
|
|
input tx_axi_rstn,
|
95 |
|
|
|
96 |
|
|
// Reference clock for IDELAYCTRL's
|
97 |
|
|
input refclk,
|
98 |
|
|
/*
|
99 |
|
|
// Receiver Statistics Interface
|
100 |
|
|
//---------------------------------------
|
101 |
|
|
output rx_mac_aclk,
|
102 |
|
|
output rx_reset,
|
103 |
|
|
output [27:0] rx_statistics_vector,
|
104 |
|
|
output rx_statistics_valid,
|
105 |
|
|
*/
|
106 |
|
|
// Receiver (AXI-S) Interface
|
107 |
|
|
//----------------------------------------
|
108 |
|
|
input rx_fifo_clock,
|
109 |
|
|
input rx_fifo_resetn,
|
110 |
|
|
|
111 |
|
|
output [7:0] rx_axis_fifo_tdata,
|
112 |
|
|
|
113 |
|
|
output rx_axis_fifo_tvalid,
|
114 |
|
|
input rx_axis_fifo_tready,
|
115 |
|
|
output rx_axis_fifo_tlast,
|
116 |
|
|
/*
|
117 |
|
|
// Transmitter Statistics Interface
|
118 |
|
|
//------------------------------------------
|
119 |
|
|
output tx_mac_aclk,
|
120 |
|
|
output tx_reset,
|
121 |
|
|
input [7:0] tx_ifg_delay,
|
122 |
|
|
output [31:0] tx_statistics_vector,
|
123 |
|
|
output tx_statistics_valid,
|
124 |
|
|
*/
|
125 |
|
|
|
126 |
|
|
// Transmitter (AXI-S) Interface
|
127 |
|
|
//-------------------------------------------
|
128 |
|
|
input tx_fifo_clock,
|
129 |
|
|
input tx_fifo_resetn,
|
130 |
|
|
|
131 |
|
|
input [7:0] tx_axis_fifo_tdata,
|
132 |
|
|
|
133 |
|
|
input tx_axis_fifo_tvalid,
|
134 |
|
|
output tx_axis_fifo_tready,
|
135 |
|
|
input tx_axis_fifo_tlast,
|
136 |
|
|
/*
|
137 |
|
|
// MAC Control Interface
|
138 |
|
|
//------------------------
|
139 |
|
|
input pause_req,
|
140 |
|
|
input [15:0] pause_val,
|
141 |
|
|
*/
|
142 |
|
|
// RGMII Interface
|
143 |
|
|
//------------------
|
144 |
|
|
output [3:0] rgmii_txd,
|
145 |
|
|
output rgmii_tx_ctl,
|
146 |
|
|
output rgmii_txc,
|
147 |
|
|
input [3:0] rgmii_rxd,
|
148 |
|
|
input rgmii_rx_ctl,
|
149 |
|
|
input rgmii_rxc,
|
150 |
|
|
|
151 |
|
|
// RGMII Inband Status Registers
|
152 |
|
|
//--------------------------------
|
153 |
|
|
output inband_link_status,
|
154 |
|
|
output [1:0] inband_clock_speed,
|
155 |
|
|
output inband_duplex_status,
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
// MDIO Interface
|
159 |
|
|
//---------------
|
160 |
|
|
inout mdio,
|
161 |
|
|
output mdc,
|
162 |
|
|
|
163 |
|
|
// AXI-Lite Interface
|
164 |
|
|
//---------------
|
165 |
|
|
input s_axi_aclk,
|
166 |
|
|
input s_axi_resetn,
|
167 |
|
|
|
168 |
|
|
input [11:0] s_axi_awaddr,
|
169 |
|
|
input s_axi_awvalid,
|
170 |
|
|
output s_axi_awready,
|
171 |
|
|
|
172 |
|
|
input [31:0] s_axi_wdata,
|
173 |
|
|
input s_axi_wvalid,
|
174 |
|
|
output s_axi_wready,
|
175 |
|
|
|
176 |
|
|
output [1:0] s_axi_bresp,
|
177 |
|
|
output s_axi_bvalid,
|
178 |
|
|
input s_axi_bready,
|
179 |
|
|
|
180 |
|
|
input [11:0] s_axi_araddr,
|
181 |
|
|
input s_axi_arvalid,
|
182 |
|
|
output s_axi_arready,
|
183 |
|
|
|
184 |
|
|
output [31:0] s_axi_rdata,
|
185 |
|
|
output [1:0] s_axi_rresp,
|
186 |
|
|
output s_axi_rvalid,
|
187 |
|
|
input s_axi_rready
|
188 |
|
|
|
189 |
|
|
);
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
//----------------------------------------------------------------------------
|
193 |
|
|
// Internal signals used in this fifo block level wrapper.
|
194 |
|
|
//----------------------------------------------------------------------------
|
195 |
|
|
|
196 |
|
|
wire rx_mac_aclk_int; // MAC Rx clock
|
197 |
|
|
wire tx_mac_aclk_int; // MAC Tx clock
|
198 |
|
|
wire rx_reset_int; // MAC Rx reset
|
199 |
|
|
wire tx_reset_int; // MAC Tx reset
|
200 |
|
|
|
201 |
|
|
// MAC receiver client I/F
|
202 |
|
|
wire [7:0] rx_axis_mac_tdata;
|
203 |
|
|
wire rx_axis_mac_tvalid;
|
204 |
|
|
wire rx_axis_mac_tlast;
|
205 |
|
|
wire rx_axis_mac_tuser;
|
206 |
|
|
|
207 |
|
|
// MAC transmitter client I/F
|
208 |
|
|
wire [7:0] tx_axis_mac_tdata;
|
209 |
|
|
wire tx_axis_mac_tvalid;
|
210 |
|
|
wire tx_axis_mac_tready;
|
211 |
|
|
wire tx_axis_mac_tlast;
|
212 |
|
|
wire tx_axis_mac_tuser;
|
213 |
|
|
|
214 |
|
|
//----------------------------------------------------------------------------
|
215 |
|
|
// Connect the output clock signals
|
216 |
|
|
//----------------------------------------------------------------------------
|
217 |
|
|
|
218 |
|
|
assign rx_mac_aclk = rx_mac_aclk_int;
|
219 |
|
|
assign tx_mac_aclk = tx_mac_aclk_int;
|
220 |
|
|
assign rx_reset = rx_reset_int;
|
221 |
|
|
assign tx_reset = tx_reset_int;
|
222 |
|
|
|
223 |
|
|
//----------------------------------------------------------------------------
|
224 |
|
|
// Instantiate the Tri-Mode Ethernet MAC Support Level wrapper
|
225 |
|
|
//----------------------------------------------------------------------------
|
226 |
|
|
tri_mode_ethernet_mac_0_support trimac_sup_block (
|
227 |
|
|
.gtx_clk (gtx_clk),
|
228 |
|
|
|
229 |
|
|
.gtx_clk_out (),
|
230 |
|
|
.gtx_clk90_out (),
|
231 |
|
|
// asynchronous reset
|
232 |
|
|
.glbl_rstn (glbl_rstn),
|
233 |
|
|
.rx_axi_rstn (rx_axi_rstn),
|
234 |
|
|
.tx_axi_rstn (tx_axi_rstn),
|
235 |
|
|
|
236 |
|
|
// Receiver Interface
|
237 |
|
|
.rx_enable (),
|
238 |
|
|
|
239 |
|
|
.rx_statistics_vector (rx_statistics_vector),
|
240 |
|
|
.rx_statistics_valid (rx_statistics_valid),
|
241 |
|
|
|
242 |
|
|
.rx_mac_aclk (rx_mac_aclk_int),
|
243 |
|
|
.rx_reset (rx_reset_int),
|
244 |
|
|
.rx_axis_mac_tdata (rx_axis_mac_tdata),
|
245 |
|
|
.rx_axis_mac_tvalid (rx_axis_mac_tvalid),
|
246 |
|
|
.rx_axis_mac_tlast (rx_axis_mac_tlast),
|
247 |
|
|
.rx_axis_mac_tuser (rx_axis_mac_tuser),
|
248 |
|
|
|
249 |
|
|
// Transmitter Interface
|
250 |
|
|
.tx_enable (),
|
251 |
|
|
|
252 |
|
|
.tx_ifg_delay (tx_ifg_delay),
|
253 |
|
|
.tx_statistics_vector (tx_statistics_vector),
|
254 |
|
|
.tx_statistics_valid (tx_statistics_valid),
|
255 |
|
|
|
256 |
|
|
.tx_mac_aclk (tx_mac_aclk_int),
|
257 |
|
|
.tx_reset (tx_reset_int),
|
258 |
|
|
.tx_axis_mac_tdata (tx_axis_mac_tdata ),
|
259 |
|
|
.tx_axis_mac_tvalid (tx_axis_mac_tvalid),
|
260 |
|
|
.tx_axis_mac_tlast (tx_axis_mac_tlast),
|
261 |
|
|
.tx_axis_mac_tuser (tx_axis_mac_tuser ),
|
262 |
|
|
.tx_axis_mac_tready (tx_axis_mac_tready),
|
263 |
|
|
|
264 |
|
|
// Flow Control
|
265 |
|
|
.pause_req (pause_req),
|
266 |
|
|
.pause_val (pause_val),
|
267 |
|
|
|
268 |
|
|
// Reference clock for IDELAYCTRL's
|
269 |
|
|
.refclk (refclk),
|
270 |
|
|
|
271 |
|
|
// Speed Control
|
272 |
|
|
.speedis100 (),
|
273 |
|
|
.speedis10100 (),
|
274 |
|
|
|
275 |
|
|
// RGMII Interface
|
276 |
|
|
.rgmii_txd (rgmii_txd),
|
277 |
|
|
.rgmii_tx_ctl (rgmii_tx_ctl),
|
278 |
|
|
.rgmii_txc (rgmii_txc),
|
279 |
|
|
.rgmii_rxd (rgmii_rxd),
|
280 |
|
|
.rgmii_rx_ctl (rgmii_rx_ctl),
|
281 |
|
|
.rgmii_rxc (rgmii_rxc),
|
282 |
|
|
.inband_link_status (inband_link_status),
|
283 |
|
|
.inband_clock_speed (inband_clock_speed),
|
284 |
|
|
.inband_duplex_status (inband_duplex_status),
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
// MDIO Interface
|
288 |
|
|
//---------------
|
289 |
|
|
.mdio (mdio),
|
290 |
|
|
.mdc (mdc),
|
291 |
|
|
|
292 |
|
|
// AXI lite interface
|
293 |
|
|
.s_axi_aclk (s_axi_aclk),
|
294 |
|
|
.s_axi_resetn (s_axi_resetn),
|
295 |
|
|
.s_axi_awaddr (s_axi_awaddr),
|
296 |
|
|
.s_axi_awvalid (s_axi_awvalid),
|
297 |
|
|
.s_axi_awready (s_axi_awready),
|
298 |
|
|
.s_axi_wdata (s_axi_wdata),
|
299 |
|
|
.s_axi_wvalid (s_axi_wvalid),
|
300 |
|
|
.s_axi_wready (s_axi_wready),
|
301 |
|
|
.s_axi_bresp (s_axi_bresp),
|
302 |
|
|
.s_axi_bvalid (s_axi_bvalid),
|
303 |
|
|
.s_axi_bready (s_axi_bready),
|
304 |
|
|
.s_axi_araddr (s_axi_araddr),
|
305 |
|
|
.s_axi_arvalid (s_axi_arvalid),
|
306 |
|
|
.s_axi_arready (s_axi_arready),
|
307 |
|
|
.s_axi_rdata (s_axi_rdata),
|
308 |
|
|
.s_axi_rresp (s_axi_rresp),
|
309 |
|
|
.s_axi_rvalid (s_axi_rvalid),
|
310 |
|
|
.s_axi_rready (s_axi_rready),
|
311 |
|
|
.mac_irq ()
|
312 |
|
|
);
|
313 |
|
|
|
314 |
|
|
|
315 |
|
|
//----------------------------------------------------------------------------
|
316 |
|
|
// Instantiate the user side FIFO
|
317 |
|
|
//----------------------------------------------------------------------------
|
318 |
|
|
|
319 |
|
|
// locally reset sync the mac generated resets - the resets are already fully sync
|
320 |
|
|
// so adding a reset sync shouldn't change that
|
321 |
|
|
tri_mode_ethernet_mac_0_reset_sync rx_mac_reset_gen (
|
322 |
|
|
.clk (rx_mac_aclk_int),
|
323 |
|
|
.enable (1'b1),
|
324 |
|
|
.reset_in (rx_reset_int),
|
325 |
|
|
.reset_out (rx_mac_reset)
|
326 |
|
|
);
|
327 |
|
|
|
328 |
|
|
tri_mode_ethernet_mac_0_reset_sync tx_mac_reset_gen (
|
329 |
|
|
.clk (tx_mac_aclk_int),
|
330 |
|
|
.enable (1'b1),
|
331 |
|
|
.reset_in (tx_reset_int),
|
332 |
|
|
.reset_out (tx_mac_reset)
|
333 |
|
|
);
|
334 |
|
|
|
335 |
|
|
// create inverted mac resets as the FIFO expects AXI compliant resets
|
336 |
|
|
assign tx_mac_resetn = !tx_mac_reset;
|
337 |
|
|
assign rx_mac_resetn = !rx_mac_reset;
|
338 |
|
|
|
339 |
|
|
|
340 |
|
|
|
341 |
|
|
tri_mode_ethernet_mac_0_ten_100_1g_eth_fifo #
|
342 |
|
|
(
|
343 |
|
|
.FULL_DUPLEX_ONLY (1)
|
344 |
|
|
)
|
345 |
|
|
|
346 |
|
|
user_side_FIFO
|
347 |
|
|
(
|
348 |
|
|
// Transmit FIFO MAC TX Interface
|
349 |
|
|
.tx_fifo_aclk (tx_fifo_clock),
|
350 |
|
|
.tx_fifo_resetn (tx_fifo_resetn),
|
351 |
|
|
.tx_axis_fifo_tdata (tx_axis_fifo_tdata),
|
352 |
|
|
.tx_axis_fifo_tvalid (tx_axis_fifo_tvalid),
|
353 |
|
|
.tx_axis_fifo_tlast (tx_axis_fifo_tlast),
|
354 |
|
|
.tx_axis_fifo_tready (tx_axis_fifo_tready),
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
.tx_mac_aclk (tx_mac_aclk_int),
|
358 |
|
|
.tx_mac_resetn (tx_mac_resetn),
|
359 |
|
|
.tx_axis_mac_tdata (tx_axis_mac_tdata),
|
360 |
|
|
.tx_axis_mac_tvalid (tx_axis_mac_tvalid),
|
361 |
|
|
.tx_axis_mac_tlast (tx_axis_mac_tlast),
|
362 |
|
|
.tx_axis_mac_tready (tx_axis_mac_tready),
|
363 |
|
|
.tx_axis_mac_tuser (tx_axis_mac_tuser),
|
364 |
|
|
|
365 |
|
|
.tx_fifo_overflow (),
|
366 |
|
|
.tx_fifo_status (),
|
367 |
|
|
.tx_collision (1'b0),
|
368 |
|
|
.tx_retransmit (1'b0),
|
369 |
|
|
|
370 |
|
|
.rx_fifo_aclk (rx_fifo_clock),
|
371 |
|
|
.rx_fifo_resetn (rx_fifo_resetn),
|
372 |
|
|
.rx_axis_fifo_tdata (rx_axis_fifo_tdata),
|
373 |
|
|
.rx_axis_fifo_tvalid (rx_axis_fifo_tvalid),
|
374 |
|
|
.rx_axis_fifo_tlast (rx_axis_fifo_tlast),
|
375 |
|
|
.rx_axis_fifo_tready (rx_axis_fifo_tready),
|
376 |
|
|
.rx_mac_aclk (rx_mac_aclk_int),
|
377 |
|
|
.rx_mac_resetn (rx_mac_resetn),
|
378 |
|
|
.rx_axis_mac_tdata (rx_axis_mac_tdata),
|
379 |
|
|
.rx_axis_mac_tvalid (rx_axis_mac_tvalid),
|
380 |
|
|
.rx_axis_mac_tlast (rx_axis_mac_tlast),
|
381 |
|
|
.rx_axis_mac_tuser (rx_axis_mac_tuser),
|
382 |
|
|
|
383 |
|
|
.rx_fifo_status (),
|
384 |
|
|
.rx_fifo_overflow ()
|
385 |
|
|
);
|
386 |
|
|
|
387 |
|
|
|
388 |
|
|
endmodule
|
389 |
|
|
|