OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [boardsupport/] [v5/] [gtp_dual_1000X.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 peteralieb
//-----------------------------------------------------------------------------
2
// Title      : 1000BASE-X RocketIO wrapper
3
// Project    : Virtex-5 Ethernet MAC Wrappers
4
//-----------------------------------------------------------------------------
5
// File       : gtp_dual_1000X.v
6
// Author     : Xilinx
7
//-----------------------------------------------------------------------------
8
// Copyright (c) 2004-2008 by Xilinx, Inc. All rights reserved.
9
// This text/file contains proprietary, confidential
10
// information of Xilinx, Inc., is distributed under license
11
// from Xilinx, Inc., and may be used, copied and/or
12
// disclosed only pursuant to the terms of a valid license
13
// agreement with Xilinx, Inc. Xilinx hereby grants you
14
// a license to use this text/file solely for design, simulation,
15
// implementation and creation of design files limited
16
// to Xilinx devices or technologies. Use with non-Xilinx
17
// devices or technologies is expressly prohibited and
18
// immediately terminates your license unless covered by
19
// a separate agreement.
20
//
21
// Xilinx is providing this design, code, or information
22
// "as is" solely for use in developing programs and
23
// solutions for Xilinx devices. By providing this design,
24
// code, or information as one possible implementation of
25
// this feature, application or standard, Xilinx is making no
26
// representation that this implementation is free from any
27
// claims of infringement. You are responsible for
28
// obtaining any rights you may require for your implementation.
29
// Xilinx expressly disclaims any warranty whatsoever with
30
// respect to the adequacy of the implementation, including
31
// but not limited to any warranties or representations that this
32
// implementation is free from claims of infringement, implied
33
// warranties of merchantability or fitness for a particular
34
// purpose.
35
//
36
// Xilinx products are not intended for use in life support
37
// appliances, devices, or systems. Use in such applications are
38
// expressly prohibited.
39
//
40
// This copyright and support notice must be retained as part
41
// of this text at all times. (c) Copyright 2004-2008 Xilinx, Inc.
42
// All rights reserved.
43
//
44
//----------------------------------------------------------------------
45
// Description:  This is the Verilog instantiation of a Virtex-5 GTP    
46
//               RocketIO tile for the Embedded Ethernet MAC.
47
//
48
//               Two GTP's must be instantiated regardless of how many  
49
//               GTPs are used in the MGT tile. 
50
//----------------------------------------------------------------------
51
 
52
`timescale 1 ps / 1 ps
53
 
54
module GTP_dual_1000X
55
(
56
          RESETDONE_0,
57
          ENMCOMMAALIGN_0,
58
          ENPCOMMAALIGN_0,
59
          LOOPBACK_0,
60
          POWERDOWN_0,
61
          RXUSRCLK_0,
62
          RXUSRCLK2_0,
63
          RXRESET_0,
64
          TXCHARDISPMODE_0,
65
          TXCHARDISPVAL_0,
66
          TXCHARISK_0,
67
          TXDATA_0,
68
          TXUSRCLK_0,
69
          TXUSRCLK2_0,
70
          TXRESET_0,
71
          RXCHARISCOMMA_0,
72
          RXCHARISK_0,
73
          RXCLKCORCNT_0,
74
          RXDATA_0,
75
          RXDISPERR_0,
76
          RXNOTINTABLE_0,
77
          RXRUNDISP_0,
78
          RXBUFERR_0,
79
          TXBUFERR_0,
80
          PLLLKDET_0,
81
          TXOUTCLK_0,
82
          RXELECIDLE_0,
83
          TX1N_0,
84
          TX1P_0,
85
          RX1N_0,
86
          RX1P_0,
87
 
88
          TX1N_1_UNUSED,
89
          TX1P_1_UNUSED,
90
          RX1N_1_UNUSED,
91
          RX1P_1_UNUSED,
92
 
93
 
94
          CLK_DS,
95
          REFCLKOUT,
96
          GTRESET,
97
          PMARESET,
98
          DCM_LOCKED);
99
 
100
  output          RESETDONE_0;
101
  input           ENMCOMMAALIGN_0;
102
  input           ENPCOMMAALIGN_0;
103
  input           LOOPBACK_0;
104
  input           POWERDOWN_0;
105
  input           RXUSRCLK_0;
106
  input           RXUSRCLK2_0;
107
  input           RXRESET_0;
108
  input           TXCHARDISPMODE_0;
109
  input           TXCHARDISPVAL_0;
110
  input           TXCHARISK_0;
111
  input [7:0]     TXDATA_0;
112
  input           TXUSRCLK_0;
113
  input           TXUSRCLK2_0;
114
  input           TXRESET_0;
115
  output          RXCHARISCOMMA_0;
116
  output          RXCHARISK_0;
117
  output [2:0]    RXCLKCORCNT_0;
118
  output [7:0]    RXDATA_0;
119
  output          RXDISPERR_0;
120
  output          RXNOTINTABLE_0;
121
  output          RXRUNDISP_0;
122
  output          RXBUFERR_0;
123
  output          TXBUFERR_0;
124
  output          PLLLKDET_0;
125
  output          TXOUTCLK_0;
126
  output          RXELECIDLE_0;
127
  output          TX1N_0;
128
  output          TX1P_0;
129
  input           RX1N_0;
130
  input           RX1P_0;
131
 
132
  output          TX1N_1_UNUSED;
133
  output          TX1P_1_UNUSED;
134
  input           RX1N_1_UNUSED;
135
  input           RX1P_1_UNUSED;
136
 
137
 
138
  input           CLK_DS;
139
  output          REFCLKOUT;
140
  input           GTRESET;
141
  input           PMARESET;
142
  input           DCM_LOCKED;
143
 
144
  //--------------------------------------------------------------------
145
  // Signal declarations for GTP
146
  //--------------------------------------------------------------------
147
 
148
   wire PLLLOCK;
149
 
150
 
151
   wire RXNOTINTABLE_0_INT;
152
   wire [7:0] RXDATA_0_INT;
153
   wire RXCHARISK_0_INT;
154
   wire RXDISPERR_0_INT;
155
   wire RXRUNDISP_0_INT;
156
 
157
   wire [1:0] RXBUFSTATUS_float0;
158
   wire TXBUFSTATUS_float0;
159
 
160
   wire gt_txoutclk1_0;
161
 
162
   reg  [7:0] RXDATA_0;
163
   reg  RXRUNDISP_0;
164
   reg  RXCHARISK_0;
165
 
166
   wire rxelecidle0_i;
167
   wire resetdone0_i;
168
 
169
   wire RXRECCLK_0;
170
   wire RXRECCLK_0_BUFR;
171
   wire RXCHARISCOMMA_0_REC;
172
   wire RXNOTINTABLE_0_REC;
173
   wire [7:0] RXDATA_0_REC;
174
   wire RXCHARISK_0_REC;
175
   wire RXDISPERR_0_REC;
176
   wire RXRUNDISP_0_REC;
177
 
178
   reg  RXRESET_0_REG;
179
   reg  RXRESET_0_REC;
180
   reg  RXRESET_0_USR_REG;
181
   reg  RXRESET_0_USR;
182
   reg  ENPCOMMAALIGN_0_REG;
183
   reg  ENPCOMMAALIGN_0_REC;
184
   reg  ENMCOMMAALIGN_0_REG;
185
   reg  ENMCOMMAALIGN_0_REC;
186
   wire RXBUFERR_0_REC;
187
   wire RXBUFERR_0_INT;
188
 
189
   // synthesis attribute ASYNC_REG of RXRESET_0_REG       is "TRUE";
190
   // synthesis attribute ASYNC_REG of RXRESET_0_REC       is "TRUE";
191
   // synthesis attribute ASYNC_REG of RXRESET_0_USR_REG   is "TRUE";
192
   // synthesis attribute ASYNC_REG of RXRESET_0_USR       is "TRUE";
193
   // synthesis attribute ASYNC_REG of ENPCOMMAALIGN_0_REG is "TRUE";
194
   // synthesis attribute ASYNC_REG of ENPCOMMAALIGN_0_REC is "TRUE";
195
   // synthesis attribute ASYNC_REG of ENMCOMMAALIGN_0_REG is "TRUE";
196
   // synthesis attribute ASYNC_REG of ENMCOMMAALIGN_0_REC is "TRUE";
197
 
198
 
199
   //--------------------------------------------------------------------
200
   // Wait for both PLL's to lock   
201
   //--------------------------------------------------------------------
202
 
203
 
204
   assign PLLLKDET_0        =   PLLLOCK;
205
 
206
 
207
   //--------------------------------------------------------------------
208
   // Wire internal signals to outputs   
209
   //--------------------------------------------------------------------
210
 
211
   assign RXNOTINTABLE_0  =   RXNOTINTABLE_0_INT;
212
   assign RXDISPERR_0     =   RXDISPERR_0_INT;
213
   assign TXOUTCLK_0      =   gt_txoutclk1_0;
214
   assign RESETDONE_0  = resetdone0_i;
215
   assign RXELECIDLE_0 = rxelecidle0_i;
216
 
217
 
218
 
219
 
220
   //--------------------------------------------------------------------
221
   // Instantiate the Virtex-5 GTP
222
   // EMAC0 connects to GTP 0 and EMAC1 connects to GTP 1
223
   //--------------------------------------------------------------------
224
 
225
   // Direct from the RocketIO Wizard output
226
   ROCKETIO_WRAPPER_GTP #
227
    (
228
        .WRAPPER_SIM_GTPRESET_SPEEDUP           (1),
229
        .WRAPPER_SIM_PLL_PERDIV2                (9'h190)
230
    )
231
    GTP_1000X
232
    (
233
        //------------------- Shared Ports - Tile and PLL Ports --------------------
234
        .TILE0_CLKIN_IN                 (CLK_DS),
235
        .TILE0_GTPRESET_IN              (GTRESET),
236
        .TILE0_PLLLKDET_OUT             (PLLLOCK),
237
        .TILE0_REFCLKOUT_OUT            (REFCLKOUT),
238
        //---------------------- Loopback and Powerdown Ports ----------------------
239
        .TILE0_LOOPBACK0_IN             ({2'b00, LOOPBACK_0}),
240
        .TILE0_RXPOWERDOWN0_IN          ({POWERDOWN_0, POWERDOWN_0}),
241
        .TILE0_TXPOWERDOWN0_IN          ({POWERDOWN_0, POWERDOWN_0}),
242
        //--------------------- Receive Ports - 8b10b Decoder ----------------------
243
        .TILE0_RXCHARISCOMMA0_OUT       (RXCHARISCOMMA_0_REC),
244
        .TILE0_RXCHARISK0_OUT           (RXCHARISK_0_REC),
245
        .TILE0_RXDISPERR0_OUT           (RXDISPERR_0_REC),
246
        .TILE0_RXNOTINTABLE0_OUT        (RXNOTINTABLE_0_REC),
247
        .TILE0_RXRUNDISP0_OUT           (RXRUNDISP_0_REC),
248
        //----------------- Receive Ports - Clock Correction Ports -----------------
249
        .TILE0_RXCLKCORCNT0_OUT         (),
250
        //------------- Receive Ports - Comma Detection and Alignment --------------
251
        .TILE0_RXENMCOMMAALIGN0_IN      (ENMCOMMAALIGN_0_REC),
252
        .TILE0_RXENPCOMMAALIGN0_IN      (ENMCOMMAALIGN_0_REC),
253
        //----------------- Receive Ports - RX Data Path interface -----------------
254
        .TILE0_RXDATA0_OUT              (RXDATA_0_REC),
255
        .TILE0_RXRECCLK0_OUT            (RXRECCLK_0),
256
        .TILE0_RXRESET0_IN              (RXRESET_0_REC),
257
        .TILE0_RXUSRCLK0_IN             (RXRECCLK_0_BUFR),
258
        .TILE0_RXUSRCLK20_IN            (RXRECCLK_0_BUFR),
259
        //------ Receive Ports - RX Elastic Buffer and Phase Alignment Ports -------
260
        .TILE0_RXBUFRESET0_IN           (RXRESET_0_REC),
261
        .TILE0_RXBUFSTATUS0_OUT         ({RXBUFERR_0_REC, RXBUFSTATUS_float0}),
262
        //----- Receive Ports - RX Driver,OOB signalling,Coupling and Eq.,CDR ------
263
        .TILE0_RXELECIDLE0_OUT          (rxelecidle0_i),
264
        .TILE0_RXN0_IN                  (RX1N_0),
265
        .TILE0_RXP0_IN                  (RX1P_0),
266
        //------------- ResetDone Ports --------------------------------------------
267
        .TILE0_RESETDONE0_OUT           (resetdone0_i),
268
        //-------------- Transmit Ports - 8b10b Encoder Control Ports --------------
269
        .TILE0_TXCHARDISPMODE0_IN       (TXCHARDISPMODE_0),
270
        .TILE0_TXCHARDISPVAL0_IN        (TXCHARDISPVAL_0),
271
        .TILE0_TXCHARISK0_IN            (TXCHARISK_0),
272
        //----------- Transmit Ports - TX Buffering and Phase Alignment ------------
273
        .TILE0_TXBUFSTATUS0_OUT         ({TXBUFERR_0, TXBUFSTATUS_float0}),
274
        //---------------- Transmit Ports - TX Data Path interface -----------------
275
        .TILE0_TXDATA0_IN               (TXDATA_0),
276
        .TILE0_TXOUTCLK0_OUT            (gt_txoutclk1_0),
277
        .TILE0_TXRESET0_IN              (TXRESET_0),
278
        .TILE0_TXUSRCLK0_IN             (TXUSRCLK_0),
279
        .TILE0_TXUSRCLK20_IN            (TXUSRCLK2_0),
280
        //------------- Transmit Ports - TX Driver and OOB signalling --------------
281
        .TILE0_TXN0_OUT                 (TX1N_0),
282
        .TILE0_TXP0_OUT                 (TX1P_0),
283
        .TILE0_LOOPBACK1_IN             (3'b000),
284
        .TILE0_RXPOWERDOWN1_IN          (2'b00),
285
        .TILE0_TXPOWERDOWN1_IN          (2'b00),
286
        .TILE0_RXCHARISCOMMA1_OUT       (),
287
        .TILE0_RXCHARISK1_OUT           (),
288
        .TILE0_RXDISPERR1_OUT           (),
289
        .TILE0_RXNOTINTABLE1_OUT        (),
290
        .TILE0_RXRUNDISP1_OUT           (),
291
        .TILE0_RXCLKCORCNT1_OUT         (),
292
        .TILE0_RXENMCOMMAALIGN1_IN      (1'b0),
293
        .TILE0_RXENPCOMMAALIGN1_IN      (1'b0),
294
        .TILE0_RXDATA1_OUT              (),
295
        .TILE0_RXRECCLK1_OUT            (),
296
        .TILE0_RXRESET1_IN              (1'b0),
297
        .TILE0_RXUSRCLK1_IN             (1'b0),
298
        .TILE0_RXUSRCLK21_IN            (1'b0),
299
        .TILE0_RXBUFRESET1_IN           (1'b0),
300
        .TILE0_RXBUFSTATUS1_OUT         (),
301
        .TILE0_RXELECIDLE1_OUT          (),
302
        .TILE0_RXN1_IN                  (RX1N_1_UNUSED),
303
        .TILE0_RXP1_IN                  (RX1P_1_UNUSED),
304
        .TILE0_RESETDONE1_OUT           (),
305
        .TILE0_TXCHARDISPMODE1_IN       (1'b0),
306
        .TILE0_TXCHARDISPVAL1_IN        (1'b0),
307
        .TILE0_TXCHARISK1_IN            (1'b0),
308
        .TILE0_TXBUFSTATUS1_OUT         (),
309
        .TILE0_TXDATA1_IN               (8'h00),
310
        .TILE0_TXOUTCLK1_OUT            (),
311
        .TILE0_TXRESET1_IN              (1'b0),
312
        .TILE0_TXUSRCLK1_IN             (1'b0),
313
        .TILE0_TXUSRCLK21_IN            (1'b0),
314
        .TILE0_TXN1_OUT                 (TX1N_1_UNUSED),
315
        .TILE0_TXP1_OUT                 (TX1P_1_UNUSED)
316
   );
317
 
318
 
319
   // Route RXRECLK0 through a regional clock buffer
320
   BUFR rxrecclk0bufr (.I(RXRECCLK_0), .O(RXRECCLK_0_BUFR), .CE(1'b1), .CLR(1'b0));
321
 
322
   // Instantiate the RX elastic buffer. This performs clock
323
   // correction on the incoming data to cope with differences 
324
   // between the user clock and the clock recovered from the data.
325
   rx_elastic_buffer rx_elastic_buffer_inst_0(
326
    // Signals from the GTP on RXRECCLK. 
327
    .rxrecclk          (RXRECCLK_0_BUFR),
328
    .reset             (RXRESET_0_REC),
329
    .rxchariscomma_rec (RXCHARISCOMMA_0_REC),
330
    .rxcharisk_rec     (RXCHARISK_0_REC),
331
    .rxdisperr_rec     (RXDISPERR_0_REC),
332
    .rxnotintable_rec  (RXNOTINTABLE_0_REC),
333
    .rxrundisp_rec     (RXRUNDISP_0_REC),
334
    .rxdata_rec        (RXDATA_0_REC),
335
 
336
    // Signals reclocked onto USRCLK.
337
    .rxusrclk2         (RXUSRCLK2_0),
338
    .rxreset           (RXRESET_0_USR),
339
    .rxchariscomma_usr (RXCHARISCOMMA_0),
340
    .rxcharisk_usr     (RXCHARISK_0_INT),
341
    .rxdisperr_usr     (RXDISPERR_0_INT),
342
    .rxnotintable_usr  (RXNOTINTABLE_0_INT),
343
    .rxrundisp_usr     (RXRUNDISP_0_INT),
344
    .rxclkcorcnt_usr   (RXCLKCORCNT_0),
345
    .rxbuferr          (RXBUFERR_0_INT),
346
    .rxdata_usr        (RXDATA_0_INT)
347
  );
348
 
349
  assign RXBUFERR_0 = RXBUFERR_0_INT | RXBUFERR_0_REC;
350
 
351
  // Resynchronise the RXRESET onto the RXRECCLK domain
352
  always @(posedge RXRECCLK_0_BUFR or posedge PMARESET)
353
  begin
354
    if (PMARESET == 1'b1)
355
    begin
356
        RXRESET_0_REG  <=1'b1;
357
        RXRESET_0_REC  <=1'b1;
358
    end
359
    else
360
    begin
361
        RXRESET_0_REG  <= 1'b0;
362
        RXRESET_0_REC  <= RXRESET_0_REG;
363
    end
364
  end
365
 
366
  // Resynchronise the RXRESET onto the RXUSRCLK2_0 domain
367
  always @(posedge RXUSRCLK2_0 or posedge RXRESET_0)
368
  begin
369
    if (RXRESET_0 == 1'b1)
370
    begin
371
        RXRESET_0_USR_REG  <= 1'b1;
372
        RXRESET_0_USR      <= 1'b1;
373
    end
374
    else
375
    begin
376
        RXRESET_0_USR_REG  <= 1'b0;
377
        RXRESET_0_USR      <= RXRESET_0_USR_REG;
378
    end
379
  end
380
 
381
  // Re-align signals from the USRCLK domain into the 
382
  // RXRECCLK domain
383
  always @(posedge RXRECCLK_0_BUFR or posedge RXRESET_0_REC)
384
  begin
385
    if (RXRESET_0_REC == 1'b1)
386
    begin
387
      ENPCOMMAALIGN_0_REG <= 1'b0;
388
      ENPCOMMAALIGN_0_REC <= 1'b0;
389
      ENMCOMMAALIGN_0_REG <= 1'b0;
390
      ENMCOMMAALIGN_0_REC <= 1'b0;
391
    end
392
    else
393
    begin
394
      ENPCOMMAALIGN_0_REG <= ENPCOMMAALIGN_0;
395
      ENPCOMMAALIGN_0_REC <= ENPCOMMAALIGN_0_REG;
396
      ENMCOMMAALIGN_0_REG <= ENMCOMMAALIGN_0;
397
      ENMCOMMAALIGN_0_REC <= ENMCOMMAALIGN_0_REG;
398
    end
399
  end
400
 
401
 
402
 
403
   //---------------------------------------------------------------------------
404
   // EMAC0 to GTP logic shim
405
   //---------------------------------------------------------------------------
406
 
407
   // When the RXNOTINTABLE condition is detected, the Virtex5 RocketIO
408
   // GTP outputs the raw 10B code in a bit swapped order to that of the
409
   // Virtex-II Pro RocketIO.
410
   always @ (RXNOTINTABLE_0_INT, RXDISPERR_0_INT, RXCHARISK_0_INT, RXDATA_0_INT,
411
                         RXRUNDISP_0_INT)
412
   begin
413
      if (RXNOTINTABLE_0_INT == 1'b1)
414
      begin
415
         RXDATA_0[0] <= RXDISPERR_0_INT;
416
         RXDATA_0[1] <= RXCHARISK_0_INT;
417
         RXDATA_0[2] <= RXDATA_0_INT[7];
418
         RXDATA_0[3] <= RXDATA_0_INT[6];
419
         RXDATA_0[4] <= RXDATA_0_INT[5];
420
         RXDATA_0[5] <= RXDATA_0_INT[4];
421
         RXDATA_0[6] <= RXDATA_0_INT[3];
422
         RXDATA_0[7] <= RXDATA_0_INT[2];
423
         RXRUNDISP_0 <= RXDATA_0_INT[1];
424
         RXCHARISK_0 <= RXDATA_0_INT[0];
425
      end
426
      else
427
      begin
428
         RXDATA_0    <= RXDATA_0_INT;
429
         RXRUNDISP_0 <= RXRUNDISP_0_INT;
430
         RXCHARISK_0 <= RXCHARISK_0_INT;
431
      end
432
   end
433
 
434
 
435
 
436
endmodule
437
 

powered by: WebSVN 2.1.0

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