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

Subversion Repositories udp_ip_stack

[/] [udp_ip_stack/] [trunk/] [contrib/] [Headers sometimes have errors/] [v6_emac_v2_1_fifo_block.vhd] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 pjf
--------------------------------------------------------------------------------
2
-- Project    : Virtex-6 Embedded Tri-Mode Ethernet MAC Wrapper
3
-- File       : v6_emac_v2_1_fifo_block.vhd
4
-- Version    : 2.1
5
-------------------------------------------------------------------------------
6
--
7
-- (c) Copyright 2004-2009 Xilinx, Inc. All rights reserved.
8
--
9
-- This file contains confidential and proprietary information
10
-- of Xilinx, Inc. and is protected under U.S. and
11
-- international copyright and other intellectual property
12
-- laws.
13
--
14
-- DISCLAIMER
15
-- This disclaimer is not a license and does not grant any
16
-- rights to the materials distributed herewith. Except as
17
-- otherwise provided in a valid license issued to you by
18
-- Xilinx, and to the maximum extent permitted by applicable
19
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
20
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
21
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
22
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
23
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
24
-- (2) Xilinx shall not be liable (whether in contract or tort,
25
-- including negligence, or under any other theory of
26
-- liability) for any loss or damage of any kind or nature
27
-- related to, arising under or in connection with these
28
-- materials, including for any direct, or any indirect,
29
-- special, incidental, or consequential loss or damage
30
-- (including loss of data, profits, goodwill, or any type of
31
-- loss or damage suffered as a result of any action brought
32
-- by a third party) even if such damage or loss was
33
-- reasonably foreseeable or Xilinx had been advised of the
34
-- possibility of the same.
35
--
36
-- CRITICAL APPLICATIONS
37
-- Xilinx products are not designed or intended to be fail-
38
-- safe, or for use in any application requiring fail-safe
39
-- performance, such as life-support or safety devices or
40
-- systems, Class III medical devices, nuclear facilities,
41
-- applications related to the deployment of airbags, or any
42
-- other applications that could lead to death, personal
43
-- injury, or severe property or environmental damage
44
-- (individually and collectively, "Critical
45
-- Applications"). Customer assumes the sole risk and
46
-- liability of any use of Xilinx products in Critical
47
-- Applications, subject only to applicable laws and
48
-- regulations governing limitations on product liability.
49
--
50
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
51
-- PART OF THIS FILE AT ALL TIMES.
52
--
53
-- Description: This is the FIFO Block level vhdl wrapper for the Virtex-6
54
--               Embedded Tri-Mode Ethernet MAC.  This wrapper enhances the
55
--              standard MAC core with an example FIFO.  The interface to 
56
--              this FIFO is designed to the AXI-S specification.  
57
--              Please refer to core documentation for
58
--              additional FIFO and AXI-S information.
59
--
60
--         _________________________________________________________
61
--        |                                                         |
62
--        |                 FIFO BLOCK LEVEL WRAPPER                |
63
--        |                                                         |
64
--        |   _____________________       ______________________    |
65
--        |  |  _________________  |     |                      |   |
66
--        |  | |                 | |     |                      |   |
67
--  -------->| |   TX AXI FIFO   | |---->| Tx               Tx  |--------->
68
--        |  | |                 | |     | AXI-S            PHY |   |
69
--        |  | |_________________| |     | I/F              I/F |   |
70
--        |  |                     |     |                      |   |
71
--  AXI   |  |     10/100/1G       |     |  V6 EMAC CORE        |   |
72
-- Stream |  |    ETHERNET FIFO    |     |    BLOCK WRAPPER     |   | PHY I/F
73
--        |  |                     |     |                      |   |
74
--        |  |  _________________  |     |                      |   |
75
--        |  | |                 | |     |                      |   |
76
--  <--------| |   RX AXI FIFO   | |<----| Rx               Rx  |<---------
77
--        |  | |                 | |     | AXI-S            PHY |   |
78
--        |  | |_________________| |     | I/F              I/F |   |
79
--        |  |_____________________|     |______________________|   |
80
--        |                                                         |
81
--        |_________________________________________________________|
82
--
83
 
84
 
85
library unisim;
86
use unisim.vcomponents.all;
87
 
88
library ieee;
89
use ieee.std_logic_1164.all;
90
use ieee.std_logic_unsigned.all;
91
use ieee.numeric_std.all;
92
 
93
 
94
--------------------------------------------------------------------------------
95
-- The module declaration for the fifo block level wrapper.
96
--------------------------------------------------------------------------------
97
 
98
entity v6_emac_v2_1_fifo_block is
99
   port(
100
      gtx_clk                    : in  std_logic;
101
      -- Receiver Statistics Interface
102
      -----------------------------------------
103
      rx_mac_aclk                : out std_logic;
104
      rx_reset                   : out std_logic;
105
      rx_statistics_vector       : out std_logic_vector(27 downto 0);
106
      rx_statistics_valid        : out std_logic;
107
 
108
      -- Receiver (AXI-S) Interface
109
      ------------------------------------------
110
      rx_fifo_clock              : in  std_logic;
111
      rx_fifo_resetn             : in  std_logic;
112
      rx_axis_fifo_tdata         : out std_logic_vector(7 downto 0);
113
      rx_axis_fifo_tvalid        : out std_logic;
114
      rx_axis_fifo_tready        : in  std_logic;
115
      rx_axis_fifo_tlast         : out std_logic;
116
 
117
      -- Transmitter Statistics Interface
118
      --------------------------------------------
119
      tx_mac_aclk                : out std_logic;
120
      tx_reset                   : out std_logic;
121
      tx_ifg_delay               : in  std_logic_vector(7 downto 0);
122
      tx_statistics_vector       : out std_logic_vector(31 downto 0);
123
      tx_statistics_valid        : out std_logic;
124
 
125
      -- Transmitter (AXI-S) Interface
126
      ---------------------------------------------
127
      tx_fifo_clock              : in  std_logic;
128
      tx_fifo_resetn             : in  std_logic;
129
      tx_axis_fifo_tdata         : in  std_logic_vector(7 downto 0);
130
      tx_axis_fifo_tvalid        : in  std_logic;
131
      tx_axis_fifo_tready        : out std_logic;
132
      tx_axis_fifo_tlast         : in  std_logic;
133
 
134
      -- MAC Control Interface
135
      --------------------------
136
      pause_req                  : in  std_logic;
137
      pause_val                  : in  std_logic_vector(15 downto 0);
138
 
139
      -- Reference clock for IDELAYCTRL's
140
      refclk                     : in  std_logic;
141
 
142
      -- GMII Interface
143
      -------------------
144
      gmii_txd                  : out std_logic_vector(7 downto 0);
145
      gmii_tx_en                : out std_logic;
146
      gmii_tx_er                : out std_logic;
147
      gmii_tx_clk               : out std_logic;
148
      gmii_rxd                  : in  std_logic_vector(7 downto 0);
149
      gmii_rx_dv                : in  std_logic;
150
      gmii_rx_er                : in  std_logic;
151
      gmii_rx_clk               : in  std_logic;
152
      gmii_col                  : in  std_logic;
153
      gmii_crs                  : in  std_logic;
154
      mii_tx_clk                : in  std_logic;
155
 
156
      -- Initial Unicast Address Value
157
      unicast_address           : in  std_logic_vector(47 downto 0);
158
 
159
 
160
      -- asynchronous reset
161
      glbl_rstn                  : in  std_logic;
162
      rx_axi_rstn                : in  std_logic;
163
      tx_axi_rstn                : in  std_logic
164
 
165
   );
166
end v6_emac_v2_1_fifo_block;
167
 
168
 
169
architecture wrapper of v6_emac_v2_1_fifo_block is
170
 
171
  ------------------------------------------------------------------------------
172
  -- Component declaration for the block level
173
  ------------------------------------------------------------------------------
174
  component v6_emac_v2_1_block
175
   port(
176
      gtx_clk                       : in std_logic;
177
 
178
      -- Receiver Interface
179
      ----------------------------
180
      rx_statistics_vector          : out std_logic_vector(27 downto 0);
181
      rx_statistics_valid           : out std_logic;
182
 
183
      rx_mac_aclk                   : out std_logic;
184
      rx_reset                      : out std_logic;
185
      rx_axis_mac_tdata             : out std_logic_vector(7 downto 0);
186
      rx_axis_mac_tvalid            : out std_logic;
187
      rx_axis_mac_tlast             : out std_logic;
188
      rx_axis_mac_tuser             : out std_logic;
189
 
190
      -- Transmitter Interface
191
      -------------------------------
192
      tx_ifg_delay                  : in std_logic_vector(7 downto 0);
193
      tx_statistics_vector          : out std_logic_vector(31 downto 0);
194
      tx_statistics_valid           : out std_logic;
195
 
196
      tx_mac_aclk                   : out std_logic;
197
      tx_reset                      : out std_logic;
198
      tx_axis_mac_tdata             : in std_logic_vector(7 downto 0);
199
      tx_axis_mac_tvalid            : in std_logic;
200
      tx_axis_mac_tlast             : in std_logic;
201
      tx_axis_mac_tuser             : in std_logic;
202
      tx_axis_mac_tready            : out std_logic;
203
      tx_collision                  : out std_logic;
204
      tx_retransmit                 : out std_logic;
205
 
206
      -- MAC Control Interface
207
      ------------------------
208
      pause_req                     : in std_logic;
209
      pause_val                     : in std_logic_vector(15 downto 0);
210
 
211
      -- Reference clock for IDELAYCTRL's
212
      refclk                        : in std_logic;
213
 
214
      -- GMII Interface
215
      -----------------
216
      gmii_txd                      : out std_logic_vector(7 downto 0);
217
      gmii_tx_en                    : out std_logic;
218
      gmii_tx_er                    : out std_logic;
219
      gmii_tx_clk                   : out std_logic;
220
      gmii_rxd                      : in std_logic_vector(7 downto 0);
221
      gmii_rx_dv                    : in std_logic;
222
      gmii_rx_er                    : in std_logic;
223
      gmii_rx_clk                   : in std_logic;
224
      gmii_col                      : in std_logic;
225
      gmii_crs                      : in std_logic;
226
      mii_tx_clk                    : in std_logic;
227
 
228
 
229
      -- Initial Unicast Address Value
230
      unicast_address               : in std_logic_vector(47 downto 0);
231
 
232
 
233
      -- asynchronous reset
234
      -----------------
235
      glbl_rstn                     : in std_logic;
236
      rx_axi_rstn                   : in std_logic;
237
      tx_axi_rstn                   : in std_logic
238
 
239
      );
240
  end component;
241
 
242
 
243
  ------------------------------------------------------------------------------
244
  -- Component declaration for the fifo
245
  ------------------------------------------------------------------------------
246
   component ten_100_1g_eth_fifo
247
   generic (
248
        FULL_DUPLEX_ONLY    : boolean := false);      -- If fifo is to be used only in full
249
                                              -- duplex set to true for optimised implementation
250
 
251
   port (
252
        tx_fifo_aclk             : in  std_logic;
253
        tx_fifo_resetn           : in  std_logic;
254
        tx_axis_fifo_tdata       : in  std_logic_vector(7 downto 0);
255
        tx_axis_fifo_tvalid      : in  std_logic;
256
        tx_axis_fifo_tlast       : in  std_logic;
257
        tx_axis_fifo_tready      : out std_logic;
258
 
259
        tx_mac_aclk              : in  std_logic;
260
        tx_mac_resetn            : in  std_logic;
261
        tx_axis_mac_tdata        : out std_logic_vector(7 downto 0);
262
        tx_axis_mac_tvalid       : out std_logic;
263
        tx_axis_mac_tlast        : out std_logic;
264
        tx_axis_mac_tready       : in  std_logic;
265
        tx_axis_mac_tuser        : out std_logic;
266
        tx_fifo_overflow         : out std_logic;
267
        tx_fifo_status           : out std_logic_vector(3 downto 0);
268
        tx_collision             : in  std_logic;
269
        tx_retransmit            : in  std_logic;
270
 
271
        rx_fifo_aclk             : in  std_logic;
272
        rx_fifo_resetn           : in  std_logic;
273
        rx_axis_fifo_tdata       : out std_logic_vector(7 downto 0);
274
        rx_axis_fifo_tvalid      : out std_logic;
275
        rx_axis_fifo_tlast       : out std_logic;
276
        rx_axis_fifo_tready      : in  std_logic;
277
 
278
        rx_mac_aclk              : in  std_logic;
279
        rx_mac_resetn            : in  std_logic;
280
        rx_axis_mac_tdata        : in  std_logic_vector(7 downto 0);
281
        rx_axis_mac_tvalid       : in  std_logic;
282
        rx_axis_mac_tlast        : in  std_logic;
283
        rx_axis_mac_tready       : out std_logic;
284
        rx_axis_mac_tuser        : in  std_logic;
285
        rx_fifo_status           : out std_logic_vector(3 downto 0);
286
        rx_fifo_overflow         : out std_logic
287
  );
288
  end component;
289
 
290
  ------------------------------------------------------------------------------
291
  -- Internal signals used in this fifo block level wrapper.
292
  ------------------------------------------------------------------------------
293
 
294
  -- Note: KEEP attributes preserve signal names so they can be displayed in
295
  --            simulator wave windows
296
 
297
  signal rx_mac_aclk_int      : std_logic;   -- MAC Rx clock
298
  signal tx_mac_aclk_int      : std_logic;   -- MAC Tx clock
299
  signal rx_reset_int         : std_logic;   -- MAC Rx reset
300
  signal tx_reset_int         : std_logic;   -- MAC Tx reset
301
  signal tx_mac_resetn        : std_logic;
302
  signal rx_mac_resetn        : std_logic;
303
 
304
  -- MAC receiver client I/F
305
  signal rx_axis_mac_tdata    : std_logic_vector(7 downto 0);
306
  signal rx_axis_mac_tvalid   : std_logic;
307
  signal rx_axis_mac_tlast    : std_logic;
308
  signal rx_axis_mac_tuser    : std_logic;
309
 
310
  -- MAC transmitter client I/F
311
  signal tx_axis_mac_tdata    : std_logic_vector(7 downto 0);
312
  signal tx_axis_mac_tvalid   : std_logic;
313
  signal tx_axis_mac_tready   : std_logic;
314
  signal tx_axis_mac_tlast    : std_logic;
315
  signal tx_axis_mac_tuser    : std_logic;
316
 
317
  signal tx_collision         : std_logic;
318
  signal tx_retransmit        : std_logic;
319
 
320
   -- Note: KEEP attributes preserve signal names so they can be displayed in
321
   --            simulator wave windows
322
   attribute keep : string;
323
   attribute keep of rx_axis_mac_tdata : signal is "true";
324
   attribute keep of rx_axis_mac_tvalid : signal is "true";
325
   attribute keep of rx_axis_mac_tlast : signal is "true";
326
   attribute keep of rx_axis_mac_tuser : signal is "true";
327
   attribute keep of tx_axis_mac_tdata : signal is "true";
328
   attribute keep of tx_axis_mac_tvalid : signal is "true";
329
   attribute keep of tx_axis_mac_tready : signal is "true";
330
   attribute keep of tx_axis_mac_tlast : signal is "true";
331
   attribute keep of tx_axis_mac_tuser : signal is "true";
332
 
333
begin
334
 
335
  ------------------------------------------------------------------------------
336
  -- Connect the output clock signals
337
  ------------------------------------------------------------------------------
338
 
339
   rx_mac_aclk          <= rx_mac_aclk_int;
340
   tx_mac_aclk          <= tx_mac_aclk_int;
341
   rx_reset             <= rx_reset_int;
342
   tx_reset             <= tx_reset_int;
343
 
344
   ------------------------------------------------------------------------------
345
   -- Instantiate the Tri-Mode EMAC Block wrapper
346
   ------------------------------------------------------------------------------
347
   v6emac_block : v6_emac_v2_1_block
348
   port map(
349
      gtx_clk               => gtx_clk,
350
 
351
      -- Client Receiver Interface
352
      rx_statistics_vector  => rx_statistics_vector,
353
      rx_statistics_valid   => rx_statistics_valid,
354
 
355
      rx_mac_aclk           => rx_mac_aclk_int,
356
      rx_reset              => rx_reset_int,
357
      rx_axis_mac_tdata     => rx_axis_mac_tdata,
358
      rx_axis_mac_tvalid    => rx_axis_mac_tvalid,
359
      rx_axis_mac_tlast     => rx_axis_mac_tlast,
360
      rx_axis_mac_tuser     => rx_axis_mac_tuser,
361
 
362
      -- Client Transmitter Interface
363
      tx_ifg_delay          => tx_ifg_delay,
364
      tx_statistics_vector  => tx_statistics_vector,
365
      tx_statistics_valid   => tx_statistics_valid,
366
 
367
      tx_mac_aclk           => tx_mac_aclk_int,
368
      tx_reset              => tx_reset_int,
369
      tx_axis_mac_tdata     => tx_axis_mac_tdata ,
370
      tx_axis_mac_tvalid    => tx_axis_mac_tvalid,
371
      tx_axis_mac_tlast     => tx_axis_mac_tlast,
372
      tx_axis_mac_tuser     => tx_axis_mac_tuser,
373
      tx_axis_mac_tready    => tx_axis_mac_tready,
374
      tx_collision          => tx_collision,
375
      tx_retransmit         => tx_retransmit,
376
 
377
      -- Flow Control
378
      pause_req             => pause_req,
379
      pause_val             => pause_val,
380
 
381
      -- Reference clock for IDELAYCTRL's
382
      refclk                => refclk,
383
 
384
      -- GMII Interface
385
      gmii_txd              => gmii_txd,
386
      gmii_tx_en            => gmii_tx_en,
387
      gmii_tx_er            => gmii_tx_er,
388
      gmii_tx_clk           => gmii_tx_clk,
389
      gmii_rxd              => gmii_rxd,
390
      gmii_rx_dv            => gmii_rx_dv,
391
      gmii_rx_er            => gmii_rx_er,
392
      gmii_rx_clk           => gmii_rx_clk,
393
      gmii_crs              => gmii_crs,
394
      gmii_col              => gmii_col,
395
      mii_tx_clk            => mii_tx_clk,
396
 
397
      unicast_address               => unicast_address,
398
 
399
      -- asynchronous reset
400
      glbl_rstn             => glbl_rstn,
401
      rx_axi_rstn           => rx_axi_rstn,
402
      tx_axi_rstn           => tx_axi_rstn
403
 
404
   );
405
 
406
 
407
   ------------------------------------------------------------------------------
408
   -- Instantiate the user side FIFO
409
   ------------------------------------------------------------------------------
410
   -- create inverted mac resets as the FIFO expects AXI compliant resets
411
   tx_mac_resetn <= not tx_reset_int;
412
   rx_mac_resetn <= not rx_reset_int;
413
 
414
 
415
   user_side_FIFO : ten_100_1g_eth_fifo
416
   generic map(
417
      FULL_DUPLEX_ONLY        => false
418
   )
419
   port map(
420
      -- Transmit FIFO MAC TX Interface
421
      tx_fifo_aclk            => tx_fifo_clock,
422
      tx_fifo_resetn          => tx_fifo_resetn,
423
      tx_axis_fifo_tdata      => tx_axis_fifo_tdata,
424
      tx_axis_fifo_tvalid     => tx_axis_fifo_tvalid,
425
      tx_axis_fifo_tlast      => tx_axis_fifo_tlast,
426
      tx_axis_fifo_tready     => tx_axis_fifo_tready,
427
 
428
      tx_mac_aclk             => tx_mac_aclk_int,
429
      tx_mac_resetn           => tx_mac_resetn,
430
      tx_axis_mac_tdata       => tx_axis_mac_tdata,
431
      tx_axis_mac_tvalid      => tx_axis_mac_tvalid,
432
      tx_axis_mac_tlast       => tx_axis_mac_tlast,
433
      tx_axis_mac_tready      => tx_axis_mac_tready,
434
      tx_axis_mac_tuser       => tx_axis_mac_tuser,
435
 
436
      tx_fifo_overflow        => open,
437
      tx_fifo_status          => open,
438
      tx_collision            => tx_collision,
439
      tx_retransmit           => tx_retransmit,
440
 
441
      rx_fifo_aclk            => rx_fifo_clock,
442
      rx_fifo_resetn          => rx_fifo_resetn,
443
      rx_axis_fifo_tdata      => rx_axis_fifo_tdata,
444
      rx_axis_fifo_tvalid     => rx_axis_fifo_tvalid,
445
      rx_axis_fifo_tlast      => rx_axis_fifo_tlast,
446
      rx_axis_fifo_tready     => rx_axis_fifo_tready,
447
 
448
      rx_mac_aclk             => rx_mac_aclk_int,
449
      rx_mac_resetn           => rx_mac_resetn,
450
      rx_axis_mac_tdata       => rx_axis_mac_tdata,
451
      rx_axis_mac_tvalid      => rx_axis_mac_tvalid,
452
      rx_axis_mac_tlast       => rx_axis_mac_tlast,
453
      rx_axis_mac_tready      => open,               -- not used as MAC cannot throttle
454
      rx_axis_mac_tuser       => rx_axis_mac_tuser,
455
 
456
      rx_fifo_status          => open,
457
      rx_fifo_overflow        => open
458
  );
459
 
460
 
461
end wrapper;

powered by: WebSVN 2.1.0

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