1 |
3 |
kuzmi4 |
//------------------------------------------------------------------------------
|
2 |
|
|
// Title : Verilog Support Level Module
|
3 |
|
|
// File : tri_mode_ethernet_mac_0_support.v
|
4 |
|
|
// Author : Xilinx Inc.
|
5 |
|
|
// -----------------------------------------------------------------------------
|
6 |
|
|
// (c) Copyright 2013 Xilinx, Inc. All rights reserved.
|
7 |
|
|
//
|
8 |
|
|
// This file contains confidential and proprietary information
|
9 |
|
|
// of Xilinx, Inc. and is protected under U.S. and
|
10 |
|
|
// international copyright and other intellectual property
|
11 |
|
|
// laws.
|
12 |
|
|
//
|
13 |
|
|
// DISCLAIMER
|
14 |
|
|
// This disclaimer is not a license and does not grant any
|
15 |
|
|
// rights to the materials distributed herewith. Except as
|
16 |
|
|
// otherwise provided in a valid license issued to you by
|
17 |
|
|
// Xilinx, and to the maximum extent permitted by applicable
|
18 |
|
|
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
19 |
|
|
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
20 |
|
|
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
21 |
|
|
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
22 |
|
|
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
23 |
|
|
// (2) Xilinx shall not be liable (whether in contract or tort,
|
24 |
|
|
// including negligence, or under any other theory of
|
25 |
|
|
// liability) for any loss or damage of any kind or nature
|
26 |
|
|
// related to, arising under or in connection with these
|
27 |
|
|
// materials, including for any direct, or any indirect,
|
28 |
|
|
// special, incidental, or consequential loss or damage
|
29 |
|
|
// (including loss of data, profits, goodwill, or any type of
|
30 |
|
|
// loss or damage suffered as a result of any action brought
|
31 |
|
|
// by a third party) even if such damage or loss was
|
32 |
|
|
// reasonably foreseeable or Xilinx had been advised of the
|
33 |
|
|
// possibility of the same.
|
34 |
|
|
//
|
35 |
|
|
// CRITICAL APPLICATIONS
|
36 |
|
|
// Xilinx products are not designed or intended to be fail-
|
37 |
|
|
// safe, or for use in any application requiring fail-safe
|
38 |
|
|
// performance, such as life-support or safety devices or
|
39 |
|
|
// systems, Class III medical devices, nuclear facilities,
|
40 |
|
|
// applications related to the deployment of airbags, or any
|
41 |
|
|
// other applications that could lead to death, personal
|
42 |
|
|
// injury, or severe property or environmental damage
|
43 |
|
|
// (individually and collectively, "Critical
|
44 |
|
|
// Applications"). Customer assumes the sole risk and
|
45 |
|
|
// liability of any use of Xilinx products in Critical
|
46 |
|
|
// Applications, subject only to applicable laws and
|
47 |
|
|
// regulations governing limitations on product liability.
|
48 |
|
|
//
|
49 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
50 |
|
|
// PART OF THIS FILE AT ALL TIMES.
|
51 |
|
|
// -----------------------------------------------------------------------------
|
52 |
|
|
// Description: This module holds the support level for the Tri-Mode
|
53 |
|
|
// Ethernet MAC IP. It contains potentially shareable FPGA
|
54 |
|
|
// resources such as clocking, reset and IDELAYCTRL logic.
|
55 |
|
|
// This can be used as-is in a single core design, or adapted
|
56 |
|
|
// for use with multi-core implementations.
|
57 |
|
|
//------------------------------------------------------------------------------
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
`timescale 1 ps/1 ps
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
//------------------------------------------------------------------------------
|
64 |
|
|
// The entity declaration for the block support level
|
65 |
|
|
//------------------------------------------------------------------------------
|
66 |
|
|
module tri_mode_ethernet_mac_0_support
|
67 |
|
|
(
|
68 |
|
|
input gtx_clk,
|
69 |
|
|
output gtx_clk_out,
|
70 |
|
|
output gtx_clk90_out,
|
71 |
|
|
// Reference clock for IDELAYCTRL's
|
72 |
|
|
input refclk,
|
73 |
|
|
|
74 |
|
|
// asynchronous reset
|
75 |
|
|
input glbl_rstn,
|
76 |
|
|
input rx_axi_rstn,
|
77 |
|
|
input tx_axi_rstn,
|
78 |
|
|
|
79 |
|
|
// Receiver Interface
|
80 |
|
|
//--------------------------
|
81 |
|
|
output rx_enable,
|
82 |
|
|
|
83 |
|
|
output [27:0] rx_statistics_vector,
|
84 |
|
|
output rx_statistics_valid,
|
85 |
|
|
|
86 |
|
|
output rx_mac_aclk,
|
87 |
|
|
output rx_reset,
|
88 |
|
|
output [7:0] rx_axis_mac_tdata,
|
89 |
|
|
output rx_axis_mac_tvalid,
|
90 |
|
|
output rx_axis_mac_tlast,
|
91 |
|
|
output rx_axis_mac_tuser,
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
// Transmitter Interface
|
95 |
|
|
//-----------------------------
|
96 |
|
|
output tx_enable,
|
97 |
|
|
|
98 |
|
|
input [7:0] tx_ifg_delay,
|
99 |
|
|
output [31:0] tx_statistics_vector,
|
100 |
|
|
output tx_statistics_valid,
|
101 |
|
|
|
102 |
|
|
output tx_mac_aclk,
|
103 |
|
|
output tx_reset,
|
104 |
|
|
input [7:0] tx_axis_mac_tdata,
|
105 |
|
|
input tx_axis_mac_tvalid,
|
106 |
|
|
input tx_axis_mac_tlast,
|
107 |
|
|
input tx_axis_mac_tuser,
|
108 |
|
|
output tx_axis_mac_tready,
|
109 |
|
|
|
110 |
|
|
// MAC Control Interface
|
111 |
|
|
//----------------------
|
112 |
|
|
input pause_req,
|
113 |
|
|
input [15:0] pause_val,
|
114 |
|
|
|
115 |
|
|
output speedis100,
|
116 |
|
|
output speedis10100,
|
117 |
|
|
|
118 |
|
|
// RGMII Interface
|
119 |
|
|
//----------------
|
120 |
|
|
output [3:0] rgmii_txd,
|
121 |
|
|
output rgmii_tx_ctl,
|
122 |
|
|
output rgmii_txc,
|
123 |
|
|
input [3:0] rgmii_rxd,
|
124 |
|
|
input rgmii_rx_ctl,
|
125 |
|
|
input rgmii_rxc,
|
126 |
|
|
output inband_link_status,
|
127 |
|
|
output [1:0] inband_clock_speed,
|
128 |
|
|
output inband_duplex_status,
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
// MDIO Interface
|
132 |
|
|
//---------------
|
133 |
|
|
inout mdio,
|
134 |
|
|
output mdc,
|
135 |
|
|
|
136 |
|
|
// AXI-Lite Interface
|
137 |
|
|
//---------------
|
138 |
|
|
input s_axi_aclk,
|
139 |
|
|
input s_axi_resetn,
|
140 |
|
|
|
141 |
|
|
input [11:0] s_axi_awaddr,
|
142 |
|
|
input s_axi_awvalid,
|
143 |
|
|
output s_axi_awready,
|
144 |
|
|
|
145 |
|
|
input [31:0] s_axi_wdata,
|
146 |
|
|
input s_axi_wvalid,
|
147 |
|
|
output s_axi_wready,
|
148 |
|
|
|
149 |
|
|
output [1:0] s_axi_bresp,
|
150 |
|
|
output s_axi_bvalid,
|
151 |
|
|
input s_axi_bready,
|
152 |
|
|
|
153 |
|
|
input [11:0] s_axi_araddr,
|
154 |
|
|
input s_axi_arvalid,
|
155 |
|
|
output s_axi_arready,
|
156 |
|
|
|
157 |
|
|
output [31:0] s_axi_rdata,
|
158 |
|
|
output [1:0] s_axi_rresp,
|
159 |
|
|
output s_axi_rvalid,
|
160 |
|
|
input s_axi_rready,
|
161 |
|
|
|
162 |
|
|
output mac_irq
|
163 |
|
|
|
164 |
|
|
);
|
165 |
|
|
|
166 |
|
|
//----------------------------------------------------------------------------
|
167 |
|
|
// Shareable logic
|
168 |
|
|
//----------------------------------------------------------------------------
|
169 |
|
|
wire mmcm_out_gtx_clk;
|
170 |
|
|
wire mmcm_out_gtx_clk90;
|
171 |
|
|
|
172 |
|
|
assign gtx_clk_out = mmcm_out_gtx_clk;
|
173 |
|
|
assign gtx_clk90_out = mmcm_out_gtx_clk90;
|
174 |
|
|
|
175 |
|
|
// Instantiate the sharable clocking logic
|
176 |
|
|
tri_mode_ethernet_mac_0_support_clocking tri_mode_ethernet_mac_support_clocking_i
|
177 |
|
|
(
|
178 |
|
|
.clk_in1 (gtx_clk),
|
179 |
|
|
.clk_out1 (mmcm_out_gtx_clk),
|
180 |
|
|
.clk_out2 (mmcm_out_gtx_clk90),
|
181 |
|
|
.reset (gtx_mmcm_rst),
|
182 |
|
|
.locked (gtx_mmcm_locked)
|
183 |
|
|
);
|
184 |
|
|
|
185 |
|
|
// Instantiate the sharable reset logic
|
186 |
|
|
tri_mode_ethernet_mac_0_support_resets tri_mode_ethernet_mac_support_resets_i (
|
187 |
|
|
.glbl_rstn (glbl_rstn),
|
188 |
|
|
.refclk (refclk),
|
189 |
|
|
|
190 |
|
|
.idelayctrl_ready (idelayctrl_ready),
|
191 |
|
|
|
192 |
|
|
.idelayctrl_reset_out (idelayctrl_reset),
|
193 |
|
|
.gtx_clk (gtx_clk),
|
194 |
|
|
.gtx_dcm_locked (gtx_mmcm_locked),
|
195 |
|
|
.gtx_mmcm_rst_out (gtx_mmcm_rst)
|
196 |
|
|
);
|
197 |
|
|
|
198 |
|
|
// An IDELAYCTRL primitive needs to be instantiated for the Fixed Tap Delay
|
199 |
|
|
// mode of the IDELAY.
|
200 |
|
|
IDELAYCTRL #(
|
201 |
|
|
.SIM_DEVICE ("7SERIES")
|
202 |
|
|
)
|
203 |
|
|
tri_mode_ethernet_mac_idelayctrl_common_i (
|
204 |
|
|
.RDY (idelayctrl_ready),
|
205 |
|
|
.REFCLK (refclk),
|
206 |
|
|
.RST (idelayctrl_reset)
|
207 |
|
|
);
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
//---------------------------------------------------------------------------
|
211 |
|
|
// Instantiate the TEMAC core
|
212 |
|
|
//---------------------------------------------------------------------------
|
213 |
|
|
tri_mode_ethernet_mac_0 tri_mode_ethernet_mac_i (
|
214 |
|
|
.gtx_clk (mmcm_out_gtx_clk),
|
215 |
|
|
.gtx_clk90 (mmcm_out_gtx_clk90),
|
216 |
|
|
// asynchronous reset
|
217 |
|
|
.glbl_rstn (glbl_rstn),
|
218 |
|
|
.rx_axi_rstn (rx_axi_rstn),
|
219 |
|
|
.tx_axi_rstn (tx_axi_rstn),
|
220 |
|
|
|
221 |
|
|
// Receiver Interface
|
222 |
|
|
//--------------------------
|
223 |
|
|
.rx_enable (rx_enable),
|
224 |
|
|
|
225 |
|
|
.rx_statistics_vector (rx_statistics_vector),
|
226 |
|
|
.rx_statistics_valid (rx_statistics_valid),
|
227 |
|
|
|
228 |
|
|
.rx_mac_aclk (rx_mac_aclk),
|
229 |
|
|
.rx_reset (rx_reset),
|
230 |
|
|
.rx_axis_mac_tdata (rx_axis_mac_tdata),
|
231 |
|
|
.rx_axis_mac_tvalid (rx_axis_mac_tvalid),
|
232 |
|
|
.rx_axis_mac_tlast (rx_axis_mac_tlast),
|
233 |
|
|
.rx_axis_mac_tuser (rx_axis_mac_tuser),
|
234 |
|
|
// Transmitter Interface
|
235 |
|
|
//-----------------------------
|
236 |
|
|
.tx_enable (tx_enable),
|
237 |
|
|
|
238 |
|
|
.tx_ifg_delay (tx_ifg_delay),
|
239 |
|
|
.tx_statistics_vector (tx_statistics_vector),
|
240 |
|
|
.tx_statistics_valid (tx_statistics_valid),
|
241 |
|
|
|
242 |
|
|
.tx_mac_aclk (tx_mac_aclk),
|
243 |
|
|
.tx_reset (tx_reset),
|
244 |
|
|
.tx_axis_mac_tdata (tx_axis_mac_tdata),
|
245 |
|
|
.tx_axis_mac_tvalid (tx_axis_mac_tvalid),
|
246 |
|
|
.tx_axis_mac_tlast (tx_axis_mac_tlast),
|
247 |
|
|
.tx_axis_mac_tuser (tx_axis_mac_tuser),
|
248 |
|
|
.tx_axis_mac_tready (tx_axis_mac_tready),
|
249 |
|
|
|
250 |
|
|
// MAC Control Interface
|
251 |
|
|
//----------------------
|
252 |
|
|
.pause_req (pause_req),
|
253 |
|
|
.pause_val (pause_val),
|
254 |
|
|
|
255 |
|
|
.speedis100 (speedis100),
|
256 |
|
|
.speedis10100 (speedis10100),
|
257 |
|
|
// RGMII Interface
|
258 |
|
|
//----------------
|
259 |
|
|
.rgmii_txd (rgmii_txd),
|
260 |
|
|
.rgmii_tx_ctl (rgmii_tx_ctl),
|
261 |
|
|
.rgmii_txc (rgmii_txc),
|
262 |
|
|
.rgmii_rxd (rgmii_rxd),
|
263 |
|
|
.rgmii_rx_ctl (rgmii_rx_ctl),
|
264 |
|
|
.rgmii_rxc (rgmii_rxc),
|
265 |
|
|
.inband_link_status (inband_link_status),
|
266 |
|
|
.inband_clock_speed (inband_clock_speed),
|
267 |
|
|
.inband_duplex_status (inband_duplex_status),
|
268 |
|
|
|
269 |
|
|
|
270 |
|
|
// MDIO Interface
|
271 |
|
|
//---------------
|
272 |
|
|
.mdio (mdio),
|
273 |
|
|
.mdc (mdc),
|
274 |
|
|
|
275 |
|
|
// AXI-Lite Interface
|
276 |
|
|
//---------------
|
277 |
|
|
.s_axi_aclk (s_axi_aclk),
|
278 |
|
|
.s_axi_resetn (s_axi_resetn),
|
279 |
|
|
|
280 |
|
|
.s_axi_awaddr (s_axi_awaddr),
|
281 |
|
|
.s_axi_awvalid (s_axi_awvalid),
|
282 |
|
|
.s_axi_awready (s_axi_awready),
|
283 |
|
|
|
284 |
|
|
.s_axi_wdata (s_axi_wdata),
|
285 |
|
|
.s_axi_wvalid (s_axi_wvalid),
|
286 |
|
|
.s_axi_wready (s_axi_wready),
|
287 |
|
|
|
288 |
|
|
.s_axi_bresp (s_axi_bresp),
|
289 |
|
|
.s_axi_bvalid (s_axi_bvalid),
|
290 |
|
|
.s_axi_bready (s_axi_bready),
|
291 |
|
|
|
292 |
|
|
.s_axi_araddr (s_axi_araddr),
|
293 |
|
|
.s_axi_arvalid (s_axi_arvalid),
|
294 |
|
|
.s_axi_arready (s_axi_arready),
|
295 |
|
|
|
296 |
|
|
.s_axi_rdata (s_axi_rdata),
|
297 |
|
|
.s_axi_rresp (s_axi_rresp),
|
298 |
|
|
.s_axi_rvalid (s_axi_rvalid),
|
299 |
|
|
.s_axi_rready (s_axi_rready),
|
300 |
|
|
|
301 |
|
|
.mac_irq (mac_irq)
|
302 |
|
|
|
303 |
|
|
);
|
304 |
|
|
|
305 |
|
|
|
306 |
|
|
endmodule
|
307 |
|
|
|
308 |
|
|
|