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

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [sim/] [BFMs/] [SGMII_altera/] [triple_speed_ethernet-library/] [altera_tse_multi_mac_pcs_pma.v] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jefflieu
// -------------------------------------------------------------------------
2
// -------------------------------------------------------------------------
3
//
4
// Revision Control Information
5
//
6
// $RCSfile: altera_tse_multi_mac_pcs_pma.v,v $
7
// $Source: /ipbu/cvs/sio/projects/TriSpeedEthernet/src/RTL/Top_level_modules/altera_tse_multi_mac_pcs_pma.v,v $
8
//
9
// $Revision: #1 $
10 20 jefflieu
// $Date: 2012/06/21 $
11
// Check in by : $Author: swbranch $
12 9 jefflieu
// Author      : Arul Paniandi
13
//
14
// Project     : Triple Speed Ethernet - 10/100/1000 MAC
15
//
16
// Description : 
17
//
18
// Top Level Triple Speed Ethernet(10/100/1000) MAC with MII/GMII
19
// interfaces, mdio module and register space (statistic, control and 
20
// management)
21
 
22
// 
23
// ALTERA Confidential and Proprietary
24
// Copyright 2006 (c) Altera Corporation  
25
// All rights reserved
26
//
27
// -------------------------------------------------------------------------
28
// -------------------------------------------------------------------------
29
 
30
(*altera_attribute = {"-name SYNCHRONIZER_IDENTIFICATION OFF" } *)
31
module altera_tse_multi_mac_pcs_pma
32
/* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"R102,R105,D102,D101,D103\"" */
33
#(
34
parameter USE_SYNC_RESET        = 0,                    //  Use Synchronized Reset Inputs
35
parameter RESET_LEVEL           = 1'b 1 ,               //  Reset Active Level
36
parameter ENABLE_GMII_LOOPBACK  = 1,                    //  GMII_LOOPBACK_ENA : Enable GMII Loopback Logic 
37
parameter ENABLE_HD_LOGIC       = 1,                    //  HD_LOGIC_ENA : Enable Half Duplex Logic
38
parameter ENABLE_SUP_ADDR       = 1,                    //  SUP_ADDR_ENA : Enable Supplemental Addresses
39
parameter ENA_HASH              = 1,                    //  ENA_HASH Enable Hash Table 
40
parameter STAT_CNT_ENA          = 1,                    //  STAT_CNT_ENA Enable Statistic Counters
41
parameter MDIO_CLK_DIV          = 40 ,                  //  Host Clock Division - MDC Generation
42
parameter CORE_VERSION          = 16'h3,                //  ALTERA Core Version
43
parameter CUST_VERSION          = 1 ,                   //  Customer Core Version
44
parameter REDUCED_INTERFACE_ENA = 0,                    //  Enable the RGMII Interface
45
parameter ENABLE_MDIO           = 1,                    //  Enable the MDIO Interface
46
parameter ENABLE_MAGIC_DETECT   = 1,                    //  Enable magic packet detection 
47
parameter ENABLE_PADDING        = 1,                    //  Enable padding operation.
48
parameter ENABLE_LGTH_CHECK     = 1,                    //  Enable frame length checking.
49
parameter GBIT_ONLY             = 1,                    //  Enable Gigabit only operation.
50
parameter MBIT_ONLY             = 1,                    //  Enable Megabit (10/100) only operation.
51
parameter REDUCED_CONTROL       = 0,                    //  Reduced control for MAC LITE
52
parameter CRC32DWIDTH           = 4'b 1000,             //  input data width (informal, not for change)
53
parameter CRC32GENDELAY         = 3'b 110,              //  when the data from the generator is valid
54
parameter CRC32CHECK16BIT       = 1'b 0,                //  1 compare two times 16 bit of the CRC (adds one pipeline step) 
55
parameter CRC32S1L2_EXTERN      = 1'b0,                 //  false: merge enable
56
parameter ENABLE_SHIFT16        = 0,                    //  Enable byte stuffing at packet header 
57
parameter ENABLE_MAC_FLOW_CTRL  = 1'b1,                 //  Option to enable flow control 
58
parameter ENABLE_MAC_TXADDR_SET = 1'b1,                 //  Option to enable MAC address insertion onto 'to-be-transmitted' Ethernet frames on MAC TX data path
59
parameter ENABLE_MAC_RX_VLAN    = 1'b1,                 //  Option to enable VLAN tagged Ethernet frames on MAC RX data path
60
parameter ENABLE_MAC_TX_VLAN    = 1'b1,                 //  Option to enable VLAN tagged Ethernet frames on MAC TX data path
61
parameter PHY_IDENTIFIER        = 32'h 00000000,        //  PHY Identifier
62
parameter DEV_VERSION           = 16'h 0001 ,           //  Customer Phy's Core Version
63
parameter ENABLE_SGMII          = 1,                    //  Enable SGMII logic for synthesis
64
parameter ENABLE_CLK_SHARING    = 0,                    //  Option to share clock for multiple channels (Clocks are rate-matched).
65
parameter ENABLE_REG_SHARING    = 0,                    //  Option to share register space. Uses certain hard-coded values from input.
66
parameter ENABLE_EXTENDED_STAT_REG = 0,                 //  Enable a few extended statistic registers
67
parameter MAX_CHANNELS          = 1,                    //  The number of channels in Multi-TSE component
68
parameter ENABLE_PKT_CLASS      = 1,                    //  Enable Packet Classification Av-ST Interface
69
parameter ENABLE_RX_FIFO_STATUS = 1,                    //  Enable Receive FIFO Almost Full status interface
70
parameter CHANNEL_WIDTH         = 1,                    //  The width of the channel interface
71
parameter EXPORT_PWRDN          = 1'b0,                 //  Option to export the Alt2gxb powerdown signal
72
parameter DEVICE_FAMILY         = "ARRIAGX",            //  The device family the the core is targetted for.
73
parameter TRANSCEIVER_OPTION    = 1'b1,                 //  Option to select transceiver block for MAC PCS PMA Instantiation. Valid Values are 0 and 1:  0 - GXB (GIGE Mode) 1 - LVDS I/O
74
parameter ENABLE_ALT_RECONFIG   = 0,                    //  Option to have the Alt_Reconfig ports exposed
75
parameter SYNCHRONIZER_DEPTH    = 3,                    //  Number of synchronizer
76
// Internal parameters
77
parameter ADDR_WIDTH = (MAX_CHANNELS > 16)? 13 :
78
                       (MAX_CHANNELS > 8)? 12 :
79
                       (MAX_CHANNELS > 4)? 11 :
80
                       (MAX_CHANNELS > 2)? 10 :
81
                       (MAX_CHANNELS > 1)? 9 : 8
82
)
83
 
84
 
85
// Port List
86
(
87
 
88
    // RESET / MAC REG IF / MDIO
89
    input wire   reset,                      //  Asynchronous Reset - clk Domain
90
    input wire   clk,                        //  25MHz Host Interface Clock
91
    input wire   read,                       //  Register Read Strobe
92
    input wire   write,                      //  Register Write Strobe
93
    input wire   [ADDR_WIDTH-1:0] address,   //  Register Address
94
    input wire   [31:0] writedata,           //  Write Data for Host Bus
95
    output wire  [31:0] readdata,            //  Read Data to Host Bus
96
    output wire  waitrequest,                //  Interface Busy
97
    output wire  mdc,                        //  2.5MHz Inteface
98
    input wire   mdio_in,                    //  MDIO Input
99
    output wire  mdio_out,                   //  MDIO Output
100
    output wire  mdio_oen,                   //  MDIO Output Enable
101
 
102
    // DEVICE SPECIFIC SIGNALS
103
    input wire   gxb_cal_blk_clk,            //  GXB Calibration Clock
104
    input wire   ref_clk,                    //  Rference Clock
105
 
106
        // SHARED CLK SIGNALS
107
    output wire  mac_rx_clk,                 //  Av-ST Receive Clock
108
        output wire  mac_tx_clk,                 //  Av-ST Transmit Clock 
109
 
110
        // SHARED RX STATUS
111
        input wire   rx_afull_clk,                             //  Almost full clock
112
    input wire   [1:0] rx_afull_data,                      //  Almost full data
113
    input wire   rx_afull_valid,                           //  Almost full valid
114
    input wire   [CHANNEL_WIDTH-1:0] rx_afull_channel,     //  Almost full channel
115
 
116
 
117
    // CHANNEL 0
118
 
119
    // PCS SIGNALS TO PHY
120
    input wire   rxp_0,                    //  Differential Receive Data 
121
    output wire  txp_0,                    //  Differential Transmit Data 
122
    input wire   gxb_pwrdn_in_0,           //  Powerdown signal to GXB
123
    output wire  pcs_pwrdn_out_0,          //  Powerdown Enable from PCS
124
    output wire  led_crs_0,                //  Carrier Sense
125
    output wire  led_link_0,               //  Valid Link 
126
    output wire  led_col_0,                //  Collision Indication
127
    output wire  led_an_0,                 //  Auto-Negotiation Status
128
    output wire  led_char_err_0,           //  Character Error
129
    output wire  led_disp_err_0,           //  Disparity Error
130
 
131
    // AV-ST TX & RX
132
    output wire  mac_rx_clk_0,             //  Av-ST Receive Clock
133
    output wire  mac_tx_clk_0,             //  Av-ST Transmit Clock   
134
    output wire  data_rx_sop_0,            //  Start of Packet
135
    output wire  data_rx_eop_0,            //  End of Packet
136
    output wire  [7:0] data_rx_data_0,     //  Data from FIFO
137
    output wire  [4:0] data_rx_error_0,    //  Receive packet error
138
    output wire  data_rx_valid_0,          //  Data Receive FIFO Valid
139
    input wire   data_rx_ready_0,          //  Data Receive Ready
140
    output wire  [4:0] pkt_class_data_0,   //  Frame Type Indication
141
    output wire  pkt_class_valid_0,        //  Frame Type Indication Valid 
142
    output wire  rx_recovclkout_0,         //  Frame Type Indication Valid 
143
    input wire   data_tx_error_0,          //  STATUS FIFO (Tx frame Error from Apps)
144
    input wire   [7:0] data_tx_data_0,     //  Data from FIFO transmit
145
    input wire   data_tx_valid_0,          //  Data FIFO transmit Empty
146
    input wire   data_tx_sop_0,            //  Start of Packet
147
    input wire   data_tx_eop_0,            //  END of Packet
148
    output wire  data_tx_ready_0,          //  Data FIFO transmit Read Enable   
149
 
150
    // STAND_ALONE CONDUITS 
151
    output wire  tx_ff_uflow_0,            //  TX FIFO underflow occured (Synchronous with tx_clk)
152
    input wire   tx_crc_fwd_0,             //  Forward Current Frame with CRC from Application
153
    input wire   xoff_gen_0,               //  Xoff Pause frame generate 
154
    input wire   xon_gen_0,                //  Xon Pause frame generate 
155
    input wire   magic_sleep_n_0,          //  Enable Sleep Mode
156
    output wire  magic_wakeup_0,           //  Wake Up Request
157
 
158
 
159
    // CHANNEL 1
160
 
161
    // PCS SIGNALS TO PHY
162
    input wire   rxp_1,                    //  Differential Receive Data 
163
    output wire  txp_1,                    //  Differential Transmit Data 
164
    input wire   gxb_pwrdn_in_1,           //  Powerdown signal to GXB
165
    output wire  pcs_pwrdn_out_1,          //  Powerdown Enable from PCS
166
    output wire  led_crs_1,                //  Carrier Sense
167
    output wire  led_link_1,               //  Valid Link 
168
    output wire  led_col_1,                //  Collision Indication
169
    output wire  led_an_1,                 //  Auto-Negotiation Status
170
    output wire  led_char_err_1,           //  Character Error
171
    output wire  led_disp_err_1,           //  Disparity Error
172
 
173
    // AV-ST TX & RX
174
    output wire  mac_rx_clk_1,             //  Av-ST Receive Clock
175
    output wire  mac_tx_clk_1,             //  Av-ST Transmit Clock   
176
    output wire  data_rx_sop_1,            //  Start of Packet
177
    output wire  data_rx_eop_1,            //  End of Packet
178
    output wire  [7:0] data_rx_data_1,     //  Data from FIFO
179
    output wire  [4:0] data_rx_error_1,    //  Receive packet error
180
    output wire  data_rx_valid_1,          //  Data Receive FIFO Valid
181
    input wire   data_rx_ready_1,          //  Data Receive Ready
182
    output wire  [4:0] pkt_class_data_1,   //  Frame Type Indication
183
    output wire  pkt_class_valid_1,        //  Frame Type Indication Valid 
184
    output wire  rx_recovclkout_1,         //  Frame Type Indication Valid 
185
    input wire   data_tx_error_1,          //  STATUS FIFO (Tx frame Error from Apps)
186
    input wire   [7:0] data_tx_data_1,     //  Data from FIFO transmit
187
    input wire   data_tx_valid_1,          //  Data FIFO transmit Empty
188
    input wire   data_tx_sop_1,            //  Start of Packet
189
    input wire   data_tx_eop_1,            //  END of Packet
190
    output wire  data_tx_ready_1,          //  Data FIFO transmit Read Enable   
191
 
192
    // STAND_ALONE CONDUITS 
193
    output wire  tx_ff_uflow_1,            //  TX FIFO underflow occured (Synchronous with tx_clk)
194
    input wire   tx_crc_fwd_1,             //  Forward Current Frame with CRC from Application
195
    input wire   xoff_gen_1,               //  Xoff Pause frame generate 
196
    input wire   xon_gen_1,                //  Xon Pause frame generate 
197
    input wire   magic_sleep_n_1,          //  Enable Sleep Mode
198
    output wire  magic_wakeup_1,           //  Wake Up Request
199
 
200
 
201
    // CHANNEL 2
202
 
203
    // PCS SIGNALS TO PHY
204
    input wire   rxp_2,                    //  Differential Receive Data 
205
    output wire  txp_2,                    //  Differential Transmit Data 
206
    input wire   gxb_pwrdn_in_2,           //  Powerdown signal to GXB
207
    output wire  pcs_pwrdn_out_2,          //  Powerdown Enable from PCS
208
    output wire  led_crs_2,                //  Carrier Sense
209
    output wire  led_link_2,               //  Valid Link 
210
    output wire  led_col_2,                //  Collision Indication
211
    output wire  led_an_2,                 //  Auto-Negotiation Status
212
    output wire  led_char_err_2,           //  Character Error
213
    output wire  led_disp_err_2,           //  Disparity Error
214
 
215
    // AV-ST TX & RX
216
    output wire  mac_rx_clk_2,             //  Av-ST Receive Clock
217
    output wire  mac_tx_clk_2,             //  Av-ST Transmit Clock   
218
    output wire  data_rx_sop_2,            //  Start of Packet
219
    output wire  data_rx_eop_2,            //  End of Packet
220
    output wire  [7:0] data_rx_data_2,     //  Data from FIFO
221
    output wire  [4:0] data_rx_error_2,    //  Receive packet error
222
    output wire  data_rx_valid_2,          //  Data Receive FIFO Valid
223
    input wire   data_rx_ready_2,          //  Data Receive Ready
224
    output wire  [4:0] pkt_class_data_2,   //  Frame Type Indication
225
    output wire  pkt_class_valid_2,        //  Frame Type Indication Valid 
226
    output wire  rx_recovclkout_2,         //  Frame Type Indication Valid 
227
    input wire   data_tx_error_2,          //  STATUS FIFO (Tx frame Error from Apps)
228
    input wire   [7:0] data_tx_data_2,     //  Data from FIFO transmit
229
    input wire   data_tx_valid_2,          //  Data FIFO transmit Empty
230
    input wire   data_tx_sop_2,            //  Start of Packet
231
    input wire   data_tx_eop_2,            //  END of Packet
232
    output wire  data_tx_ready_2,          //  Data FIFO transmit Read Enable   
233
 
234
    // STAND_ALONE CONDUITS 
235
    output wire  tx_ff_uflow_2,            //  TX FIFO underflow occured (Synchronous with tx_clk)
236
    input wire   tx_crc_fwd_2,             //  Forward Current Frame with CRC from Application
237
    input wire   xoff_gen_2,               //  Xoff Pause frame generate 
238
    input wire   xon_gen_2,                //  Xon Pause frame generate 
239
    input wire   magic_sleep_n_2,          //  Enable Sleep Mode
240
    output wire  magic_wakeup_2,           //  Wake Up Request
241
 
242
 
243
    // CHANNEL 3
244
 
245
    // PCS SIGNALS TO PHY
246
    input wire   rxp_3,                    //  Differential Receive Data 
247
    output wire  txp_3,                    //  Differential Transmit Data 
248
    input wire   gxb_pwrdn_in_3,           //  Powerdown signal to GXB
249
    output wire  pcs_pwrdn_out_3,          //  Powerdown Enable from PCS
250
    output wire  led_crs_3,                //  Carrier Sense
251
    output wire  led_link_3,               //  Valid Link 
252
    output wire  led_col_3,                //  Collision Indication
253
    output wire  led_an_3,                 //  Auto-Negotiation Status
254
    output wire  led_char_err_3,           //  Character Error
255
    output wire  led_disp_err_3,           //  Disparity Error
256
 
257
    // AV-ST TX & RX
258
    output wire  mac_rx_clk_3,             //  Av-ST Receive Clock
259
    output wire  mac_tx_clk_3,             //  Av-ST Transmit Clock   
260
    output wire  data_rx_sop_3,            //  Start of Packet
261
    output wire  data_rx_eop_3,            //  End of Packet
262
    output wire  [7:0] data_rx_data_3,     //  Data from FIFO
263
    output wire  [4:0] data_rx_error_3,    //  Receive packet error
264
    output wire  data_rx_valid_3,          //  Data Receive FIFO Valid
265
    input wire   data_rx_ready_3,          //  Data Receive Ready
266
    output wire  [4:0] pkt_class_data_3,   //  Frame Type Indication
267
    output wire  pkt_class_valid_3,        //  Frame Type Indication Valid 
268
    output wire  rx_recovclkout_3,         //  Frame Type Indication Valid 
269
    input wire   data_tx_error_3,          //  STATUS FIFO (Tx frame Error from Apps)
270
    input wire   [7:0] data_tx_data_3,     //  Data from FIFO transmit
271
    input wire   data_tx_valid_3,          //  Data FIFO transmit Empty
272
    input wire   data_tx_sop_3,            //  Start of Packet
273
    input wire   data_tx_eop_3,            //  END of Packet
274
    output wire  data_tx_ready_3,          //  Data FIFO transmit Read Enable   
275
 
276
    // STAND_ALONE CONDUITS 
277
    output wire  tx_ff_uflow_3,            //  TX FIFO underflow occured (Synchronous with tx_clk)
278
    input wire   tx_crc_fwd_3,             //  Forward Current Frame with CRC from Application
279
    input wire   xoff_gen_3,               //  Xoff Pause frame generate 
280
    input wire   xon_gen_3,                //  Xon Pause frame generate 
281
    input wire   magic_sleep_n_3,          //  Enable Sleep Mode
282
    output wire  magic_wakeup_3,           //  Wake Up Request
283
 
284
 
285
    // CHANNEL 4
286
 
287
    // PCS SIGNALS TO PHY
288
    input wire   rxp_4,                    //  Differential Receive Data 
289
    output wire  txp_4,                    //  Differential Transmit Data 
290
    input wire   gxb_pwrdn_in_4,           //  Powerdown signal to GXB
291
    output wire  pcs_pwrdn_out_4,          //  Powerdown Enable from PCS
292
    output wire  led_crs_4,                //  Carrier Sense
293
    output wire  led_link_4,               //  Valid Link 
294
    output wire  led_col_4,                //  Collision Indication
295
    output wire  led_an_4,                 //  Auto-Negotiation Status
296
    output wire  led_char_err_4,           //  Character Error
297
    output wire  led_disp_err_4,           //  Disparity Error
298
 
299
    // AV-ST TX & RX
300
    output wire  mac_rx_clk_4,             //  Av-ST Receive Clock
301
    output wire  mac_tx_clk_4,             //  Av-ST Transmit Clock   
302
    output wire  data_rx_sop_4,            //  Start of Packet
303
    output wire  data_rx_eop_4,            //  End of Packet
304
    output wire  [7:0] data_rx_data_4,     //  Data from FIFO
305
    output wire  [4:0] data_rx_error_4,    //  Receive packet error
306
    output wire  data_rx_valid_4,          //  Data Receive FIFO Valid
307
    input wire   data_rx_ready_4,          //  Data Receive Ready
308
    output wire  [4:0] pkt_class_data_4,   //  Frame Type Indication
309
    output wire  pkt_class_valid_4,        //  Frame Type Indication Valid 
310
    output wire  rx_recovclkout_4,         //  Frame Type Indication Valid 
311
    input wire   data_tx_error_4,          //  STATUS FIFO (Tx frame Error from Apps)
312
    input wire   [7:0] data_tx_data_4,     //  Data from FIFO transmit
313
    input wire   data_tx_valid_4,          //  Data FIFO transmit Empty
314
    input wire   data_tx_sop_4,            //  Start of Packet
315
    input wire   data_tx_eop_4,            //  END of Packet
316
    output wire  data_tx_ready_4,          //  Data FIFO transmit Read Enable   
317
 
318
    // STAND_ALONE CONDUITS 
319
    output wire  tx_ff_uflow_4,            //  TX FIFO underflow occured (Synchronous with tx_clk)
320
    input wire   tx_crc_fwd_4,             //  Forward Current Frame with CRC from Application
321
    input wire   xoff_gen_4,               //  Xoff Pause frame generate 
322
    input wire   xon_gen_4,                //  Xon Pause frame generate 
323
    input wire   magic_sleep_n_4,          //  Enable Sleep Mode
324
    output wire  magic_wakeup_4,           //  Wake Up Request
325
 
326
 
327
    // CHANNEL 5
328
 
329
    // PCS SIGNALS TO PHY
330
    input wire   rxp_5,                    //  Differential Receive Data 
331
    output wire  txp_5,                    //  Differential Transmit Data 
332
    input wire   gxb_pwrdn_in_5,           //  Powerdown signal to GXB
333
    output wire  pcs_pwrdn_out_5,          //  Powerdown Enable from PCS
334
    output wire  led_crs_5,                //  Carrier Sense
335
    output wire  led_link_5,               //  Valid Link 
336
    output wire  led_col_5,                //  Collision Indication
337
    output wire  led_an_5,                 //  Auto-Negotiation Status
338
    output wire  led_char_err_5,           //  Character Error
339
    output wire  led_disp_err_5,           //  Disparity Error
340
 
341
    // AV-ST TX & RX
342
    output wire  mac_rx_clk_5,             //  Av-ST Receive Clock
343
    output wire  mac_tx_clk_5,             //  Av-ST Transmit Clock   
344
    output wire  data_rx_sop_5,            //  Start of Packet
345
    output wire  data_rx_eop_5,            //  End of Packet
346
    output wire  [7:0] data_rx_data_5,     //  Data from FIFO
347
    output wire  [4:0] data_rx_error_5,    //  Receive packet error
348
    output wire  data_rx_valid_5,          //  Data Receive FIFO Valid
349
    input wire   data_rx_ready_5,          //  Data Receive Ready
350
    output wire  [4:0] pkt_class_data_5,   //  Frame Type Indication
351
    output wire  pkt_class_valid_5,        //  Frame Type Indication Valid 
352
    output wire  rx_recovclkout_5,         //  Frame Type Indication Valid 
353
    input wire   data_tx_error_5,          //  STATUS FIFO (Tx frame Error from Apps)
354
    input wire   [7:0] data_tx_data_5,     //  Data from FIFO transmit
355
    input wire   data_tx_valid_5,          //  Data FIFO transmit Empty
356
    input wire   data_tx_sop_5,            //  Start of Packet
357
    input wire   data_tx_eop_5,            //  END of Packet
358
    output wire  data_tx_ready_5,          //  Data FIFO transmit Read Enable   
359
 
360
    // STAND_ALONE CONDUITS 
361
    output wire  tx_ff_uflow_5,            //  TX FIFO underflow occured (Synchronous with tx_clk)
362
    input wire   tx_crc_fwd_5,             //  Forward Current Frame with CRC from Application
363
    input wire   xoff_gen_5,               //  Xoff Pause frame generate 
364
    input wire   xon_gen_5,                //  Xon Pause frame generate 
365
    input wire   magic_sleep_n_5,          //  Enable Sleep Mode
366
    output wire  magic_wakeup_5,           //  Wake Up Request
367
 
368
 
369
    // CHANNEL 6
370
 
371
    // PCS SIGNALS TO PHY
372
    input wire   rxp_6,                    //  Differential Receive Data 
373
    output wire  txp_6,                    //  Differential Transmit Data 
374
    input wire   gxb_pwrdn_in_6,           //  Powerdown signal to GXB
375
    output wire  pcs_pwrdn_out_6,          //  Powerdown Enable from PCS
376
    output wire  led_crs_6,                //  Carrier Sense
377
    output wire  led_link_6,               //  Valid Link 
378
    output wire  led_col_6,                //  Collision Indication
379
    output wire  led_an_6,                 //  Auto-Negotiation Status
380
    output wire  led_char_err_6,           //  Character Error
381
    output wire  led_disp_err_6,           //  Disparity Error
382
 
383
    // AV-ST TX & RX
384
    output wire  mac_rx_clk_6,             //  Av-ST Receive Clock
385
    output wire  mac_tx_clk_6,             //  Av-ST Transmit Clock   
386
    output wire  data_rx_sop_6,            //  Start of Packet
387
    output wire  data_rx_eop_6,            //  End of Packet
388
    output wire  [7:0] data_rx_data_6,     //  Data from FIFO
389
    output wire  [4:0] data_rx_error_6,    //  Receive packet error
390
    output wire  data_rx_valid_6,          //  Data Receive FIFO Valid
391
    input wire   data_rx_ready_6,          //  Data Receive Ready
392
    output wire  [4:0] pkt_class_data_6,   //  Frame Type Indication
393
    output wire  pkt_class_valid_6,        //  Frame Type Indication Valid 
394
    output wire  rx_recovclkout_6,         //  Frame Type Indication Valid 
395
    input wire   data_tx_error_6,          //  STATUS FIFO (Tx frame Error from Apps)
396
    input wire   [7:0] data_tx_data_6,     //  Data from FIFO transmit
397
    input wire   data_tx_valid_6,          //  Data FIFO transmit Empty
398
    input wire   data_tx_sop_6,            //  Start of Packet
399
    input wire   data_tx_eop_6,            //  END of Packet
400
    output wire  data_tx_ready_6,          //  Data FIFO transmit Read Enable   
401
 
402
    // STAND_ALONE CONDUITS 
403
    output wire  tx_ff_uflow_6,            //  TX FIFO underflow occured (Synchronous with tx_clk)
404
    input wire   tx_crc_fwd_6,             //  Forward Current Frame with CRC from Application
405
    input wire   xoff_gen_6,               //  Xoff Pause frame generate 
406
    input wire   xon_gen_6,                //  Xon Pause frame generate 
407
    input wire   magic_sleep_n_6,          //  Enable Sleep Mode
408
    output wire  magic_wakeup_6,           //  Wake Up Request
409
 
410
 
411
    // CHANNEL 7
412
 
413
    // PCS SIGNALS TO PHY
414
    input wire   rxp_7,                    //  Differential Receive Data 
415
    output wire  txp_7,                    //  Differential Transmit Data 
416
    input wire   gxb_pwrdn_in_7,           //  Powerdown signal to GXB
417
    output wire  pcs_pwrdn_out_7,          //  Powerdown Enable from PCS
418
    output wire  led_crs_7,                //  Carrier Sense
419
    output wire  led_link_7,               //  Valid Link 
420
    output wire  led_col_7,                //  Collision Indication
421
    output wire  led_an_7,                 //  Auto-Negotiation Status
422
    output wire  led_char_err_7,           //  Character Error
423
    output wire  led_disp_err_7,           //  Disparity Error
424
 
425
    // AV-ST TX & RX
426
    output wire  mac_rx_clk_7,             //  Av-ST Receive Clock
427
    output wire  mac_tx_clk_7,             //  Av-ST Transmit Clock   
428
    output wire  data_rx_sop_7,            //  Start of Packet
429
    output wire  data_rx_eop_7,            //  End of Packet
430
    output wire  [7:0] data_rx_data_7,     //  Data from FIFO
431
    output wire  [4:0] data_rx_error_7,    //  Receive packet error
432
    output wire  data_rx_valid_7,          //  Data Receive FIFO Valid
433
    input wire   data_rx_ready_7,          //  Data Receive Ready
434
    output wire  [4:0] pkt_class_data_7,   //  Frame Type Indication
435
    output wire  pkt_class_valid_7,        //  Frame Type Indication Valid 
436
    output wire  rx_recovclkout_7,         //  Frame Type Indication Valid 
437
    input wire   data_tx_error_7,          //  STATUS FIFO (Tx frame Error from Apps)
438
    input wire   [7:0] data_tx_data_7,     //  Data from FIFO transmit
439
    input wire   data_tx_valid_7,          //  Data FIFO transmit Empty
440
    input wire   data_tx_sop_7,            //  Start of Packet
441
    input wire   data_tx_eop_7,            //  END of Packet
442
    output wire  data_tx_ready_7,          //  Data FIFO transmit Read Enable   
443
 
444
    // STAND_ALONE CONDUITS 
445
    output wire  tx_ff_uflow_7,            //  TX FIFO underflow occured (Synchronous with tx_clk)
446
    input wire   tx_crc_fwd_7,             //  Forward Current Frame with CRC from Application
447
    input wire   xoff_gen_7,               //  Xoff Pause frame generate 
448
    input wire   xon_gen_7,                //  Xon Pause frame generate 
449
    input wire   magic_sleep_n_7,          //  Enable Sleep Mode
450
    output wire  magic_wakeup_7,           //  Wake Up Request
451
 
452
 
453
    // CHANNEL 8
454
 
455
    // PCS SIGNALS TO PHY
456
    input wire   rxp_8,                    //  Differential Receive Data 
457
    output wire  txp_8,                    //  Differential Transmit Data 
458
    input wire   gxb_pwrdn_in_8,           //  Powerdown signal to GXB
459
    output wire  pcs_pwrdn_out_8,          //  Powerdown Enable from PCS
460
    output wire  led_crs_8,                //  Carrier Sense
461
    output wire  led_link_8,               //  Valid Link 
462
    output wire  led_col_8,                //  Collision Indication
463
    output wire  led_an_8,                 //  Auto-Negotiation Status
464
    output wire  led_char_err_8,           //  Character Error
465
    output wire  led_disp_err_8,           //  Disparity Error
466
 
467
    // AV-ST TX & RX
468
    output wire  mac_rx_clk_8,             //  Av-ST Receive Clock
469
    output wire  mac_tx_clk_8,             //  Av-ST Transmit Clock   
470
    output wire  data_rx_sop_8,            //  Start of Packet
471
    output wire  data_rx_eop_8,            //  End of Packet
472
    output wire  [7:0] data_rx_data_8,     //  Data from FIFO
473
    output wire  [4:0] data_rx_error_8,    //  Receive packet error
474
    output wire  data_rx_valid_8,          //  Data Receive FIFO Valid
475
    input wire   data_rx_ready_8,          //  Data Receive Ready
476
    output wire  [4:0] pkt_class_data_8,   //  Frame Type Indication
477
    output wire  pkt_class_valid_8,        //  Frame Type Indication Valid 
478
    output wire  rx_recovclkout_8,         //  Frame Type Indication Valid 
479
    input wire   data_tx_error_8,          //  STATUS FIFO (Tx frame Error from Apps)
480
    input wire   [7:0] data_tx_data_8,     //  Data from FIFO transmit
481
    input wire   data_tx_valid_8,          //  Data FIFO transmit Empty
482
    input wire   data_tx_sop_8,            //  Start of Packet
483
    input wire   data_tx_eop_8,            //  END of Packet
484
    output wire  data_tx_ready_8,          //  Data FIFO transmit Read Enable   
485
 
486
    // STAND_ALONE CONDUITS 
487
    output wire  tx_ff_uflow_8,            //  TX FIFO underflow occured (Synchronous with tx_clk)
488
    input wire   tx_crc_fwd_8,             //  Forward Current Frame with CRC from Application
489
    input wire   xoff_gen_8,               //  Xoff Pause frame generate 
490
    input wire   xon_gen_8,                //  Xon Pause frame generate 
491
    input wire   magic_sleep_n_8,          //  Enable Sleep Mode
492
    output wire  magic_wakeup_8,           //  Wake Up Request
493
 
494
 
495
    // CHANNEL 9
496
 
497
    // PCS SIGNALS TO PHY
498
    input wire   rxp_9,                    //  Differential Receive Data 
499
    output wire  txp_9,                    //  Differential Transmit Data 
500
    input wire   gxb_pwrdn_in_9,           //  Powerdown signal to GXB
501
    output wire  pcs_pwrdn_out_9,          //  Powerdown Enable from PCS
502
    output wire  led_crs_9,                //  Carrier Sense
503
    output wire  led_link_9,               //  Valid Link 
504
    output wire  led_col_9,                //  Collision Indication
505
    output wire  led_an_9,                 //  Auto-Negotiation Status
506
    output wire  led_char_err_9,           //  Character Error
507
    output wire  led_disp_err_9,           //  Disparity Error
508
 
509
    // AV-ST TX & RX
510
    output wire  mac_rx_clk_9,             //  Av-ST Receive Clock
511
    output wire  mac_tx_clk_9,             //  Av-ST Transmit Clock   
512
    output wire  data_rx_sop_9,            //  Start of Packet
513
    output wire  data_rx_eop_9,            //  End of Packet
514
    output wire  [7:0] data_rx_data_9,     //  Data from FIFO
515
    output wire  [4:0] data_rx_error_9,    //  Receive packet error
516
    output wire  data_rx_valid_9,          //  Data Receive FIFO Valid
517
    input wire   data_rx_ready_9,          //  Data Receive Ready
518
    output wire  [4:0] pkt_class_data_9,   //  Frame Type Indication
519
    output wire  pkt_class_valid_9,        //  Frame Type Indication Valid 
520
    output wire  rx_recovclkout_9,         //  Frame Type Indication Valid 
521
    input wire   data_tx_error_9,          //  STATUS FIFO (Tx frame Error from Apps)
522
    input wire   [7:0] data_tx_data_9,     //  Data from FIFO transmit
523
    input wire   data_tx_valid_9,          //  Data FIFO transmit Empty
524
    input wire   data_tx_sop_9,            //  Start of Packet
525
    input wire   data_tx_eop_9,            //  END of Packet
526
    output wire  data_tx_ready_9,          //  Data FIFO transmit Read Enable   
527
 
528
    // STAND_ALONE CONDUITS 
529
    output wire  tx_ff_uflow_9,            //  TX FIFO underflow occured (Synchronous with tx_clk)
530
    input wire   tx_crc_fwd_9,             //  Forward Current Frame with CRC from Application
531
    input wire   xoff_gen_9,               //  Xoff Pause frame generate 
532
    input wire   xon_gen_9,                //  Xon Pause frame generate 
533
    input wire   magic_sleep_n_9,          //  Enable Sleep Mode
534
    output wire  magic_wakeup_9,           //  Wake Up Request
535
 
536
 
537
    // CHANNEL 10
538
 
539
    // PCS SIGNALS TO PHY
540
    input wire   rxp_10,                    //  Differential Receive Data 
541
    output wire  txp_10,                    //  Differential Transmit Data 
542
    input wire   gxb_pwrdn_in_10,           //  Powerdown signal to GXB
543
    output wire  pcs_pwrdn_out_10,          //  Powerdown Enable from PCS
544
    output wire  led_crs_10,                //  Carrier Sense
545
    output wire  led_link_10,               //  Valid Link 
546
    output wire  led_col_10,                //  Collision Indication
547
    output wire  led_an_10,                 //  Auto-Negotiation Status
548
    output wire  led_char_err_10,           //  Character Error
549
    output wire  led_disp_err_10,           //  Disparity Error
550
 
551
    // AV-ST TX & RX
552
    output wire  mac_rx_clk_10,             //  Av-ST Receive Clock
553
    output wire  mac_tx_clk_10,             //  Av-ST Transmit Clock   
554
    output wire  data_rx_sop_10,            //  Start of Packet
555
    output wire  data_rx_eop_10,            //  End of Packet
556
    output wire  [7:0] data_rx_data_10,     //  Data from FIFO
557
    output wire  [4:0] data_rx_error_10,    //  Receive packet error
558
    output wire  data_rx_valid_10,          //  Data Receive FIFO Valid
559
    input wire   data_rx_ready_10,          //  Data Receive Ready
560
    output wire  [4:0] pkt_class_data_10,   //  Frame Type Indication
561
    output wire  pkt_class_valid_10,        //  Frame Type Indication Valid 
562
    output wire  rx_recovclkout_10,         //  Frame Type Indication Valid 
563
    input wire   data_tx_error_10,          //  STATUS FIFO (Tx frame Error from Apps)
564
    input wire   [7:0] data_tx_data_10,     //  Data from FIFO transmit
565
    input wire   data_tx_valid_10,          //  Data FIFO transmit Empty
566
    input wire   data_tx_sop_10,            //  Start of Packet
567
    input wire   data_tx_eop_10,            //  END of Packet
568
    output wire  data_tx_ready_10,          //  Data FIFO transmit Read Enable  
569
 
570
    // STAND_ALONE CONDUITS 
571
    output wire  tx_ff_uflow_10,            //  TX FIFO underflow occured (Synchronous with tx_clk)
572
    input wire   tx_crc_fwd_10,             //  Forward Current Frame with CRC from Application
573
    input wire   xoff_gen_10,               //  Xoff Pause frame generate 
574
    input wire   xon_gen_10,                //  Xon Pause frame generate 
575
    input wire   magic_sleep_n_10,          //  Enable Sleep Mode
576
    output wire  magic_wakeup_10,           //  Wake Up Request
577
 
578
 
579
    // CHANNEL 11
580
 
581
    // PCS SIGNALS TO PHY
582
    input wire   rxp_11,                    //  Differential Receive Data 
583
    output wire  txp_11,                    //  Differential Transmit Data 
584
    input wire   gxb_pwrdn_in_11,           //  Powerdown signal to GXB
585
    output wire  pcs_pwrdn_out_11,          //  Powerdown Enable from PCS
586
    output wire  led_crs_11,                //  Carrier Sense
587
    output wire  led_link_11,               //  Valid Link 
588
    output wire  led_col_11,                //  Collision Indication
589
    output wire  led_an_11,                 //  Auto-Negotiation Status
590
    output wire  led_char_err_11,           //  Character Error
591
    output wire  led_disp_err_11,           //  Disparity Error
592
 
593
    // AV-ST TX & RX
594
    output wire  mac_rx_clk_11,             //  Av-ST Receive Clock
595
    output wire  mac_tx_clk_11,             //  Av-ST Transmit Clock   
596
    output wire  data_rx_sop_11,            //  Start of Packet
597
    output wire  data_rx_eop_11,            //  End of Packet
598
    output wire  [7:0] data_rx_data_11,     //  Data from FIFO
599
    output wire  [4:0] data_rx_error_11,    //  Receive packet error
600
    output wire  data_rx_valid_11,          //  Data Receive FIFO Valid
601
    input wire   data_rx_ready_11,          //  Data Receive Ready
602
    output wire  [4:0] pkt_class_data_11,   //  Frame Type Indication
603
    output wire  pkt_class_valid_11,        //  Frame Type Indication Valid 
604
    output wire  rx_recovclkout_11,         //  Frame Type Indication Valid 
605
    input wire   data_tx_error_11,          //  STATUS FIFO (Tx frame Error from Apps)
606
    input wire   [7:0] data_tx_data_11,     //  Data from FIFO transmit
607
    input wire   data_tx_valid_11,          //  Data FIFO transmit Empty
608
    input wire   data_tx_sop_11,            //  Start of Packet
609
    input wire   data_tx_eop_11,            //  END of Packet
610
    output wire  data_tx_ready_11,          //  Data FIFO transmit Read Enable  
611
 
612
    // STAND_ALONE CONDUITS 
613
    output wire  tx_ff_uflow_11,            //  TX FIFO underflow occured (Synchronous with tx_clk)
614
    input wire   tx_crc_fwd_11,             //  Forward Current Frame with CRC from Application
615
    input wire   xoff_gen_11,               //  Xoff Pause frame generate 
616
    input wire   xon_gen_11,                //  Xon Pause frame generate 
617
    input wire   magic_sleep_n_11,          //  Enable Sleep Mode
618
    output wire  magic_wakeup_11,           //  Wake Up Request
619
 
620
 
621
    // CHANNEL 12
622
 
623
    // PCS SIGNALS TO PHY
624
    input wire   rxp_12,                    //  Differential Receive Data 
625
    output wire  txp_12,                    //  Differential Transmit Data 
626
    input wire   gxb_pwrdn_in_12,           //  Powerdown signal to GXB
627
    output wire  pcs_pwrdn_out_12,          //  Powerdown Enable from PCS
628
    output wire  led_crs_12,                //  Carrier Sense
629
    output wire  led_link_12,               //  Valid Link 
630
    output wire  led_col_12,                //  Collision Indication
631
    output wire  led_an_12,                 //  Auto-Negotiation Status
632
    output wire  led_char_err_12,           //  Character Error
633
    output wire  led_disp_err_12,           //  Disparity Error
634
 
635
    // AV-ST TX & RX
636
    output wire  mac_rx_clk_12,             //  Av-ST Receive Clock
637
    output wire  mac_tx_clk_12,             //  Av-ST Transmit Clock   
638
    output wire  data_rx_sop_12,            //  Start of Packet
639
    output wire  data_rx_eop_12,            //  End of Packet
640
    output wire  [7:0] data_rx_data_12,     //  Data from FIFO
641
    output wire  [4:0] data_rx_error_12,    //  Receive packet error
642
    output wire  data_rx_valid_12,          //  Data Receive FIFO Valid
643
    input wire   data_rx_ready_12,          //  Data Receive Ready
644
    output wire  [4:0] pkt_class_data_12,   //  Frame Type Indication
645
    output wire  pkt_class_valid_12,        //  Frame Type Indication Valid 
646
    output wire  rx_recovclkout_12,         //  Frame Type Indication Valid 
647
    input wire   data_tx_error_12,          //  STATUS FIFO (Tx frame Error from Apps)
648
    input wire   [7:0] data_tx_data_12,     //  Data from FIFO transmit
649
    input wire   data_tx_valid_12,          //  Data FIFO transmit Empty
650
    input wire   data_tx_sop_12,            //  Start of Packet
651
    input wire   data_tx_eop_12,            //  END of Packet
652
    output wire  data_tx_ready_12,          //  Data FIFO transmit Read Enable  
653
 
654
    // STAND_ALONE CONDUITS 
655
    output wire  tx_ff_uflow_12,            //  TX FIFO underflow occured (Synchronous with tx_clk)
656
    input wire   tx_crc_fwd_12,             //  Forward Current Frame with CRC from Application
657
    input wire   xoff_gen_12,               //  Xoff Pause frame generate 
658
    input wire   xon_gen_12,                //  Xon Pause frame generate 
659
    input wire   magic_sleep_n_12,          //  Enable Sleep Mode
660
    output wire  magic_wakeup_12,           //  Wake Up Request
661
 
662
 
663
    // CHANNEL 13
664
 
665
    // PCS SIGNALS TO PHY
666
    input wire   rxp_13,                    //  Differential Receive Data 
667
    output wire  txp_13,                    //  Differential Transmit Data 
668
    input wire   gxb_pwrdn_in_13,           //  Powerdown signal to GXB
669
    output wire  pcs_pwrdn_out_13,          //  Powerdown Enable from PCS
670
    output wire  led_crs_13,                //  Carrier Sense
671
    output wire  led_link_13,               //  Valid Link 
672
    output wire  led_col_13,                //  Collision Indication
673
    output wire  led_an_13,                 //  Auto-Negotiation Status
674
    output wire  led_char_err_13,           //  Character Error
675
    output wire  led_disp_err_13,           //  Disparity Error
676
 
677
    // AV-ST TX & RX
678
    output wire  mac_rx_clk_13,             //  Av-ST Receive Clock
679
    output wire  mac_tx_clk_13,             //  Av-ST Transmit Clock   
680
    output wire  data_rx_sop_13,            //  Start of Packet
681
    output wire  data_rx_eop_13,            //  End of Packet
682
    output wire  [7:0] data_rx_data_13,     //  Data from FIFO
683
    output wire  [4:0] data_rx_error_13,    //  Receive packet error
684
    output wire  data_rx_valid_13,          //  Data Receive FIFO Valid
685
    input wire   data_rx_ready_13,          //  Data Receive Ready
686
    output wire  [4:0] pkt_class_data_13,   //  Frame Type Indication
687
    output wire  pkt_class_valid_13,        //  Frame Type Indication Valid 
688
    output wire  rx_recovclkout_13,         //  Frame Type Indication Valid 
689
    input wire   data_tx_error_13,          //  STATUS FIFO (Tx frame Error from Apps)
690
    input wire   [7:0] data_tx_data_13,     //  Data from FIFO transmit
691
    input wire   data_tx_valid_13,          //  Data FIFO transmit Empty
692
    input wire   data_tx_sop_13,            //  Start of Packet
693
    input wire   data_tx_eop_13,            //  END of Packet
694
    output wire  data_tx_ready_13,          //  Data FIFO transmit Read Enable  
695
 
696
    // STAND_ALONE CONDUITS 
697
    output wire  tx_ff_uflow_13,            //  TX FIFO underflow occured (Synchronous with tx_clk)
698
    input wire   tx_crc_fwd_13,             //  Forward Current Frame with CRC from Application
699
    input wire   xoff_gen_13,               //  Xoff Pause frame generate 
700
    input wire   xon_gen_13,                //  Xon Pause frame generate 
701
    input wire   magic_sleep_n_13,          //  Enable Sleep Mode
702
    output wire  magic_wakeup_13,           //  Wake Up Request
703
 
704
 
705
    // CHANNEL 14
706
 
707
    // PCS SIGNALS TO PHY
708
    input wire   rxp_14,                    //  Differential Receive Data 
709
    output wire  txp_14,                    //  Differential Transmit Data 
710
    input wire   gxb_pwrdn_in_14,           //  Powerdown signal to GXB
711
    output wire  pcs_pwrdn_out_14,          //  Powerdown Enable from PCS
712
    output wire  led_crs_14,                //  Carrier Sense
713
    output wire  led_link_14,               //  Valid Link 
714
    output wire  led_col_14,                //  Collision Indication
715
    output wire  led_an_14,                 //  Auto-Negotiation Status
716
    output wire  led_char_err_14,           //  Character Error
717
    output wire  led_disp_err_14,           //  Disparity Error
718
 
719
    // AV-ST TX & RX
720
    output wire  mac_rx_clk_14,             //  Av-ST Receive Clock
721
    output wire  mac_tx_clk_14,             //  Av-ST Transmit Clock   
722
    output wire  data_rx_sop_14,            //  Start of Packet
723
    output wire  data_rx_eop_14,            //  End of Packet
724
    output wire  [7:0] data_rx_data_14,     //  Data from FIFO
725
    output wire  [4:0] data_rx_error_14,    //  Receive packet error
726
    output wire  data_rx_valid_14,          //  Data Receive FIFO Valid
727
    input wire   data_rx_ready_14,          //  Data Receive Ready
728
    output wire  [4:0] pkt_class_data_14,   //  Frame Type Indication
729
    output wire  pkt_class_valid_14,        //  Frame Type Indication Valid 
730
    output wire  rx_recovclkout_14,         //  Frame Type Indication Valid 
731
    input wire   data_tx_error_14,          //  STATUS FIFO (Tx frame Error from Apps)
732
    input wire   [7:0] data_tx_data_14,     //  Data from FIFO transmit
733
    input wire   data_tx_valid_14,          //  Data FIFO transmit Empty
734
    input wire   data_tx_sop_14,            //  Start of Packet
735
    input wire   data_tx_eop_14,            //  END of Packet
736
    output wire  data_tx_ready_14,          //  Data FIFO transmit Read Enable  
737
 
738
    // STAND_ALONE CONDUITS 
739
    output wire  tx_ff_uflow_14,            //  TX FIFO underflow occured (Synchronous with tx_clk)
740
    input wire   tx_crc_fwd_14,             //  Forward Current Frame with CRC from Application
741
    input wire   xoff_gen_14,               //  Xoff Pause frame generate 
742
    input wire   xon_gen_14,                //  Xon Pause frame generate 
743
    input wire   magic_sleep_n_14,          //  Enable Sleep Mode
744
    output wire  magic_wakeup_14,           //  Wake Up Request
745
 
746
 
747
    // CHANNEL 15
748
 
749
    // PCS SIGNALS TO PHY
750
    input wire   rxp_15,                    //  Differential Receive Data 
751
    output wire  txp_15,                    //  Differential Transmit Data 
752
    input wire   gxb_pwrdn_in_15,           //  Powerdown signal to GXB
753
    output wire  pcs_pwrdn_out_15,          //  Powerdown Enable from PCS
754
    output wire  led_crs_15,                //  Carrier Sense
755
    output wire  led_link_15,               //  Valid Link 
756
    output wire  led_col_15,                //  Collision Indication
757
    output wire  led_an_15,                 //  Auto-Negotiation Status
758
    output wire  led_char_err_15,           //  Character Error
759
    output wire  led_disp_err_15,           //  Disparity Error
760
 
761
    // AV-ST TX & RX
762
    output wire  mac_rx_clk_15,             //  Av-ST Receive Clock
763
    output wire  mac_tx_clk_15,             //  Av-ST Transmit Clock   
764
    output wire  data_rx_sop_15,            //  Start of Packet
765
    output wire  data_rx_eop_15,            //  End of Packet
766
    output wire  [7:0] data_rx_data_15,     //  Data from FIFO
767
    output wire  [4:0] data_rx_error_15,    //  Receive packet error
768
    output wire  data_rx_valid_15,          //  Data Receive FIFO Valid
769
    input wire   data_rx_ready_15,          //  Data Receive Ready
770
    output wire  [4:0] pkt_class_data_15,   //  Frame Type Indication
771
    output wire  pkt_class_valid_15,        //  Frame Type Indication Valid 
772
    output wire  rx_recovclkout_15,         //  Frame Type Indication Valid 
773
    input wire   data_tx_error_15,          //  STATUS FIFO (Tx frame Error from Apps)
774
    input wire   [7:0] data_tx_data_15,     //  Data from FIFO transmit
775
    input wire   data_tx_valid_15,          //  Data FIFO transmit Empty
776
    input wire   data_tx_sop_15,            //  Start of Packet
777
    input wire   data_tx_eop_15,            //  END of Packet
778
    output wire  data_tx_ready_15,          //  Data FIFO transmit Read Enable  
779
 
780
    // STAND_ALONE CONDUITS 
781
    output wire  tx_ff_uflow_15,            //  TX FIFO underflow occured (Synchronous with tx_clk)
782
    input wire   tx_crc_fwd_15,             //  Forward Current Frame with CRC from Application
783
    input wire   xoff_gen_15,               //  Xoff Pause frame generate 
784
    input wire   xon_gen_15,                //  Xon Pause frame generate 
785
    input wire   magic_sleep_n_15,          //  Enable Sleep Mode
786
    output wire  magic_wakeup_15,           //  Wake Up Request
787
 
788
 
789
    // CHANNEL 16
790
 
791
    // PCS SIGNALS TO PHY
792
    input wire   rxp_16,                    //  Differential Receive Data 
793
    output wire  txp_16,                    //  Differential Transmit Data 
794
    input wire   gxb_pwrdn_in_16,           //  Powerdown signal to GXB
795
    output wire  pcs_pwrdn_out_16,          //  Powerdown Enable from PCS
796
    output wire  led_crs_16,                //  Carrier Sense
797
    output wire  led_link_16,               //  Valid Link 
798
    output wire  led_col_16,                //  Collision Indication
799
    output wire  led_an_16,                 //  Auto-Negotiation Status
800
    output wire  led_char_err_16,           //  Character Error
801
    output wire  led_disp_err_16,           //  Disparity Error
802
 
803
    // AV-ST TX & RX
804
    output wire  mac_rx_clk_16,             //  Av-ST Receive Clock
805
    output wire  mac_tx_clk_16,             //  Av-ST Transmit Clock   
806
    output wire  data_rx_sop_16,            //  Start of Packet
807
    output wire  data_rx_eop_16,            //  End of Packet
808
    output wire  [7:0] data_rx_data_16,     //  Data from FIFO
809
    output wire  [4:0] data_rx_error_16,    //  Receive packet error
810
    output wire  data_rx_valid_16,          //  Data Receive FIFO Valid
811
    input wire   data_rx_ready_16,          //  Data Receive Ready
812
    output wire  [4:0] pkt_class_data_16,   //  Frame Type Indication
813
    output wire  pkt_class_valid_16,        //  Frame Type Indication Valid 
814
    output wire  rx_recovclkout_16,         //  Frame Type Indication Valid 
815
    input wire   data_tx_error_16,          //  STATUS FIFO (Tx frame Error from Apps)
816
    input wire   [7:0] data_tx_data_16,     //  Data from FIFO transmit
817
    input wire   data_tx_valid_16,          //  Data FIFO transmit Empty
818
    input wire   data_tx_sop_16,            //  Start of Packet
819
    input wire   data_tx_eop_16,            //  END of Packet
820
    output wire  data_tx_ready_16,          //  Data FIFO transmit Read Enable  
821
 
822
    // STAND_ALONE CONDUITS 
823
    output wire  tx_ff_uflow_16,            //  TX FIFO underflow occured (Synchronous with tx_clk)
824
    input wire   tx_crc_fwd_16,             //  Forward Current Frame with CRC from Application
825
    input wire   xoff_gen_16,               //  Xoff Pause frame generate 
826
    input wire   xon_gen_16,                //  Xon Pause frame generate 
827
    input wire   magic_sleep_n_16,          //  Enable Sleep Mode
828
    output wire  magic_wakeup_16,           //  Wake Up Request
829
 
830
 
831
    // CHANNEL 17
832
 
833
    // PCS SIGNALS TO PHY
834
    input wire   rxp_17,                    //  Differential Receive Data 
835
    output wire  txp_17,                    //  Differential Transmit Data 
836
    input wire   gxb_pwrdn_in_17,           //  Powerdown signal to GXB
837
    output wire  pcs_pwrdn_out_17,          //  Powerdown Enable from PCS
838
    output wire  led_crs_17,                //  Carrier Sense
839
    output wire  led_link_17,               //  Valid Link 
840
    output wire  led_col_17,                //  Collision Indication
841
    output wire  led_an_17,                 //  Auto-Negotiation Status
842
    output wire  led_char_err_17,           //  Character Error
843
    output wire  led_disp_err_17,           //  Disparity Error
844
 
845
    // AV-ST TX & RX
846
    output wire  mac_rx_clk_17,             //  Av-ST Receive Clock
847
    output wire  mac_tx_clk_17,             //  Av-ST Transmit Clock   
848
    output wire  data_rx_sop_17,            //  Start of Packet
849
    output wire  data_rx_eop_17,            //  End of Packet
850
    output wire  [7:0] data_rx_data_17,     //  Data from FIFO
851
    output wire  [4:0] data_rx_error_17,    //  Receive packet error
852
    output wire  data_rx_valid_17,          //  Data Receive FIFO Valid
853
    input wire   data_rx_ready_17,          //  Data Receive Ready
854
    output wire  [4:0] pkt_class_data_17,   //  Frame Type Indication
855
    output wire  pkt_class_valid_17,        //  Frame Type Indication Valid 
856
    output wire  rx_recovclkout_17,         //  Frame Type Indication Valid 
857
    input wire   data_tx_error_17,          //  STATUS FIFO (Tx frame Error from Apps)
858
    input wire   [7:0] data_tx_data_17,     //  Data from FIFO transmit
859
    input wire   data_tx_valid_17,          //  Data FIFO transmit Empty
860
    input wire   data_tx_sop_17,            //  Start of Packet
861
    input wire   data_tx_eop_17,            //  END of Packet
862
    output wire  data_tx_ready_17,          //  Data FIFO transmit Read Enable  
863
 
864
    // STAND_ALONE CONDUITS 
865
    output wire  tx_ff_uflow_17,            //  TX FIFO underflow occured (Synchronous with tx_clk)
866
    input wire   tx_crc_fwd_17,             //  Forward Current Frame with CRC from Application
867
    input wire   xoff_gen_17,               //  Xoff Pause frame generate 
868
    input wire   xon_gen_17,                //  Xon Pause frame generate 
869
    input wire   magic_sleep_n_17,          //  Enable Sleep Mode
870
    output wire  magic_wakeup_17,           //  Wake Up Request
871
 
872
 
873
    // CHANNEL 18
874
 
875
    // PCS SIGNALS TO PHY
876
    input wire   rxp_18,                    //  Differential Receive Data 
877
    output wire  txp_18,                    //  Differential Transmit Data 
878
    input wire   gxb_pwrdn_in_18,           //  Powerdown signal to GXB
879
    output wire  pcs_pwrdn_out_18,          //  Powerdown Enable from PCS
880
    output wire  led_crs_18,                //  Carrier Sense
881
    output wire  led_link_18,               //  Valid Link 
882
    output wire  led_col_18,                //  Collision Indication
883
    output wire  led_an_18,                 //  Auto-Negotiation Status
884
    output wire  led_char_err_18,           //  Character Error
885
    output wire  led_disp_err_18,           //  Disparity Error
886
 
887
    // AV-ST TX & RX
888
    output wire  mac_rx_clk_18,             //  Av-ST Receive Clock
889
    output wire  mac_tx_clk_18,             //  Av-ST Transmit Clock   
890
    output wire  data_rx_sop_18,            //  Start of Packet
891
    output wire  data_rx_eop_18,            //  End of Packet
892
    output wire  [7:0] data_rx_data_18,     //  Data from FIFO
893
    output wire  [4:0] data_rx_error_18,    //  Receive packet error
894
    output wire  data_rx_valid_18,          //  Data Receive FIFO Valid
895
    input wire   data_rx_ready_18,          //  Data Receive Ready
896
    output wire  [4:0] pkt_class_data_18,   //  Frame Type Indication
897
    output wire  pkt_class_valid_18,        //  Frame Type Indication Valid 
898
    output wire  rx_recovclkout_18,         //  Frame Type Indication Valid 
899
    input wire   data_tx_error_18,          //  STATUS FIFO (Tx frame Error from Apps)
900
    input wire   [7:0] data_tx_data_18,     //  Data from FIFO transmit
901
    input wire   data_tx_valid_18,          //  Data FIFO transmit Empty
902
    input wire   data_tx_sop_18,            //  Start of Packet
903
    input wire   data_tx_eop_18,            //  END of Packet
904
    output wire  data_tx_ready_18,          //  Data FIFO transmit Read Enable  
905
 
906
    // STAND_ALONE CONDUITS 
907
    output wire  tx_ff_uflow_18,            //  TX FIFO underflow occured (Synchronous with tx_clk)
908
    input wire   tx_crc_fwd_18,             //  Forward Current Frame with CRC from Application
909
    input wire   xoff_gen_18,               //  Xoff Pause frame generate 
910
    input wire   xon_gen_18,                //  Xon Pause frame generate 
911
    input wire   magic_sleep_n_18,          //  Enable Sleep Mode
912
    output wire  magic_wakeup_18,           //  Wake Up Request
913
 
914
 
915
    // CHANNEL 19
916
 
917
    // PCS SIGNALS TO PHY
918
    input wire   rxp_19,                    //  Differential Receive Data 
919
    output wire  txp_19,                    //  Differential Transmit Data 
920
    input wire   gxb_pwrdn_in_19,           //  Powerdown signal to GXB
921
    output wire  pcs_pwrdn_out_19,          //  Powerdown Enable from PCS
922
    output wire  led_crs_19,                //  Carrier Sense
923
    output wire  led_link_19,               //  Valid Link 
924
    output wire  led_col_19,                //  Collision Indication
925
    output wire  led_an_19,                 //  Auto-Negotiation Status
926
    output wire  led_char_err_19,           //  Character Error
927
    output wire  led_disp_err_19,           //  Disparity Error
928
 
929
    // AV-ST TX & RX
930
    output wire  mac_rx_clk_19,             //  Av-ST Receive Clock
931
    output wire  mac_tx_clk_19,             //  Av-ST Transmit Clock   
932
    output wire  data_rx_sop_19,            //  Start of Packet
933
    output wire  data_rx_eop_19,            //  End of Packet
934
    output wire  [7:0] data_rx_data_19,     //  Data from FIFO
935
    output wire  [4:0] data_rx_error_19,    //  Receive packet error
936
    output wire  data_rx_valid_19,          //  Data Receive FIFO Valid
937
    input wire   data_rx_ready_19,          //  Data Receive Ready
938
    output wire  [4:0] pkt_class_data_19,   //  Frame Type Indication
939
    output wire  pkt_class_valid_19,        //  Frame Type Indication Valid 
940
    output wire  rx_recovclkout_19,         //  Frame Type Indication Valid 
941
    input wire   data_tx_error_19,          //  STATUS FIFO (Tx frame Error from Apps)
942
    input wire   [7:0] data_tx_data_19,     //  Data from FIFO transmit
943
    input wire   data_tx_valid_19,          //  Data FIFO transmit Empty
944
    input wire   data_tx_sop_19,            //  Start of Packet
945
    input wire   data_tx_eop_19,            //  END of Packet
946
    output wire  data_tx_ready_19,          //  Data FIFO transmit Read Enable  
947
 
948
    // STAND_ALONE CONDUITS 
949
    output wire  tx_ff_uflow_19,            //  TX FIFO underflow occured (Synchronous with tx_clk)
950
    input wire   tx_crc_fwd_19,             //  Forward Current Frame with CRC from Application
951
    input wire   xoff_gen_19,               //  Xoff Pause frame generate 
952
    input wire   xon_gen_19,                //  Xon Pause frame generate 
953
    input wire   magic_sleep_n_19,          //  Enable Sleep Mode
954
    output wire  magic_wakeup_19,           //  Wake Up Request
955
 
956
 
957
    // CHANNEL 20
958
 
959
    // PCS SIGNALS TO PHY
960
    input wire   rxp_20,                    //  Differential Receive Data 
961
    output wire  txp_20,                    //  Differential Transmit Data 
962
    input wire   gxb_pwrdn_in_20,           //  Powerdown signal to GXB
963
    output wire  pcs_pwrdn_out_20,          //  Powerdown Enable from PCS
964
    output wire  led_crs_20,                //  Carrier Sense
965
    output wire  led_link_20,               //  Valid Link 
966
    output wire  led_col_20,                //  Collision Indication
967
    output wire  led_an_20,                 //  Auto-Negotiation Status
968
    output wire  led_char_err_20,           //  Character Error
969
    output wire  led_disp_err_20,           //  Disparity Error
970
 
971
    // AV-ST TX & RX
972
    output wire  mac_rx_clk_20,             //  Av-ST Receive Clock
973
    output wire  mac_tx_clk_20,             //  Av-ST Transmit Clock   
974
    output wire  data_rx_sop_20,            //  Start of Packet
975
    output wire  data_rx_eop_20,            //  End of Packet
976
    output wire  [7:0] data_rx_data_20,     //  Data from FIFO
977
    output wire  [4:0] data_rx_error_20,    //  Receive packet error
978
    output wire  data_rx_valid_20,          //  Data Receive FIFO Valid
979
    input wire   data_rx_ready_20,          //  Data Receive Ready
980
    output wire  [4:0] pkt_class_data_20,   //  Frame Type Indication
981
    output wire  pkt_class_valid_20,        //  Frame Type Indication Valid 
982
    output wire  rx_recovclkout_20,         //  Frame Type Indication Valid 
983
    input wire   data_tx_error_20,          //  STATUS FIFO (Tx frame Error from Apps)
984
    input wire   [7:0] data_tx_data_20,     //  Data from FIFO transmit
985
    input wire   data_tx_valid_20,          //  Data FIFO transmit Empty
986
    input wire   data_tx_sop_20,            //  Start of Packet
987
    input wire   data_tx_eop_20,            //  END of Packet
988
    output wire  data_tx_ready_20,          //  Data FIFO transmit Read Enable  
989
 
990
    // STAND_ALONE CONDUITS 
991
    output wire  tx_ff_uflow_20,            //  TX FIFO underflow occured (Synchronous with tx_clk)
992
    input wire   tx_crc_fwd_20,             //  Forward Current Frame with CRC from Application
993
    input wire   xoff_gen_20,               //  Xoff Pause frame generate 
994
    input wire   xon_gen_20,                //  Xon Pause frame generate 
995
    input wire   magic_sleep_n_20,          //  Enable Sleep Mode
996
    output wire  magic_wakeup_20,           //  Wake Up Request
997
 
998
 
999
    // CHANNEL 21
1000
 
1001
    // PCS SIGNALS TO PHY
1002
    input wire   rxp_21,                    //  Differential Receive Data 
1003
    output wire  txp_21,                    //  Differential Transmit Data 
1004
    input wire   gxb_pwrdn_in_21,           //  Powerdown signal to GXB
1005
    output wire  pcs_pwrdn_out_21,          //  Powerdown Enable from PCS
1006
    output wire  led_crs_21,                //  Carrier Sense
1007
    output wire  led_link_21,               //  Valid Link 
1008
    output wire  led_col_21,                //  Collision Indication
1009
    output wire  led_an_21,                 //  Auto-Negotiation Status
1010
    output wire  led_char_err_21,           //  Character Error
1011
    output wire  led_disp_err_21,           //  Disparity Error
1012
 
1013
    // AV-ST TX & RX
1014
    output wire  mac_rx_clk_21,             //  Av-ST Receive Clock
1015
    output wire  mac_tx_clk_21,             //  Av-ST Transmit Clock   
1016
    output wire  data_rx_sop_21,            //  Start of Packet
1017
    output wire  data_rx_eop_21,            //  End of Packet
1018
    output wire  [7:0] data_rx_data_21,     //  Data from FIFO
1019
    output wire  [4:0] data_rx_error_21,    //  Receive packet error
1020
    output wire  data_rx_valid_21,          //  Data Receive FIFO Valid
1021
    input wire   data_rx_ready_21,          //  Data Receive Ready
1022
    output wire  [4:0] pkt_class_data_21,   //  Frame Type Indication
1023
    output wire  pkt_class_valid_21,        //  Frame Type Indication Valid 
1024
    output wire  rx_recovclkout_21,         //  Frame Type Indication Valid 
1025
    input wire   data_tx_error_21,          //  STATUS FIFO (Tx frame Error from Apps)
1026
    input wire   [7:0] data_tx_data_21,     //  Data from FIFO transmit
1027
    input wire   data_tx_valid_21,          //  Data FIFO transmit Empty
1028
    input wire   data_tx_sop_21,            //  Start of Packet
1029
    input wire   data_tx_eop_21,            //  END of Packet
1030
    output wire  data_tx_ready_21,          //  Data FIFO transmit Read Enable  
1031
 
1032
    // STAND_ALONE CONDUITS 
1033
    output wire  tx_ff_uflow_21,            //  TX FIFO underflow occured (Synchronous with tx_clk)
1034
    input wire   tx_crc_fwd_21,             //  Forward Current Frame with CRC from Application
1035
    input wire   xoff_gen_21,               //  Xoff Pause frame generate 
1036
    input wire   xon_gen_21,                //  Xon Pause frame generate 
1037
    input wire   magic_sleep_n_21,          //  Enable Sleep Mode
1038
    output wire  magic_wakeup_21,           //  Wake Up Request
1039
 
1040
 
1041
    // CHANNEL 22
1042
 
1043
    // PCS SIGNALS TO PHY
1044
    input wire   rxp_22,                    //  Differential Receive Data 
1045
    output wire  txp_22,                    //  Differential Transmit Data 
1046
    input wire   gxb_pwrdn_in_22,           //  Powerdown signal to GXB
1047
    output wire  pcs_pwrdn_out_22,          //  Powerdown Enable from PCS
1048
    output wire  led_crs_22,                //  Carrier Sense
1049
    output wire  led_link_22,               //  Valid Link 
1050
    output wire  led_col_22,                //  Collision Indication
1051
    output wire  led_an_22,                 //  Auto-Negotiation Status
1052
    output wire  led_char_err_22,           //  Character Error
1053
    output wire  led_disp_err_22,           //  Disparity Error
1054
 
1055
    // AV-ST TX & RX
1056
    output wire  mac_rx_clk_22,             //  Av-ST Receive Clock
1057
    output wire  mac_tx_clk_22,             //  Av-ST Transmit Clock   
1058
    output wire  data_rx_sop_22,            //  Start of Packet
1059
    output wire  data_rx_eop_22,            //  End of Packet
1060
    output wire  [7:0] data_rx_data_22,     //  Data from FIFO
1061
    output wire  [4:0] data_rx_error_22,    //  Receive packet error
1062
    output wire  data_rx_valid_22,          //  Data Receive FIFO Valid
1063
    input wire   data_rx_ready_22,          //  Data Receive Ready
1064
    output wire  [4:0] pkt_class_data_22,   //  Frame Type Indication
1065
    output wire  pkt_class_valid_22,        //  Frame Type Indication Valid 
1066
    output wire  rx_recovclkout_22,         //  Frame Type Indication Valid 
1067
    input wire   data_tx_error_22,          //  STATUS FIFO (Tx frame Error from Apps)
1068
    input wire   [7:0] data_tx_data_22,     //  Data from FIFO transmit
1069
    input wire   data_tx_valid_22,          //  Data FIFO transmit Empty
1070
    input wire   data_tx_sop_22,            //  Start of Packet
1071
    input wire   data_tx_eop_22,            //  END of Packet
1072
    output wire  data_tx_ready_22,          //  Data FIFO transmit Read Enable  
1073
 
1074
    // STAND_ALONE CONDUITS 
1075
    output wire  tx_ff_uflow_22,            //  TX FIFO underflow occured (Synchronous with tx_clk)
1076
    input wire   tx_crc_fwd_22,             //  Forward Current Frame with CRC from Application
1077
    input wire   xoff_gen_22,               //  Xoff Pause frame generate 
1078
    input wire   xon_gen_22,                //  Xon Pause frame generate 
1079
    input wire   magic_sleep_n_22,          //  Enable Sleep Mode
1080
    output wire  magic_wakeup_22,           //  Wake Up Request
1081
 
1082
 
1083
    // CHANNEL 23
1084
 
1085
    // PCS SIGNALS TO PHY
1086
    input wire   rxp_23,                    //  Differential Receive Data 
1087
    output wire  txp_23,                    //  Differential Transmit Data 
1088
    input wire   gxb_pwrdn_in_23,           //  Powerdown signal to GXB
1089
    output wire  pcs_pwrdn_out_23,          //  Powerdown Enable from PCS
1090
    output wire  led_crs_23,                //  Carrier Sense
1091
    output wire  led_link_23,               //  Valid Link 
1092
    output wire  led_col_23,                //  Collision Indication
1093
    output wire  led_an_23,                 //  Auto-Negotiation Status
1094
    output wire  led_char_err_23,           //  Character Error
1095
    output wire  led_disp_err_23,           //  Disparity Error
1096
 
1097
    // AV-ST TX & RX
1098
    output wire  mac_rx_clk_23,             //  Av-ST Receive Clock
1099
    output wire  mac_tx_clk_23,             //  Av-ST Transmit Clock   
1100
    output wire  data_rx_sop_23,            //  Start of Packet
1101
    output wire  data_rx_eop_23,            //  End of Packet
1102
    output wire  [7:0] data_rx_data_23,     //  Data from FIFO
1103
    output wire  [4:0] data_rx_error_23,    //  Receive packet error
1104
    output wire  data_rx_valid_23,          //  Data Receive FIFO Valid
1105
    input wire   data_rx_ready_23,          //  Data Receive Ready
1106
    output wire  [4:0] pkt_class_data_23,   //  Frame Type Indication
1107
    output wire  pkt_class_valid_23,        //  Frame Type Indication Valid 
1108
    output wire  rx_recovclkout_23,         //  Frame Type Indication Valid 
1109
    input wire   data_tx_error_23,          //  STATUS FIFO (Tx frame Error from Apps)
1110
    input wire   [7:0] data_tx_data_23,     //  Data from FIFO transmit
1111
    input wire   data_tx_valid_23,          //  Data FIFO transmit Empty
1112
    input wire   data_tx_sop_23,            //  Start of Packet
1113
    input wire   data_tx_eop_23,            //  END of Packet
1114
    output wire  data_tx_ready_23,          //  Data FIFO transmit Read Enable  
1115
 
1116
    // STAND_ALONE CONDUITS 
1117
    output wire  tx_ff_uflow_23,            //  TX FIFO underflow occured (Synchronous with tx_clk)
1118
    input wire   tx_crc_fwd_23,             //  Forward Current Frame with CRC from Application
1119
    input wire   xoff_gen_23,               //  Xoff Pause frame generate 
1120
    input wire   xon_gen_23,                //  Xon Pause frame generate 
1121
    input wire   magic_sleep_n_23,          //  Enable Sleep Mode
1122
    output wire  magic_wakeup_23);          //  Wake Up Request
1123
 
1124
 
1125
wire    [23:0] pcs_pwrdn_out_sig;
1126
wire    [23:0] gxb_pwrdn_in_sig;
1127
 
1128
wire    [9:0] tbi_rx_d_lvds_0;
1129
reg     [9:0] tbi_rx_d_flip_0;
1130
reg     [9:0] tbi_tx_d_flip_0;
1131
wire    [9:0] tbi_rx_d_0;
1132
wire    [9:0] tbi_tx_d_0;
1133
wire    [9:0] tbi_rx_d_lvds_1;
1134
reg     [9:0] tbi_rx_d_flip_1;
1135
reg     [9:0] tbi_tx_d_flip_1;
1136
wire    [9:0] tbi_rx_d_1;
1137
wire    [9:0] tbi_tx_d_1;
1138
wire    [9:0] tbi_rx_d_lvds_2;
1139
reg     [9:0] tbi_rx_d_flip_2;
1140
reg     [9:0] tbi_tx_d_flip_2;
1141
wire    [9:0] tbi_rx_d_2;
1142
wire    [9:0] tbi_tx_d_2;
1143
wire    [9:0] tbi_rx_d_lvds_3;
1144
reg     [9:0] tbi_rx_d_flip_3;
1145
reg     [9:0] tbi_tx_d_flip_3;
1146
wire    [9:0] tbi_rx_d_3;
1147
wire    [9:0] tbi_tx_d_3;
1148
wire    [9:0] tbi_rx_d_lvds_4;
1149
reg     [9:0] tbi_rx_d_flip_4;
1150
reg     [9:0] tbi_tx_d_flip_4;
1151
wire    [9:0] tbi_rx_d_4;
1152
wire    [9:0] tbi_tx_d_4;
1153
wire    [9:0] tbi_rx_d_lvds_5;
1154
reg     [9:0] tbi_rx_d_flip_5;
1155
reg     [9:0] tbi_tx_d_flip_5;
1156
wire    [9:0] tbi_rx_d_5;
1157
wire    [9:0] tbi_tx_d_5;
1158
wire    [9:0] tbi_rx_d_lvds_6;
1159
reg     [9:0] tbi_rx_d_flip_6;
1160
reg     [9:0] tbi_tx_d_flip_6;
1161
wire    [9:0] tbi_rx_d_6;
1162
wire    [9:0] tbi_tx_d_6;
1163
wire    [9:0] tbi_rx_d_lvds_7;
1164
reg     [9:0] tbi_rx_d_flip_7;
1165
reg     [9:0] tbi_tx_d_flip_7;
1166
wire    [9:0] tbi_rx_d_7;
1167
wire    [9:0] tbi_tx_d_7;
1168
wire    [9:0] tbi_rx_d_lvds_8;
1169
reg     [9:0] tbi_rx_d_flip_8;
1170
reg     [9:0] tbi_tx_d_flip_8;
1171
wire    [9:0] tbi_rx_d_8;
1172
wire    [9:0] tbi_tx_d_8;
1173
wire    [9:0] tbi_rx_d_lvds_9;
1174
reg     [9:0] tbi_rx_d_flip_9;
1175
reg     [9:0] tbi_tx_d_flip_9;
1176
wire    [9:0] tbi_rx_d_9;
1177
wire    [9:0] tbi_tx_d_9;
1178
wire    [9:0] tbi_rx_d_lvds_10;
1179
reg     [9:0] tbi_rx_d_flip_10;
1180
reg     [9:0] tbi_tx_d_flip_10;
1181
wire    [9:0] tbi_rx_d_10;
1182
wire    [9:0] tbi_tx_d_10;
1183
wire    [9:0] tbi_rx_d_lvds_11;
1184
reg     [9:0] tbi_rx_d_flip_11;
1185
reg     [9:0] tbi_tx_d_flip_11;
1186
wire    [9:0] tbi_rx_d_11;
1187
wire    [9:0] tbi_tx_d_11;
1188
wire    [9:0] tbi_rx_d_lvds_12;
1189
reg     [9:0] tbi_rx_d_flip_12;
1190
reg     [9:0] tbi_tx_d_flip_12;
1191
wire    [9:0] tbi_rx_d_12;
1192
wire    [9:0] tbi_tx_d_12;
1193
wire    [9:0] tbi_rx_d_lvds_13;
1194
reg     [9:0] tbi_rx_d_flip_13;
1195
reg     [9:0] tbi_tx_d_flip_13;
1196
wire    [9:0] tbi_rx_d_13;
1197
wire    [9:0] tbi_tx_d_13;
1198
wire    [9:0] tbi_rx_d_lvds_14;
1199
reg     [9:0] tbi_rx_d_flip_14;
1200
reg     [9:0] tbi_tx_d_flip_14;
1201
wire    [9:0] tbi_rx_d_14;
1202
wire    [9:0] tbi_tx_d_14;
1203
wire    [9:0] tbi_rx_d_lvds_15;
1204
reg     [9:0] tbi_rx_d_flip_15;
1205
reg     [9:0] tbi_tx_d_flip_15;
1206
wire    [9:0] tbi_rx_d_15;
1207
wire    [9:0] tbi_tx_d_15;
1208
wire    [9:0] tbi_rx_d_lvds_16;
1209
reg     [9:0] tbi_rx_d_flip_16;
1210
reg     [9:0] tbi_tx_d_flip_16;
1211
wire    [9:0] tbi_rx_d_16;
1212
wire    [9:0] tbi_tx_d_16;
1213
wire    [9:0] tbi_rx_d_lvds_17;
1214
reg     [9:0] tbi_rx_d_flip_17;
1215
reg     [9:0] tbi_tx_d_flip_17;
1216
wire    [9:0] tbi_rx_d_17;
1217
wire    [9:0] tbi_tx_d_17;
1218
wire    [9:0] tbi_rx_d_lvds_18;
1219
reg     [9:0] tbi_rx_d_flip_18;
1220
reg     [9:0] tbi_tx_d_flip_18;
1221
wire    [9:0] tbi_rx_d_18;
1222
wire    [9:0] tbi_tx_d_18;
1223
wire    [9:0] tbi_rx_d_lvds_19;
1224
reg     [9:0] tbi_rx_d_flip_19;
1225
reg     [9:0] tbi_tx_d_flip_19;
1226
wire    [9:0] tbi_rx_d_19;
1227
wire    [9:0] tbi_tx_d_19;
1228
wire    [9:0] tbi_rx_d_lvds_20;
1229
reg     [9:0] tbi_rx_d_flip_20;
1230
reg     [9:0] tbi_tx_d_flip_20;
1231
wire    [9:0] tbi_rx_d_20;
1232
wire    [9:0] tbi_tx_d_20;
1233
wire    [9:0] tbi_rx_d_lvds_21;
1234
reg     [9:0] tbi_rx_d_flip_21;
1235
reg     [9:0] tbi_tx_d_flip_21;
1236
wire    [9:0] tbi_rx_d_21;
1237
wire    [9:0] tbi_tx_d_21;
1238
wire    [9:0] tbi_rx_d_lvds_22;
1239
reg     [9:0] tbi_rx_d_flip_22;
1240
reg     [9:0] tbi_tx_d_flip_22;
1241
wire    [9:0] tbi_rx_d_22;
1242
wire    [9:0] tbi_tx_d_22;
1243
wire    [9:0] tbi_rx_d_lvds_23;
1244
reg     [9:0] tbi_rx_d_flip_23;
1245
reg     [9:0] tbi_tx_d_flip_23;
1246
wire    [9:0] tbi_rx_d_23;
1247
wire    [9:0] tbi_tx_d_23;
1248
 
1249
wire    sd_loopback_0;
1250
wire    sd_loopback_1;
1251
wire    sd_loopback_2;
1252
wire    sd_loopback_3;
1253
wire    sd_loopback_4;
1254
wire    sd_loopback_5;
1255
wire    sd_loopback_6;
1256
wire    sd_loopback_7;
1257
wire    sd_loopback_8;
1258
wire    sd_loopback_9;
1259
wire    sd_loopback_10;
1260
wire    sd_loopback_11;
1261
wire    sd_loopback_12;
1262
wire    sd_loopback_13;
1263
wire    sd_loopback_14;
1264
wire    sd_loopback_15;
1265
wire    sd_loopback_16;
1266
wire    sd_loopback_17;
1267
wire    sd_loopback_18;
1268
wire    sd_loopback_19;
1269
wire    sd_loopback_20;
1270
wire    sd_loopback_21;
1271
wire    sd_loopback_22;
1272
wire    sd_loopback_23;
1273
 
1274
wire    tbi_rx_clk_0;
1275
wire    tbi_rx_clk_1;
1276
wire    tbi_rx_clk_2;
1277
wire    tbi_rx_clk_3;
1278
wire    tbi_rx_clk_4;
1279
wire    tbi_rx_clk_5;
1280
wire    tbi_rx_clk_6;
1281
wire    tbi_rx_clk_7;
1282
wire    tbi_rx_clk_8;
1283
wire    tbi_rx_clk_9;
1284
wire    tbi_rx_clk_10;
1285
wire    tbi_rx_clk_11;
1286
wire    tbi_rx_clk_12;
1287
wire    tbi_rx_clk_13;
1288
wire    tbi_rx_clk_14;
1289
wire    tbi_rx_clk_15;
1290
wire    tbi_rx_clk_16;
1291
wire    tbi_rx_clk_17;
1292
wire    tbi_rx_clk_18;
1293
wire    tbi_rx_clk_19;
1294
wire    tbi_rx_clk_20;
1295
wire    tbi_rx_clk_21;
1296
wire    tbi_rx_clk_22;
1297
wire    tbi_rx_clk_23;
1298
 
1299
wire    tbi_tx_clk_0;
1300
wire    tbi_tx_clk_1;
1301
wire    tbi_tx_clk_2;
1302
wire    tbi_tx_clk_3;
1303
wire    tbi_tx_clk_4;
1304
wire    tbi_tx_clk_5;
1305
wire    tbi_tx_clk_6;
1306
wire    tbi_tx_clk_7;
1307
wire    tbi_tx_clk_8;
1308
wire    tbi_tx_clk_9;
1309
wire    tbi_tx_clk_10;
1310
wire    tbi_tx_clk_11;
1311
wire    tbi_tx_clk_12;
1312
wire    tbi_tx_clk_13;
1313
wire    tbi_tx_clk_14;
1314
wire    tbi_tx_clk_15;
1315
wire    tbi_tx_clk_16;
1316
wire    tbi_tx_clk_17;
1317
wire    tbi_tx_clk_18;
1318
wire    tbi_tx_clk_19;
1319
wire    tbi_tx_clk_20;
1320
wire    tbi_tx_clk_21;
1321
wire    tbi_tx_clk_22;
1322
wire    tbi_tx_clk_23;
1323
 
1324 20 jefflieu
wire    reset_ref_clk_int;
1325
 
1326
wire    reset_tbi_rx_clk_0_int;
1327
wire    reset_tbi_rx_clk_1_int;
1328
wire    reset_tbi_rx_clk_2_int;
1329
wire    reset_tbi_rx_clk_3_int;
1330
wire    reset_tbi_rx_clk_4_int;
1331
wire    reset_tbi_rx_clk_5_int;
1332
wire    reset_tbi_rx_clk_6_int;
1333
wire    reset_tbi_rx_clk_7_int;
1334
wire    reset_tbi_rx_clk_8_int;
1335
wire    reset_tbi_rx_clk_9_int;
1336
wire    reset_tbi_rx_clk_10_int;
1337
wire    reset_tbi_rx_clk_11_int;
1338
wire    reset_tbi_rx_clk_12_int;
1339
wire    reset_tbi_rx_clk_13_int;
1340
wire    reset_tbi_rx_clk_14_int;
1341
wire    reset_tbi_rx_clk_15_int;
1342
wire    reset_tbi_rx_clk_16_int;
1343
wire    reset_tbi_rx_clk_17_int;
1344
wire    reset_tbi_rx_clk_18_int;
1345
wire    reset_tbi_rx_clk_19_int;
1346
wire    reset_tbi_rx_clk_20_int;
1347
wire    reset_tbi_rx_clk_21_int;
1348
wire    reset_tbi_rx_clk_22_int;
1349
wire    reset_tbi_rx_clk_23_int;
1350
 
1351 9 jefflieu
wire pll_areset_0,rx_cda_reset_0,rx_channel_data_align_0,rx_locked_0,rx_reset_0;
1352
wire pll_areset_1,rx_cda_reset_1,rx_channel_data_align_1,rx_locked_1,rx_reset_1;
1353
wire pll_areset_2,rx_cda_reset_2,rx_channel_data_align_2,rx_locked_2,rx_reset_2;
1354
wire pll_areset_3,rx_cda_reset_3,rx_channel_data_align_3,rx_locked_3,rx_reset_3;
1355
wire pll_areset_4,rx_cda_reset_4,rx_channel_data_align_4,rx_locked_4,rx_reset_4;
1356
wire pll_areset_5,rx_cda_reset_5,rx_channel_data_align_5,rx_locked_5,rx_reset_5;
1357
wire pll_areset_6,rx_cda_reset_6,rx_channel_data_align_6,rx_locked_6,rx_reset_6;
1358
wire pll_areset_7,rx_cda_reset_7,rx_channel_data_align_7,rx_locked_7,rx_reset_7;
1359
wire pll_areset_8,rx_cda_reset_8,rx_channel_data_align_8,rx_locked_8,rx_reset_8;
1360
wire pll_areset_9,rx_cda_reset_9,rx_channel_data_align_9,rx_locked_9,rx_reset_9;
1361
wire pll_areset_10,rx_cda_reset_10,rx_channel_data_align_10,rx_locked_10,rx_reset_10;
1362
wire pll_areset_11,rx_cda_reset_11,rx_channel_data_align_11,rx_locked_11,rx_reset_11;
1363
wire pll_areset_12,rx_cda_reset_12,rx_channel_data_align_12,rx_locked_12,rx_reset_12;
1364
wire pll_areset_13,rx_cda_reset_13,rx_channel_data_align_13,rx_locked_13,rx_reset_13;
1365
wire pll_areset_14,rx_cda_reset_14,rx_channel_data_align_14,rx_locked_14,rx_reset_14;
1366
wire pll_areset_15,rx_cda_reset_15,rx_channel_data_align_15,rx_locked_15,rx_reset_15;
1367
wire pll_areset_16,rx_cda_reset_16,rx_channel_data_align_16,rx_locked_16,rx_reset_16;
1368
wire pll_areset_17,rx_cda_reset_17,rx_channel_data_align_17,rx_locked_17,rx_reset_17;
1369
wire pll_areset_18,rx_cda_reset_18,rx_channel_data_align_18,rx_locked_18,rx_reset_18;
1370
wire pll_areset_19,rx_cda_reset_19,rx_channel_data_align_19,rx_locked_19,rx_reset_19;
1371
wire pll_areset_20,rx_cda_reset_20,rx_channel_data_align_20,rx_locked_20,rx_reset_20;
1372
wire pll_areset_21,rx_cda_reset_21,rx_channel_data_align_21,rx_locked_21,rx_reset_21;
1373
wire pll_areset_22,rx_cda_reset_22,rx_channel_data_align_22,rx_locked_22,rx_reset_22;
1374
wire pll_areset_23,rx_cda_reset_23,rx_channel_data_align_23,rx_locked_23,rx_reset_23;
1375
 
1376
assign rx_recovclkout_0 = tbi_rx_clk_0;
1377
assign rx_recovclkout_1 = tbi_rx_clk_1;
1378
assign rx_recovclkout_2 = tbi_rx_clk_2;
1379
assign rx_recovclkout_3 = tbi_rx_clk_3;
1380
assign rx_recovclkout_4 = tbi_rx_clk_4;
1381
assign rx_recovclkout_5 = tbi_rx_clk_5;
1382
assign rx_recovclkout_6 = tbi_rx_clk_6;
1383
assign rx_recovclkout_7 = tbi_rx_clk_7;
1384
assign rx_recovclkout_8 = tbi_rx_clk_8;
1385
assign rx_recovclkout_9 = tbi_rx_clk_9;
1386
assign rx_recovclkout_10 = tbi_rx_clk_10;
1387
assign rx_recovclkout_11 = tbi_rx_clk_11;
1388
assign rx_recovclkout_12 = tbi_rx_clk_12;
1389
assign rx_recovclkout_13 = tbi_rx_clk_13;
1390
assign rx_recovclkout_14 = tbi_rx_clk_14;
1391
assign rx_recovclkout_15 = tbi_rx_clk_15;
1392
assign rx_recovclkout_16 = tbi_rx_clk_16;
1393
assign rx_recovclkout_17 = tbi_rx_clk_17;
1394
assign rx_recovclkout_18 = tbi_rx_clk_18;
1395
assign rx_recovclkout_19 = tbi_rx_clk_19;
1396
assign rx_recovclkout_20 = tbi_rx_clk_20;
1397
assign rx_recovclkout_21 = tbi_rx_clk_21;
1398
assign rx_recovclkout_22 = tbi_rx_clk_22;
1399
assign rx_recovclkout_23 = tbi_rx_clk_23;
1400
 
1401
    // Instantiation of the MAC_PCS core that connects to a PMA
1402
    // --------------------------------------------------------
1403
 
1404
    altera_tse_top_multi_mac_pcs U_MULTI_MAC_PCS(
1405
 
1406
        .reset(reset),                            //INPUT  : ASYNCHRONOUS RESET - clk DOMAIN
1407
        .clk(clk),                                //INPUT  : CLOCK
1408
        .read(read),                              //INPUT  : REGISTER READ TRANSACTION
1409
        .ref_clk(ref_clk),                        //INPUT  : REFERENCE CLOCK 
1410
        .write(write),                            //INPUT  : REGISTER WRITE TRANSACTION
1411
        .address(address),                        //INPUT  : REGISTER ADDRESS
1412
        .writedata(writedata),                    //INPUT  : REGISTER WRITE DATA
1413
        .readdata(readdata),                      //OUTPUT : REGISTER READ DATA
1414
        .waitrequest(waitrequest),                //OUTPUT : TRANSACTION BUSY, ACTIVE LOW
1415
        .mdc(mdc),                                //OUTPUT : MDIO Clock 
1416
        .mdio_out(mdio_out),                      //OUTPUT : Outgoing MDIO DATA
1417
        .mdio_in(mdio_in),                        //INPUT  : Incoming MDIO DATA       
1418
        .mdio_oen(mdio_oen),                      //OUTPUT : MDIO Output Enable
1419
        .mac_rx_clk(mac_rx_clk),                  //OUTPUT : Av-ST Rx Clock
1420
        .mac_tx_clk(mac_tx_clk),                  //OUTPUT : Av-ST Tx Clock
1421
        .rx_afull_clk(rx_afull_clk),              //INPUT  : AFull Status Clock
1422
            .rx_afull_data(rx_afull_data),            //INPUT  : AFull Status Data
1423
            .rx_afull_valid(rx_afull_valid),          //INPUT  : AFull Status Valid
1424
            .rx_afull_channel(rx_afull_channel),      //INPUT  : AFull Status Channel
1425
 
1426
         // Channel 0 
1427
 
1428
        .tbi_rx_clk_0(tbi_rx_clk_0),              //INPUT  : Receive TBI Clock
1429
        .tbi_tx_clk_0(tbi_tx_clk_0),              //INPUT  : Transmit TBI Clock
1430
        .tbi_rx_d_0(tbi_rx_d_0),                  //INPUT  : Receive TBI Interface
1431
        .tbi_tx_d_0(tbi_tx_d_0),                  //OUTPUT : Transmit TBI Interface
1432
        .sd_loopback_0(sd_loopback_0),            //OUTPUT : SERDES Loopback Enable
1433
        .powerdown_0(pcs_pwrdn_out_sig[0]),       //OUTPUT : Powerdown Enable
1434
        .led_col_0(led_col_0),                    //OUTPUT : Collision Indication
1435
        .led_an_0(led_an_0),                      //OUTPUT : Auto Negotiation Status
1436
        .led_char_err_0(led_char_err_0),          //OUTPUT : Character error
1437
        .led_disp_err_0(led_disp_err_0),          //OUTPUT : Disparity error
1438
        .led_crs_0(led_crs_0),                    //OUTPUT : Carrier sense
1439
        .led_link_0(led_link_0),                  //OUTPUT : Valid link    
1440
        .mac_rx_clk_0(mac_rx_clk_0),              //OUTPUT : Av-ST Rx Clock
1441
        .mac_tx_clk_0(mac_tx_clk_0),              //OUTPUT : Av-ST Tx Clock
1442
        .data_rx_sop_0(data_rx_sop_0),            //OUTPUT : Start of Packet
1443
        .data_rx_eop_0(data_rx_eop_0),            //OUTPUT : End of Packet
1444
        .data_rx_data_0(data_rx_data_0),          //OUTPUT : Data from FIFO
1445
        .data_rx_error_0(data_rx_error_0),        //OUTPUT : Receive packet error
1446
        .data_rx_valid_0(data_rx_valid_0),        //OUTPUT : Data Receive FIFO Valid
1447
        .data_rx_ready_0(data_rx_ready_0),        //OUTPUT : Data Receive Ready
1448
        .pkt_class_data_0(pkt_class_data_0),      //OUTPUT : Frame Type Indication
1449
        .pkt_class_valid_0(pkt_class_valid_0),    //OUTPUT : Frame Type Indication Valid
1450
        .data_tx_error_0(data_tx_error_0),        //INPUT  : Status
1451
        .data_tx_data_0(data_tx_data_0),          //INPUT  : Data from FIFO transmit
1452
        .data_tx_valid_0(data_tx_valid_0),        //INPUT  : Data FIFO transmit Empty
1453
        .data_tx_sop_0(data_tx_sop_0),            //INPUT  : Start of Packet
1454
        .data_tx_eop_0(data_tx_eop_0),            //INPUT  : End of Packet
1455
        .data_tx_ready_0(data_tx_ready_0),        //OUTPUT : Data FIFO transmit Read Enable  
1456
        .tx_ff_uflow_0(tx_ff_uflow_0),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1457
        .tx_crc_fwd_0(tx_crc_fwd_0),              //INPUT  : Forward Current Frame with CRC from Application
1458
        .xoff_gen_0(xoff_gen_0),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1459
        .xon_gen_0(xon_gen_0),                    //INPUT  : XON PAUSE FRAME GENERATE
1460
        .magic_sleep_n_0(magic_sleep_n_0),        //INPUT  : MAC SLEEP MODE CONTROL
1461
        .magic_wakeup_0(magic_wakeup_0),          //OUTPUT : MAC WAKE-UP INDICATION
1462
 
1463
         // Channel 1 
1464
 
1465
        .tbi_rx_clk_1(tbi_rx_clk_1),              //INPUT  : Receive TBI Clock
1466
        .tbi_tx_clk_1(tbi_tx_clk_1),              //INPUT  : Transmit TBI Clock
1467
        .tbi_rx_d_1(tbi_rx_d_1),                  //INPUT  : Receive TBI Interface
1468
        .tbi_tx_d_1(tbi_tx_d_1),                  //OUTPUT : Transmit TBI Interface
1469
        .sd_loopback_1(sd_loopback_1),            //OUTPUT : SERDES Loopback Enable
1470
        .powerdown_1(pcs_pwrdn_out_sig[1]),       //OUTPUT : Powerdown Enable
1471
        .led_col_1(led_col_1),                    //OUTPUT : Collision Indication
1472
        .led_an_1(led_an_1),                      //OUTPUT : Auto Negotiation Status
1473
        .led_char_err_1(led_char_err_1),          //OUTPUT : Character error
1474
        .led_disp_err_1(led_disp_err_1),          //OUTPUT : Disparity error
1475
        .led_crs_1(led_crs_1),                    //OUTPUT : Carrier sense
1476
        .led_link_1(led_link_1),                  //OUTPUT : Valid link    
1477
        .mac_rx_clk_1(mac_rx_clk_1),              //OUTPUT : Av-ST Rx Clock
1478
        .mac_tx_clk_1(mac_tx_clk_1),              //OUTPUT : Av-ST Tx Clock
1479
        .data_rx_sop_1(data_rx_sop_1),            //OUTPUT : Start of Packet
1480
        .data_rx_eop_1(data_rx_eop_1),            //OUTPUT : End of Packet
1481
        .data_rx_data_1(data_rx_data_1),          //OUTPUT : Data from FIFO
1482
        .data_rx_error_1(data_rx_error_1),        //OUTPUT : Receive packet error
1483
        .data_rx_valid_1(data_rx_valid_1),        //OUTPUT : Data Receive FIFO Valid
1484
        .data_rx_ready_1(data_rx_ready_1),        //OUTPUT : Data Receive Ready
1485
        .pkt_class_data_1(pkt_class_data_1),      //OUTPUT : Frame Type Indication
1486
        .pkt_class_valid_1(pkt_class_valid_1),    //OUTPUT : Frame Type Indication Valid
1487
        .data_tx_error_1(data_tx_error_1),        //INPUT  : Status
1488
        .data_tx_data_1(data_tx_data_1),          //INPUT  : Data from FIFO transmit
1489
        .data_tx_valid_1(data_tx_valid_1),        //INPUT  : Data FIFO transmit Empty
1490
        .data_tx_sop_1(data_tx_sop_1),            //INPUT  : Start of Packet
1491
        .data_tx_eop_1(data_tx_eop_1),            //INPUT  : End of Packet
1492
        .data_tx_ready_1(data_tx_ready_1),        //OUTPUT : Data FIFO transmit Read Enable  
1493
        .tx_ff_uflow_1(tx_ff_uflow_1),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1494
        .tx_crc_fwd_1(tx_crc_fwd_1),              //INPUT  : Forward Current Frame with CRC from Application
1495
        .xoff_gen_1(xoff_gen_1),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1496
        .xon_gen_1(xon_gen_1),                    //INPUT  : XON PAUSE FRAME GENERATE
1497
        .magic_sleep_n_1(magic_sleep_n_1),        //INPUT  : MAC SLEEP MODE CONTROL
1498
        .magic_wakeup_1(magic_wakeup_1),          //OUTPUT : MAC WAKE-UP INDICATION
1499
 
1500
         // Channel 2 
1501
 
1502
        .tbi_rx_clk_2(tbi_rx_clk_2),              //INPUT  : Receive TBI Clock
1503
        .tbi_tx_clk_2(tbi_tx_clk_2),              //INPUT  : Transmit TBI Clock
1504
        .tbi_rx_d_2(tbi_rx_d_2),                  //INPUT  : Receive TBI Interface
1505
        .tbi_tx_d_2(tbi_tx_d_2),                  //OUTPUT : Transmit TBI Interface
1506
        .sd_loopback_2(sd_loopback_2),            //OUTPUT : SERDES Loopback Enable
1507
        .powerdown_2(pcs_pwrdn_out_sig[2]),       //OUTPUT : Powerdown Enable
1508
        .led_col_2(led_col_2),                    //OUTPUT : Collision Indication
1509
        .led_an_2(led_an_2),                      //OUTPUT : Auto Negotiation Status
1510
        .led_char_err_2(led_char_err_2),          //OUTPUT : Character error
1511
        .led_disp_err_2(led_disp_err_2),          //OUTPUT : Disparity error
1512
        .led_crs_2(led_crs_2),                    //OUTPUT : Carrier sense
1513
        .led_link_2(led_link_2),                  //OUTPUT : Valid link    
1514
        .mac_rx_clk_2(mac_rx_clk_2),              //OUTPUT : Av-ST Rx Clock
1515
        .mac_tx_clk_2(mac_tx_clk_2),              //OUTPUT : Av-ST Tx Clock
1516
        .data_rx_sop_2(data_rx_sop_2),            //OUTPUT : Start of Packet
1517
        .data_rx_eop_2(data_rx_eop_2),            //OUTPUT : End of Packet
1518
        .data_rx_data_2(data_rx_data_2),          //OUTPUT : Data from FIFO
1519
        .data_rx_error_2(data_rx_error_2),        //OUTPUT : Receive packet error
1520
        .data_rx_valid_2(data_rx_valid_2),        //OUTPUT : Data Receive FIFO Valid
1521
        .data_rx_ready_2(data_rx_ready_2),        //OUTPUT : Data Receive Ready
1522
        .pkt_class_data_2(pkt_class_data_2),      //OUTPUT : Frame Type Indication
1523
        .pkt_class_valid_2(pkt_class_valid_2),    //OUTPUT : Frame Type Indication Valid
1524
        .data_tx_error_2(data_tx_error_2),        //INPUT  : Status
1525
        .data_tx_data_2(data_tx_data_2),          //INPUT  : Data from FIFO transmit
1526
        .data_tx_valid_2(data_tx_valid_2),        //INPUT  : Data FIFO transmit Empty
1527
        .data_tx_sop_2(data_tx_sop_2),            //INPUT  : Start of Packet
1528
        .data_tx_eop_2(data_tx_eop_2),            //INPUT  : End of Packet
1529
        .data_tx_ready_2(data_tx_ready_2),        //OUTPUT : Data FIFO transmit Read Enable  
1530
        .tx_ff_uflow_2(tx_ff_uflow_2),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1531
        .tx_crc_fwd_2(tx_crc_fwd_2),              //INPUT  : Forward Current Frame with CRC from Application
1532
        .xoff_gen_2(xoff_gen_2),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1533
        .xon_gen_2(xon_gen_2),                    //INPUT  : XON PAUSE FRAME GENERATE
1534
        .magic_sleep_n_2(magic_sleep_n_2),        //INPUT  : MAC SLEEP MODE CONTROL
1535
        .magic_wakeup_2(magic_wakeup_2),          //OUTPUT : MAC WAKE-UP INDICATION
1536
 
1537
         // Channel 3 
1538
 
1539
        .tbi_rx_clk_3(tbi_rx_clk_3),              //INPUT  : Receive TBI Clock
1540
        .tbi_tx_clk_3(tbi_tx_clk_3),              //INPUT  : Transmit TBI Clock
1541
        .tbi_rx_d_3(tbi_rx_d_3),                  //INPUT  : Receive TBI Interface
1542
        .tbi_tx_d_3(tbi_tx_d_3),                  //OUTPUT : Transmit TBI Interface
1543
        .sd_loopback_3(sd_loopback_3),            //OUTPUT : SERDES Loopback Enable
1544
        .powerdown_3(pcs_pwrdn_out_sig[3]),       //OUTPUT : Powerdown Enable
1545
        .led_col_3(led_col_3),                    //OUTPUT : Collision Indication
1546
        .led_an_3(led_an_3),                      //OUTPUT : Auto Negotiation Status
1547
        .led_char_err_3(led_char_err_3),          //OUTPUT : Character error
1548
        .led_disp_err_3(led_disp_err_3),          //OUTPUT : Disparity error
1549
        .led_crs_3(led_crs_3),                    //OUTPUT : Carrier sense
1550
        .led_link_3(led_link_3),                  //OUTPUT : Valid link    
1551
        .mac_rx_clk_3(mac_rx_clk_3),              //OUTPUT : Av-ST Rx Clock
1552
        .mac_tx_clk_3(mac_tx_clk_3),              //OUTPUT : Av-ST Tx Clock
1553
        .data_rx_sop_3(data_rx_sop_3),            //OUTPUT : Start of Packet
1554
        .data_rx_eop_3(data_rx_eop_3),            //OUTPUT : End of Packet
1555
        .data_rx_data_3(data_rx_data_3),          //OUTPUT : Data from FIFO
1556
        .data_rx_error_3(data_rx_error_3),        //OUTPUT : Receive packet error
1557
        .data_rx_valid_3(data_rx_valid_3),        //OUTPUT : Data Receive FIFO Valid
1558
        .data_rx_ready_3(data_rx_ready_3),        //OUTPUT : Data Receive Ready
1559
        .pkt_class_data_3(pkt_class_data_3),      //OUTPUT : Frame Type Indication
1560
        .pkt_class_valid_3(pkt_class_valid_3),    //OUTPUT : Frame Type Indication Valid
1561
        .data_tx_error_3(data_tx_error_3),        //INPUT  : Status
1562
        .data_tx_data_3(data_tx_data_3),          //INPUT  : Data from FIFO transmit
1563
        .data_tx_valid_3(data_tx_valid_3),        //INPUT  : Data FIFO transmit Empty
1564
        .data_tx_sop_3(data_tx_sop_3),            //INPUT  : Start of Packet
1565
        .data_tx_eop_3(data_tx_eop_3),            //INPUT  : End of Packet
1566
        .data_tx_ready_3(data_tx_ready_3),        //OUTPUT : Data FIFO transmit Read Enable  
1567
        .tx_ff_uflow_3(tx_ff_uflow_3),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1568
        .tx_crc_fwd_3(tx_crc_fwd_3),              //INPUT  : Forward Current Frame with CRC from Application
1569
        .xoff_gen_3(xoff_gen_3),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1570
        .xon_gen_3(xon_gen_3),                    //INPUT  : XON PAUSE FRAME GENERATE
1571
        .magic_sleep_n_3(magic_sleep_n_3),        //INPUT  : MAC SLEEP MODE CONTROL
1572
        .magic_wakeup_3(magic_wakeup_3),          //OUTPUT : MAC WAKE-UP INDICATION
1573
 
1574
         // Channel 4 
1575
 
1576
        .tbi_rx_clk_4(tbi_rx_clk_4),              //INPUT  : Receive TBI Clock
1577
        .tbi_tx_clk_4(tbi_tx_clk_4),              //INPUT  : Transmit TBI Clock
1578
        .tbi_rx_d_4(tbi_rx_d_4),                  //INPUT  : Receive TBI Interface
1579
        .tbi_tx_d_4(tbi_tx_d_4),                  //OUTPUT : Transmit TBI Interface
1580
        .sd_loopback_4(sd_loopback_4),            //OUTPUT : SERDES Loopback Enable
1581
        .powerdown_4(pcs_pwrdn_out_sig[4]),       //OUTPUT : Powerdown Enable
1582
        .led_col_4(led_col_4),                    //OUTPUT : Collision Indication
1583
        .led_an_4(led_an_4),                      //OUTPUT : Auto Negotiation Status
1584
        .led_char_err_4(led_char_err_4),          //OUTPUT : Character error
1585
        .led_disp_err_4(led_disp_err_4),          //OUTPUT : Disparity error
1586
        .led_crs_4(led_crs_4),                    //OUTPUT : Carrier sense
1587
        .led_link_4(led_link_4),                  //OUTPUT : Valid link    
1588
        .mac_rx_clk_4(mac_rx_clk_4),              //OUTPUT : Av-ST Rx Clock
1589
        .mac_tx_clk_4(mac_tx_clk_4),              //OUTPUT : Av-ST Tx Clock
1590
        .data_rx_sop_4(data_rx_sop_4),            //OUTPUT : Start of Packet
1591
        .data_rx_eop_4(data_rx_eop_4),            //OUTPUT : End of Packet
1592
        .data_rx_data_4(data_rx_data_4),          //OUTPUT : Data from FIFO
1593
        .data_rx_error_4(data_rx_error_4),        //OUTPUT : Receive packet error
1594
        .data_rx_valid_4(data_rx_valid_4),        //OUTPUT : Data Receive FIFO Valid
1595
        .data_rx_ready_4(data_rx_ready_4),        //OUTPUT : Data Receive Ready
1596
        .pkt_class_data_4(pkt_class_data_4),      //OUTPUT : Frame Type Indication
1597
        .pkt_class_valid_4(pkt_class_valid_4),    //OUTPUT : Frame Type Indication Valid
1598
        .data_tx_error_4(data_tx_error_4),        //INPUT  : Status
1599
        .data_tx_data_4(data_tx_data_4),          //INPUT  : Data from FIFO transmit
1600
        .data_tx_valid_4(data_tx_valid_4),        //INPUT  : Data FIFO transmit Empty
1601
        .data_tx_sop_4(data_tx_sop_4),            //INPUT  : Start of Packet
1602
        .data_tx_eop_4(data_tx_eop_4),            //INPUT  : End of Packet
1603
        .data_tx_ready_4(data_tx_ready_4),        //OUTPUT : Data FIFO transmit Read Enable  
1604
        .tx_ff_uflow_4(tx_ff_uflow_4),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1605
        .tx_crc_fwd_4(tx_crc_fwd_4),              //INPUT  : Forward Current Frame with CRC from Application
1606
        .xoff_gen_4(xoff_gen_4),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1607
        .xon_gen_4(xon_gen_4),                    //INPUT  : XON PAUSE FRAME GENERATE
1608
        .magic_sleep_n_4(magic_sleep_n_4),        //INPUT  : MAC SLEEP MODE CONTROL
1609
        .magic_wakeup_4(magic_wakeup_4),          //OUTPUT : MAC WAKE-UP INDICATION
1610
 
1611
         // Channel 5 
1612
 
1613
        .tbi_rx_clk_5(tbi_rx_clk_5),              //INPUT  : Receive TBI Clock
1614
        .tbi_tx_clk_5(tbi_tx_clk_5),              //INPUT  : Transmit TBI Clock
1615
        .tbi_rx_d_5(tbi_rx_d_5),                  //INPUT  : Receive TBI Interface
1616
        .tbi_tx_d_5(tbi_tx_d_5),                  //OUTPUT : Transmit TBI Interface
1617
        .sd_loopback_5(sd_loopback_5),            //OUTPUT : SERDES Loopback Enable
1618
        .powerdown_5(pcs_pwrdn_out_sig[5]),       //OUTPUT : Powerdown Enable
1619
        .led_col_5(led_col_5),                    //OUTPUT : Collision Indication
1620
        .led_an_5(led_an_5),                      //OUTPUT : Auto Negotiation Status
1621
        .led_char_err_5(led_char_err_5),          //OUTPUT : Character error
1622
        .led_disp_err_5(led_disp_err_5),          //OUTPUT : Disparity error
1623
        .led_crs_5(led_crs_5),                    //OUTPUT : Carrier sense
1624
        .led_link_5(led_link_5),                  //OUTPUT : Valid link    
1625
        .mac_rx_clk_5(mac_rx_clk_5),              //OUTPUT : Av-ST Rx Clock
1626
        .mac_tx_clk_5(mac_tx_clk_5),              //OUTPUT : Av-ST Tx Clock
1627
        .data_rx_sop_5(data_rx_sop_5),            //OUTPUT : Start of Packet
1628
        .data_rx_eop_5(data_rx_eop_5),            //OUTPUT : End of Packet
1629
        .data_rx_data_5(data_rx_data_5),          //OUTPUT : Data from FIFO
1630
        .data_rx_error_5(data_rx_error_5),        //OUTPUT : Receive packet error
1631
        .data_rx_valid_5(data_rx_valid_5),        //OUTPUT : Data Receive FIFO Valid
1632
        .data_rx_ready_5(data_rx_ready_5),        //OUTPUT : Data Receive Ready
1633
        .pkt_class_data_5(pkt_class_data_5),      //OUTPUT : Frame Type Indication
1634
        .pkt_class_valid_5(pkt_class_valid_5),    //OUTPUT : Frame Type Indication Valid
1635
        .data_tx_error_5(data_tx_error_5),        //INPUT  : Status
1636
        .data_tx_data_5(data_tx_data_5),          //INPUT  : Data from FIFO transmit
1637
        .data_tx_valid_5(data_tx_valid_5),        //INPUT  : Data FIFO transmit Empty
1638
        .data_tx_sop_5(data_tx_sop_5),            //INPUT  : Start of Packet
1639
        .data_tx_eop_5(data_tx_eop_5),            //INPUT  : End of Packet
1640
        .data_tx_ready_5(data_tx_ready_5),        //OUTPUT : Data FIFO transmit Read Enable  
1641
        .tx_ff_uflow_5(tx_ff_uflow_5),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1642
        .tx_crc_fwd_5(tx_crc_fwd_5),              //INPUT  : Forward Current Frame with CRC from Application
1643
        .xoff_gen_5(xoff_gen_5),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1644
        .xon_gen_5(xon_gen_5),                    //INPUT  : XON PAUSE FRAME GENERATE
1645
        .magic_sleep_n_5(magic_sleep_n_5),        //INPUT  : MAC SLEEP MODE CONTROL
1646
        .magic_wakeup_5(magic_wakeup_5),          //OUTPUT : MAC WAKE-UP INDICATION
1647
 
1648
         // Channel 6 
1649
 
1650
        .tbi_rx_clk_6(tbi_rx_clk_6),              //INPUT  : Receive TBI Clock
1651
        .tbi_tx_clk_6(tbi_tx_clk_6),              //INPUT  : Transmit TBI Clock
1652
        .tbi_rx_d_6(tbi_rx_d_6),                  //INPUT  : Receive TBI Interface
1653
        .tbi_tx_d_6(tbi_tx_d_6),                  //OUTPUT : Transmit TBI Interface
1654
        .sd_loopback_6(sd_loopback_6),            //OUTPUT : SERDES Loopback Enable
1655
        .powerdown_6(pcs_pwrdn_out_sig[6]),       //OUTPUT : Powerdown Enable
1656
        .led_col_6(led_col_6),                    //OUTPUT : Collision Indication
1657
        .led_an_6(led_an_6),                      //OUTPUT : Auto Negotiation Status
1658
        .led_char_err_6(led_char_err_6),          //OUTPUT : Character error
1659
        .led_disp_err_6(led_disp_err_6),          //OUTPUT : Disparity error
1660
        .led_crs_6(led_crs_6),                    //OUTPUT : Carrier sense
1661
        .led_link_6(led_link_6),                  //OUTPUT : Valid link    
1662
        .mac_rx_clk_6(mac_rx_clk_6),              //OUTPUT : Av-ST Rx Clock
1663
        .mac_tx_clk_6(mac_tx_clk_6),              //OUTPUT : Av-ST Tx Clock
1664
        .data_rx_sop_6(data_rx_sop_6),            //OUTPUT : Start of Packet
1665
        .data_rx_eop_6(data_rx_eop_6),            //OUTPUT : End of Packet
1666
        .data_rx_data_6(data_rx_data_6),          //OUTPUT : Data from FIFO
1667
        .data_rx_error_6(data_rx_error_6),        //OUTPUT : Receive packet error
1668
        .data_rx_valid_6(data_rx_valid_6),        //OUTPUT : Data Receive FIFO Valid
1669
        .data_rx_ready_6(data_rx_ready_6),        //OUTPUT : Data Receive Ready
1670
        .pkt_class_data_6(pkt_class_data_6),      //OUTPUT : Frame Type Indication
1671
        .pkt_class_valid_6(pkt_class_valid_6),    //OUTPUT : Frame Type Indication Valid
1672
        .data_tx_error_6(data_tx_error_6),        //INPUT  : Status
1673
        .data_tx_data_6(data_tx_data_6),          //INPUT  : Data from FIFO transmit
1674
        .data_tx_valid_6(data_tx_valid_6),        //INPUT  : Data FIFO transmit Empty
1675
        .data_tx_sop_6(data_tx_sop_6),            //INPUT  : Start of Packet
1676
        .data_tx_eop_6(data_tx_eop_6),            //INPUT  : End of Packet
1677
        .data_tx_ready_6(data_tx_ready_6),        //OUTPUT : Data FIFO transmit Read Enable  
1678
        .tx_ff_uflow_6(tx_ff_uflow_6),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1679
        .tx_crc_fwd_6(tx_crc_fwd_6),              //INPUT  : Forward Current Frame with CRC from Application
1680
        .xoff_gen_6(xoff_gen_6),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1681
        .xon_gen_6(xon_gen_6),                    //INPUT  : XON PAUSE FRAME GENERATE
1682
        .magic_sleep_n_6(magic_sleep_n_6),        //INPUT  : MAC SLEEP MODE CONTROL
1683
        .magic_wakeup_6(magic_wakeup_6),          //OUTPUT : MAC WAKE-UP INDICATION
1684
 
1685
         // Channel 7 
1686
 
1687
        .tbi_rx_clk_7(tbi_rx_clk_7),              //INPUT  : Receive TBI Clock
1688
        .tbi_tx_clk_7(tbi_tx_clk_7),              //INPUT  : Transmit TBI Clock
1689
        .tbi_rx_d_7(tbi_rx_d_7),                  //INPUT  : Receive TBI Interface
1690
        .tbi_tx_d_7(tbi_tx_d_7),                  //OUTPUT : Transmit TBI Interface
1691
        .sd_loopback_7(sd_loopback_7),            //OUTPUT : SERDES Loopback Enable
1692
        .powerdown_7(pcs_pwrdn_out_sig[7]),       //OUTPUT : Powerdown Enable
1693
        .led_col_7(led_col_7),                    //OUTPUT : Collision Indication
1694
        .led_an_7(led_an_7),                      //OUTPUT : Auto Negotiation Status
1695
        .led_char_err_7(led_char_err_7),          //OUTPUT : Character error
1696
        .led_disp_err_7(led_disp_err_7),          //OUTPUT : Disparity error
1697
        .led_crs_7(led_crs_7),                    //OUTPUT : Carrier sense
1698
        .led_link_7(led_link_7),                  //OUTPUT : Valid link    
1699
        .mac_rx_clk_7(mac_rx_clk_7),              //OUTPUT : Av-ST Rx Clock
1700
        .mac_tx_clk_7(mac_tx_clk_7),              //OUTPUT : Av-ST Tx Clock
1701
        .data_rx_sop_7(data_rx_sop_7),            //OUTPUT : Start of Packet
1702
        .data_rx_eop_7(data_rx_eop_7),            //OUTPUT : End of Packet
1703
        .data_rx_data_7(data_rx_data_7),          //OUTPUT : Data from FIFO
1704
        .data_rx_error_7(data_rx_error_7),        //OUTPUT : Receive packet error
1705
        .data_rx_valid_7(data_rx_valid_7),        //OUTPUT : Data Receive FIFO Valid
1706
        .data_rx_ready_7(data_rx_ready_7),        //OUTPUT : Data Receive Ready
1707
        .pkt_class_data_7(pkt_class_data_7),      //OUTPUT : Frame Type Indication
1708
        .pkt_class_valid_7(pkt_class_valid_7),    //OUTPUT : Frame Type Indication Valid
1709
        .data_tx_error_7(data_tx_error_7),        //INPUT  : Status
1710
        .data_tx_data_7(data_tx_data_7),          //INPUT  : Data from FIFO transmit
1711
        .data_tx_valid_7(data_tx_valid_7),        //INPUT  : Data FIFO transmit Empty
1712
        .data_tx_sop_7(data_tx_sop_7),            //INPUT  : Start of Packet
1713
        .data_tx_eop_7(data_tx_eop_7),            //INPUT  : End of Packet
1714
        .data_tx_ready_7(data_tx_ready_7),        //OUTPUT : Data FIFO transmit Read Enable  
1715
        .tx_ff_uflow_7(tx_ff_uflow_7),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1716
        .tx_crc_fwd_7(tx_crc_fwd_7),              //INPUT  : Forward Current Frame with CRC from Application
1717
        .xoff_gen_7(xoff_gen_7),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1718
        .xon_gen_7(xon_gen_7),                    //INPUT  : XON PAUSE FRAME GENERATE
1719
        .magic_sleep_n_7(magic_sleep_n_7),        //INPUT  : MAC SLEEP MODE CONTROL
1720
        .magic_wakeup_7(magic_wakeup_7),          //OUTPUT : MAC WAKE-UP INDICATION
1721
 
1722
         // Channel 8 
1723
 
1724
        .tbi_rx_clk_8(tbi_rx_clk_8),              //INPUT  : Receive TBI Clock
1725
        .tbi_tx_clk_8(tbi_tx_clk_8),              //INPUT  : Transmit TBI Clock
1726
        .tbi_rx_d_8(tbi_rx_d_8),                  //INPUT  : Receive TBI Interface
1727
        .tbi_tx_d_8(tbi_tx_d_8),                  //OUTPUT : Transmit TBI Interface
1728
        .sd_loopback_8(sd_loopback_8),            //OUTPUT : SERDES Loopback Enable
1729
        .powerdown_8(pcs_pwrdn_out_sig[8]),       //OUTPUT : Powerdown Enable
1730
        .led_col_8(led_col_8),                    //OUTPUT : Collision Indication
1731
        .led_an_8(led_an_8),                      //OUTPUT : Auto Negotiation Status
1732
        .led_char_err_8(led_char_err_8),          //OUTPUT : Character error
1733
        .led_disp_err_8(led_disp_err_8),          //OUTPUT : Disparity error
1734
        .led_crs_8(led_crs_8),                    //OUTPUT : Carrier sense
1735
        .led_link_8(led_link_8),                  //OUTPUT : Valid link    
1736
        .mac_rx_clk_8(mac_rx_clk_8),              //OUTPUT : Av-ST Rx Clock
1737
        .mac_tx_clk_8(mac_tx_clk_8),              //OUTPUT : Av-ST Tx Clock
1738
        .data_rx_sop_8(data_rx_sop_8),            //OUTPUT : Start of Packet
1739
        .data_rx_eop_8(data_rx_eop_8),            //OUTPUT : End of Packet
1740
        .data_rx_data_8(data_rx_data_8),          //OUTPUT : Data from FIFO
1741
        .data_rx_error_8(data_rx_error_8),        //OUTPUT : Receive packet error
1742
        .data_rx_valid_8(data_rx_valid_8),        //OUTPUT : Data Receive FIFO Valid
1743
        .data_rx_ready_8(data_rx_ready_8),        //OUTPUT : Data Receive Ready
1744
        .pkt_class_data_8(pkt_class_data_8),      //OUTPUT : Frame Type Indication
1745
        .pkt_class_valid_8(pkt_class_valid_8),    //OUTPUT : Frame Type Indication Valid
1746
        .data_tx_error_8(data_tx_error_8),        //INPUT  : Status
1747
        .data_tx_data_8(data_tx_data_8),          //INPUT  : Data from FIFO transmit
1748
        .data_tx_valid_8(data_tx_valid_8),        //INPUT  : Data FIFO transmit Empty
1749
        .data_tx_sop_8(data_tx_sop_8),            //INPUT  : Start of Packet
1750
        .data_tx_eop_8(data_tx_eop_8),            //INPUT  : End of Packet
1751
        .data_tx_ready_8(data_tx_ready_8),        //OUTPUT : Data FIFO transmit Read Enable  
1752
        .tx_ff_uflow_8(tx_ff_uflow_8),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1753
        .tx_crc_fwd_8(tx_crc_fwd_8),              //INPUT  : Forward Current Frame with CRC from Application
1754
        .xoff_gen_8(xoff_gen_8),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1755
        .xon_gen_8(xon_gen_8),                    //INPUT  : XON PAUSE FRAME GENERATE
1756
        .magic_sleep_n_8(magic_sleep_n_8),        //INPUT  : MAC SLEEP MODE CONTROL
1757
        .magic_wakeup_8(magic_wakeup_8),          //OUTPUT : MAC WAKE-UP INDICATION
1758
 
1759
         // Channel 9 
1760
 
1761
        .tbi_rx_clk_9(tbi_rx_clk_9),              //INPUT  : Receive TBI Clock
1762
        .tbi_tx_clk_9(tbi_tx_clk_9),              //INPUT  : Transmit TBI Clock
1763
        .tbi_rx_d_9(tbi_rx_d_9),                  //INPUT  : Receive TBI Interface
1764
        .tbi_tx_d_9(tbi_tx_d_9),                  //OUTPUT : Transmit TBI Interface
1765
        .sd_loopback_9(sd_loopback_9),            //OUTPUT : SERDES Loopback Enable
1766
        .powerdown_9(pcs_pwrdn_out_sig[9]),       //OUTPUT : Powerdown Enable
1767
        .led_col_9(led_col_9),                    //OUTPUT : Collision Indication
1768
        .led_an_9(led_an_9),                      //OUTPUT : Auto Negotiation Status
1769
        .led_char_err_9(led_char_err_9),          //OUTPUT : Character error
1770
        .led_disp_err_9(led_disp_err_9),          //OUTPUT : Disparity error
1771
        .led_crs_9(led_crs_9),                    //OUTPUT : Carrier sense
1772
        .led_link_9(led_link_9),                  //OUTPUT : Valid link    
1773
        .mac_rx_clk_9(mac_rx_clk_9),              //OUTPUT : Av-ST Rx Clock
1774
        .mac_tx_clk_9(mac_tx_clk_9),              //OUTPUT : Av-ST Tx Clock
1775
        .data_rx_sop_9(data_rx_sop_9),            //OUTPUT : Start of Packet
1776
        .data_rx_eop_9(data_rx_eop_9),            //OUTPUT : End of Packet
1777
        .data_rx_data_9(data_rx_data_9),          //OUTPUT : Data from FIFO
1778
        .data_rx_error_9(data_rx_error_9),        //OUTPUT : Receive packet error
1779
        .data_rx_valid_9(data_rx_valid_9),        //OUTPUT : Data Receive FIFO Valid
1780
        .data_rx_ready_9(data_rx_ready_9),        //OUTPUT : Data Receive Ready
1781
        .pkt_class_data_9(pkt_class_data_9),      //OUTPUT : Frame Type Indication
1782
        .pkt_class_valid_9(pkt_class_valid_9),    //OUTPUT : Frame Type Indication Valid
1783
        .data_tx_error_9(data_tx_error_9),        //INPUT  : Status
1784
        .data_tx_data_9(data_tx_data_9),          //INPUT  : Data from FIFO transmit
1785
        .data_tx_valid_9(data_tx_valid_9),        //INPUT  : Data FIFO transmit Empty
1786
        .data_tx_sop_9(data_tx_sop_9),            //INPUT  : Start of Packet
1787
        .data_tx_eop_9(data_tx_eop_9),            //INPUT  : End of Packet
1788
        .data_tx_ready_9(data_tx_ready_9),        //OUTPUT : Data FIFO transmit Read Enable  
1789
        .tx_ff_uflow_9(tx_ff_uflow_9),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1790
        .tx_crc_fwd_9(tx_crc_fwd_9),              //INPUT  : Forward Current Frame with CRC from Application
1791
        .xoff_gen_9(xoff_gen_9),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1792
        .xon_gen_9(xon_gen_9),                    //INPUT  : XON PAUSE FRAME GENERATE
1793
        .magic_sleep_n_9(magic_sleep_n_9),        //INPUT  : MAC SLEEP MODE CONTROL
1794
        .magic_wakeup_9(magic_wakeup_9),          //OUTPUT : MAC WAKE-UP INDICATION
1795
 
1796
         // Channel 10 
1797
 
1798
        .tbi_rx_clk_10(tbi_rx_clk_10),              //INPUT  : Receive TBI Clock
1799
        .tbi_tx_clk_10(tbi_tx_clk_10),              //INPUT  : Transmit TBI Clock
1800
        .tbi_rx_d_10(tbi_rx_d_10),                  //INPUT  : Receive TBI Interface
1801
        .tbi_tx_d_10(tbi_tx_d_10),                  //OUTPUT : Transmit TBI Interface
1802
        .sd_loopback_10(sd_loopback_10),            //OUTPUT : SERDES Loopback Enable
1803
        .powerdown_10(pcs_pwrdn_out_sig[10]),       //OUTPUT : Powerdown Enable
1804
        .led_col_10(led_col_10),                    //OUTPUT : Collision Indication
1805
        .led_an_10(led_an_10),                      //OUTPUT : Auto Negotiation Status
1806
        .led_char_err_10(led_char_err_10),          //OUTPUT : Character error
1807
        .led_disp_err_10(led_disp_err_10),          //OUTPUT : Disparity error
1808
        .led_crs_10(led_crs_10),                    //OUTPUT : Carrier sense
1809
        .led_link_10(led_link_10),                  //OUTPUT : Valid link    
1810
        .mac_rx_clk_10(mac_rx_clk_10),              //OUTPUT : Av-ST Rx Clock
1811
        .mac_tx_clk_10(mac_tx_clk_10),              //OUTPUT : Av-ST Tx Clock
1812
        .data_rx_sop_10(data_rx_sop_10),            //OUTPUT : Start of Packet
1813
        .data_rx_eop_10(data_rx_eop_10),            //OUTPUT : End of Packet
1814
        .data_rx_data_10(data_rx_data_10),          //OUTPUT : Data from FIFO
1815
        .data_rx_error_10(data_rx_error_10),        //OUTPUT : Receive packet error
1816
        .data_rx_valid_10(data_rx_valid_10),        //OUTPUT : Data Receive FIFO Valid
1817
        .data_rx_ready_10(data_rx_ready_10),        //OUTPUT : Data Receive Ready
1818
        .pkt_class_data_10(pkt_class_data_10),      //OUTPUT : Frame Type Indication
1819
        .pkt_class_valid_10(pkt_class_valid_10),    //OUTPUT : Frame Type Indication Valid
1820
        .data_tx_error_10(data_tx_error_10),        //INPUT  : Status
1821
        .data_tx_data_10(data_tx_data_10),          //INPUT  : Data from FIFO transmit
1822
        .data_tx_valid_10(data_tx_valid_10),        //INPUT  : Data FIFO transmit Empty
1823
        .data_tx_sop_10(data_tx_sop_10),            //INPUT  : Start of Packet
1824
        .data_tx_eop_10(data_tx_eop_10),            //INPUT  : End of Packet
1825
        .data_tx_ready_10(data_tx_ready_10),        //OUTPUT : Data FIFO transmit Read Enable  
1826
        .tx_ff_uflow_10(tx_ff_uflow_10),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1827
        .tx_crc_fwd_10(tx_crc_fwd_10),              //INPUT  : Forward Current Frame with CRC from Application
1828
        .xoff_gen_10(xoff_gen_10),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1829
        .xon_gen_10(xon_gen_10),                    //INPUT  : XON PAUSE FRAME GENERATE
1830
        .magic_sleep_n_10(magic_sleep_n_10),        //INPUT  : MAC SLEEP MODE CONTROL
1831
        .magic_wakeup_10(magic_wakeup_10),          //OUTPUT : MAC WAKE-UP INDICATION
1832
 
1833
         // Channel 11 
1834
 
1835
        .tbi_rx_clk_11(tbi_rx_clk_11),              //INPUT  : Receive TBI Clock
1836
        .tbi_tx_clk_11(tbi_tx_clk_11),              //INPUT  : Transmit TBI Clock
1837
        .tbi_rx_d_11(tbi_rx_d_11),                  //INPUT  : Receive TBI Interface
1838
        .tbi_tx_d_11(tbi_tx_d_11),                  //OUTPUT : Transmit TBI Interface
1839
        .sd_loopback_11(sd_loopback_11),            //OUTPUT : SERDES Loopback Enable
1840
        .powerdown_11(pcs_pwrdn_out_sig[11]),       //OUTPUT : Powerdown Enable
1841
        .led_col_11(led_col_11),                    //OUTPUT : Collision Indication
1842
        .led_an_11(led_an_11),                      //OUTPUT : Auto Negotiation Status
1843
        .led_char_err_11(led_char_err_11),          //OUTPUT : Character error
1844
        .led_disp_err_11(led_disp_err_11),          //OUTPUT : Disparity error
1845
        .led_crs_11(led_crs_11),                    //OUTPUT : Carrier sense
1846
        .led_link_11(led_link_11),                  //OUTPUT : Valid link    
1847
        .mac_rx_clk_11(mac_rx_clk_11),              //OUTPUT : Av-ST Rx Clock
1848
        .mac_tx_clk_11(mac_tx_clk_11),              //OUTPUT : Av-ST Tx Clock
1849
        .data_rx_sop_11(data_rx_sop_11),            //OUTPUT : Start of Packet
1850
        .data_rx_eop_11(data_rx_eop_11),            //OUTPUT : End of Packet
1851
        .data_rx_data_11(data_rx_data_11),          //OUTPUT : Data from FIFO
1852
        .data_rx_error_11(data_rx_error_11),        //OUTPUT : Receive packet error
1853
        .data_rx_valid_11(data_rx_valid_11),        //OUTPUT : Data Receive FIFO Valid
1854
        .data_rx_ready_11(data_rx_ready_11),        //OUTPUT : Data Receive Ready
1855
        .pkt_class_data_11(pkt_class_data_11),      //OUTPUT : Frame Type Indication
1856
        .pkt_class_valid_11(pkt_class_valid_11),    //OUTPUT : Frame Type Indication Valid
1857
        .data_tx_error_11(data_tx_error_11),        //INPUT  : Status
1858
        .data_tx_data_11(data_tx_data_11),          //INPUT  : Data from FIFO transmit
1859
        .data_tx_valid_11(data_tx_valid_11),        //INPUT  : Data FIFO transmit Empty
1860
        .data_tx_sop_11(data_tx_sop_11),            //INPUT  : Start of Packet
1861
        .data_tx_eop_11(data_tx_eop_11),            //INPUT  : End of Packet
1862
        .data_tx_ready_11(data_tx_ready_11),        //OUTPUT : Data FIFO transmit Read Enable  
1863
        .tx_ff_uflow_11(tx_ff_uflow_11),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1864
        .tx_crc_fwd_11(tx_crc_fwd_11),              //INPUT  : Forward Current Frame with CRC from Application
1865
        .xoff_gen_11(xoff_gen_11),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1866
        .xon_gen_11(xon_gen_11),                    //INPUT  : XON PAUSE FRAME GENERATE
1867
        .magic_sleep_n_11(magic_sleep_n_11),        //INPUT  : MAC SLEEP MODE CONTROL
1868
        .magic_wakeup_11(magic_wakeup_11),          //OUTPUT : MAC WAKE-UP INDICATION
1869
 
1870
         // Channel 12 
1871
 
1872
        .tbi_rx_clk_12(tbi_rx_clk_12),              //INPUT  : Receive TBI Clock
1873
        .tbi_tx_clk_12(tbi_tx_clk_12),              //INPUT  : Transmit TBI Clock
1874
        .tbi_rx_d_12(tbi_rx_d_12),                  //INPUT  : Receive TBI Interface
1875
        .tbi_tx_d_12(tbi_tx_d_12),                  //OUTPUT : Transmit TBI Interface
1876
        .sd_loopback_12(sd_loopback_12),            //OUTPUT : SERDES Loopback Enable
1877
        .powerdown_12(pcs_pwrdn_out_sig[12]),       //OUTPUT : Powerdown Enable
1878
        .led_col_12(led_col_12),                    //OUTPUT : Collision Indication
1879
        .led_an_12(led_an_12),                      //OUTPUT : Auto Negotiation Status
1880
        .led_char_err_12(led_char_err_12),          //OUTPUT : Character error
1881
        .led_disp_err_12(led_disp_err_12),          //OUTPUT : Disparity error
1882
        .led_crs_12(led_crs_12),                    //OUTPUT : Carrier sense
1883
        .led_link_12(led_link_12),                  //OUTPUT : Valid link    
1884
        .mac_rx_clk_12(mac_rx_clk_12),              //OUTPUT : Av-ST Rx Clock
1885
        .mac_tx_clk_12(mac_tx_clk_12),              //OUTPUT : Av-ST Tx Clock
1886
        .data_rx_sop_12(data_rx_sop_12),            //OUTPUT : Start of Packet
1887
        .data_rx_eop_12(data_rx_eop_12),            //OUTPUT : End of Packet
1888
        .data_rx_data_12(data_rx_data_12),          //OUTPUT : Data from FIFO
1889
        .data_rx_error_12(data_rx_error_12),        //OUTPUT : Receive packet error
1890
        .data_rx_valid_12(data_rx_valid_12),        //OUTPUT : Data Receive FIFO Valid
1891
        .data_rx_ready_12(data_rx_ready_12),        //OUTPUT : Data Receive Ready
1892
        .pkt_class_data_12(pkt_class_data_12),      //OUTPUT : Frame Type Indication
1893
        .pkt_class_valid_12(pkt_class_valid_12),    //OUTPUT : Frame Type Indication Valid
1894
        .data_tx_error_12(data_tx_error_12),        //INPUT  : Status
1895
        .data_tx_data_12(data_tx_data_12),          //INPUT  : Data from FIFO transmit
1896
        .data_tx_valid_12(data_tx_valid_12),        //INPUT  : Data FIFO transmit Empty
1897
        .data_tx_sop_12(data_tx_sop_12),            //INPUT  : Start of Packet
1898
        .data_tx_eop_12(data_tx_eop_12),            //INPUT  : End of Packet
1899
        .data_tx_ready_12(data_tx_ready_12),        //OUTPUT : Data FIFO transmit Read Enable  
1900
        .tx_ff_uflow_12(tx_ff_uflow_12),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1901
        .tx_crc_fwd_12(tx_crc_fwd_12),              //INPUT  : Forward Current Frame with CRC from Application
1902
        .xoff_gen_12(xoff_gen_12),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1903
        .xon_gen_12(xon_gen_12),                    //INPUT  : XON PAUSE FRAME GENERATE
1904
        .magic_sleep_n_12(magic_sleep_n_12),        //INPUT  : MAC SLEEP MODE CONTROL
1905
        .magic_wakeup_12(magic_wakeup_12),          //OUTPUT : MAC WAKE-UP INDICATION
1906
 
1907
         // Channel 13 
1908
 
1909
        .tbi_rx_clk_13(tbi_rx_clk_13),              //INPUT  : Receive TBI Clock
1910
        .tbi_tx_clk_13(tbi_tx_clk_13),              //INPUT  : Transmit TBI Clock
1911
        .tbi_rx_d_13(tbi_rx_d_13),                  //INPUT  : Receive TBI Interface
1912
        .tbi_tx_d_13(tbi_tx_d_13),                  //OUTPUT : Transmit TBI Interface
1913
        .sd_loopback_13(sd_loopback_13),            //OUTPUT : SERDES Loopback Enable
1914
        .powerdown_13(pcs_pwrdn_out_sig[13]),       //OUTPUT : Powerdown Enable
1915
        .led_col_13(led_col_13),                    //OUTPUT : Collision Indication
1916
        .led_an_13(led_an_13),                      //OUTPUT : Auto Negotiation Status
1917
        .led_char_err_13(led_char_err_13),          //OUTPUT : Character error
1918
        .led_disp_err_13(led_disp_err_13),          //OUTPUT : Disparity error
1919
        .led_crs_13(led_crs_13),                    //OUTPUT : Carrier sense
1920
        .led_link_13(led_link_13),                  //OUTPUT : Valid link    
1921
        .mac_rx_clk_13(mac_rx_clk_13),              //OUTPUT : Av-ST Rx Clock
1922
        .mac_tx_clk_13(mac_tx_clk_13),              //OUTPUT : Av-ST Tx Clock
1923
        .data_rx_sop_13(data_rx_sop_13),            //OUTPUT : Start of Packet
1924
        .data_rx_eop_13(data_rx_eop_13),            //OUTPUT : End of Packet
1925
        .data_rx_data_13(data_rx_data_13),          //OUTPUT : Data from FIFO
1926
        .data_rx_error_13(data_rx_error_13),        //OUTPUT : Receive packet error
1927
        .data_rx_valid_13(data_rx_valid_13),        //OUTPUT : Data Receive FIFO Valid
1928
        .data_rx_ready_13(data_rx_ready_13),        //OUTPUT : Data Receive Ready
1929
        .pkt_class_data_13(pkt_class_data_13),      //OUTPUT : Frame Type Indication
1930
        .pkt_class_valid_13(pkt_class_valid_13),    //OUTPUT : Frame Type Indication Valid
1931
        .data_tx_error_13(data_tx_error_13),        //INPUT  : Status
1932
        .data_tx_data_13(data_tx_data_13),          //INPUT  : Data from FIFO transmit
1933
        .data_tx_valid_13(data_tx_valid_13),        //INPUT  : Data FIFO transmit Empty
1934
        .data_tx_sop_13(data_tx_sop_13),            //INPUT  : Start of Packet
1935
        .data_tx_eop_13(data_tx_eop_13),            //INPUT  : End of Packet
1936
        .data_tx_ready_13(data_tx_ready_13),        //OUTPUT : Data FIFO transmit Read Enable  
1937
        .tx_ff_uflow_13(tx_ff_uflow_13),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1938
        .tx_crc_fwd_13(tx_crc_fwd_13),              //INPUT  : Forward Current Frame with CRC from Application
1939
        .xoff_gen_13(xoff_gen_13),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1940
        .xon_gen_13(xon_gen_13),                    //INPUT  : XON PAUSE FRAME GENERATE
1941
        .magic_sleep_n_13(magic_sleep_n_13),        //INPUT  : MAC SLEEP MODE CONTROL
1942
        .magic_wakeup_13(magic_wakeup_13),          //OUTPUT : MAC WAKE-UP INDICATION
1943
 
1944
         // Channel 14 
1945
 
1946
        .tbi_rx_clk_14(tbi_rx_clk_14),              //INPUT  : Receive TBI Clock
1947
        .tbi_tx_clk_14(tbi_tx_clk_14),              //INPUT  : Transmit TBI Clock
1948
        .tbi_rx_d_14(tbi_rx_d_14),                  //INPUT  : Receive TBI Interface
1949
        .tbi_tx_d_14(tbi_tx_d_14),                  //OUTPUT : Transmit TBI Interface
1950
        .sd_loopback_14(sd_loopback_14),            //OUTPUT : SERDES Loopback Enable
1951
        .powerdown_14(pcs_pwrdn_out_sig[14]),       //OUTPUT : Powerdown Enable
1952
        .led_col_14(led_col_14),                    //OUTPUT : Collision Indication
1953
        .led_an_14(led_an_14),                      //OUTPUT : Auto Negotiation Status
1954
        .led_char_err_14(led_char_err_14),          //OUTPUT : Character error
1955
        .led_disp_err_14(led_disp_err_14),          //OUTPUT : Disparity error
1956
        .led_crs_14(led_crs_14),                    //OUTPUT : Carrier sense
1957
        .led_link_14(led_link_14),                  //OUTPUT : Valid link    
1958
        .mac_rx_clk_14(mac_rx_clk_14),              //OUTPUT : Av-ST Rx Clock
1959
        .mac_tx_clk_14(mac_tx_clk_14),              //OUTPUT : Av-ST Tx Clock
1960
        .data_rx_sop_14(data_rx_sop_14),            //OUTPUT : Start of Packet
1961
        .data_rx_eop_14(data_rx_eop_14),            //OUTPUT : End of Packet
1962
        .data_rx_data_14(data_rx_data_14),          //OUTPUT : Data from FIFO
1963
        .data_rx_error_14(data_rx_error_14),        //OUTPUT : Receive packet error
1964
        .data_rx_valid_14(data_rx_valid_14),        //OUTPUT : Data Receive FIFO Valid
1965
        .data_rx_ready_14(data_rx_ready_14),        //OUTPUT : Data Receive Ready
1966
        .pkt_class_data_14(pkt_class_data_14),      //OUTPUT : Frame Type Indication
1967
        .pkt_class_valid_14(pkt_class_valid_14),    //OUTPUT : Frame Type Indication Valid
1968
        .data_tx_error_14(data_tx_error_14),        //INPUT  : Status
1969
        .data_tx_data_14(data_tx_data_14),          //INPUT  : Data from FIFO transmit
1970
        .data_tx_valid_14(data_tx_valid_14),        //INPUT  : Data FIFO transmit Empty
1971
        .data_tx_sop_14(data_tx_sop_14),            //INPUT  : Start of Packet
1972
        .data_tx_eop_14(data_tx_eop_14),            //INPUT  : End of Packet
1973
        .data_tx_ready_14(data_tx_ready_14),        //OUTPUT : Data FIFO transmit Read Enable  
1974
        .tx_ff_uflow_14(tx_ff_uflow_14),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
1975
        .tx_crc_fwd_14(tx_crc_fwd_14),              //INPUT  : Forward Current Frame with CRC from Application
1976
        .xoff_gen_14(xoff_gen_14),                  //INPUT  : XOFF PAUSE FRAME GENERATE
1977
        .xon_gen_14(xon_gen_14),                    //INPUT  : XON PAUSE FRAME GENERATE
1978
        .magic_sleep_n_14(magic_sleep_n_14),        //INPUT  : MAC SLEEP MODE CONTROL
1979
        .magic_wakeup_14(magic_wakeup_14),          //OUTPUT : MAC WAKE-UP INDICATION
1980
 
1981
         // Channel 15 
1982
 
1983
        .tbi_rx_clk_15(tbi_rx_clk_15),              //INPUT  : Receive TBI Clock
1984
        .tbi_tx_clk_15(tbi_tx_clk_15),              //INPUT  : Transmit TBI Clock
1985
        .tbi_rx_d_15(tbi_rx_d_15),                  //INPUT  : Receive TBI Interface
1986
        .tbi_tx_d_15(tbi_tx_d_15),                  //OUTPUT : Transmit TBI Interface
1987
        .sd_loopback_15(sd_loopback_15),            //OUTPUT : SERDES Loopback Enable
1988
        .powerdown_15(pcs_pwrdn_out_sig[15]),       //OUTPUT : Powerdown Enable
1989
        .led_col_15(led_col_15),                    //OUTPUT : Collision Indication
1990
        .led_an_15(led_an_15),                      //OUTPUT : Auto Negotiation Status
1991
        .led_char_err_15(led_char_err_15),          //OUTPUT : Character error
1992
        .led_disp_err_15(led_disp_err_15),          //OUTPUT : Disparity error
1993
        .led_crs_15(led_crs_15),                    //OUTPUT : Carrier sense
1994
        .led_link_15(led_link_15),                  //OUTPUT : Valid link    
1995
        .mac_rx_clk_15(mac_rx_clk_15),              //OUTPUT : Av-ST Rx Clock
1996
        .mac_tx_clk_15(mac_tx_clk_15),              //OUTPUT : Av-ST Tx Clock
1997
        .data_rx_sop_15(data_rx_sop_15),            //OUTPUT : Start of Packet
1998
        .data_rx_eop_15(data_rx_eop_15),            //OUTPUT : End of Packet
1999
        .data_rx_data_15(data_rx_data_15),          //OUTPUT : Data from FIFO
2000
        .data_rx_error_15(data_rx_error_15),        //OUTPUT : Receive packet error
2001
        .data_rx_valid_15(data_rx_valid_15),        //OUTPUT : Data Receive FIFO Valid
2002
        .data_rx_ready_15(data_rx_ready_15),        //OUTPUT : Data Receive Ready
2003
        .pkt_class_data_15(pkt_class_data_15),      //OUTPUT : Frame Type Indication
2004
        .pkt_class_valid_15(pkt_class_valid_15),    //OUTPUT : Frame Type Indication Valid
2005
        .data_tx_error_15(data_tx_error_15),        //INPUT  : Status
2006
        .data_tx_data_15(data_tx_data_15),          //INPUT  : Data from FIFO transmit
2007
        .data_tx_valid_15(data_tx_valid_15),        //INPUT  : Data FIFO transmit Empty
2008
        .data_tx_sop_15(data_tx_sop_15),            //INPUT  : Start of Packet
2009
        .data_tx_eop_15(data_tx_eop_15),            //INPUT  : End of Packet
2010
        .data_tx_ready_15(data_tx_ready_15),        //OUTPUT : Data FIFO transmit Read Enable  
2011
        .tx_ff_uflow_15(tx_ff_uflow_15),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2012
        .tx_crc_fwd_15(tx_crc_fwd_15),              //INPUT  : Forward Current Frame with CRC from Application
2013
        .xoff_gen_15(xoff_gen_15),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2014
        .xon_gen_15(xon_gen_15),                    //INPUT  : XON PAUSE FRAME GENERATE
2015
        .magic_sleep_n_15(magic_sleep_n_15),        //INPUT  : MAC SLEEP MODE CONTROL
2016
        .magic_wakeup_15(magic_wakeup_15),          //OUTPUT : MAC WAKE-UP INDICATION
2017
 
2018
         // Channel 16 
2019
 
2020
        .tbi_rx_clk_16(tbi_rx_clk_16),              //INPUT  : Receive TBI Clock
2021
        .tbi_tx_clk_16(tbi_tx_clk_16),              //INPUT  : Transmit TBI Clock
2022
        .tbi_rx_d_16(tbi_rx_d_16),                  //INPUT  : Receive TBI Interface
2023
        .tbi_tx_d_16(tbi_tx_d_16),                  //OUTPUT : Transmit TBI Interface
2024
        .sd_loopback_16(sd_loopback_16),            //OUTPUT : SERDES Loopback Enable
2025
        .powerdown_16(pcs_pwrdn_out_sig[16]),       //OUTPUT : Powerdown Enable
2026
        .led_col_16(led_col_16),                    //OUTPUT : Collision Indication
2027
        .led_an_16(led_an_16),                      //OUTPUT : Auto Negotiation Status
2028
        .led_char_err_16(led_char_err_16),          //OUTPUT : Character error
2029
        .led_disp_err_16(led_disp_err_16),          //OUTPUT : Disparity error
2030
        .led_crs_16(led_crs_16),                    //OUTPUT : Carrier sense
2031
        .led_link_16(led_link_16),                  //OUTPUT : Valid link    
2032
        .mac_rx_clk_16(mac_rx_clk_16),              //OUTPUT : Av-ST Rx Clock
2033
        .mac_tx_clk_16(mac_tx_clk_16),              //OUTPUT : Av-ST Tx Clock
2034
        .data_rx_sop_16(data_rx_sop_16),            //OUTPUT : Start of Packet
2035
        .data_rx_eop_16(data_rx_eop_16),            //OUTPUT : End of Packet
2036
        .data_rx_data_16(data_rx_data_16),          //OUTPUT : Data from FIFO
2037
        .data_rx_error_16(data_rx_error_16),        //OUTPUT : Receive packet error
2038
        .data_rx_valid_16(data_rx_valid_16),        //OUTPUT : Data Receive FIFO Valid
2039
        .data_rx_ready_16(data_rx_ready_16),        //OUTPUT : Data Receive Ready
2040
        .pkt_class_data_16(pkt_class_data_16),      //OUTPUT : Frame Type Indication
2041
        .pkt_class_valid_16(pkt_class_valid_16),    //OUTPUT : Frame Type Indication Valid
2042
        .data_tx_error_16(data_tx_error_16),        //INPUT  : Status
2043
        .data_tx_data_16(data_tx_data_16),          //INPUT  : Data from FIFO transmit
2044
        .data_tx_valid_16(data_tx_valid_16),        //INPUT  : Data FIFO transmit Empty
2045
        .data_tx_sop_16(data_tx_sop_16),            //INPUT  : Start of Packet
2046
        .data_tx_eop_16(data_tx_eop_16),            //INPUT  : End of Packet
2047
        .data_tx_ready_16(data_tx_ready_16),        //OUTPUT : Data FIFO transmit Read Enable  
2048
        .tx_ff_uflow_16(tx_ff_uflow_16),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2049
        .tx_crc_fwd_16(tx_crc_fwd_16),              //INPUT  : Forward Current Frame with CRC from Application
2050
        .xoff_gen_16(xoff_gen_16),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2051
        .xon_gen_16(xon_gen_16),                    //INPUT  : XON PAUSE FRAME GENERATE
2052
        .magic_sleep_n_16(magic_sleep_n_16),        //INPUT  : MAC SLEEP MODE CONTROL
2053
        .magic_wakeup_16(magic_wakeup_16),          //OUTPUT : MAC WAKE-UP INDICATION
2054
 
2055
         // Channel 17 
2056
 
2057
        .tbi_rx_clk_17(tbi_rx_clk_17),              //INPUT  : Receive TBI Clock
2058
        .tbi_tx_clk_17(tbi_tx_clk_17),              //INPUT  : Transmit TBI Clock
2059
        .tbi_rx_d_17(tbi_rx_d_17),                  //INPUT  : Receive TBI Interface
2060
        .tbi_tx_d_17(tbi_tx_d_17),                  //OUTPUT : Transmit TBI Interface
2061
        .sd_loopback_17(sd_loopback_17),            //OUTPUT : SERDES Loopback Enable
2062
        .powerdown_17(pcs_pwrdn_out_sig[17]),       //OUTPUT : Powerdown Enable
2063
        .led_col_17(led_col_17),                    //OUTPUT : Collision Indication
2064
        .led_an_17(led_an_17),                      //OUTPUT : Auto Negotiation Status
2065
        .led_char_err_17(led_char_err_17),          //OUTPUT : Character error
2066
        .led_disp_err_17(led_disp_err_17),          //OUTPUT : Disparity error
2067
        .led_crs_17(led_crs_17),                    //OUTPUT : Carrier sense
2068
        .led_link_17(led_link_17),                  //OUTPUT : Valid link    
2069
        .mac_rx_clk_17(mac_rx_clk_17),              //OUTPUT : Av-ST Rx Clock
2070
        .mac_tx_clk_17(mac_tx_clk_17),              //OUTPUT : Av-ST Tx Clock
2071
        .data_rx_sop_17(data_rx_sop_17),            //OUTPUT : Start of Packet
2072
        .data_rx_eop_17(data_rx_eop_17),            //OUTPUT : End of Packet
2073
        .data_rx_data_17(data_rx_data_17),          //OUTPUT : Data from FIFO
2074
        .data_rx_error_17(data_rx_error_17),        //OUTPUT : Receive packet error
2075
        .data_rx_valid_17(data_rx_valid_17),        //OUTPUT : Data Receive FIFO Valid
2076
        .data_rx_ready_17(data_rx_ready_17),        //OUTPUT : Data Receive Ready
2077
        .pkt_class_data_17(pkt_class_data_17),      //OUTPUT : Frame Type Indication
2078
        .pkt_class_valid_17(pkt_class_valid_17),    //OUTPUT : Frame Type Indication Valid
2079
        .data_tx_error_17(data_tx_error_17),        //INPUT  : Status
2080
        .data_tx_data_17(data_tx_data_17),          //INPUT  : Data from FIFO transmit
2081
        .data_tx_valid_17(data_tx_valid_17),        //INPUT  : Data FIFO transmit Empty
2082
        .data_tx_sop_17(data_tx_sop_17),            //INPUT  : Start of Packet
2083
        .data_tx_eop_17(data_tx_eop_17),            //INPUT  : End of Packet
2084
        .data_tx_ready_17(data_tx_ready_17),        //OUTPUT : Data FIFO transmit Read Enable  
2085
        .tx_ff_uflow_17(tx_ff_uflow_17),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2086
        .tx_crc_fwd_17(tx_crc_fwd_17),              //INPUT  : Forward Current Frame with CRC from Application
2087
        .xoff_gen_17(xoff_gen_17),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2088
        .xon_gen_17(xon_gen_17),                    //INPUT  : XON PAUSE FRAME GENERATE
2089
        .magic_sleep_n_17(magic_sleep_n_17),        //INPUT  : MAC SLEEP MODE CONTROL
2090
        .magic_wakeup_17(magic_wakeup_17),          //OUTPUT : MAC WAKE-UP INDICATION
2091
 
2092
         // Channel 18 
2093
 
2094
        .tbi_rx_clk_18(tbi_rx_clk_18),              //INPUT  : Receive TBI Clock
2095
        .tbi_tx_clk_18(tbi_tx_clk_18),              //INPUT  : Transmit TBI Clock
2096
        .tbi_rx_d_18(tbi_rx_d_18),                  //INPUT  : Receive TBI Interface
2097
        .tbi_tx_d_18(tbi_tx_d_18),                  //OUTPUT : Transmit TBI Interface
2098
        .sd_loopback_18(sd_loopback_18),            //OUTPUT : SERDES Loopback Enable
2099
        .powerdown_18(pcs_pwrdn_out_sig[18]),       //OUTPUT : Powerdown Enable
2100
        .led_col_18(led_col_18),                    //OUTPUT : Collision Indication
2101
        .led_an_18(led_an_18),                      //OUTPUT : Auto Negotiation Status
2102
        .led_char_err_18(led_char_err_18),          //OUTPUT : Character error
2103
        .led_disp_err_18(led_disp_err_18),          //OUTPUT : Disparity error
2104
        .led_crs_18(led_crs_18),                    //OUTPUT : Carrier sense
2105
        .led_link_18(led_link_18),                  //OUTPUT : Valid link    
2106
        .mac_rx_clk_18(mac_rx_clk_18),              //OUTPUT : Av-ST Rx Clock
2107
        .mac_tx_clk_18(mac_tx_clk_18),              //OUTPUT : Av-ST Tx Clock
2108
        .data_rx_sop_18(data_rx_sop_18),            //OUTPUT : Start of Packet
2109
        .data_rx_eop_18(data_rx_eop_18),            //OUTPUT : End of Packet
2110
        .data_rx_data_18(data_rx_data_18),          //OUTPUT : Data from FIFO
2111
        .data_rx_error_18(data_rx_error_18),        //OUTPUT : Receive packet error
2112
        .data_rx_valid_18(data_rx_valid_18),        //OUTPUT : Data Receive FIFO Valid
2113
        .data_rx_ready_18(data_rx_ready_18),        //OUTPUT : Data Receive Ready
2114
        .pkt_class_data_18(pkt_class_data_18),      //OUTPUT : Frame Type Indication
2115
        .pkt_class_valid_18(pkt_class_valid_18),    //OUTPUT : Frame Type Indication Valid
2116
        .data_tx_error_18(data_tx_error_18),        //INPUT  : Status
2117
        .data_tx_data_18(data_tx_data_18),          //INPUT  : Data from FIFO transmit
2118
        .data_tx_valid_18(data_tx_valid_18),        //INPUT  : Data FIFO transmit Empty
2119
        .data_tx_sop_18(data_tx_sop_18),            //INPUT  : Start of Packet
2120
        .data_tx_eop_18(data_tx_eop_18),            //INPUT  : End of Packet
2121
        .data_tx_ready_18(data_tx_ready_18),        //OUTPUT : Data FIFO transmit Read Enable  
2122
        .tx_ff_uflow_18(tx_ff_uflow_18),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2123
        .tx_crc_fwd_18(tx_crc_fwd_18),              //INPUT  : Forward Current Frame with CRC from Application
2124
        .xoff_gen_18(xoff_gen_18),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2125
        .xon_gen_18(xon_gen_18),                    //INPUT  : XON PAUSE FRAME GENERATE
2126
        .magic_sleep_n_18(magic_sleep_n_18),        //INPUT  : MAC SLEEP MODE CONTROL
2127
        .magic_wakeup_18(magic_wakeup_18),          //OUTPUT : MAC WAKE-UP INDICATION
2128
 
2129
         // Channel 19 
2130
 
2131
        .tbi_rx_clk_19(tbi_rx_clk_19),              //INPUT  : Receive TBI Clock
2132
        .tbi_tx_clk_19(tbi_tx_clk_19),              //INPUT  : Transmit TBI Clock
2133
        .tbi_rx_d_19(tbi_rx_d_19),                  //INPUT  : Receive TBI Interface
2134
        .tbi_tx_d_19(tbi_tx_d_19),                  //OUTPUT : Transmit TBI Interface
2135
        .sd_loopback_19(sd_loopback_19),            //OUTPUT : SERDES Loopback Enable
2136
        .powerdown_19(pcs_pwrdn_out_sig[19]),       //OUTPUT : Powerdown Enable
2137
        .led_col_19(led_col_19),                    //OUTPUT : Collision Indication
2138
        .led_an_19(led_an_19),                      //OUTPUT : Auto Negotiation Status
2139
        .led_char_err_19(led_char_err_19),          //OUTPUT : Character error
2140
        .led_disp_err_19(led_disp_err_19),          //OUTPUT : Disparity error
2141
        .led_crs_19(led_crs_19),                    //OUTPUT : Carrier sense
2142
        .led_link_19(led_link_19),                  //OUTPUT : Valid link    
2143
        .mac_rx_clk_19(mac_rx_clk_19),              //OUTPUT : Av-ST Rx Clock
2144
        .mac_tx_clk_19(mac_tx_clk_19),              //OUTPUT : Av-ST Tx Clock
2145
        .data_rx_sop_19(data_rx_sop_19),            //OUTPUT : Start of Packet
2146
        .data_rx_eop_19(data_rx_eop_19),            //OUTPUT : End of Packet
2147
        .data_rx_data_19(data_rx_data_19),          //OUTPUT : Data from FIFO
2148
        .data_rx_error_19(data_rx_error_19),        //OUTPUT : Receive packet error
2149
        .data_rx_valid_19(data_rx_valid_19),        //OUTPUT : Data Receive FIFO Valid
2150
        .data_rx_ready_19(data_rx_ready_19),        //OUTPUT : Data Receive Ready
2151
        .pkt_class_data_19(pkt_class_data_19),      //OUTPUT : Frame Type Indication
2152
        .pkt_class_valid_19(pkt_class_valid_19),    //OUTPUT : Frame Type Indication Valid
2153
        .data_tx_error_19(data_tx_error_19),        //INPUT  : Status
2154
        .data_tx_data_19(data_tx_data_19),          //INPUT  : Data from FIFO transmit
2155
        .data_tx_valid_19(data_tx_valid_19),        //INPUT  : Data FIFO transmit Empty
2156
        .data_tx_sop_19(data_tx_sop_19),            //INPUT  : Start of Packet
2157
        .data_tx_eop_19(data_tx_eop_19),            //INPUT  : End of Packet
2158
        .data_tx_ready_19(data_tx_ready_19),        //OUTPUT : Data FIFO transmit Read Enable  
2159
        .tx_ff_uflow_19(tx_ff_uflow_19),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2160
        .tx_crc_fwd_19(tx_crc_fwd_19),              //INPUT  : Forward Current Frame with CRC from Application
2161
        .xoff_gen_19(xoff_gen_19),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2162
        .xon_gen_19(xon_gen_19),                    //INPUT  : XON PAUSE FRAME GENERATE
2163
        .magic_sleep_n_19(magic_sleep_n_19),        //INPUT  : MAC SLEEP MODE CONTROL
2164
        .magic_wakeup_19(magic_wakeup_19),          //OUTPUT : MAC WAKE-UP INDICATION
2165
 
2166
         // Channel 20 
2167
 
2168
        .tbi_rx_clk_20(tbi_rx_clk_20),              //INPUT  : Receive TBI Clock
2169
        .tbi_tx_clk_20(tbi_tx_clk_20),              //INPUT  : Transmit TBI Clock
2170
        .tbi_rx_d_20(tbi_rx_d_20),                  //INPUT  : Receive TBI Interface
2171
        .tbi_tx_d_20(tbi_tx_d_20),                  //OUTPUT : Transmit TBI Interface
2172
        .sd_loopback_20(sd_loopback_20),            //OUTPUT : SERDES Loopback Enable
2173
        .powerdown_20(pcs_pwrdn_out_sig[20]),       //OUTPUT : Powerdown Enable
2174
        .led_col_20(led_col_20),                    //OUTPUT : Collision Indication
2175
        .led_an_20(led_an_20),                      //OUTPUT : Auto Negotiation Status
2176
        .led_char_err_20(led_char_err_20),          //OUTPUT : Character error
2177
        .led_disp_err_20(led_disp_err_20),          //OUTPUT : Disparity error
2178
        .led_crs_20(led_crs_20),                    //OUTPUT : Carrier sense
2179
        .led_link_20(led_link_20),                  //OUTPUT : Valid link    
2180
        .mac_rx_clk_20(mac_rx_clk_20),              //OUTPUT : Av-ST Rx Clock
2181
        .mac_tx_clk_20(mac_tx_clk_20),              //OUTPUT : Av-ST Tx Clock
2182
        .data_rx_sop_20(data_rx_sop_20),            //OUTPUT : Start of Packet
2183
        .data_rx_eop_20(data_rx_eop_20),            //OUTPUT : End of Packet
2184
        .data_rx_data_20(data_rx_data_20),          //OUTPUT : Data from FIFO
2185
        .data_rx_error_20(data_rx_error_20),        //OUTPUT : Receive packet error
2186
        .data_rx_valid_20(data_rx_valid_20),        //OUTPUT : Data Receive FIFO Valid
2187
        .data_rx_ready_20(data_rx_ready_20),        //OUTPUT : Data Receive Ready
2188
        .pkt_class_data_20(pkt_class_data_20),      //OUTPUT : Frame Type Indication
2189
        .pkt_class_valid_20(pkt_class_valid_20),    //OUTPUT : Frame Type Indication Valid
2190
        .data_tx_error_20(data_tx_error_20),        //INPUT  : Status
2191
        .data_tx_data_20(data_tx_data_20),          //INPUT  : Data from FIFO transmit
2192
        .data_tx_valid_20(data_tx_valid_20),        //INPUT  : Data FIFO transmit Empty
2193
        .data_tx_sop_20(data_tx_sop_20),            //INPUT  : Start of Packet
2194
        .data_tx_eop_20(data_tx_eop_20),            //INPUT  : End of Packet
2195
        .data_tx_ready_20(data_tx_ready_20),        //OUTPUT : Data FIFO transmit Read Enable  
2196
        .tx_ff_uflow_20(tx_ff_uflow_20),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2197
        .tx_crc_fwd_20(tx_crc_fwd_20),              //INPUT  : Forward Current Frame with CRC from Application
2198
        .xoff_gen_20(xoff_gen_20),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2199
        .xon_gen_20(xon_gen_20),                    //INPUT  : XON PAUSE FRAME GENERATE
2200
        .magic_sleep_n_20(magic_sleep_n_20),        //INPUT  : MAC SLEEP MODE CONTROL
2201
        .magic_wakeup_20(magic_wakeup_20),          //OUTPUT : MAC WAKE-UP INDICATION
2202
 
2203
         // Channel 21 
2204
 
2205
        .tbi_rx_clk_21(tbi_rx_clk_21),              //INPUT  : Receive TBI Clock
2206
        .tbi_tx_clk_21(tbi_tx_clk_21),              //INPUT  : Transmit TBI Clock
2207
        .tbi_rx_d_21(tbi_rx_d_21),                  //INPUT  : Receive TBI Interface
2208
        .tbi_tx_d_21(tbi_tx_d_21),                  //OUTPUT : Transmit TBI Interface
2209
        .sd_loopback_21(sd_loopback_21),            //OUTPUT : SERDES Loopback Enable
2210
        .powerdown_21(pcs_pwrdn_out_sig[21]),       //OUTPUT : Powerdown Enable
2211
        .led_col_21(led_col_21),                    //OUTPUT : Collision Indication
2212
        .led_an_21(led_an_21),                      //OUTPUT : Auto Negotiation Status
2213
        .led_char_err_21(led_char_err_21),          //OUTPUT : Character error
2214
        .led_disp_err_21(led_disp_err_21),          //OUTPUT : Disparity error
2215
        .led_crs_21(led_crs_21),                    //OUTPUT : Carrier sense
2216
        .led_link_21(led_link_21),                  //OUTPUT : Valid link    
2217
        .mac_rx_clk_21(mac_rx_clk_21),              //OUTPUT : Av-ST Rx Clock
2218
        .mac_tx_clk_21(mac_tx_clk_21),              //OUTPUT : Av-ST Tx Clock
2219
        .data_rx_sop_21(data_rx_sop_21),            //OUTPUT : Start of Packet
2220
        .data_rx_eop_21(data_rx_eop_21),            //OUTPUT : End of Packet
2221
        .data_rx_data_21(data_rx_data_21),          //OUTPUT : Data from FIFO
2222
        .data_rx_error_21(data_rx_error_21),        //OUTPUT : Receive packet error
2223
        .data_rx_valid_21(data_rx_valid_21),        //OUTPUT : Data Receive FIFO Valid
2224
        .data_rx_ready_21(data_rx_ready_21),        //OUTPUT : Data Receive Ready
2225
        .pkt_class_data_21(pkt_class_data_21),      //OUTPUT : Frame Type Indication
2226
        .pkt_class_valid_21(pkt_class_valid_21),    //OUTPUT : Frame Type Indication Valid
2227
        .data_tx_error_21(data_tx_error_21),        //INPUT  : Status
2228
        .data_tx_data_21(data_tx_data_21),          //INPUT  : Data from FIFO transmit
2229
        .data_tx_valid_21(data_tx_valid_21),        //INPUT  : Data FIFO transmit Empty
2230
        .data_tx_sop_21(data_tx_sop_21),            //INPUT  : Start of Packet
2231
        .data_tx_eop_21(data_tx_eop_21),            //INPUT  : End of Packet
2232
        .data_tx_ready_21(data_tx_ready_21),        //OUTPUT : Data FIFO transmit Read Enable  
2233
        .tx_ff_uflow_21(tx_ff_uflow_21),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2234
        .tx_crc_fwd_21(tx_crc_fwd_21),              //INPUT  : Forward Current Frame with CRC from Application
2235
        .xoff_gen_21(xoff_gen_21),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2236
        .xon_gen_21(xon_gen_21),                    //INPUT  : XON PAUSE FRAME GENERATE
2237
        .magic_sleep_n_21(magic_sleep_n_21),        //INPUT  : MAC SLEEP MODE CONTROL
2238
        .magic_wakeup_21(magic_wakeup_21),          //OUTPUT : MAC WAKE-UP INDICATION
2239
 
2240
         // Channel 22 
2241
 
2242
        .tbi_rx_clk_22(tbi_rx_clk_22),              //INPUT  : Receive TBI Clock
2243
        .tbi_tx_clk_22(tbi_tx_clk_22),              //INPUT  : Transmit TBI Clock
2244
        .tbi_rx_d_22(tbi_rx_d_22),                  //INPUT  : Receive TBI Interface
2245
        .tbi_tx_d_22(tbi_tx_d_22),                  //OUTPUT : Transmit TBI Interface
2246
        .sd_loopback_22(sd_loopback_22),            //OUTPUT : SERDES Loopback Enable
2247
        .powerdown_22(pcs_pwrdn_out_sig[22]),       //OUTPUT : Powerdown Enable
2248
        .led_col_22(led_col_22),                    //OUTPUT : Collision Indication
2249
        .led_an_22(led_an_22),                      //OUTPUT : Auto Negotiation Status
2250
        .led_char_err_22(led_char_err_22),          //OUTPUT : Character error
2251
        .led_disp_err_22(led_disp_err_22),          //OUTPUT : Disparity error
2252
        .led_crs_22(led_crs_22),                    //OUTPUT : Carrier sense
2253
        .led_link_22(led_link_22),                  //OUTPUT : Valid link    
2254
        .mac_rx_clk_22(mac_rx_clk_22),              //OUTPUT : Av-ST Rx Clock
2255
        .mac_tx_clk_22(mac_tx_clk_22),              //OUTPUT : Av-ST Tx Clock
2256
        .data_rx_sop_22(data_rx_sop_22),            //OUTPUT : Start of Packet
2257
        .data_rx_eop_22(data_rx_eop_22),            //OUTPUT : End of Packet
2258
        .data_rx_data_22(data_rx_data_22),          //OUTPUT : Data from FIFO
2259
        .data_rx_error_22(data_rx_error_22),        //OUTPUT : Receive packet error
2260
        .data_rx_valid_22(data_rx_valid_22),        //OUTPUT : Data Receive FIFO Valid
2261
        .data_rx_ready_22(data_rx_ready_22),        //OUTPUT : Data Receive Ready
2262
        .pkt_class_data_22(pkt_class_data_22),      //OUTPUT : Frame Type Indication
2263
        .pkt_class_valid_22(pkt_class_valid_22),    //OUTPUT : Frame Type Indication Valid
2264
        .data_tx_error_22(data_tx_error_22),        //INPUT  : Status
2265
        .data_tx_data_22(data_tx_data_22),          //INPUT  : Data from FIFO transmit
2266
        .data_tx_valid_22(data_tx_valid_22),        //INPUT  : Data FIFO transmit Empty
2267
        .data_tx_sop_22(data_tx_sop_22),            //INPUT  : Start of Packet
2268
        .data_tx_eop_22(data_tx_eop_22),            //INPUT  : End of Packet
2269
        .data_tx_ready_22(data_tx_ready_22),        //OUTPUT : Data FIFO transmit Read Enable  
2270
        .tx_ff_uflow_22(tx_ff_uflow_22),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2271
        .tx_crc_fwd_22(tx_crc_fwd_22),              //INPUT  : Forward Current Frame with CRC from Application
2272
        .xoff_gen_22(xoff_gen_22),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2273
        .xon_gen_22(xon_gen_22),                    //INPUT  : XON PAUSE FRAME GENERATE
2274
        .magic_sleep_n_22(magic_sleep_n_22),        //INPUT  : MAC SLEEP MODE CONTROL
2275
        .magic_wakeup_22(magic_wakeup_22),          //OUTPUT : MAC WAKE-UP INDICATION
2276
 
2277
         // Channel 23 
2278
 
2279
        .tbi_rx_clk_23(tbi_rx_clk_23),              //INPUT  : Receive TBI Clock
2280
        .tbi_tx_clk_23(tbi_tx_clk_23),              //INPUT  : Transmit TBI Clock
2281
        .tbi_rx_d_23(tbi_rx_d_23),                  //INPUT  : Receive TBI Interface
2282
        .tbi_tx_d_23(tbi_tx_d_23),                  //OUTPUT : Transmit TBI Interface
2283
        .sd_loopback_23(sd_loopback_23),            //OUTPUT : SERDES Loopback Enable
2284
        .powerdown_23(pcs_pwrdn_out_sig[23]),       //OUTPUT : Powerdown Enable
2285
        .led_col_23(led_col_23),                    //OUTPUT : Collision Indication
2286
        .led_an_23(led_an_23),                      //OUTPUT : Auto Negotiation Status
2287
        .led_char_err_23(led_char_err_23),          //OUTPUT : Character error
2288
        .led_disp_err_23(led_disp_err_23),          //OUTPUT : Disparity error
2289
        .led_crs_23(led_crs_23),                    //OUTPUT : Carrier sense
2290
        .led_link_23(led_link_23),                  //OUTPUT : Valid link    
2291
        .mac_rx_clk_23(mac_rx_clk_23),              //OUTPUT : Av-ST Rx Clock
2292
        .mac_tx_clk_23(mac_tx_clk_23),              //OUTPUT : Av-ST Tx Clock
2293
        .data_rx_sop_23(data_rx_sop_23),            //OUTPUT : Start of Packet
2294
        .data_rx_eop_23(data_rx_eop_23),            //OUTPUT : End of Packet
2295
        .data_rx_data_23(data_rx_data_23),          //OUTPUT : Data from FIFO
2296
        .data_rx_error_23(data_rx_error_23),        //OUTPUT : Receive packet error
2297
        .data_rx_valid_23(data_rx_valid_23),        //OUTPUT : Data Receive FIFO Valid
2298
        .data_rx_ready_23(data_rx_ready_23),        //OUTPUT : Data Receive Ready
2299
        .pkt_class_data_23(pkt_class_data_23),      //OUTPUT : Frame Type Indication
2300
        .pkt_class_valid_23(pkt_class_valid_23),    //OUTPUT : Frame Type Indication Valid
2301
        .data_tx_error_23(data_tx_error_23),        //INPUT  : Status
2302
        .data_tx_data_23(data_tx_data_23),          //INPUT  : Data from FIFO transmit
2303
        .data_tx_valid_23(data_tx_valid_23),        //INPUT  : Data FIFO transmit Empty
2304
        .data_tx_sop_23(data_tx_sop_23),            //INPUT  : Start of Packet
2305
        .data_tx_eop_23(data_tx_eop_23),            //INPUT  : End of Packet
2306
        .data_tx_ready_23(data_tx_ready_23),        //OUTPUT : Data FIFO transmit Read Enable  
2307
        .tx_ff_uflow_23(tx_ff_uflow_23),            //OUTPUT : TX FIFO underflow occured (Synchronous with tx_clk)
2308
        .tx_crc_fwd_23(tx_crc_fwd_23),              //INPUT  : Forward Current Frame with CRC from Application
2309
        .xoff_gen_23(xoff_gen_23),                  //INPUT  : XOFF PAUSE FRAME GENERATE
2310
        .xon_gen_23(xon_gen_23),                    //INPUT  : XON PAUSE FRAME GENERATE
2311
        .magic_sleep_n_23(magic_sleep_n_23),        //INPUT  : MAC SLEEP MODE CONTROL
2312
        .magic_wakeup_23(magic_wakeup_23));         //OUTPUT : MAC WAKE-UP INDICATION
2313
 
2314
    defparam
2315
        U_MULTI_MAC_PCS.USE_SYNC_RESET = USE_SYNC_RESET,
2316
        U_MULTI_MAC_PCS.RESET_LEVEL = RESET_LEVEL,
2317
        U_MULTI_MAC_PCS.ENABLE_GMII_LOOPBACK = ENABLE_GMII_LOOPBACK,
2318
        U_MULTI_MAC_PCS.ENABLE_HD_LOGIC = ENABLE_HD_LOGIC,
2319
        U_MULTI_MAC_PCS.ENABLE_SUP_ADDR = ENABLE_SUP_ADDR,
2320
        U_MULTI_MAC_PCS.ENA_HASH = ENA_HASH,
2321
        U_MULTI_MAC_PCS.STAT_CNT_ENA = STAT_CNT_ENA,
2322
        U_MULTI_MAC_PCS.CORE_VERSION = CORE_VERSION,
2323
        U_MULTI_MAC_PCS.CUST_VERSION = CUST_VERSION,
2324
        U_MULTI_MAC_PCS.REDUCED_INTERFACE_ENA = REDUCED_INTERFACE_ENA,
2325
        U_MULTI_MAC_PCS.ENABLE_MDIO = ENABLE_MDIO,
2326
        U_MULTI_MAC_PCS.MDIO_CLK_DIV = MDIO_CLK_DIV,
2327
        U_MULTI_MAC_PCS.ENABLE_MAGIC_DETECT = ENABLE_MAGIC_DETECT,
2328
        U_MULTI_MAC_PCS.ENABLE_PADDING = ENABLE_PADDING,
2329
        U_MULTI_MAC_PCS.ENABLE_LGTH_CHECK = ENABLE_LGTH_CHECK,
2330
        U_MULTI_MAC_PCS.GBIT_ONLY = GBIT_ONLY,
2331
        U_MULTI_MAC_PCS.MBIT_ONLY = MBIT_ONLY,
2332
        U_MULTI_MAC_PCS.REDUCED_CONTROL = REDUCED_CONTROL,
2333
        U_MULTI_MAC_PCS.CRC32DWIDTH = CRC32DWIDTH,
2334
        U_MULTI_MAC_PCS.CRC32GENDELAY = CRC32GENDELAY,
2335
        U_MULTI_MAC_PCS.CRC32CHECK16BIT = CRC32CHECK16BIT,
2336
        U_MULTI_MAC_PCS.CRC32S1L2_EXTERN = CRC32S1L2_EXTERN,
2337
        U_MULTI_MAC_PCS.ENABLE_SHIFT16 = ENABLE_SHIFT16,
2338
        U_MULTI_MAC_PCS.ENABLE_MAC_FLOW_CTRL = ENABLE_MAC_FLOW_CTRL,
2339
        U_MULTI_MAC_PCS.ENABLE_MAC_TXADDR_SET = ENABLE_MAC_TXADDR_SET,
2340
        U_MULTI_MAC_PCS.ENABLE_MAC_RX_VLAN = ENABLE_MAC_RX_VLAN,
2341
        U_MULTI_MAC_PCS.ENABLE_MAC_TX_VLAN = ENABLE_MAC_TX_VLAN,
2342
        U_MULTI_MAC_PCS.PHY_IDENTIFIER = PHY_IDENTIFIER,
2343
        U_MULTI_MAC_PCS.DEV_VERSION = DEV_VERSION,
2344
        U_MULTI_MAC_PCS.ENABLE_SGMII = ENABLE_SGMII,
2345
        U_MULTI_MAC_PCS.MAX_CHANNELS = MAX_CHANNELS,
2346
        U_MULTI_MAC_PCS.CHANNEL_WIDTH = CHANNEL_WIDTH,
2347
            U_MULTI_MAC_PCS.ENABLE_RX_FIFO_STATUS = ENABLE_RX_FIFO_STATUS,
2348
            U_MULTI_MAC_PCS.ENABLE_EXTENDED_STAT_REG = ENABLE_EXTENDED_STAT_REG,
2349
        U_MULTI_MAC_PCS.ENABLE_CLK_SHARING = ENABLE_CLK_SHARING,
2350
        U_MULTI_MAC_PCS.ENABLE_REG_SHARING = ENABLE_REG_SHARING;
2351
 
2352
 
2353
 
2354
// #######################################################################
2355
// ###############       CHANNEL 0 LOGIC/COMPONENTS       ###############
2356
// #######################################################################
2357
 
2358
// Export powerdown signal or wire it internally
2359
// ---------------------------------------------
2360
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 0)
2361
    begin
2362
        assign gxb_pwrdn_in_sig[0] = gxb_pwrdn_in_0;
2363
        assign pcs_pwrdn_out_0 = pcs_pwrdn_out_sig[0];
2364
    end
2365
else
2366
    begin
2367
        assign gxb_pwrdn_in_sig[0] = pcs_pwrdn_out_sig[0];
2368
                assign pcs_pwrdn_out_0 = 1'b0;
2369
    end
2370
endgenerate
2371
 
2372
 
2373
// Either one of these blocks below will be instantiated depending on the parameterization 
2374
// that is chosen.
2375
// ---------------------------------------------------------------------------------------
2376
 
2377
// Instantiation of the Alt2gxb block as the PMA for Stratix_II_GX devices
2378
// ---------------------------------------------------------------------------- 
2379
// Instantiation of the Alt2gxb block as the PMA for ArriaGX device
2380
// ---------------------------------------------------------------- 
2381
 
2382
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
2383
//
2384
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
2385
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
2386
// reversal algorithm.  
2387
// -------------------------------------------------------------------------
2388
 
2389
altera_tse_reset_synchronizer reset_sync_0 (
2390
        .clk(ref_clk),
2391
        .reset_in(reset),
2392
        .reset_out(reset_ref_clk_int)
2393
        );
2394
 
2395
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 0)
2396
    begin
2397
 
2398
    assign tbi_tx_clk_0 = ref_clk;
2399
    assign tbi_rx_d_0 = tbi_rx_d_flip_0;
2400
 
2401
    altera_tse_reset_synchronizer ch_0_reset_sync_0 (
2402
        .clk(tbi_rx_clk_0),
2403
        .reset_in(reset),
2404
        .reset_out(reset_tbi_rx_clk_0_int)
2405
        );
2406
 
2407
    always @(posedge tbi_rx_clk_0 or posedge reset_tbi_rx_clk_0_int)
2408
        begin
2409
        if (reset_tbi_rx_clk_0_int == 1)
2410
            tbi_rx_d_flip_0 <= 0;
2411
        else
2412
            begin
2413
            tbi_rx_d_flip_0[0] <= tbi_rx_d_lvds_0[9];
2414
            tbi_rx_d_flip_0[1] <= tbi_rx_d_lvds_0[8];
2415
            tbi_rx_d_flip_0[2] <= tbi_rx_d_lvds_0[7];
2416
            tbi_rx_d_flip_0[3] <= tbi_rx_d_lvds_0[6];
2417
            tbi_rx_d_flip_0[4] <= tbi_rx_d_lvds_0[5];
2418
            tbi_rx_d_flip_0[5] <= tbi_rx_d_lvds_0[4];
2419
            tbi_rx_d_flip_0[6] <= tbi_rx_d_lvds_0[3];
2420
            tbi_rx_d_flip_0[7] <= tbi_rx_d_lvds_0[2];
2421
            tbi_rx_d_flip_0[8] <= tbi_rx_d_lvds_0[1];
2422
            tbi_rx_d_flip_0[9] <= tbi_rx_d_lvds_0[0];
2423
            end
2424
        end
2425
 
2426
    always @(posedge ref_clk or posedge reset_ref_clk_int)
2427
        begin
2428
        if (reset_ref_clk_int == 1)
2429
            tbi_tx_d_flip_0 <= 0;
2430
        else
2431
            begin
2432
            tbi_tx_d_flip_0[0] <= tbi_tx_d_0[9];
2433
            tbi_tx_d_flip_0[1] <= tbi_tx_d_0[8];
2434
            tbi_tx_d_flip_0[2] <= tbi_tx_d_0[7];
2435
            tbi_tx_d_flip_0[3] <= tbi_tx_d_0[6];
2436
            tbi_tx_d_flip_0[4] <= tbi_tx_d_0[5];
2437
            tbi_tx_d_flip_0[5] <= tbi_tx_d_0[4];
2438
            tbi_tx_d_flip_0[6] <= tbi_tx_d_0[3];
2439
            tbi_tx_d_flip_0[7] <= tbi_tx_d_0[2];
2440
            tbi_tx_d_flip_0[8] <= tbi_tx_d_0[1];
2441
            tbi_tx_d_flip_0[9] <= tbi_tx_d_0[0];
2442
            end
2443
        end
2444
 
2445
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_0
2446
     (
2447
         .pll_areset ( reset ),
2448
         .rx_cda_reset ( rx_cda_reset_0 ),
2449
         .rx_channel_data_align ( rx_channel_data_align_0 ),
2450
         .rx_locked ( rx_locked_0 ),
2451
         .rx_divfwdclk (tbi_rx_clk_0),
2452
         .rx_in (rxp_0),
2453
         .rx_inclock (ref_clk),
2454
         .rx_out (tbi_rx_d_lvds_0),
2455
         .rx_outclock (),
2456
         .rx_reset (rx_reset_0)
2457
     );
2458
 
2459
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_0 (
2460
                .clk ( ref_clk ),
2461
                .reset ( reset_ref_clk_int ),
2462
                .rx_locked ( rx_locked_0 ),
2463
                .rx_channel_data_align ( rx_channel_data_align_0 ),
2464
                .pll_areset ( pll_areset_0 ),
2465
                .rx_reset ( rx_reset_0 ),
2466
                .rx_cda_reset ( rx_cda_reset_0 )
2467
        );
2468
 
2469
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_0
2470
    (
2471
        .tx_in (tbi_tx_d_flip_0),
2472
        .tx_inclock (ref_clk),
2473
                .pll_areset ( reset ),
2474
        .tx_out (txp_0)
2475
    );
2476
 
2477
    end
2478
else
2479
    begin
2480
    assign txp_0 = 1'b0;
2481
    assign tbi_rx_clk_0 = 1'b0;
2482
    end
2483
endgenerate
2484
 
2485
 
2486
 
2487
// #######################################################################
2488
// ###############       CHANNEL 1 LOGIC/COMPONENTS       ###############
2489
// #######################################################################
2490
 
2491
// Export powerdown signal or wire it internally
2492
// ---------------------------------------------
2493
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 1)
2494
    begin
2495
        assign gxb_pwrdn_in_sig[1] = gxb_pwrdn_in_1;
2496
        assign pcs_pwrdn_out_1 = pcs_pwrdn_out_sig[1];
2497
    end
2498
else
2499
    begin
2500
        assign gxb_pwrdn_in_sig[1] = pcs_pwrdn_out_sig[1];
2501
                assign pcs_pwrdn_out_1 = 1'b0;
2502
    end
2503
endgenerate
2504
 
2505
 
2506
// Either one of these blocks below will be instantiated depending on the parameterization 
2507
// that is chosen.
2508
// ---------------------------------------------------------------------------------------
2509
 
2510
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
2511
//
2512
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
2513
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
2514
// reversal algorithm.  
2515
// -------------------------------------------------------------------------
2516
 
2517
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 1)
2518
    begin
2519
 
2520
    assign tbi_tx_clk_1 = ref_clk;
2521
    assign tbi_rx_d_1 = tbi_rx_d_flip_1;
2522
 
2523
    altera_tse_reset_synchronizer ch_1_reset_sync_0 (
2524
        .clk(tbi_rx_clk_1),
2525
        .reset_in(reset),
2526
        .reset_out(reset_tbi_rx_clk_1_int)
2527
        );
2528
 
2529
    always @(posedge tbi_rx_clk_1 or posedge reset_tbi_rx_clk_1_int)
2530
        begin
2531
        if (reset_tbi_rx_clk_1_int == 1)
2532
            tbi_rx_d_flip_1 <= 0;
2533
        else
2534
            begin
2535
            tbi_rx_d_flip_1[0] <= tbi_rx_d_lvds_1[9];
2536
            tbi_rx_d_flip_1[1] <= tbi_rx_d_lvds_1[8];
2537
            tbi_rx_d_flip_1[2] <= tbi_rx_d_lvds_1[7];
2538
            tbi_rx_d_flip_1[3] <= tbi_rx_d_lvds_1[6];
2539
            tbi_rx_d_flip_1[4] <= tbi_rx_d_lvds_1[5];
2540
            tbi_rx_d_flip_1[5] <= tbi_rx_d_lvds_1[4];
2541
            tbi_rx_d_flip_1[6] <= tbi_rx_d_lvds_1[3];
2542
            tbi_rx_d_flip_1[7] <= tbi_rx_d_lvds_1[2];
2543
            tbi_rx_d_flip_1[8] <= tbi_rx_d_lvds_1[1];
2544
            tbi_rx_d_flip_1[9] <= tbi_rx_d_lvds_1[0];
2545
            end
2546
        end
2547
 
2548
    always @(posedge ref_clk or posedge reset_ref_clk_int)
2549
        begin
2550
        if (reset_ref_clk_int == 1)
2551
            tbi_tx_d_flip_1 <= 0;
2552
        else
2553
            begin
2554
            tbi_tx_d_flip_1[0] <= tbi_tx_d_1[9];
2555
            tbi_tx_d_flip_1[1] <= tbi_tx_d_1[8];
2556
            tbi_tx_d_flip_1[2] <= tbi_tx_d_1[7];
2557
            tbi_tx_d_flip_1[3] <= tbi_tx_d_1[6];
2558
            tbi_tx_d_flip_1[4] <= tbi_tx_d_1[5];
2559
            tbi_tx_d_flip_1[5] <= tbi_tx_d_1[4];
2560
            tbi_tx_d_flip_1[6] <= tbi_tx_d_1[3];
2561
            tbi_tx_d_flip_1[7] <= tbi_tx_d_1[2];
2562
            tbi_tx_d_flip_1[8] <= tbi_tx_d_1[1];
2563
            tbi_tx_d_flip_1[9] <= tbi_tx_d_1[0];
2564
            end
2565
        end
2566
 
2567
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_1
2568
     (
2569
         .pll_areset ( reset ),
2570
         .rx_cda_reset ( rx_cda_reset_1 ),
2571
         .rx_channel_data_align ( rx_channel_data_align_1 ),
2572
         .rx_locked ( rx_locked_1 ),
2573
         .rx_divfwdclk (tbi_rx_clk_1),
2574
         .rx_in (rxp_1),
2575
         .rx_inclock (ref_clk),
2576
         .rx_out (tbi_rx_d_lvds_1),
2577
         .rx_outclock (),
2578
         .rx_reset (rx_reset_1)
2579
     );
2580
 
2581
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_1 (
2582
                .clk ( ref_clk ),
2583
                .reset ( reset_ref_clk_int ),
2584
                .rx_locked ( rx_locked_1 ),
2585
                .rx_channel_data_align ( rx_channel_data_align_1 ),
2586
                .pll_areset ( pll_areset_1 ),
2587
                .rx_reset ( rx_reset_1 ),
2588
                .rx_cda_reset ( rx_cda_reset_1 )
2589
        );
2590
 
2591
 
2592
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_1
2593
    (
2594
        .tx_in (tbi_tx_d_flip_1),
2595
        .tx_inclock (ref_clk),
2596
                .pll_areset ( reset ),
2597
        .tx_out (txp_1)
2598
    );
2599
 
2600
    end
2601
else
2602
    begin
2603
    assign txp_1 = 1'b0;
2604
    assign tbi_rx_clk_1 = 1'b0;
2605
    end
2606
endgenerate
2607
 
2608
 
2609
 
2610
// #######################################################################
2611
// ###############       CHANNEL 2 LOGIC/COMPONENTS       ###############
2612
// #######################################################################
2613
 
2614
// Export powerdown signal or wire it internally
2615
// ---------------------------------------------
2616
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 2)
2617
    begin
2618
        assign gxb_pwrdn_in_sig[2] = gxb_pwrdn_in_2;
2619
        assign pcs_pwrdn_out_2 = pcs_pwrdn_out_sig[2];
2620
    end
2621
else
2622
    begin
2623
        assign gxb_pwrdn_in_sig[2] = pcs_pwrdn_out_sig[2];
2624
                assign pcs_pwrdn_out_2 = 1'b0;
2625
    end
2626
endgenerate
2627
 
2628
 
2629
// Either one of these blocks below will be instantiated depending on the parameterization 
2630
// that is chosen.
2631
// ---------------------------------------------------------------------------------------
2632
 
2633
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
2634
//
2635
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
2636
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
2637
// reversal algorithm.  
2638
// -------------------------------------------------------------------------
2639
 
2640
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 2)
2641
    begin
2642
 
2643
    assign tbi_tx_clk_2 = ref_clk;
2644
    assign tbi_rx_d_2 = tbi_rx_d_flip_2;
2645
 
2646
    altera_tse_reset_synchronizer ch_2_reset_sync_0 (
2647
        .clk(tbi_rx_clk_2),
2648
        .reset_in(reset),
2649
        .reset_out(reset_tbi_rx_clk_2_int)
2650
        );
2651
 
2652
    always @(posedge tbi_rx_clk_2 or posedge reset_tbi_rx_clk_2_int)
2653
        begin
2654
        if (reset_tbi_rx_clk_2_int == 1)
2655
            tbi_rx_d_flip_2 <= 0;
2656
        else
2657
            begin
2658
            tbi_rx_d_flip_2[0] <= tbi_rx_d_lvds_2[9];
2659
            tbi_rx_d_flip_2[1] <= tbi_rx_d_lvds_2[8];
2660
            tbi_rx_d_flip_2[2] <= tbi_rx_d_lvds_2[7];
2661
            tbi_rx_d_flip_2[3] <= tbi_rx_d_lvds_2[6];
2662
            tbi_rx_d_flip_2[4] <= tbi_rx_d_lvds_2[5];
2663
            tbi_rx_d_flip_2[5] <= tbi_rx_d_lvds_2[4];
2664
            tbi_rx_d_flip_2[6] <= tbi_rx_d_lvds_2[3];
2665
            tbi_rx_d_flip_2[7] <= tbi_rx_d_lvds_2[2];
2666
            tbi_rx_d_flip_2[8] <= tbi_rx_d_lvds_2[1];
2667
            tbi_rx_d_flip_2[9] <= tbi_rx_d_lvds_2[0];
2668
            end
2669
        end
2670
 
2671
    always @(posedge ref_clk or posedge reset_ref_clk_int)
2672
        begin
2673
        if (reset_ref_clk_int == 1)
2674
            tbi_tx_d_flip_2 <= 0;
2675
        else
2676
            begin
2677
            tbi_tx_d_flip_2[0] <= tbi_tx_d_2[9];
2678
            tbi_tx_d_flip_2[1] <= tbi_tx_d_2[8];
2679
            tbi_tx_d_flip_2[2] <= tbi_tx_d_2[7];
2680
            tbi_tx_d_flip_2[3] <= tbi_tx_d_2[6];
2681
            tbi_tx_d_flip_2[4] <= tbi_tx_d_2[5];
2682
            tbi_tx_d_flip_2[5] <= tbi_tx_d_2[4];
2683
            tbi_tx_d_flip_2[6] <= tbi_tx_d_2[3];
2684
            tbi_tx_d_flip_2[7] <= tbi_tx_d_2[2];
2685
            tbi_tx_d_flip_2[8] <= tbi_tx_d_2[1];
2686
            tbi_tx_d_flip_2[9] <= tbi_tx_d_2[0];
2687
            end
2688
        end
2689
 
2690
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_2
2691
     (
2692
         .pll_areset ( reset ),
2693
         .rx_cda_reset ( rx_cda_reset_2 ),
2694
         .rx_channel_data_align ( rx_channel_data_align_2 ),
2695
         .rx_locked ( rx_locked_2 ),
2696
         .rx_divfwdclk (tbi_rx_clk_2),
2697
         .rx_in (rxp_2),
2698
         .rx_inclock (ref_clk),
2699
         .rx_out (tbi_rx_d_lvds_2),
2700
         .rx_outclock (),
2701
         .rx_reset (rx_reset_2)
2702
     );
2703
 
2704
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_2 (
2705
                .clk ( ref_clk ),
2706
                .reset ( reset_ref_clk_int ),
2707
                .rx_locked ( rx_locked_2 ),
2708
                .rx_channel_data_align ( rx_channel_data_align_2 ),
2709
                .pll_areset ( pll_areset_2 ),
2710
                .rx_reset ( rx_reset_2 ),
2711
                .rx_cda_reset ( rx_cda_reset_2 )
2712
        );
2713
 
2714
 
2715
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_2
2716
    (
2717
        .tx_in (tbi_tx_d_flip_2),
2718
        .tx_inclock (ref_clk),
2719
                .pll_areset ( reset ),
2720
        .tx_out (txp_2)
2721
    );
2722
 
2723
    end
2724
else
2725
    begin
2726
    assign txp_2 = 1'b0;
2727
    assign tbi_rx_clk_2 = 1'b0;
2728
    end
2729
endgenerate
2730
 
2731
 
2732
 
2733
// #######################################################################
2734
// ###############       CHANNEL 3 LOGIC/COMPONENTS       ###############
2735
// #######################################################################
2736
 
2737
// Export powerdown signal or wire it internally
2738
// ---------------------------------------------
2739
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 3)
2740
    begin
2741
        assign gxb_pwrdn_in_sig[3] = gxb_pwrdn_in_3;
2742
        assign pcs_pwrdn_out_3 = pcs_pwrdn_out_sig[3];
2743
    end
2744
else
2745
    begin
2746
        assign gxb_pwrdn_in_sig[3] = pcs_pwrdn_out_sig[3];
2747
                assign pcs_pwrdn_out_3 = 1'b0;
2748
    end
2749
endgenerate
2750
 
2751
 
2752
// Either one of these blocks below will be instantiated depending on the parameterization 
2753
// that is chosen.
2754
// ---------------------------------------------------------------------------------------
2755
 
2756
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
2757
//
2758
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
2759
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
2760
// reversal algorithm.  
2761
// -------------------------------------------------------------------------
2762
 
2763
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 3)
2764
    begin
2765
 
2766
    assign tbi_tx_clk_3 = ref_clk;
2767
    assign tbi_rx_d_3 = tbi_rx_d_flip_3;
2768
 
2769
    altera_tse_reset_synchronizer ch_3_reset_sync_0 (
2770
        .clk(tbi_rx_clk_3),
2771
        .reset_in(reset),
2772
        .reset_out(reset_tbi_rx_clk_3_int)
2773
        );
2774
 
2775
    always @(posedge tbi_rx_clk_3 or posedge reset_tbi_rx_clk_3_int)
2776
        begin
2777
        if (reset_tbi_rx_clk_3_int == 1)
2778
            tbi_rx_d_flip_3 <= 0;
2779
        else
2780
            begin
2781
            tbi_rx_d_flip_3[0] <= tbi_rx_d_lvds_3[9];
2782
            tbi_rx_d_flip_3[1] <= tbi_rx_d_lvds_3[8];
2783
            tbi_rx_d_flip_3[2] <= tbi_rx_d_lvds_3[7];
2784
            tbi_rx_d_flip_3[3] <= tbi_rx_d_lvds_3[6];
2785
            tbi_rx_d_flip_3[4] <= tbi_rx_d_lvds_3[5];
2786
            tbi_rx_d_flip_3[5] <= tbi_rx_d_lvds_3[4];
2787
            tbi_rx_d_flip_3[6] <= tbi_rx_d_lvds_3[3];
2788
            tbi_rx_d_flip_3[7] <= tbi_rx_d_lvds_3[2];
2789
            tbi_rx_d_flip_3[8] <= tbi_rx_d_lvds_3[1];
2790
            tbi_rx_d_flip_3[9] <= tbi_rx_d_lvds_3[0];
2791
            end
2792
        end
2793
 
2794
    always @(posedge ref_clk or posedge reset_ref_clk_int)
2795
        begin
2796
        if (reset_ref_clk_int == 1)
2797
            tbi_tx_d_flip_3 <= 0;
2798
        else
2799
            begin
2800
            tbi_tx_d_flip_3[0] <= tbi_tx_d_3[9];
2801
            tbi_tx_d_flip_3[1] <= tbi_tx_d_3[8];
2802
            tbi_tx_d_flip_3[2] <= tbi_tx_d_3[7];
2803
            tbi_tx_d_flip_3[3] <= tbi_tx_d_3[6];
2804
            tbi_tx_d_flip_3[4] <= tbi_tx_d_3[5];
2805
            tbi_tx_d_flip_3[5] <= tbi_tx_d_3[4];
2806
            tbi_tx_d_flip_3[6] <= tbi_tx_d_3[3];
2807
            tbi_tx_d_flip_3[7] <= tbi_tx_d_3[2];
2808
            tbi_tx_d_flip_3[8] <= tbi_tx_d_3[1];
2809
            tbi_tx_d_flip_3[9] <= tbi_tx_d_3[0];
2810
            end
2811
        end
2812
 
2813
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_3
2814
     (
2815
         .pll_areset ( reset ),
2816
         .rx_cda_reset ( rx_cda_reset_3 ),
2817
         .rx_channel_data_align ( rx_channel_data_align_3 ),
2818
         .rx_locked ( rx_locked_3 ),
2819
         .rx_divfwdclk (tbi_rx_clk_3),
2820
         .rx_in (rxp_3),
2821
         .rx_inclock (ref_clk),
2822
         .rx_out (tbi_rx_d_lvds_3),
2823
         .rx_outclock (),
2824
         .rx_reset (rx_reset_3)
2825
     );
2826
 
2827
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_3 (
2828
                .clk ( ref_clk ),
2829
                .reset ( reset_ref_clk_int ),
2830
                .rx_locked ( rx_locked_3 ),
2831
                .rx_channel_data_align ( rx_channel_data_align_3 ),
2832
                .pll_areset ( pll_areset_3 ),
2833
                .rx_reset ( rx_reset_3 ),
2834
                .rx_cda_reset ( rx_cda_reset_3 )
2835
        );
2836
 
2837
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_3
2838
    (
2839
        .tx_in (tbi_tx_d_flip_3),
2840
        .tx_inclock (ref_clk),
2841
                .pll_areset ( reset ),
2842
        .tx_out (txp_3)
2843
    );
2844
 
2845
    end
2846
else
2847
    begin
2848
    assign txp_3 = 1'b0;
2849
    assign tbi_rx_clk_3 = 1'b0;
2850
    end
2851
endgenerate
2852
 
2853
 
2854
 
2855
// #######################################################################
2856
// ###############       CHANNEL 4 LOGIC/COMPONENTS       ###############
2857
// #######################################################################
2858
 
2859
// Export powerdown signal or wire it internally
2860
// ---------------------------------------------
2861
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 4)
2862
    begin
2863
        assign gxb_pwrdn_in_sig[4] = gxb_pwrdn_in_4;
2864
        assign pcs_pwrdn_out_4 = pcs_pwrdn_out_sig[4];
2865
    end
2866
else
2867
    begin
2868
        assign gxb_pwrdn_in_sig[4] = pcs_pwrdn_out_sig[4];
2869
                assign pcs_pwrdn_out_4 = 1'b0;
2870
    end
2871
endgenerate
2872
 
2873
 
2874
// Either one of these blocks below will be instantiated depending on the parameterization 
2875
// that is chosen.
2876
// ---------------------------------------------------------------------------------------
2877
 
2878
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
2879
//
2880
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
2881
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
2882
// reversal algorithm.  
2883
// -------------------------------------------------------------------------
2884
 
2885
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 4)
2886
    begin
2887
 
2888
    assign tbi_tx_clk_4 = ref_clk;
2889
    assign tbi_rx_d_4 = tbi_rx_d_flip_4;
2890
 
2891
    altera_tse_reset_synchronizer ch_4_reset_sync_0 (
2892
        .clk(tbi_rx_clk_4),
2893
        .reset_in(reset),
2894
        .reset_out(reset_tbi_rx_clk_4_int)
2895
        );
2896
 
2897
    always @(posedge tbi_rx_clk_4 or posedge reset_tbi_rx_clk_4_int)
2898
        begin
2899
        if (reset_tbi_rx_clk_4_int == 1)
2900
            tbi_rx_d_flip_4 <= 0;
2901
        else
2902
            begin
2903
            tbi_rx_d_flip_4[0] <= tbi_rx_d_lvds_4[9];
2904
            tbi_rx_d_flip_4[1] <= tbi_rx_d_lvds_4[8];
2905
            tbi_rx_d_flip_4[2] <= tbi_rx_d_lvds_4[7];
2906
            tbi_rx_d_flip_4[3] <= tbi_rx_d_lvds_4[6];
2907
            tbi_rx_d_flip_4[4] <= tbi_rx_d_lvds_4[5];
2908
            tbi_rx_d_flip_4[5] <= tbi_rx_d_lvds_4[4];
2909
            tbi_rx_d_flip_4[6] <= tbi_rx_d_lvds_4[3];
2910
            tbi_rx_d_flip_4[7] <= tbi_rx_d_lvds_4[2];
2911
            tbi_rx_d_flip_4[8] <= tbi_rx_d_lvds_4[1];
2912
            tbi_rx_d_flip_4[9] <= tbi_rx_d_lvds_4[0];
2913
            end
2914
        end
2915
 
2916
    always @(posedge ref_clk or posedge reset_ref_clk_int)
2917
        begin
2918
        if (reset_ref_clk_int == 1)
2919
            tbi_tx_d_flip_4 <= 0;
2920
        else
2921
            begin
2922
            tbi_tx_d_flip_4[0] <= tbi_tx_d_4[9];
2923
            tbi_tx_d_flip_4[1] <= tbi_tx_d_4[8];
2924
            tbi_tx_d_flip_4[2] <= tbi_tx_d_4[7];
2925
            tbi_tx_d_flip_4[3] <= tbi_tx_d_4[6];
2926
            tbi_tx_d_flip_4[4] <= tbi_tx_d_4[5];
2927
            tbi_tx_d_flip_4[5] <= tbi_tx_d_4[4];
2928
            tbi_tx_d_flip_4[6] <= tbi_tx_d_4[3];
2929
            tbi_tx_d_flip_4[7] <= tbi_tx_d_4[2];
2930
            tbi_tx_d_flip_4[8] <= tbi_tx_d_4[1];
2931
            tbi_tx_d_flip_4[9] <= tbi_tx_d_4[0];
2932
            end
2933
        end
2934
 
2935
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_4
2936
     (
2937
         .pll_areset ( reset ),
2938
         .rx_cda_reset ( rx_cda_reset_4 ),
2939
         .rx_channel_data_align ( rx_channel_data_align_4 ),
2940
         .rx_locked ( rx_locked_4 ),
2941
         .rx_divfwdclk (tbi_rx_clk_4),
2942
         .rx_in (rxp_4),
2943
         .rx_inclock (ref_clk),
2944
         .rx_out (tbi_rx_d_lvds_4),
2945
         .rx_outclock (),
2946
         .rx_reset (rx_reset_4)
2947
     );
2948
 
2949
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_4 (
2950
                .clk ( ref_clk ),
2951
                .reset ( reset_ref_clk_int ),
2952
                .rx_locked ( rx_locked_4 ),
2953
                .rx_channel_data_align ( rx_channel_data_align_4 ),
2954
                .pll_areset ( pll_areset_4 ),
2955
                .rx_reset ( rx_reset_4 ),
2956
                .rx_cda_reset ( rx_cda_reset_4 )
2957
        );
2958
 
2959
 
2960
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_4
2961
    (
2962
        .tx_in (tbi_tx_d_flip_4),
2963
        .tx_inclock (ref_clk),
2964
                .pll_areset ( reset ),
2965
        .tx_out (txp_4)
2966
    );
2967
 
2968
    end
2969
else
2970
    begin
2971
    assign txp_4 = 1'b0;
2972
    assign tbi_rx_clk_4 = 1'b0;
2973
    end
2974
endgenerate
2975
 
2976
 
2977
 
2978
// #######################################################################
2979
// ###############       CHANNEL 5 LOGIC/COMPONENTS       ###############
2980
// #######################################################################
2981
 
2982
// Export powerdown signal or wire it internally
2983
// ---------------------------------------------
2984
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 5)
2985
    begin
2986
        assign gxb_pwrdn_in_sig[5] = gxb_pwrdn_in_5;
2987
        assign pcs_pwrdn_out_5 = pcs_pwrdn_out_sig[5];
2988
    end
2989
else
2990
    begin
2991
        assign gxb_pwrdn_in_sig[5] = pcs_pwrdn_out_sig[5];
2992
                assign pcs_pwrdn_out_5 = 1'b0;
2993
    end
2994
endgenerate
2995
 
2996
 
2997
// Either one of these blocks below will be instantiated depending on the parameterization 
2998
// that is chosen.
2999
// ---------------------------------------------------------------------------------------
3000
 
3001
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3002
//
3003
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3004
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3005
// reversal algorithm.  
3006
// -------------------------------------------------------------------------
3007
 
3008
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 5)
3009
    begin
3010
 
3011
    assign tbi_tx_clk_5 = ref_clk;
3012
    assign tbi_rx_d_5 = tbi_rx_d_flip_5;
3013
 
3014
    altera_tse_reset_synchronizer ch_5_reset_sync_0 (
3015
        .clk(tbi_rx_clk_5),
3016
        .reset_in(reset),
3017
        .reset_out(reset_tbi_rx_clk_5_int)
3018
        );
3019
 
3020
    always @(posedge tbi_rx_clk_5 or posedge reset_tbi_rx_clk_5_int)
3021
        begin
3022
        if (reset_tbi_rx_clk_5_int == 1)
3023
            tbi_rx_d_flip_5 <= 0;
3024
        else
3025
            begin
3026
            tbi_rx_d_flip_5[0] <= tbi_rx_d_lvds_5[9];
3027
            tbi_rx_d_flip_5[1] <= tbi_rx_d_lvds_5[8];
3028
            tbi_rx_d_flip_5[2] <= tbi_rx_d_lvds_5[7];
3029
            tbi_rx_d_flip_5[3] <= tbi_rx_d_lvds_5[6];
3030
            tbi_rx_d_flip_5[4] <= tbi_rx_d_lvds_5[5];
3031
            tbi_rx_d_flip_5[5] <= tbi_rx_d_lvds_5[4];
3032
            tbi_rx_d_flip_5[6] <= tbi_rx_d_lvds_5[3];
3033
            tbi_rx_d_flip_5[7] <= tbi_rx_d_lvds_5[2];
3034
            tbi_rx_d_flip_5[8] <= tbi_rx_d_lvds_5[1];
3035
            tbi_rx_d_flip_5[9] <= tbi_rx_d_lvds_5[0];
3036
            end
3037
        end
3038
 
3039
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3040
        begin
3041
        if (reset_ref_clk_int == 1)
3042
            tbi_tx_d_flip_5 <= 0;
3043
        else
3044
            begin
3045
            tbi_tx_d_flip_5[0] <= tbi_tx_d_5[9];
3046
            tbi_tx_d_flip_5[1] <= tbi_tx_d_5[8];
3047
            tbi_tx_d_flip_5[2] <= tbi_tx_d_5[7];
3048
            tbi_tx_d_flip_5[3] <= tbi_tx_d_5[6];
3049
            tbi_tx_d_flip_5[4] <= tbi_tx_d_5[5];
3050
            tbi_tx_d_flip_5[5] <= tbi_tx_d_5[4];
3051
            tbi_tx_d_flip_5[6] <= tbi_tx_d_5[3];
3052
            tbi_tx_d_flip_5[7] <= tbi_tx_d_5[2];
3053
            tbi_tx_d_flip_5[8] <= tbi_tx_d_5[1];
3054
            tbi_tx_d_flip_5[9] <= tbi_tx_d_5[0];
3055
            end
3056
        end
3057
 
3058
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_5
3059
     (
3060
         .pll_areset ( reset ),
3061
         .rx_cda_reset ( rx_cda_reset_5 ),
3062
         .rx_channel_data_align ( rx_channel_data_align_5 ),
3063
         .rx_locked ( rx_locked_5 ),
3064
         .rx_divfwdclk (tbi_rx_clk_5),
3065
         .rx_in (rxp_5),
3066
         .rx_inclock (ref_clk),
3067
         .rx_out (tbi_rx_d_lvds_5),
3068
         .rx_outclock (),
3069
         .rx_reset (rx_reset_5)
3070
     );
3071
 
3072
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_5 (
3073
                .clk ( ref_clk ),
3074
                .reset ( reset_ref_clk_int ),
3075
                .rx_locked ( rx_locked_5 ),
3076
                .rx_channel_data_align ( rx_channel_data_align_5 ),
3077
                .pll_areset ( pll_areset_5 ),
3078
                .rx_reset ( rx_reset_5 ),
3079
        .rx_cda_reset ( rx_cda_reset_5 )
3080
        );
3081
 
3082
 
3083
 
3084
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_5
3085
    (
3086
        .tx_in (tbi_tx_d_flip_5),
3087
        .tx_inclock (ref_clk),
3088
                .pll_areset ( reset ),
3089
        .tx_out (txp_5)
3090
    );
3091
 
3092
    end
3093
else
3094
    begin
3095
    assign txp_5 = 1'b0;
3096
    assign tbi_rx_clk_5 = 1'b0;
3097
    end
3098
endgenerate
3099
 
3100
 
3101
 
3102
// #######################################################################
3103
// ###############       CHANNEL 6 LOGIC/COMPONENTS       ###############
3104
// #######################################################################
3105
 
3106
// Export powerdown signal or wire it internally
3107
// ---------------------------------------------
3108
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 6)
3109
    begin
3110
        assign gxb_pwrdn_in_sig[6] = gxb_pwrdn_in_6;
3111
        assign pcs_pwrdn_out_6 = pcs_pwrdn_out_sig[6];
3112
    end
3113
else
3114
    begin
3115
        assign gxb_pwrdn_in_sig[6] = pcs_pwrdn_out_sig[6];
3116
                assign pcs_pwrdn_out_6 = 1'b0;
3117
    end
3118
endgenerate
3119
 
3120
 
3121
// Either one of these blocks below will be instantiated depending on the parameterization 
3122
// that is chosen.
3123
// ---------------------------------------------------------------------------------------
3124
 
3125
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3126
//
3127
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3128
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3129
// reversal algorithm.  
3130
// -------------------------------------------------------------------------
3131
 
3132
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 6)
3133
    begin
3134
 
3135
    assign tbi_tx_clk_6 = ref_clk;
3136
    assign tbi_rx_d_6 = tbi_rx_d_flip_6;
3137
 
3138
    altera_tse_reset_synchronizer ch_6_reset_sync_0 (
3139
        .clk(tbi_rx_clk_6),
3140
        .reset_in(reset),
3141
        .reset_out(reset_tbi_rx_clk_6_int)
3142
        );
3143
 
3144
    always @(posedge tbi_rx_clk_6 or posedge reset_tbi_rx_clk_6_int)
3145
        begin
3146
        if (reset_tbi_rx_clk_6_int == 1)
3147
            tbi_rx_d_flip_6 <= 0;
3148
        else
3149
            begin
3150
            tbi_rx_d_flip_6[0] <= tbi_rx_d_lvds_6[9];
3151
            tbi_rx_d_flip_6[1] <= tbi_rx_d_lvds_6[8];
3152
            tbi_rx_d_flip_6[2] <= tbi_rx_d_lvds_6[7];
3153
            tbi_rx_d_flip_6[3] <= tbi_rx_d_lvds_6[6];
3154
            tbi_rx_d_flip_6[4] <= tbi_rx_d_lvds_6[5];
3155
            tbi_rx_d_flip_6[5] <= tbi_rx_d_lvds_6[4];
3156
            tbi_rx_d_flip_6[6] <= tbi_rx_d_lvds_6[3];
3157
            tbi_rx_d_flip_6[7] <= tbi_rx_d_lvds_6[2];
3158
            tbi_rx_d_flip_6[8] <= tbi_rx_d_lvds_6[1];
3159
            tbi_rx_d_flip_6[9] <= tbi_rx_d_lvds_6[0];
3160
            end
3161
        end
3162
 
3163
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3164
        begin
3165
        if (reset_ref_clk_int == 1)
3166
            tbi_tx_d_flip_6 <= 0;
3167
        else
3168
            begin
3169
            tbi_tx_d_flip_6[0] <= tbi_tx_d_6[9];
3170
            tbi_tx_d_flip_6[1] <= tbi_tx_d_6[8];
3171
            tbi_tx_d_flip_6[2] <= tbi_tx_d_6[7];
3172
            tbi_tx_d_flip_6[3] <= tbi_tx_d_6[6];
3173
            tbi_tx_d_flip_6[4] <= tbi_tx_d_6[5];
3174
            tbi_tx_d_flip_6[5] <= tbi_tx_d_6[4];
3175
            tbi_tx_d_flip_6[6] <= tbi_tx_d_6[3];
3176
            tbi_tx_d_flip_6[7] <= tbi_tx_d_6[2];
3177
            tbi_tx_d_flip_6[8] <= tbi_tx_d_6[1];
3178
            tbi_tx_d_flip_6[9] <= tbi_tx_d_6[0];
3179
            end
3180
        end
3181
 
3182
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_6
3183
     (
3184
         .pll_areset ( reset ),
3185
         .rx_cda_reset ( rx_cda_reset_6 ),
3186
         .rx_channel_data_align ( rx_channel_data_align_6 ),
3187
         .rx_locked ( rx_locked_6 ),
3188
         .rx_divfwdclk (tbi_rx_clk_6),
3189
         .rx_in (rxp_6),
3190
         .rx_inclock (ref_clk),
3191
         .rx_out (tbi_rx_d_lvds_6),
3192
         .rx_outclock (),
3193
         .rx_reset (rx_reset_6)
3194
     );
3195
 
3196
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_6 (
3197
                .clk ( ref_clk ),
3198
                .reset ( reset_ref_clk_int ),
3199
                .rx_locked ( rx_locked_6 ),
3200
                .rx_channel_data_align ( rx_channel_data_align_6 ),
3201
                .pll_areset ( pll_areset_6 ),
3202
                .rx_reset ( rx_reset_6 ),
3203
        .rx_cda_reset ( rx_cda_reset_6 )
3204
        );
3205
 
3206
 
3207
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_6
3208
    (
3209
        .tx_in (tbi_tx_d_flip_6),
3210
        .tx_inclock (ref_clk),
3211
                .pll_areset ( reset ),
3212
        .tx_out (txp_6)
3213
    );
3214
 
3215
    end
3216
else
3217
    begin
3218
    assign txp_6 = 1'b0;
3219
    assign tbi_rx_clk_6 = 1'b0;
3220
    end
3221
endgenerate
3222
 
3223
 
3224
 
3225
// #######################################################################
3226
// ###############       CHANNEL 7 LOGIC/COMPONENTS       ###############
3227
// #######################################################################
3228
 
3229
// Export powerdown signal or wire it internally
3230
// ---------------------------------------------
3231
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 7)
3232
    begin
3233
        assign gxb_pwrdn_in_sig[7] = gxb_pwrdn_in_7;
3234
        assign pcs_pwrdn_out_7 = pcs_pwrdn_out_sig[7];
3235
    end
3236
else
3237
    begin
3238
        assign gxb_pwrdn_in_sig[7] = pcs_pwrdn_out_sig[7];
3239
                assign pcs_pwrdn_out_7 = 1'b0;
3240
    end
3241
endgenerate
3242
 
3243
 
3244
// Either one of these blocks below will be instantiated depending on the parameterization 
3245
// that is chosen.
3246
// ---------------------------------------------------------------------------------------
3247
 
3248
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3249
//
3250
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3251
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3252
// reversal algorithm.  
3253
// -------------------------------------------------------------------------
3254
 
3255
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 7)
3256
    begin
3257
 
3258
    assign tbi_tx_clk_7 = ref_clk;
3259
    assign tbi_rx_d_7 = tbi_rx_d_flip_7;
3260
 
3261
    altera_tse_reset_synchronizer ch_7_reset_sync_0 (
3262
        .clk(tbi_rx_clk_7),
3263
        .reset_in(reset),
3264
        .reset_out(reset_tbi_rx_clk_7_int)
3265
        );
3266
 
3267
    always @(posedge tbi_rx_clk_7 or posedge reset_tbi_rx_clk_7_int)
3268
        begin
3269
        if (reset_tbi_rx_clk_7_int == 1)
3270
            tbi_rx_d_flip_7 <= 0;
3271
        else
3272
            begin
3273
            tbi_rx_d_flip_7[0] <= tbi_rx_d_lvds_7[9];
3274
            tbi_rx_d_flip_7[1] <= tbi_rx_d_lvds_7[8];
3275
            tbi_rx_d_flip_7[2] <= tbi_rx_d_lvds_7[7];
3276
            tbi_rx_d_flip_7[3] <= tbi_rx_d_lvds_7[6];
3277
            tbi_rx_d_flip_7[4] <= tbi_rx_d_lvds_7[5];
3278
            tbi_rx_d_flip_7[5] <= tbi_rx_d_lvds_7[4];
3279
            tbi_rx_d_flip_7[6] <= tbi_rx_d_lvds_7[3];
3280
            tbi_rx_d_flip_7[7] <= tbi_rx_d_lvds_7[2];
3281
            tbi_rx_d_flip_7[8] <= tbi_rx_d_lvds_7[1];
3282
            tbi_rx_d_flip_7[9] <= tbi_rx_d_lvds_7[0];
3283
            end
3284
        end
3285
 
3286
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3287
        begin
3288
        if (reset_ref_clk_int == 1)
3289
            tbi_tx_d_flip_7 <= 0;
3290
        else
3291
            begin
3292
            tbi_tx_d_flip_7[0] <= tbi_tx_d_7[9];
3293
            tbi_tx_d_flip_7[1] <= tbi_tx_d_7[8];
3294
            tbi_tx_d_flip_7[2] <= tbi_tx_d_7[7];
3295
            tbi_tx_d_flip_7[3] <= tbi_tx_d_7[6];
3296
            tbi_tx_d_flip_7[4] <= tbi_tx_d_7[5];
3297
            tbi_tx_d_flip_7[5] <= tbi_tx_d_7[4];
3298
            tbi_tx_d_flip_7[6] <= tbi_tx_d_7[3];
3299
            tbi_tx_d_flip_7[7] <= tbi_tx_d_7[2];
3300
            tbi_tx_d_flip_7[8] <= tbi_tx_d_7[1];
3301
            tbi_tx_d_flip_7[9] <= tbi_tx_d_7[0];
3302
            end
3303
        end
3304
 
3305
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_7
3306
     (
3307
         .pll_areset ( reset ),
3308
         .rx_cda_reset ( rx_cda_reset_7 ),
3309
         .rx_channel_data_align ( rx_channel_data_align_7 ),
3310
         .rx_locked ( rx_locked_7 ),
3311
         .rx_divfwdclk (tbi_rx_clk_7),
3312
         .rx_in (rxp_7),
3313
         .rx_inclock (ref_clk),
3314
         .rx_out (tbi_rx_d_lvds_7),
3315
         .rx_outclock (),
3316
         .rx_reset (rx_reset_7)
3317
     );
3318
 
3319
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_7 (
3320
                .clk ( ref_clk ),
3321
                .reset ( reset_ref_clk_int ),
3322
                .rx_locked ( rx_locked_7 ),
3323
                .rx_channel_data_align ( rx_channel_data_align_7 ),
3324
                .pll_areset ( pll_areset_7 ),
3325
                .rx_reset ( rx_reset_7 ),
3326
        .rx_cda_reset ( rx_cda_reset_7 )
3327
        );
3328
 
3329
 
3330
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_7
3331
    (
3332
        .tx_in (tbi_tx_d_flip_7),
3333
        .tx_inclock (ref_clk),
3334
                .pll_areset ( reset ),
3335
        .tx_out (txp_7)
3336
    );
3337
 
3338
    end
3339
else
3340
    begin
3341
    assign txp_7 = 1'b0;
3342
    assign tbi_rx_clk_7 = 1'b0;
3343
    end
3344
endgenerate
3345
 
3346
 
3347
 
3348
// #######################################################################
3349
// ###############       CHANNEL 8 LOGIC/COMPONENTS       ###############
3350
// #######################################################################
3351
 
3352
// Export powerdown signal or wire it internally
3353
// ---------------------------------------------
3354
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 8)
3355
    begin
3356
        assign gxb_pwrdn_in_sig[8] = gxb_pwrdn_in_8;
3357
        assign pcs_pwrdn_out_8 = pcs_pwrdn_out_sig[8];
3358
    end
3359
else
3360
    begin
3361
        assign gxb_pwrdn_in_sig[8] = pcs_pwrdn_out_sig[8];
3362
                assign pcs_pwrdn_out_8 = 1'b0;
3363
    end
3364
endgenerate
3365
 
3366
 
3367
// Either one of these blocks below will be instantiated depending on the parameterization 
3368
// that is chosen.
3369
// ---------------------------------------------------------------------------------------
3370
 
3371
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3372
//
3373
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3374
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3375
// reversal algorithm.  
3376
// -------------------------------------------------------------------------
3377
 
3378
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 8)
3379
    begin
3380
 
3381
    assign tbi_tx_clk_8 = ref_clk;
3382
    assign tbi_rx_d_8 = tbi_rx_d_flip_8;
3383
 
3384
    altera_tse_reset_synchronizer ch_8_reset_sync_0 (
3385
        .clk(tbi_rx_clk_8),
3386
        .reset_in(reset),
3387
        .reset_out(reset_tbi_rx_clk_8_int)
3388
        );
3389
 
3390
    always @(posedge tbi_rx_clk_8 or posedge reset_tbi_rx_clk_8_int)
3391
        begin
3392
        if (reset_tbi_rx_clk_8_int == 1)
3393
            tbi_rx_d_flip_8 <= 0;
3394
        else
3395
            begin
3396
            tbi_rx_d_flip_8[0] <= tbi_rx_d_lvds_8[9];
3397
            tbi_rx_d_flip_8[1] <= tbi_rx_d_lvds_8[8];
3398
            tbi_rx_d_flip_8[2] <= tbi_rx_d_lvds_8[7];
3399
            tbi_rx_d_flip_8[3] <= tbi_rx_d_lvds_8[6];
3400
            tbi_rx_d_flip_8[4] <= tbi_rx_d_lvds_8[5];
3401
            tbi_rx_d_flip_8[5] <= tbi_rx_d_lvds_8[4];
3402
            tbi_rx_d_flip_8[6] <= tbi_rx_d_lvds_8[3];
3403
            tbi_rx_d_flip_8[7] <= tbi_rx_d_lvds_8[2];
3404
            tbi_rx_d_flip_8[8] <= tbi_rx_d_lvds_8[1];
3405
            tbi_rx_d_flip_8[9] <= tbi_rx_d_lvds_8[0];
3406
            end
3407
        end
3408
 
3409
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3410
        begin
3411
        if (reset_ref_clk_int == 1)
3412
            tbi_tx_d_flip_8 <= 0;
3413
        else
3414
            begin
3415
            tbi_tx_d_flip_8[0] <= tbi_tx_d_8[9];
3416
            tbi_tx_d_flip_8[1] <= tbi_tx_d_8[8];
3417
            tbi_tx_d_flip_8[2] <= tbi_tx_d_8[7];
3418
            tbi_tx_d_flip_8[3] <= tbi_tx_d_8[6];
3419
            tbi_tx_d_flip_8[4] <= tbi_tx_d_8[5];
3420
            tbi_tx_d_flip_8[5] <= tbi_tx_d_8[4];
3421
            tbi_tx_d_flip_8[6] <= tbi_tx_d_8[3];
3422
            tbi_tx_d_flip_8[7] <= tbi_tx_d_8[2];
3423
            tbi_tx_d_flip_8[8] <= tbi_tx_d_8[1];
3424
            tbi_tx_d_flip_8[9] <= tbi_tx_d_8[0];
3425
            end
3426
        end
3427
 
3428
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_8
3429
     (
3430
         .pll_areset ( reset ),
3431
         .rx_cda_reset ( rx_cda_reset_8 ),
3432
         .rx_channel_data_align ( rx_channel_data_align_8 ),
3433
         .rx_locked ( rx_locked_8 ),
3434
         .rx_divfwdclk (tbi_rx_clk_8),
3435
         .rx_in (rxp_8),
3436
         .rx_inclock (ref_clk),
3437
         .rx_out (tbi_rx_d_lvds_8),
3438
         .rx_outclock (),
3439
         .rx_reset (rx_reset_8)
3440
     );
3441
 
3442
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_8 (
3443
                .clk ( ref_clk ),
3444
                .reset ( reset_ref_clk_int ),
3445
                .rx_locked ( rx_locked_8 ),
3446
                .rx_channel_data_align ( rx_channel_data_align_8 ),
3447
                .pll_areset ( pll_areset_8 ),
3448
                .rx_reset ( rx_reset_8 ),
3449
        .rx_cda_reset ( rx_cda_reset_8 )
3450
        );
3451
 
3452
 
3453
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_8
3454
    (
3455
        .tx_in (tbi_tx_d_flip_8),
3456
        .tx_inclock (ref_clk),
3457
                .pll_areset ( reset ),
3458
        .tx_out (txp_8)
3459
    );
3460
 
3461
    end
3462
else
3463
    begin
3464
    assign txp_8 = 1'b0;
3465
    assign tbi_rx_clk_8 = 1'b0;
3466
    end
3467
endgenerate
3468
 
3469
 
3470
 
3471
// #######################################################################
3472
// ###############       CHANNEL 9 LOGIC/COMPONENTS       ###############
3473
// #######################################################################
3474
 
3475
// Export powerdown signal or wire it internally
3476
// ---------------------------------------------
3477
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 9)
3478
    begin
3479
        assign gxb_pwrdn_in_sig[9] = gxb_pwrdn_in_9;
3480
        assign pcs_pwrdn_out_9 = pcs_pwrdn_out_sig[9];
3481
    end
3482
else
3483
    begin
3484
        assign gxb_pwrdn_in_sig[9] = pcs_pwrdn_out_sig[9];
3485
                assign pcs_pwrdn_out_9 = 1'b0;
3486
    end
3487
endgenerate
3488
 
3489
 
3490
// Either one of these blocks below will be instantiated depending on the parameterization 
3491
// that is chosen.
3492
// ---------------------------------------------------------------------------------------
3493
 
3494
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3495
//
3496
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3497
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3498
// reversal algorithm.  
3499
// -------------------------------------------------------------------------
3500
 
3501
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 9)
3502
    begin
3503
 
3504
    assign tbi_tx_clk_9 = ref_clk;
3505
    assign tbi_rx_d_9 = tbi_rx_d_flip_9;
3506
 
3507
    altera_tse_reset_synchronizer ch_9_reset_sync_0 (
3508
        .clk(tbi_rx_clk_9),
3509
        .reset_in(reset),
3510
        .reset_out(reset_tbi_rx_clk_9_int)
3511
        );
3512
 
3513
    always @(posedge tbi_rx_clk_9 or posedge reset_tbi_rx_clk_9_int)
3514
        begin
3515
        if (reset_tbi_rx_clk_9_int == 1)
3516
            tbi_rx_d_flip_9 <= 0;
3517
        else
3518
            begin
3519
            tbi_rx_d_flip_9[0] <= tbi_rx_d_lvds_9[9];
3520
            tbi_rx_d_flip_9[1] <= tbi_rx_d_lvds_9[8];
3521
            tbi_rx_d_flip_9[2] <= tbi_rx_d_lvds_9[7];
3522
            tbi_rx_d_flip_9[3] <= tbi_rx_d_lvds_9[6];
3523
            tbi_rx_d_flip_9[4] <= tbi_rx_d_lvds_9[5];
3524
            tbi_rx_d_flip_9[5] <= tbi_rx_d_lvds_9[4];
3525
            tbi_rx_d_flip_9[6] <= tbi_rx_d_lvds_9[3];
3526
            tbi_rx_d_flip_9[7] <= tbi_rx_d_lvds_9[2];
3527
            tbi_rx_d_flip_9[8] <= tbi_rx_d_lvds_9[1];
3528
            tbi_rx_d_flip_9[9] <= tbi_rx_d_lvds_9[0];
3529
            end
3530
        end
3531
 
3532
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3533
        begin
3534
        if (reset_ref_clk_int == 1)
3535
            tbi_tx_d_flip_9 <= 0;
3536
        else
3537
            begin
3538
            tbi_tx_d_flip_9[0] <= tbi_tx_d_9[9];
3539
            tbi_tx_d_flip_9[1] <= tbi_tx_d_9[8];
3540
            tbi_tx_d_flip_9[2] <= tbi_tx_d_9[7];
3541
            tbi_tx_d_flip_9[3] <= tbi_tx_d_9[6];
3542
            tbi_tx_d_flip_9[4] <= tbi_tx_d_9[5];
3543
            tbi_tx_d_flip_9[5] <= tbi_tx_d_9[4];
3544
            tbi_tx_d_flip_9[6] <= tbi_tx_d_9[3];
3545
            tbi_tx_d_flip_9[7] <= tbi_tx_d_9[2];
3546
            tbi_tx_d_flip_9[8] <= tbi_tx_d_9[1];
3547
            tbi_tx_d_flip_9[9] <= tbi_tx_d_9[0];
3548
            end
3549
        end
3550
 
3551
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_9
3552
     (
3553
         .pll_areset ( reset ),
3554
         .rx_cda_reset ( rx_cda_reset_9 ),
3555
         .rx_channel_data_align ( rx_channel_data_align_9 ),
3556
         .rx_locked ( rx_locked_9 ),
3557
         .rx_divfwdclk (tbi_rx_clk_9),
3558
         .rx_in (rxp_9),
3559
         .rx_inclock (ref_clk),
3560
         .rx_out (tbi_rx_d_lvds_9),
3561
         .rx_outclock (),
3562
         .rx_reset (rx_reset_9)
3563
     );
3564
 
3565
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_9 (
3566
                .clk ( ref_clk ),
3567
                .reset ( reset_ref_clk_int ),
3568
                .rx_locked ( rx_locked_9 ),
3569
                .rx_channel_data_align ( rx_channel_data_align_9 ),
3570
                .pll_areset ( pll_areset_9 ),
3571
                .rx_reset ( rx_reset_9 ),
3572
        .rx_cda_reset ( rx_cda_reset_9 )
3573
        );
3574
 
3575
 
3576
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_9
3577
    (
3578
        .tx_in (tbi_tx_d_flip_9),
3579
        .tx_inclock (ref_clk),
3580
                .pll_areset ( reset ),
3581
        .tx_out (txp_9)
3582
    );
3583
 
3584
    end
3585
else
3586
    begin
3587
    assign txp_9 = 1'b0;
3588
    assign tbi_rx_clk_9 = 1'b0;
3589
    end
3590
endgenerate
3591
 
3592
 
3593
 
3594
// #######################################################################
3595
// ###############       CHANNEL 10 LOGIC/COMPONENTS       ###############
3596
// #######################################################################
3597
 
3598
// Export powerdown signal or wire it internally
3599
// ---------------------------------------------
3600
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 10)
3601
    begin
3602
        assign gxb_pwrdn_in_sig[10] = gxb_pwrdn_in_10;
3603
        assign pcs_pwrdn_out_10 = pcs_pwrdn_out_sig[10];
3604
    end
3605
else
3606
    begin
3607
        assign gxb_pwrdn_in_sig[10] = pcs_pwrdn_out_sig[10];
3608
                assign pcs_pwrdn_out_10 = 1'b0;
3609
    end
3610
endgenerate
3611
 
3612
 
3613
// Either one of these blocks below will be instantiated depending on the parameterization 
3614
// that is chosen.
3615
// ---------------------------------------------------------------------------------------
3616
 
3617
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3618
//
3619
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3620
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3621
// reversal algorithm.  
3622
// -------------------------------------------------------------------------
3623
 
3624
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 10)
3625
    begin
3626
 
3627
    assign tbi_tx_clk_10 = ref_clk;
3628
    assign tbi_rx_d_10 = tbi_rx_d_flip_10;
3629
 
3630
    altera_tse_reset_synchronizer ch_10_reset_sync_0 (
3631
        .clk(tbi_rx_clk_10),
3632
        .reset_in(reset),
3633
        .reset_out(reset_tbi_rx_clk_10_int)
3634
        );
3635
 
3636
    always @(posedge tbi_rx_clk_10 or posedge reset_tbi_rx_clk_10_int)
3637
        begin
3638
        if (reset_tbi_rx_clk_10_int == 1)
3639
            tbi_rx_d_flip_10 <= 0;
3640
        else
3641
            begin
3642
            tbi_rx_d_flip_10[0] <= tbi_rx_d_lvds_10[9];
3643
            tbi_rx_d_flip_10[1] <= tbi_rx_d_lvds_10[8];
3644
            tbi_rx_d_flip_10[2] <= tbi_rx_d_lvds_10[7];
3645
            tbi_rx_d_flip_10[3] <= tbi_rx_d_lvds_10[6];
3646
            tbi_rx_d_flip_10[4] <= tbi_rx_d_lvds_10[5];
3647
            tbi_rx_d_flip_10[5] <= tbi_rx_d_lvds_10[4];
3648
            tbi_rx_d_flip_10[6] <= tbi_rx_d_lvds_10[3];
3649
            tbi_rx_d_flip_10[7] <= tbi_rx_d_lvds_10[2];
3650
            tbi_rx_d_flip_10[8] <= tbi_rx_d_lvds_10[1];
3651
            tbi_rx_d_flip_10[9] <= tbi_rx_d_lvds_10[0];
3652
            end
3653
        end
3654
 
3655
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3656
        begin
3657
        if (reset_ref_clk_int == 1)
3658
            tbi_tx_d_flip_10 <= 0;
3659
        else
3660
            begin
3661
            tbi_tx_d_flip_10[0] <= tbi_tx_d_10[9];
3662
            tbi_tx_d_flip_10[1] <= tbi_tx_d_10[8];
3663
            tbi_tx_d_flip_10[2] <= tbi_tx_d_10[7];
3664
            tbi_tx_d_flip_10[3] <= tbi_tx_d_10[6];
3665
            tbi_tx_d_flip_10[4] <= tbi_tx_d_10[5];
3666
            tbi_tx_d_flip_10[5] <= tbi_tx_d_10[4];
3667
            tbi_tx_d_flip_10[6] <= tbi_tx_d_10[3];
3668
            tbi_tx_d_flip_10[7] <= tbi_tx_d_10[2];
3669
            tbi_tx_d_flip_10[8] <= tbi_tx_d_10[1];
3670
            tbi_tx_d_flip_10[9] <= tbi_tx_d_10[0];
3671
            end
3672
        end
3673
 
3674
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_10
3675
     (
3676
         .pll_areset ( reset ),
3677
         .rx_cda_reset ( rx_cda_reset_10 ),
3678
         .rx_channel_data_align ( rx_channel_data_align_10 ),
3679
         .rx_locked ( rx_locked_10 ),
3680
         .rx_divfwdclk (tbi_rx_clk_10),
3681
         .rx_in (rxp_10),
3682
         .rx_inclock (ref_clk),
3683
         .rx_out (tbi_rx_d_lvds_10),
3684
         .rx_outclock (),
3685
         .rx_reset (rx_reset_10)
3686
     );
3687
 
3688
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_10 (
3689
                .clk ( ref_clk ),
3690
                .reset ( reset_ref_clk_int ),
3691
                .rx_locked ( rx_locked_10 ),
3692
                .rx_channel_data_align ( rx_channel_data_align_10 ),
3693
                .pll_areset ( pll_areset_10 ),
3694
                .rx_reset ( rx_reset_10 ),
3695
        .rx_cda_reset ( rx_cda_reset_10 )
3696
        );
3697
 
3698
 
3699
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_10
3700
    (
3701
        .tx_in (tbi_tx_d_flip_10),
3702
        .tx_inclock (ref_clk),
3703
                .pll_areset ( reset ),
3704
        .tx_out (txp_10)
3705
    );
3706
 
3707
    end
3708
else
3709
    begin
3710
    assign txp_10 = 1'b0;
3711
    assign tbi_rx_clk_10 = 1'b0;
3712
    end
3713
endgenerate
3714
 
3715
 
3716
 
3717
// #######################################################################
3718
// ###############       CHANNEL 11 LOGIC/COMPONENTS       ###############
3719
// #######################################################################
3720
 
3721
// Export powerdown signal or wire it internally
3722
// ---------------------------------------------
3723
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 11)
3724
    begin
3725
        assign gxb_pwrdn_in_sig[11] = gxb_pwrdn_in_11;
3726
        assign pcs_pwrdn_out_11 = pcs_pwrdn_out_sig[11];
3727
    end
3728
else
3729
    begin
3730
        assign gxb_pwrdn_in_sig[11] = pcs_pwrdn_out_sig[11];
3731
                assign pcs_pwrdn_out_11 = 1'b0;
3732
    end
3733
endgenerate
3734
 
3735
 
3736
// Either one of these blocks below will be instantiated depending on the parameterization 
3737
// that is chosen.
3738
// ---------------------------------------------------------------------------------------
3739
 
3740
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3741
//
3742
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3743
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3744
// reversal algorithm.  
3745
// -------------------------------------------------------------------------
3746
 
3747
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 11)
3748
    begin
3749
 
3750
    assign tbi_tx_clk_11 = ref_clk;
3751
    assign tbi_rx_d_11 = tbi_rx_d_flip_11;
3752
 
3753
    altera_tse_reset_synchronizer ch_11_reset_sync_0 (
3754
        .clk(tbi_rx_clk_11),
3755
        .reset_in(reset),
3756
        .reset_out(reset_tbi_rx_clk_11_int)
3757
        );
3758
 
3759
    always @(posedge tbi_rx_clk_11 or posedge reset_tbi_rx_clk_11_int)
3760
        begin
3761
        if (reset_tbi_rx_clk_11_int == 1)
3762
            tbi_rx_d_flip_11 <= 0;
3763
        else
3764
            begin
3765
            tbi_rx_d_flip_11[0] <= tbi_rx_d_lvds_11[9];
3766
            tbi_rx_d_flip_11[1] <= tbi_rx_d_lvds_11[8];
3767
            tbi_rx_d_flip_11[2] <= tbi_rx_d_lvds_11[7];
3768
            tbi_rx_d_flip_11[3] <= tbi_rx_d_lvds_11[6];
3769
            tbi_rx_d_flip_11[4] <= tbi_rx_d_lvds_11[5];
3770
            tbi_rx_d_flip_11[5] <= tbi_rx_d_lvds_11[4];
3771
            tbi_rx_d_flip_11[6] <= tbi_rx_d_lvds_11[3];
3772
            tbi_rx_d_flip_11[7] <= tbi_rx_d_lvds_11[2];
3773
            tbi_rx_d_flip_11[8] <= tbi_rx_d_lvds_11[1];
3774
            tbi_rx_d_flip_11[9] <= tbi_rx_d_lvds_11[0];
3775
            end
3776
        end
3777
 
3778
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3779
        begin
3780
        if (reset_ref_clk_int == 1)
3781
            tbi_tx_d_flip_11 <= 0;
3782
        else
3783
            begin
3784
            tbi_tx_d_flip_11[0] <= tbi_tx_d_11[9];
3785
            tbi_tx_d_flip_11[1] <= tbi_tx_d_11[8];
3786
            tbi_tx_d_flip_11[2] <= tbi_tx_d_11[7];
3787
            tbi_tx_d_flip_11[3] <= tbi_tx_d_11[6];
3788
            tbi_tx_d_flip_11[4] <= tbi_tx_d_11[5];
3789
            tbi_tx_d_flip_11[5] <= tbi_tx_d_11[4];
3790
            tbi_tx_d_flip_11[6] <= tbi_tx_d_11[3];
3791
            tbi_tx_d_flip_11[7] <= tbi_tx_d_11[2];
3792
            tbi_tx_d_flip_11[8] <= tbi_tx_d_11[1];
3793
            tbi_tx_d_flip_11[9] <= tbi_tx_d_11[0];
3794
            end
3795
        end
3796
 
3797
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_11
3798
     (
3799
         .pll_areset ( reset ),
3800
         .rx_cda_reset ( rx_cda_reset_11 ),
3801
         .rx_channel_data_align ( rx_channel_data_align_11 ),
3802
         .rx_locked ( rx_locked_11 ),
3803
         .rx_divfwdclk (tbi_rx_clk_11),
3804
         .rx_in (rxp_11),
3805
         .rx_inclock (ref_clk),
3806
         .rx_out (tbi_rx_d_lvds_11),
3807
         .rx_outclock (),
3808
         .rx_reset (rx_reset_11)
3809
     );
3810
 
3811
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_11 (
3812
                .clk ( ref_clk ),
3813
                .reset ( reset_ref_clk_int ),
3814
                .rx_locked ( rx_locked_11 ),
3815
                .rx_channel_data_align ( rx_channel_data_align_11 ),
3816
                .pll_areset ( pll_areset_11 ),
3817
                .rx_reset ( rx_reset_11 ),
3818
        .rx_cda_reset ( rx_cda_reset_11 )
3819
        );
3820
 
3821
 
3822
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_11
3823
    (
3824
        .tx_in (tbi_tx_d_flip_11),
3825
        .tx_inclock (ref_clk),
3826
                .pll_areset ( reset ),
3827
        .tx_out (txp_11)
3828
    );
3829
 
3830
    end
3831
else
3832
    begin
3833
    assign txp_11 = 1'b0;
3834
    assign tbi_rx_clk_11 = 1'b0;
3835
    end
3836
endgenerate
3837
 
3838
 
3839
 
3840
// #######################################################################
3841
// ###############       CHANNEL 12 LOGIC/COMPONENTS       ###############
3842
// #######################################################################
3843
 
3844
// Export powerdown signal or wire it internally
3845
// ---------------------------------------------
3846
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 12)
3847
    begin
3848
        assign gxb_pwrdn_in_sig[12] = gxb_pwrdn_in_12;
3849
        assign pcs_pwrdn_out_12 = pcs_pwrdn_out_sig[12];
3850
    end
3851
else
3852
    begin
3853
        assign gxb_pwrdn_in_sig[12] = pcs_pwrdn_out_sig[12];
3854
                assign pcs_pwrdn_out_12 = 1'b0;
3855
    end
3856
endgenerate
3857
 
3858
 
3859
// Either one of these blocks below will be instantiated depending on the parameterization 
3860
// that is chosen.
3861
// ---------------------------------------------------------------------------------------
3862
 
3863
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3864
//
3865
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3866
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3867
// reversal algorithm.  
3868
// -------------------------------------------------------------------------
3869
 
3870
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 12)
3871
    begin
3872
 
3873
    assign tbi_tx_clk_12 = ref_clk;
3874
    assign tbi_rx_d_12 = tbi_rx_d_flip_12;
3875
 
3876
    altera_tse_reset_synchronizer ch_12_reset_sync_0 (
3877
        .clk(tbi_rx_clk_12),
3878
        .reset_in(reset),
3879
        .reset_out(reset_tbi_rx_clk_12_int)
3880
        );
3881
 
3882
    always @(posedge tbi_rx_clk_12 or posedge reset_tbi_rx_clk_12_int)
3883
        begin
3884
        if (reset_tbi_rx_clk_12_int == 1)
3885
            tbi_rx_d_flip_12 <= 0;
3886
        else
3887
            begin
3888
            tbi_rx_d_flip_12[0] <= tbi_rx_d_lvds_12[9];
3889
            tbi_rx_d_flip_12[1] <= tbi_rx_d_lvds_12[8];
3890
            tbi_rx_d_flip_12[2] <= tbi_rx_d_lvds_12[7];
3891
            tbi_rx_d_flip_12[3] <= tbi_rx_d_lvds_12[6];
3892
            tbi_rx_d_flip_12[4] <= tbi_rx_d_lvds_12[5];
3893
            tbi_rx_d_flip_12[5] <= tbi_rx_d_lvds_12[4];
3894
            tbi_rx_d_flip_12[6] <= tbi_rx_d_lvds_12[3];
3895
            tbi_rx_d_flip_12[7] <= tbi_rx_d_lvds_12[2];
3896
            tbi_rx_d_flip_12[8] <= tbi_rx_d_lvds_12[1];
3897
            tbi_rx_d_flip_12[9] <= tbi_rx_d_lvds_12[0];
3898
            end
3899
        end
3900
 
3901
    always @(posedge ref_clk or posedge reset_ref_clk_int)
3902
        begin
3903
        if (reset_ref_clk_int == 1)
3904
            tbi_tx_d_flip_12 <= 0;
3905
        else
3906
            begin
3907
            tbi_tx_d_flip_12[0] <= tbi_tx_d_12[9];
3908
            tbi_tx_d_flip_12[1] <= tbi_tx_d_12[8];
3909
            tbi_tx_d_flip_12[2] <= tbi_tx_d_12[7];
3910
            tbi_tx_d_flip_12[3] <= tbi_tx_d_12[6];
3911
            tbi_tx_d_flip_12[4] <= tbi_tx_d_12[5];
3912
            tbi_tx_d_flip_12[5] <= tbi_tx_d_12[4];
3913
            tbi_tx_d_flip_12[6] <= tbi_tx_d_12[3];
3914
            tbi_tx_d_flip_12[7] <= tbi_tx_d_12[2];
3915
            tbi_tx_d_flip_12[8] <= tbi_tx_d_12[1];
3916
            tbi_tx_d_flip_12[9] <= tbi_tx_d_12[0];
3917
            end
3918
        end
3919
 
3920
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_12
3921
     (
3922
         .pll_areset ( reset ),
3923
         .rx_cda_reset ( rx_cda_reset_12 ),
3924
         .rx_channel_data_align ( rx_channel_data_align_12 ),
3925
         .rx_locked ( rx_locked_12 ),
3926
         .rx_divfwdclk (tbi_rx_clk_12),
3927
         .rx_in (rxp_12),
3928
         .rx_inclock (ref_clk),
3929
         .rx_out (tbi_rx_d_lvds_12),
3930
         .rx_outclock (),
3931
         .rx_reset (rx_reset_12)
3932
     );
3933
 
3934
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_12 (
3935
                .clk ( ref_clk ),
3936
                .reset ( reset_ref_clk_int ),
3937
                .rx_locked ( rx_locked_12 ),
3938
                .rx_channel_data_align ( rx_channel_data_align_12 ),
3939
                .pll_areset ( pll_areset_12 ),
3940
                .rx_reset ( rx_reset_12 ),
3941
        .rx_cda_reset ( rx_cda_reset_12 )
3942
        );
3943
 
3944
 
3945
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_12
3946
    (
3947
        .tx_in (tbi_tx_d_flip_12),
3948
        .tx_inclock (ref_clk),
3949
                .pll_areset ( reset ),
3950
        .tx_out (txp_12)
3951
    );
3952
 
3953
    end
3954
else
3955
    begin
3956
    assign txp_12 = 1'b0;
3957
    assign tbi_rx_clk_12 = 1'b0;
3958
    end
3959
endgenerate
3960
 
3961
 
3962
 
3963
// #######################################################################
3964
// ###############       CHANNEL 13 LOGIC/COMPONENTS       ###############
3965
// #######################################################################
3966
 
3967
// Export powerdown signal or wire it internally
3968
// ---------------------------------------------
3969
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 13)
3970
    begin
3971
        assign gxb_pwrdn_in_sig[13] = gxb_pwrdn_in_13;
3972
        assign pcs_pwrdn_out_13 = pcs_pwrdn_out_sig[13];
3973
    end
3974
else
3975
    begin
3976
        assign gxb_pwrdn_in_sig[13] = pcs_pwrdn_out_sig[13];
3977
                assign pcs_pwrdn_out_13 = 1'b0;
3978
    end
3979
endgenerate
3980
 
3981
 
3982
// Either one of these blocks below will be instantiated depending on the parameterization 
3983
// that is chosen.
3984
// ---------------------------------------------------------------------------------------
3985
 
3986
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
3987
//
3988
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
3989
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
3990
// reversal algorithm.  
3991
// -------------------------------------------------------------------------
3992
 
3993
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 13)
3994
    begin
3995
 
3996
    assign tbi_tx_clk_13 = ref_clk;
3997
    assign tbi_rx_d_13 = tbi_rx_d_flip_13;
3998
 
3999
    altera_tse_reset_synchronizer ch_13_reset_sync_0 (
4000
        .clk(tbi_rx_clk_13),
4001
        .reset_in(reset),
4002
        .reset_out(reset_tbi_rx_clk_13_int)
4003
        );
4004
 
4005
    always @(posedge tbi_rx_clk_13 or posedge reset_tbi_rx_clk_13_int)
4006
        begin
4007
        if (reset_tbi_rx_clk_13_int == 1)
4008
            tbi_rx_d_flip_13 <= 0;
4009
        else
4010
            begin
4011
            tbi_rx_d_flip_13[0] <= tbi_rx_d_lvds_13[9];
4012
            tbi_rx_d_flip_13[1] <= tbi_rx_d_lvds_13[8];
4013
            tbi_rx_d_flip_13[2] <= tbi_rx_d_lvds_13[7];
4014
            tbi_rx_d_flip_13[3] <= tbi_rx_d_lvds_13[6];
4015
            tbi_rx_d_flip_13[4] <= tbi_rx_d_lvds_13[5];
4016
            tbi_rx_d_flip_13[5] <= tbi_rx_d_lvds_13[4];
4017
            tbi_rx_d_flip_13[6] <= tbi_rx_d_lvds_13[3];
4018
            tbi_rx_d_flip_13[7] <= tbi_rx_d_lvds_13[2];
4019
            tbi_rx_d_flip_13[8] <= tbi_rx_d_lvds_13[1];
4020
            tbi_rx_d_flip_13[9] <= tbi_rx_d_lvds_13[0];
4021
            end
4022
        end
4023
 
4024
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4025
        begin
4026
        if (reset_ref_clk_int == 1)
4027
            tbi_tx_d_flip_13 <= 0;
4028
        else
4029
            begin
4030
            tbi_tx_d_flip_13[0] <= tbi_tx_d_13[9];
4031
            tbi_tx_d_flip_13[1] <= tbi_tx_d_13[8];
4032
            tbi_tx_d_flip_13[2] <= tbi_tx_d_13[7];
4033
            tbi_tx_d_flip_13[3] <= tbi_tx_d_13[6];
4034
            tbi_tx_d_flip_13[4] <= tbi_tx_d_13[5];
4035
            tbi_tx_d_flip_13[5] <= tbi_tx_d_13[4];
4036
            tbi_tx_d_flip_13[6] <= tbi_tx_d_13[3];
4037
            tbi_tx_d_flip_13[7] <= tbi_tx_d_13[2];
4038
            tbi_tx_d_flip_13[8] <= tbi_tx_d_13[1];
4039
            tbi_tx_d_flip_13[9] <= tbi_tx_d_13[0];
4040
            end
4041
        end
4042
 
4043
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_13
4044
     (
4045
         .pll_areset ( reset ),
4046
         .rx_cda_reset ( rx_cda_reset_13 ),
4047
         .rx_channel_data_align ( rx_channel_data_align_13 ),
4048
         .rx_locked ( rx_locked_13 ),
4049
         .rx_divfwdclk (tbi_rx_clk_13),
4050
         .rx_in (rxp_13),
4051
         .rx_inclock (ref_clk),
4052
         .rx_out (tbi_rx_d_lvds_13),
4053
         .rx_outclock (),
4054
         .rx_reset (rx_reset_13)
4055
     );
4056
 
4057
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_13 (
4058
                .clk ( ref_clk ),
4059
                .reset ( reset_ref_clk_int ),
4060
                .rx_locked ( rx_locked_13 ),
4061
                .rx_channel_data_align ( rx_channel_data_align_13 ),
4062
                .pll_areset ( pll_areset_13 ),
4063
                .rx_reset ( rx_reset_13 ),
4064
        .rx_cda_reset ( rx_cda_reset_13 )
4065
        );
4066
 
4067
 
4068
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_13
4069
    (
4070
        .tx_in (tbi_tx_d_flip_13),
4071
        .tx_inclock (ref_clk),
4072
                .pll_areset ( reset ),
4073
        .tx_out (txp_13)
4074
    );
4075
 
4076
    end
4077
else
4078
    begin
4079
    assign txp_13 = 1'b0;
4080
    assign tbi_rx_clk_13 = 1'b0;
4081
    end
4082
endgenerate
4083
 
4084
 
4085
 
4086
// #######################################################################
4087
// ###############       CHANNEL 14 LOGIC/COMPONENTS       ###############
4088
// #######################################################################
4089
 
4090
// Export powerdown signal or wire it internally
4091
// ---------------------------------------------
4092
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 14)
4093
    begin
4094
        assign gxb_pwrdn_in_sig[14] = gxb_pwrdn_in_14;
4095
        assign pcs_pwrdn_out_14 = pcs_pwrdn_out_sig[14];
4096
    end
4097
else
4098
    begin
4099
        assign gxb_pwrdn_in_sig[14] = pcs_pwrdn_out_sig[14];
4100
                assign pcs_pwrdn_out_14 = 1'b0;
4101
    end
4102
endgenerate
4103
 
4104
 
4105
// Either one of these blocks below will be instantiated depending on the parameterization 
4106
// that is chosen.
4107
// ---------------------------------------------------------------------------------------
4108
 
4109
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4110
//
4111
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4112
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4113
// reversal algorithm.  
4114
// -------------------------------------------------------------------------
4115
 
4116
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 14)
4117
    begin
4118
 
4119
    assign tbi_tx_clk_14 = ref_clk;
4120
    assign tbi_rx_d_14 = tbi_rx_d_flip_14;
4121
 
4122
    altera_tse_reset_synchronizer ch_14_reset_sync_0 (
4123
        .clk(tbi_rx_clk_14),
4124
        .reset_in(reset),
4125
        .reset_out(reset_tbi_rx_clk_14_int)
4126
        );
4127
 
4128
    always @(posedge tbi_rx_clk_14 or posedge reset_tbi_rx_clk_14_int)
4129
        begin
4130
        if (reset_tbi_rx_clk_14_int == 1)
4131
            tbi_rx_d_flip_14 <= 0;
4132
        else
4133
            begin
4134
            tbi_rx_d_flip_14[0] <= tbi_rx_d_lvds_14[9];
4135
            tbi_rx_d_flip_14[1] <= tbi_rx_d_lvds_14[8];
4136
            tbi_rx_d_flip_14[2] <= tbi_rx_d_lvds_14[7];
4137
            tbi_rx_d_flip_14[3] <= tbi_rx_d_lvds_14[6];
4138
            tbi_rx_d_flip_14[4] <= tbi_rx_d_lvds_14[5];
4139
            tbi_rx_d_flip_14[5] <= tbi_rx_d_lvds_14[4];
4140
            tbi_rx_d_flip_14[6] <= tbi_rx_d_lvds_14[3];
4141
            tbi_rx_d_flip_14[7] <= tbi_rx_d_lvds_14[2];
4142
            tbi_rx_d_flip_14[8] <= tbi_rx_d_lvds_14[1];
4143
            tbi_rx_d_flip_14[9] <= tbi_rx_d_lvds_14[0];
4144
            end
4145
        end
4146
 
4147
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4148
        begin
4149
        if (reset_ref_clk_int == 1)
4150
            tbi_tx_d_flip_14 <= 0;
4151
        else
4152
            begin
4153
            tbi_tx_d_flip_14[0] <= tbi_tx_d_14[9];
4154
            tbi_tx_d_flip_14[1] <= tbi_tx_d_14[8];
4155
            tbi_tx_d_flip_14[2] <= tbi_tx_d_14[7];
4156
            tbi_tx_d_flip_14[3] <= tbi_tx_d_14[6];
4157
            tbi_tx_d_flip_14[4] <= tbi_tx_d_14[5];
4158
            tbi_tx_d_flip_14[5] <= tbi_tx_d_14[4];
4159
            tbi_tx_d_flip_14[6] <= tbi_tx_d_14[3];
4160
            tbi_tx_d_flip_14[7] <= tbi_tx_d_14[2];
4161
            tbi_tx_d_flip_14[8] <= tbi_tx_d_14[1];
4162
            tbi_tx_d_flip_14[9] <= tbi_tx_d_14[0];
4163
            end
4164
        end
4165
 
4166
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_14
4167
     (
4168
         .pll_areset ( reset ),
4169
         .rx_cda_reset ( rx_cda_reset_14 ),
4170
         .rx_channel_data_align ( rx_channel_data_align_14 ),
4171
         .rx_locked ( rx_locked_14 ),
4172
         .rx_divfwdclk (tbi_rx_clk_14),
4173
         .rx_in (rxp_14),
4174
         .rx_inclock (ref_clk),
4175
         .rx_out (tbi_rx_d_lvds_14),
4176
         .rx_outclock (),
4177
         .rx_reset (rx_reset_14)
4178
     );
4179
 
4180
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_14 (
4181
                .clk ( ref_clk ),
4182
                .reset ( reset_ref_clk_int ),
4183
                .rx_locked ( rx_locked_14 ),
4184
                .rx_channel_data_align ( rx_channel_data_align_14 ),
4185
                .pll_areset ( pll_areset_14 ),
4186
                .rx_reset ( rx_reset_14 ),
4187
        .rx_cda_reset ( rx_cda_reset_14 )
4188
        );
4189
 
4190
 
4191
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_14
4192
    (
4193
        .tx_in (tbi_tx_d_flip_14),
4194
        .tx_inclock (ref_clk),
4195
                .pll_areset ( reset ),
4196
        .tx_out (txp_14)
4197
    );
4198
 
4199
    end
4200
else
4201
    begin
4202
    assign txp_14 = 1'b0;
4203
    assign tbi_rx_clk_14 = 1'b0;
4204
    end
4205
endgenerate
4206
 
4207
 
4208
 
4209
// #######################################################################
4210
// ###############       CHANNEL 15 LOGIC/COMPONENTS       ###############
4211
// #######################################################################
4212
 
4213
// Export powerdown signal or wire it internally
4214
// ---------------------------------------------
4215
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 15)
4216
    begin
4217
        assign gxb_pwrdn_in_sig[15] = gxb_pwrdn_in_15;
4218
        assign pcs_pwrdn_out_15 = pcs_pwrdn_out_sig[15];
4219
    end
4220
else
4221
    begin
4222
        assign gxb_pwrdn_in_sig[15] = pcs_pwrdn_out_sig[15];
4223
                assign pcs_pwrdn_out_15 = 1'b0;
4224
    end
4225
endgenerate
4226
 
4227
 
4228
// Either one of these blocks below will be instantiated depending on the parameterization 
4229
// that is chosen.
4230
// ---------------------------------------------------------------------------------------
4231
 
4232
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4233
//
4234
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4235
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4236
// reversal algorithm.  
4237
// -------------------------------------------------------------------------
4238
 
4239
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 15)
4240
    begin
4241
 
4242
    assign tbi_tx_clk_15 = ref_clk;
4243
    assign tbi_rx_d_15 = tbi_rx_d_flip_15;
4244
 
4245
    altera_tse_reset_synchronizer ch_15_reset_sync_0 (
4246
        .clk(tbi_rx_clk_15),
4247
        .reset_in(reset),
4248
        .reset_out(reset_tbi_rx_clk_15_int)
4249
        );
4250
 
4251
    always @(posedge tbi_rx_clk_15 or posedge reset_tbi_rx_clk_15_int)
4252
        begin
4253
        if (reset_tbi_rx_clk_15_int == 1)
4254
            tbi_rx_d_flip_15 <= 0;
4255
        else
4256
            begin
4257
            tbi_rx_d_flip_15[0] <= tbi_rx_d_lvds_15[9];
4258
            tbi_rx_d_flip_15[1] <= tbi_rx_d_lvds_15[8];
4259
            tbi_rx_d_flip_15[2] <= tbi_rx_d_lvds_15[7];
4260
            tbi_rx_d_flip_15[3] <= tbi_rx_d_lvds_15[6];
4261
            tbi_rx_d_flip_15[4] <= tbi_rx_d_lvds_15[5];
4262
            tbi_rx_d_flip_15[5] <= tbi_rx_d_lvds_15[4];
4263
            tbi_rx_d_flip_15[6] <= tbi_rx_d_lvds_15[3];
4264
            tbi_rx_d_flip_15[7] <= tbi_rx_d_lvds_15[2];
4265
            tbi_rx_d_flip_15[8] <= tbi_rx_d_lvds_15[1];
4266
            tbi_rx_d_flip_15[9] <= tbi_rx_d_lvds_15[0];
4267
            end
4268
        end
4269
 
4270
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4271
        begin
4272
        if (reset_ref_clk_int == 1)
4273
            tbi_tx_d_flip_15 <= 0;
4274
        else
4275
            begin
4276
            tbi_tx_d_flip_15[0] <= tbi_tx_d_15[9];
4277
            tbi_tx_d_flip_15[1] <= tbi_tx_d_15[8];
4278
            tbi_tx_d_flip_15[2] <= tbi_tx_d_15[7];
4279
            tbi_tx_d_flip_15[3] <= tbi_tx_d_15[6];
4280
            tbi_tx_d_flip_15[4] <= tbi_tx_d_15[5];
4281
            tbi_tx_d_flip_15[5] <= tbi_tx_d_15[4];
4282
            tbi_tx_d_flip_15[6] <= tbi_tx_d_15[3];
4283
            tbi_tx_d_flip_15[7] <= tbi_tx_d_15[2];
4284
            tbi_tx_d_flip_15[8] <= tbi_tx_d_15[1];
4285
            tbi_tx_d_flip_15[9] <= tbi_tx_d_15[0];
4286
            end
4287
        end
4288
 
4289
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_15
4290
     (
4291
         .pll_areset ( reset ),
4292
         .rx_cda_reset ( rx_cda_reset_15 ),
4293
         .rx_channel_data_align ( rx_channel_data_align_15 ),
4294
         .rx_locked ( rx_locked_15 ),
4295
         .rx_divfwdclk (tbi_rx_clk_15),
4296
         .rx_in (rxp_15),
4297
         .rx_inclock (ref_clk),
4298
         .rx_out (tbi_rx_d_lvds_15),
4299
         .rx_outclock (),
4300
         .rx_reset (rx_reset_15)
4301
     );
4302
 
4303
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_15 (
4304
                .clk ( ref_clk ),
4305
                .reset ( reset_ref_clk_int ),
4306
                .rx_locked ( rx_locked_15 ),
4307
                .rx_channel_data_align ( rx_channel_data_align_15 ),
4308
                .pll_areset ( pll_areset_15 ),
4309
                .rx_reset ( rx_reset_15 ),
4310
        .rx_cda_reset ( rx_cda_reset_15 )
4311
        );
4312
 
4313
 
4314
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_15
4315
    (
4316
        .tx_in (tbi_tx_d_flip_15),
4317
        .tx_inclock (ref_clk),
4318
                .pll_areset ( reset ),
4319
        .tx_out (txp_15)
4320
    );
4321
 
4322
    end
4323
else
4324
    begin
4325
    assign txp_15 = 1'b0;
4326
    assign tbi_rx_clk_15 = 1'b0;
4327
    end
4328
endgenerate
4329
 
4330
 
4331
 
4332
// #######################################################################
4333
// ###############       CHANNEL 16 LOGIC/COMPONENTS       ###############
4334
// #######################################################################
4335
 
4336
// Export powerdown signal or wire it internally
4337
// ---------------------------------------------
4338
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 16)
4339
    begin
4340
        assign gxb_pwrdn_in_sig[16] = gxb_pwrdn_in_16;
4341
        assign pcs_pwrdn_out_16 = pcs_pwrdn_out_sig[16];
4342
    end
4343
else
4344
    begin
4345
        assign gxb_pwrdn_in_sig[16] = pcs_pwrdn_out_sig[16];
4346
                assign pcs_pwrdn_out_16 = 1'b0;
4347
    end
4348
endgenerate
4349
 
4350
 
4351
// Either one of these blocks below will be instantiated depending on the parameterization 
4352
// that is chosen.
4353
// ---------------------------------------------------------------------------------------
4354
 
4355
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4356
//
4357
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4358
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4359
// reversal algorithm.  
4360
// -------------------------------------------------------------------------
4361
 
4362
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 16)
4363
    begin
4364
 
4365
    assign tbi_tx_clk_16 = ref_clk;
4366
    assign tbi_rx_d_16 = tbi_rx_d_flip_16;
4367
 
4368
    altera_tse_reset_synchronizer ch_16_reset_sync_0 (
4369
        .clk(tbi_rx_clk_16),
4370
        .reset_in(reset),
4371
        .reset_out(reset_tbi_rx_clk_16_int)
4372
        );
4373
 
4374
    always @(posedge tbi_rx_clk_16 or posedge reset_tbi_rx_clk_16_int)
4375
        begin
4376
        if (reset_tbi_rx_clk_16_int == 1)
4377
            tbi_rx_d_flip_16 <= 0;
4378
        else
4379
            begin
4380
            tbi_rx_d_flip_16[0] <= tbi_rx_d_lvds_16[9];
4381
            tbi_rx_d_flip_16[1] <= tbi_rx_d_lvds_16[8];
4382
            tbi_rx_d_flip_16[2] <= tbi_rx_d_lvds_16[7];
4383
            tbi_rx_d_flip_16[3] <= tbi_rx_d_lvds_16[6];
4384
            tbi_rx_d_flip_16[4] <= tbi_rx_d_lvds_16[5];
4385
            tbi_rx_d_flip_16[5] <= tbi_rx_d_lvds_16[4];
4386
            tbi_rx_d_flip_16[6] <= tbi_rx_d_lvds_16[3];
4387
            tbi_rx_d_flip_16[7] <= tbi_rx_d_lvds_16[2];
4388
            tbi_rx_d_flip_16[8] <= tbi_rx_d_lvds_16[1];
4389
            tbi_rx_d_flip_16[9] <= tbi_rx_d_lvds_16[0];
4390
            end
4391
        end
4392
 
4393
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4394
        begin
4395
        if (reset_ref_clk_int == 1)
4396
            tbi_tx_d_flip_16 <= 0;
4397
        else
4398
            begin
4399
            tbi_tx_d_flip_16[0] <= tbi_tx_d_16[9];
4400
            tbi_tx_d_flip_16[1] <= tbi_tx_d_16[8];
4401
            tbi_tx_d_flip_16[2] <= tbi_tx_d_16[7];
4402
            tbi_tx_d_flip_16[3] <= tbi_tx_d_16[6];
4403
            tbi_tx_d_flip_16[4] <= tbi_tx_d_16[5];
4404
            tbi_tx_d_flip_16[5] <= tbi_tx_d_16[4];
4405
            tbi_tx_d_flip_16[6] <= tbi_tx_d_16[3];
4406
            tbi_tx_d_flip_16[7] <= tbi_tx_d_16[2];
4407
            tbi_tx_d_flip_16[8] <= tbi_tx_d_16[1];
4408
            tbi_tx_d_flip_16[9] <= tbi_tx_d_16[0];
4409
            end
4410
        end
4411
 
4412
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_16
4413
     (
4414
         .pll_areset ( reset ),
4415
         .rx_cda_reset ( rx_cda_reset_16 ),
4416
         .rx_channel_data_align ( rx_channel_data_align_16 ),
4417
         .rx_locked ( rx_locked_16 ),
4418
         .rx_divfwdclk (tbi_rx_clk_16),
4419
         .rx_in (rxp_16),
4420
         .rx_inclock (ref_clk),
4421
         .rx_out (tbi_rx_d_lvds_16),
4422
         .rx_outclock (),
4423
         .rx_reset (rx_reset_16)
4424
     );
4425
 
4426
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_16 (
4427
                .clk ( ref_clk ),
4428
                .reset ( reset_ref_clk_int ),
4429
                .rx_locked ( rx_locked_16 ),
4430
                .rx_channel_data_align ( rx_channel_data_align_16 ),
4431
                .pll_areset ( pll_areset_16 ),
4432
                .rx_reset ( rx_reset_16 ),
4433
        .rx_cda_reset ( rx_cda_reset_16 )
4434
        );
4435
 
4436
 
4437
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_16
4438
    (
4439
        .tx_in (tbi_tx_d_flip_16),
4440
        .tx_inclock (ref_clk),
4441
                .pll_areset ( reset ),
4442
        .tx_out (txp_16)
4443
    );
4444
 
4445
    end
4446
else
4447
    begin
4448
    assign txp_16 = 1'b0;
4449
    assign tbi_rx_clk_16 = 1'b0;
4450
    end
4451
endgenerate
4452
 
4453
 
4454
 
4455
// #######################################################################
4456
// ###############       CHANNEL 17 LOGIC/COMPONENTS       ###############
4457
// #######################################################################
4458
 
4459
// Export powerdown signal or wire it internally
4460
// ---------------------------------------------
4461
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 17)
4462
    begin
4463
        assign gxb_pwrdn_in_sig[17] = gxb_pwrdn_in_17;
4464
        assign pcs_pwrdn_out_17 = pcs_pwrdn_out_sig[17];
4465
    end
4466
else
4467
    begin
4468
        assign gxb_pwrdn_in_sig[17] = pcs_pwrdn_out_sig[17];
4469
                assign pcs_pwrdn_out_17 = 1'b0;
4470
    end
4471
endgenerate
4472
 
4473
 
4474
// Either one of these blocks below will be instantiated depending on the parameterization 
4475
// that is chosen.
4476
// ---------------------------------------------------------------------------------------
4477
 
4478
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4479
//
4480
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4481
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4482
// reversal algorithm.  
4483
// -------------------------------------------------------------------------
4484
 
4485
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 17)
4486
    begin
4487
 
4488
    assign tbi_tx_clk_17 = ref_clk;
4489
    assign tbi_rx_d_17 = tbi_rx_d_flip_17;
4490
 
4491
    altera_tse_reset_synchronizer ch_17_reset_sync_0 (
4492
        .clk(tbi_rx_clk_17),
4493
        .reset_in(reset),
4494
        .reset_out(reset_tbi_rx_clk_17_int)
4495
        );
4496
 
4497
    always @(posedge tbi_rx_clk_17 or posedge reset_tbi_rx_clk_17_int)
4498
        begin
4499
        if (reset_tbi_rx_clk_17_int == 1)
4500
            tbi_rx_d_flip_17 <= 0;
4501
        else
4502
            begin
4503
            tbi_rx_d_flip_17[0] <= tbi_rx_d_lvds_17[9];
4504
            tbi_rx_d_flip_17[1] <= tbi_rx_d_lvds_17[8];
4505
            tbi_rx_d_flip_17[2] <= tbi_rx_d_lvds_17[7];
4506
            tbi_rx_d_flip_17[3] <= tbi_rx_d_lvds_17[6];
4507
            tbi_rx_d_flip_17[4] <= tbi_rx_d_lvds_17[5];
4508
            tbi_rx_d_flip_17[5] <= tbi_rx_d_lvds_17[4];
4509
            tbi_rx_d_flip_17[6] <= tbi_rx_d_lvds_17[3];
4510
            tbi_rx_d_flip_17[7] <= tbi_rx_d_lvds_17[2];
4511
            tbi_rx_d_flip_17[8] <= tbi_rx_d_lvds_17[1];
4512
            tbi_rx_d_flip_17[9] <= tbi_rx_d_lvds_17[0];
4513
            end
4514
        end
4515
 
4516
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4517
        begin
4518
        if (reset_ref_clk_int == 1)
4519
            tbi_tx_d_flip_17 <= 0;
4520
        else
4521
            begin
4522
            tbi_tx_d_flip_17[0] <= tbi_tx_d_17[9];
4523
            tbi_tx_d_flip_17[1] <= tbi_tx_d_17[8];
4524
            tbi_tx_d_flip_17[2] <= tbi_tx_d_17[7];
4525
            tbi_tx_d_flip_17[3] <= tbi_tx_d_17[6];
4526
            tbi_tx_d_flip_17[4] <= tbi_tx_d_17[5];
4527
            tbi_tx_d_flip_17[5] <= tbi_tx_d_17[4];
4528
            tbi_tx_d_flip_17[6] <= tbi_tx_d_17[3];
4529
            tbi_tx_d_flip_17[7] <= tbi_tx_d_17[2];
4530
            tbi_tx_d_flip_17[8] <= tbi_tx_d_17[1];
4531
            tbi_tx_d_flip_17[9] <= tbi_tx_d_17[0];
4532
            end
4533
        end
4534
 
4535
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_17
4536
     (
4537
         .pll_areset ( reset ),
4538
         .rx_cda_reset ( rx_cda_reset_17 ),
4539
         .rx_channel_data_align ( rx_channel_data_align_17 ),
4540
         .rx_locked ( rx_locked_17 ),
4541
         .rx_divfwdclk (tbi_rx_clk_17),
4542
         .rx_in (rxp_17),
4543
         .rx_inclock (ref_clk),
4544
         .rx_out (tbi_rx_d_lvds_17),
4545
         .rx_outclock (),
4546
         .rx_reset (rx_reset_17)
4547
     );
4548
 
4549
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_17 (
4550
                .clk ( ref_clk ),
4551
                .reset ( reset_ref_clk_int ),
4552
                .rx_locked ( rx_locked_17 ),
4553
                .rx_channel_data_align ( rx_channel_data_align_17 ),
4554
                .pll_areset ( pll_areset_17 ),
4555
                .rx_reset ( rx_reset_17 ),
4556
        .rx_cda_reset ( rx_cda_reset_17 )
4557
        );
4558
 
4559
 
4560
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_17
4561
    (
4562
        .tx_in (tbi_tx_d_flip_17),
4563
        .tx_inclock (ref_clk),
4564
                .pll_areset ( reset ),
4565
        .tx_out (txp_17)
4566
    );
4567
 
4568
    end
4569
else
4570
    begin
4571
    assign txp_17 = 1'b0;
4572
    assign tbi_rx_clk_17 = 1'b0;
4573
    end
4574
endgenerate
4575
 
4576
 
4577
 
4578
// #######################################################################
4579
// ###############       CHANNEL 18 LOGIC/COMPONENTS       ###############
4580
// #######################################################################
4581
 
4582
// Export powerdown signal or wire it internally
4583
// ---------------------------------------------
4584
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 18)
4585
    begin
4586
        assign gxb_pwrdn_in_sig[18] = gxb_pwrdn_in_18;
4587
        assign pcs_pwrdn_out_18 = pcs_pwrdn_out_sig[18];
4588
    end
4589
else
4590
    begin
4591
        assign gxb_pwrdn_in_sig[18] = pcs_pwrdn_out_sig[18];
4592
                assign pcs_pwrdn_out_18 = 1'b0;
4593
    end
4594
endgenerate
4595
 
4596
 
4597
// Either one of these blocks below will be instantiated depending on the parameterization 
4598
// that is chosen.
4599
// ---------------------------------------------------------------------------------------
4600
 
4601
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4602
//
4603
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4604
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4605
// reversal algorithm.  
4606
// -------------------------------------------------------------------------
4607
 
4608
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 18)
4609
    begin
4610
 
4611
    assign tbi_tx_clk_18 = ref_clk;
4612
    assign tbi_rx_d_18 = tbi_rx_d_flip_18;
4613
 
4614
    altera_tse_reset_synchronizer ch_18_reset_sync_0 (
4615
        .clk(tbi_rx_clk_18),
4616
        .reset_in(reset),
4617
        .reset_out(reset_tbi_rx_clk_18_int)
4618
        );
4619
 
4620
    always @(posedge tbi_rx_clk_18 or posedge reset_tbi_rx_clk_18_int)
4621
        begin
4622
        if (reset_tbi_rx_clk_18_int == 1)
4623
            tbi_rx_d_flip_18 <= 0;
4624
        else
4625
            begin
4626
            tbi_rx_d_flip_18[0] <= tbi_rx_d_lvds_18[9];
4627
            tbi_rx_d_flip_18[1] <= tbi_rx_d_lvds_18[8];
4628
            tbi_rx_d_flip_18[2] <= tbi_rx_d_lvds_18[7];
4629
            tbi_rx_d_flip_18[3] <= tbi_rx_d_lvds_18[6];
4630
            tbi_rx_d_flip_18[4] <= tbi_rx_d_lvds_18[5];
4631
            tbi_rx_d_flip_18[5] <= tbi_rx_d_lvds_18[4];
4632
            tbi_rx_d_flip_18[6] <= tbi_rx_d_lvds_18[3];
4633
            tbi_rx_d_flip_18[7] <= tbi_rx_d_lvds_18[2];
4634
            tbi_rx_d_flip_18[8] <= tbi_rx_d_lvds_18[1];
4635
            tbi_rx_d_flip_18[9] <= tbi_rx_d_lvds_18[0];
4636
            end
4637
        end
4638
 
4639
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4640
        begin
4641
        if (reset_ref_clk_int == 1)
4642
            tbi_tx_d_flip_18 <= 0;
4643
        else
4644
            begin
4645
            tbi_tx_d_flip_18[0] <= tbi_tx_d_18[9];
4646
            tbi_tx_d_flip_18[1] <= tbi_tx_d_18[8];
4647
            tbi_tx_d_flip_18[2] <= tbi_tx_d_18[7];
4648
            tbi_tx_d_flip_18[3] <= tbi_tx_d_18[6];
4649
            tbi_tx_d_flip_18[4] <= tbi_tx_d_18[5];
4650
            tbi_tx_d_flip_18[5] <= tbi_tx_d_18[4];
4651
            tbi_tx_d_flip_18[6] <= tbi_tx_d_18[3];
4652
            tbi_tx_d_flip_18[7] <= tbi_tx_d_18[2];
4653
            tbi_tx_d_flip_18[8] <= tbi_tx_d_18[1];
4654
            tbi_tx_d_flip_18[9] <= tbi_tx_d_18[0];
4655
            end
4656
        end
4657
 
4658
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_18
4659
     (
4660
         .pll_areset ( reset ),
4661
         .rx_cda_reset ( rx_cda_reset_18 ),
4662
         .rx_channel_data_align ( rx_channel_data_align_18 ),
4663
         .rx_locked ( rx_locked_18 ),
4664
         .rx_divfwdclk (tbi_rx_clk_18),
4665
         .rx_in (rxp_18),
4666
         .rx_inclock (ref_clk),
4667
         .rx_out (tbi_rx_d_lvds_18),
4668
         .rx_outclock (),
4669
         .rx_reset (rx_reset_18)
4670
     );
4671
 
4672
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_18 (
4673
                .clk ( ref_clk ),
4674
                .reset ( reset_ref_clk_int ),
4675
                .rx_locked ( rx_locked_18 ),
4676
                .rx_channel_data_align ( rx_channel_data_align_18 ),
4677
                .pll_areset ( pll_areset_18 ),
4678
                .rx_reset ( rx_reset_18 ),
4679
        .rx_cda_reset ( rx_cda_reset_18 )
4680
        );
4681
 
4682
 
4683
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_18
4684
    (
4685
        .tx_in (tbi_tx_d_flip_18),
4686
        .tx_inclock (ref_clk),
4687
                .pll_areset ( reset ),
4688
        .tx_out (txp_18)
4689
    );
4690
 
4691
    end
4692
else
4693
    begin
4694
    assign txp_18 = 1'b0;
4695
    assign tbi_rx_clk_18 = 1'b0;
4696
    end
4697
endgenerate
4698
 
4699
 
4700
 
4701
// #######################################################################
4702
// ###############       CHANNEL 19 LOGIC/COMPONENTS       ###############
4703
// #######################################################################
4704
 
4705
// Export powerdown signal or wire it internally
4706
// ---------------------------------------------
4707
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 19)
4708
    begin
4709
        assign gxb_pwrdn_in_sig[19] = gxb_pwrdn_in_19;
4710
        assign pcs_pwrdn_out_19 = pcs_pwrdn_out_sig[19];
4711
    end
4712
else
4713
    begin
4714
        assign gxb_pwrdn_in_sig[19] = pcs_pwrdn_out_sig[19];
4715
                assign pcs_pwrdn_out_19 = 1'b0;
4716
    end
4717
endgenerate
4718
 
4719
 
4720
// Either one of these blocks below will be instantiated depending on the parameterization 
4721
// that is chosen.
4722
// ---------------------------------------------------------------------------------------
4723
 
4724
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4725
//
4726
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4727
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4728
// reversal algorithm.  
4729
// -------------------------------------------------------------------------
4730
 
4731
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 19)
4732
    begin
4733
 
4734
    assign tbi_tx_clk_19 = ref_clk;
4735
    assign tbi_rx_d_19 = tbi_rx_d_flip_19;
4736
 
4737
    altera_tse_reset_synchronizer ch_19_reset_sync_0 (
4738
        .clk(tbi_rx_clk_19),
4739
        .reset_in(reset),
4740
        .reset_out(reset_tbi_rx_clk_19_int)
4741
        );
4742
 
4743
    always @(posedge tbi_rx_clk_19 or posedge reset_tbi_rx_clk_19_int)
4744
        begin
4745
        if (reset_tbi_rx_clk_19_int == 1)
4746
            tbi_rx_d_flip_19 <= 0;
4747
        else
4748
            begin
4749
            tbi_rx_d_flip_19[0] <= tbi_rx_d_lvds_19[9];
4750
            tbi_rx_d_flip_19[1] <= tbi_rx_d_lvds_19[8];
4751
            tbi_rx_d_flip_19[2] <= tbi_rx_d_lvds_19[7];
4752
            tbi_rx_d_flip_19[3] <= tbi_rx_d_lvds_19[6];
4753
            tbi_rx_d_flip_19[4] <= tbi_rx_d_lvds_19[5];
4754
            tbi_rx_d_flip_19[5] <= tbi_rx_d_lvds_19[4];
4755
            tbi_rx_d_flip_19[6] <= tbi_rx_d_lvds_19[3];
4756
            tbi_rx_d_flip_19[7] <= tbi_rx_d_lvds_19[2];
4757
            tbi_rx_d_flip_19[8] <= tbi_rx_d_lvds_19[1];
4758
            tbi_rx_d_flip_19[9] <= tbi_rx_d_lvds_19[0];
4759
            end
4760
        end
4761
 
4762
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4763
        begin
4764
        if (reset_ref_clk_int == 1)
4765
            tbi_tx_d_flip_19 <= 0;
4766
        else
4767
            begin
4768
            tbi_tx_d_flip_19[0] <= tbi_tx_d_19[9];
4769
            tbi_tx_d_flip_19[1] <= tbi_tx_d_19[8];
4770
            tbi_tx_d_flip_19[2] <= tbi_tx_d_19[7];
4771
            tbi_tx_d_flip_19[3] <= tbi_tx_d_19[6];
4772
            tbi_tx_d_flip_19[4] <= tbi_tx_d_19[5];
4773
            tbi_tx_d_flip_19[5] <= tbi_tx_d_19[4];
4774
            tbi_tx_d_flip_19[6] <= tbi_tx_d_19[3];
4775
            tbi_tx_d_flip_19[7] <= tbi_tx_d_19[2];
4776
            tbi_tx_d_flip_19[8] <= tbi_tx_d_19[1];
4777
            tbi_tx_d_flip_19[9] <= tbi_tx_d_19[0];
4778
            end
4779
        end
4780
 
4781
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_19
4782
     (
4783
         .pll_areset ( reset ),
4784
         .rx_cda_reset ( rx_cda_reset_19 ),
4785
         .rx_channel_data_align ( rx_channel_data_align_19 ),
4786
         .rx_locked ( rx_locked_19 ),
4787
         .rx_divfwdclk (tbi_rx_clk_19),
4788
         .rx_in (rxp_19),
4789
         .rx_inclock (ref_clk),
4790
         .rx_out (tbi_rx_d_lvds_19),
4791
         .rx_outclock (),
4792
         .rx_reset (rx_reset_19)
4793
     );
4794
 
4795
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_19 (
4796
                .clk ( ref_clk ),
4797
                .reset ( reset_ref_clk_int ),
4798
                .rx_locked ( rx_locked_19 ),
4799
                .rx_channel_data_align ( rx_channel_data_align_19 ),
4800
                .pll_areset ( pll_areset_19 ),
4801
                .rx_reset ( rx_reset_19 ),
4802
        .rx_cda_reset ( rx_cda_reset_19 )
4803
        );
4804
 
4805
 
4806
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_19
4807
    (
4808
        .tx_in (tbi_tx_d_flip_19),
4809
        .tx_inclock (ref_clk),
4810
                .pll_areset ( reset ),
4811
        .tx_out (txp_19)
4812
    );
4813
 
4814
    end
4815
else
4816
    begin
4817
    assign txp_19 = 1'b0;
4818
    assign tbi_rx_clk_19 = 1'b0;
4819
    end
4820
endgenerate
4821
 
4822
 
4823
 
4824
// #######################################################################
4825
// ###############       CHANNEL 20 LOGIC/COMPONENTS       ###############
4826
// #######################################################################
4827
 
4828
// Export powerdown signal or wire it internally
4829
// ---------------------------------------------
4830
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 20)
4831
    begin
4832
        assign gxb_pwrdn_in_sig[20] = gxb_pwrdn_in_20;
4833
        assign pcs_pwrdn_out_20 = pcs_pwrdn_out_sig[20];
4834
    end
4835
else
4836
    begin
4837
        assign gxb_pwrdn_in_sig[20] = pcs_pwrdn_out_sig[20];
4838
                assign pcs_pwrdn_out_20 = 1'b0;
4839
    end
4840
endgenerate
4841
 
4842
 
4843
// Either one of these blocks below will be instantiated depending on the parameterization 
4844
// that is chosen.
4845
// ---------------------------------------------------------------------------------------
4846
 
4847
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4848
//
4849
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4850
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4851
// reversal algorithm.  
4852
// -------------------------------------------------------------------------
4853
 
4854
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 20)
4855
    begin
4856
 
4857
    assign tbi_tx_clk_20 = ref_clk;
4858
    assign tbi_rx_d_20 = tbi_rx_d_flip_20;
4859
 
4860
    altera_tse_reset_synchronizer ch_20_reset_sync_0 (
4861
        .clk(tbi_rx_clk_20),
4862
        .reset_in(reset),
4863
        .reset_out(reset_tbi_rx_clk_20_int)
4864
        );
4865
 
4866
    always @(posedge tbi_rx_clk_20 or posedge reset_tbi_rx_clk_20_int)
4867
        begin
4868
        if (reset_tbi_rx_clk_20_int == 1)
4869
            tbi_rx_d_flip_20 <= 0;
4870
        else
4871
            begin
4872
            tbi_rx_d_flip_20[0] <= tbi_rx_d_lvds_20[9];
4873
            tbi_rx_d_flip_20[1] <= tbi_rx_d_lvds_20[8];
4874
            tbi_rx_d_flip_20[2] <= tbi_rx_d_lvds_20[7];
4875
            tbi_rx_d_flip_20[3] <= tbi_rx_d_lvds_20[6];
4876
            tbi_rx_d_flip_20[4] <= tbi_rx_d_lvds_20[5];
4877
            tbi_rx_d_flip_20[5] <= tbi_rx_d_lvds_20[4];
4878
            tbi_rx_d_flip_20[6] <= tbi_rx_d_lvds_20[3];
4879
            tbi_rx_d_flip_20[7] <= tbi_rx_d_lvds_20[2];
4880
            tbi_rx_d_flip_20[8] <= tbi_rx_d_lvds_20[1];
4881
            tbi_rx_d_flip_20[9] <= tbi_rx_d_lvds_20[0];
4882
            end
4883
        end
4884
 
4885
    always @(posedge ref_clk or posedge reset_ref_clk_int)
4886
        begin
4887
        if (reset_ref_clk_int == 1)
4888
            tbi_tx_d_flip_20 <= 0;
4889
        else
4890
            begin
4891
            tbi_tx_d_flip_20[0] <= tbi_tx_d_20[9];
4892
            tbi_tx_d_flip_20[1] <= tbi_tx_d_20[8];
4893
            tbi_tx_d_flip_20[2] <= tbi_tx_d_20[7];
4894
            tbi_tx_d_flip_20[3] <= tbi_tx_d_20[6];
4895
            tbi_tx_d_flip_20[4] <= tbi_tx_d_20[5];
4896
            tbi_tx_d_flip_20[5] <= tbi_tx_d_20[4];
4897
            tbi_tx_d_flip_20[6] <= tbi_tx_d_20[3];
4898
            tbi_tx_d_flip_20[7] <= tbi_tx_d_20[2];
4899
            tbi_tx_d_flip_20[8] <= tbi_tx_d_20[1];
4900
            tbi_tx_d_flip_20[9] <= tbi_tx_d_20[0];
4901
            end
4902
        end
4903
 
4904
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_20
4905
     (
4906
         .pll_areset ( reset ),
4907
         .rx_cda_reset ( rx_cda_reset_20 ),
4908
         .rx_channel_data_align ( rx_channel_data_align_20 ),
4909
         .rx_locked ( rx_locked_20 ),
4910
         .rx_divfwdclk (tbi_rx_clk_20),
4911
         .rx_in (rxp_20),
4912
         .rx_inclock (ref_clk),
4913
         .rx_out (tbi_rx_d_lvds_20),
4914
         .rx_outclock (),
4915
         .rx_reset (rx_reset_20)
4916
     );
4917
 
4918
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_20 (
4919
                .clk ( ref_clk ),
4920
                .reset ( reset_ref_clk_int ),
4921
                .rx_locked ( rx_locked_20 ),
4922
                .rx_channel_data_align ( rx_channel_data_align_20 ),
4923
                .pll_areset ( pll_areset_20 ),
4924
                .rx_reset ( rx_reset_20 ),
4925
        .rx_cda_reset ( rx_cda_reset_20 )
4926
        );
4927
 
4928
 
4929
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_20
4930
    (
4931
        .tx_in (tbi_tx_d_flip_20),
4932
        .tx_inclock (ref_clk),
4933
                .pll_areset ( reset ),
4934
        .tx_out (txp_20)
4935
    );
4936
 
4937
    end
4938
else
4939
    begin
4940
    assign txp_20 = 1'b0;
4941
    assign tbi_rx_clk_20 = 1'b0;
4942
    end
4943
endgenerate
4944
 
4945
 
4946
 
4947
// #######################################################################
4948
// ###############       CHANNEL 21 LOGIC/COMPONENTS       ###############
4949
// #######################################################################
4950
 
4951
// Export powerdown signal or wire it internally
4952
// ---------------------------------------------
4953
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 21)
4954
    begin
4955
        assign gxb_pwrdn_in_sig[21] = gxb_pwrdn_in_21;
4956
        assign pcs_pwrdn_out_21 = pcs_pwrdn_out_sig[21];
4957
    end
4958
else
4959
    begin
4960
        assign gxb_pwrdn_in_sig[21] = pcs_pwrdn_out_sig[21];
4961
                assign pcs_pwrdn_out_21 = 1'b0;
4962
    end
4963
endgenerate
4964
 
4965
 
4966
// Either one of these blocks below will be instantiated depending on the parameterization 
4967
// that is chosen.
4968
// ---------------------------------------------------------------------------------------
4969
 
4970
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
4971
//
4972
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
4973
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
4974
// reversal algorithm.  
4975
// -------------------------------------------------------------------------
4976
 
4977
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 21)
4978
    begin
4979
 
4980
    assign tbi_tx_clk_21 = ref_clk;
4981
    assign tbi_rx_d_21 = tbi_rx_d_flip_21;
4982
 
4983
    altera_tse_reset_synchronizer ch_21_reset_sync_0 (
4984
        .clk(tbi_rx_clk_21),
4985
        .reset_in(reset),
4986
        .reset_out(reset_tbi_rx_clk_21_int)
4987
        );
4988
 
4989
    always @(posedge tbi_rx_clk_21 or posedge reset_tbi_rx_clk_21_int)
4990
        begin
4991
        if (reset_tbi_rx_clk_21_int == 1)
4992
            tbi_rx_d_flip_21 <= 0;
4993
        else
4994
            begin
4995
            tbi_rx_d_flip_21[0] <= tbi_rx_d_lvds_21[9];
4996
            tbi_rx_d_flip_21[1] <= tbi_rx_d_lvds_21[8];
4997
            tbi_rx_d_flip_21[2] <= tbi_rx_d_lvds_21[7];
4998
            tbi_rx_d_flip_21[3] <= tbi_rx_d_lvds_21[6];
4999
            tbi_rx_d_flip_21[4] <= tbi_rx_d_lvds_21[5];
5000
            tbi_rx_d_flip_21[5] <= tbi_rx_d_lvds_21[4];
5001
            tbi_rx_d_flip_21[6] <= tbi_rx_d_lvds_21[3];
5002
            tbi_rx_d_flip_21[7] <= tbi_rx_d_lvds_21[2];
5003
            tbi_rx_d_flip_21[8] <= tbi_rx_d_lvds_21[1];
5004
            tbi_rx_d_flip_21[9] <= tbi_rx_d_lvds_21[0];
5005
            end
5006
        end
5007
 
5008
    always @(posedge ref_clk or posedge reset_ref_clk_int)
5009
        begin
5010
        if (reset_ref_clk_int == 1)
5011
            tbi_tx_d_flip_21 <= 0;
5012
        else
5013
            begin
5014
            tbi_tx_d_flip_21[0] <= tbi_tx_d_21[9];
5015
            tbi_tx_d_flip_21[1] <= tbi_tx_d_21[8];
5016
            tbi_tx_d_flip_21[2] <= tbi_tx_d_21[7];
5017
            tbi_tx_d_flip_21[3] <= tbi_tx_d_21[6];
5018
            tbi_tx_d_flip_21[4] <= tbi_tx_d_21[5];
5019
            tbi_tx_d_flip_21[5] <= tbi_tx_d_21[4];
5020
            tbi_tx_d_flip_21[6] <= tbi_tx_d_21[3];
5021
            tbi_tx_d_flip_21[7] <= tbi_tx_d_21[2];
5022
            tbi_tx_d_flip_21[8] <= tbi_tx_d_21[1];
5023
            tbi_tx_d_flip_21[9] <= tbi_tx_d_21[0];
5024
            end
5025
        end
5026
 
5027
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_21
5028
     (
5029
         .pll_areset ( reset ),
5030
         .rx_cda_reset ( rx_cda_reset_21 ),
5031
         .rx_channel_data_align ( rx_channel_data_align_21 ),
5032
         .rx_locked ( rx_locked_21 ),
5033
         .rx_divfwdclk (tbi_rx_clk_21),
5034
         .rx_in (rxp_21),
5035
         .rx_inclock (ref_clk),
5036
         .rx_out (tbi_rx_d_lvds_21),
5037
         .rx_outclock (),
5038
         .rx_reset (rx_reset_21)
5039
     );
5040
 
5041
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_21 (
5042
                .clk ( ref_clk ),
5043
                .reset ( reset_ref_clk_int ),
5044
                .rx_locked ( rx_locked_21 ),
5045
                .rx_channel_data_align ( rx_channel_data_align_21 ),
5046
                .pll_areset ( pll_areset_21 ),
5047
                .rx_reset ( rx_reset_21 ),
5048
        .rx_cda_reset ( rx_cda_reset_21 )
5049
        );
5050
 
5051
 
5052
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_21
5053
    (
5054
        .tx_in (tbi_tx_d_flip_21),
5055
        .tx_inclock (ref_clk),
5056
                .pll_areset ( reset ),
5057
        .tx_out (txp_21)
5058
    );
5059
 
5060
    end
5061
else
5062
    begin
5063
    assign txp_21 = 1'b0;
5064
    assign tbi_rx_clk_21 = 1'b0;
5065
    end
5066
endgenerate
5067
 
5068
 
5069
 
5070
// #######################################################################
5071
// ###############       CHANNEL 22 LOGIC/COMPONENTS       ###############
5072
// #######################################################################
5073
 
5074
// Export powerdown signal or wire it internally
5075
// ---------------------------------------------
5076
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 22)
5077
    begin
5078
        assign gxb_pwrdn_in_sig[22] = gxb_pwrdn_in_22;
5079
        assign pcs_pwrdn_out_22 = pcs_pwrdn_out_sig[22];
5080
    end
5081
else
5082
    begin
5083
        assign gxb_pwrdn_in_sig[22] = pcs_pwrdn_out_sig[22];
5084
                assign pcs_pwrdn_out_22 = 1'b0;
5085
    end
5086
endgenerate
5087
 
5088
 
5089
// Either one of these blocks below will be instantiated depending on the parameterization 
5090
// that is chosen.
5091
// ---------------------------------------------------------------------------------------
5092
 
5093
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
5094
//
5095
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
5096
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
5097
// reversal algorithm.  
5098
// -------------------------------------------------------------------------
5099
 
5100
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 22)
5101
    begin
5102
 
5103
    assign tbi_tx_clk_22 = ref_clk;
5104
    assign tbi_rx_d_22 = tbi_rx_d_flip_22;
5105
 
5106
    altera_tse_reset_synchronizer ch_22_reset_sync_0 (
5107
        .clk(tbi_rx_clk_22),
5108
        .reset_in(reset),
5109
        .reset_out(reset_tbi_rx_clk_22_int)
5110
        );
5111
 
5112
    always @(posedge tbi_rx_clk_22 or posedge reset_tbi_rx_clk_22_int)
5113
        begin
5114
        if (reset_tbi_rx_clk_22_int == 1)
5115
            tbi_rx_d_flip_22 <= 0;
5116
        else
5117
            begin
5118
            tbi_rx_d_flip_22[0] <= tbi_rx_d_lvds_22[9];
5119
            tbi_rx_d_flip_22[1] <= tbi_rx_d_lvds_22[8];
5120
            tbi_rx_d_flip_22[2] <= tbi_rx_d_lvds_22[7];
5121
            tbi_rx_d_flip_22[3] <= tbi_rx_d_lvds_22[6];
5122
            tbi_rx_d_flip_22[4] <= tbi_rx_d_lvds_22[5];
5123
            tbi_rx_d_flip_22[5] <= tbi_rx_d_lvds_22[4];
5124
            tbi_rx_d_flip_22[6] <= tbi_rx_d_lvds_22[3];
5125
            tbi_rx_d_flip_22[7] <= tbi_rx_d_lvds_22[2];
5126
            tbi_rx_d_flip_22[8] <= tbi_rx_d_lvds_22[1];
5127
            tbi_rx_d_flip_22[9] <= tbi_rx_d_lvds_22[0];
5128
            end
5129
        end
5130
 
5131
    always @(posedge ref_clk or posedge reset_ref_clk_int)
5132
        begin
5133
        if (reset_ref_clk_int == 1)
5134
            tbi_tx_d_flip_22 <= 0;
5135
        else
5136
            begin
5137
            tbi_tx_d_flip_22[0] <= tbi_tx_d_22[9];
5138
            tbi_tx_d_flip_22[1] <= tbi_tx_d_22[8];
5139
            tbi_tx_d_flip_22[2] <= tbi_tx_d_22[7];
5140
            tbi_tx_d_flip_22[3] <= tbi_tx_d_22[6];
5141
            tbi_tx_d_flip_22[4] <= tbi_tx_d_22[5];
5142
            tbi_tx_d_flip_22[5] <= tbi_tx_d_22[4];
5143
            tbi_tx_d_flip_22[6] <= tbi_tx_d_22[3];
5144
            tbi_tx_d_flip_22[7] <= tbi_tx_d_22[2];
5145
            tbi_tx_d_flip_22[8] <= tbi_tx_d_22[1];
5146
            tbi_tx_d_flip_22[9] <= tbi_tx_d_22[0];
5147
            end
5148
        end
5149
 
5150
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_22
5151
     (
5152
         .pll_areset ( reset ),
5153
         .rx_cda_reset ( rx_cda_reset_22 ),
5154
         .rx_channel_data_align ( rx_channel_data_align_22 ),
5155
         .rx_locked ( rx_locked_22 ),
5156
         .rx_divfwdclk (tbi_rx_clk_22),
5157
         .rx_in (rxp_22),
5158
         .rx_inclock (ref_clk),
5159
         .rx_out (tbi_rx_d_lvds_22),
5160
         .rx_outclock (),
5161
         .rx_reset (rx_reset_22)
5162
     );
5163
 
5164
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_22 (
5165
                .clk ( ref_clk ),
5166
                .reset ( reset_ref_clk_int ),
5167
                .rx_locked ( rx_locked_22 ),
5168
                .rx_channel_data_align ( rx_channel_data_align_22 ),
5169
                .pll_areset ( pll_areset_22 ),
5170
                .rx_reset ( rx_reset_22 ),
5171
        .rx_cda_reset ( rx_cda_reset_22 )
5172
        );
5173
 
5174
 
5175
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_22
5176
    (
5177
        .tx_in (tbi_tx_d_flip_22),
5178
        .tx_inclock (ref_clk),
5179
                .pll_areset ( reset ),
5180
        .tx_out (txp_22)
5181
    );
5182
 
5183
    end
5184
else
5185
    begin
5186
    assign txp_22 = 1'b0;
5187
    assign tbi_rx_clk_22 = 1'b0;
5188
    end
5189
endgenerate
5190
 
5191
 
5192
 
5193
// #######################################################################
5194
// ###############       CHANNEL 23 LOGIC/COMPONENTS       ###############
5195
// #######################################################################
5196
 
5197
// Export powerdown signal or wire it internally
5198
// ---------------------------------------------
5199
generate if (EXPORT_PWRDN == 1 && MAX_CHANNELS > 23)
5200
    begin
5201
        assign gxb_pwrdn_in_sig[23] = gxb_pwrdn_in_23;
5202
        assign pcs_pwrdn_out_23 = pcs_pwrdn_out_sig[23];
5203
    end
5204
else
5205
    begin
5206
        assign gxb_pwrdn_in_sig[23] = pcs_pwrdn_out_sig[23];
5207
                assign pcs_pwrdn_out_23 = 1'b0;
5208
    end
5209
endgenerate
5210
 
5211
 
5212
// Either one of these blocks below will be instantiated depending on the parameterization 
5213
// that is chosen.
5214
// ---------------------------------------------------------------------------------------
5215
 
5216
// Instantiation of the LVDS SERDES block as the PMA for Stratix III devices
5217
//
5218
// IEEE 802.3 Clause 36 PCS requires that bit 0 of TBI_DATA to be transmitted 
5219
// first.  However, ALTLVDS had bit 9 transmit first.  hence, we need a bit
5220
// reversal algorithm.  
5221
// -------------------------------------------------------------------------
5222
 
5223
generate if (DEVICE_FAMILY != "ARRIAGX" && TRANSCEIVER_OPTION == 1 && MAX_CHANNELS > 23)
5224
    begin
5225
 
5226
    assign tbi_tx_clk_23 = ref_clk;
5227
    assign tbi_rx_d_23 = tbi_rx_d_flip_23;
5228
 
5229
    altera_tse_reset_synchronizer ch_23_reset_sync_0 (
5230
        .clk(tbi_rx_clk_23),
5231
        .reset_in(reset),
5232
        .reset_out(reset_tbi_rx_clk_23_int)
5233
        );
5234
 
5235
    always @(posedge tbi_rx_clk_23 or posedge reset_tbi_rx_clk_23_int)
5236
        begin
5237
        if (reset_tbi_rx_clk_23_int == 1)
5238
            tbi_rx_d_flip_23 <= 0;
5239
        else
5240
            begin
5241
            tbi_rx_d_flip_23[0] <= tbi_rx_d_lvds_23[9];
5242
            tbi_rx_d_flip_23[1] <= tbi_rx_d_lvds_23[8];
5243
            tbi_rx_d_flip_23[2] <= tbi_rx_d_lvds_23[7];
5244
            tbi_rx_d_flip_23[3] <= tbi_rx_d_lvds_23[6];
5245
            tbi_rx_d_flip_23[4] <= tbi_rx_d_lvds_23[5];
5246
            tbi_rx_d_flip_23[5] <= tbi_rx_d_lvds_23[4];
5247
            tbi_rx_d_flip_23[6] <= tbi_rx_d_lvds_23[3];
5248
            tbi_rx_d_flip_23[7] <= tbi_rx_d_lvds_23[2];
5249
            tbi_rx_d_flip_23[8] <= tbi_rx_d_lvds_23[1];
5250
            tbi_rx_d_flip_23[9] <= tbi_rx_d_lvds_23[0];
5251
            end
5252
        end
5253
 
5254
    always @(posedge ref_clk or posedge reset_ref_clk_int)
5255
        begin
5256
        if (reset_ref_clk_int == 1)
5257
            tbi_tx_d_flip_23 <= 0;
5258
        else
5259
            begin
5260
            tbi_tx_d_flip_23[0] <= tbi_tx_d_23[9];
5261
            tbi_tx_d_flip_23[1] <= tbi_tx_d_23[8];
5262
            tbi_tx_d_flip_23[2] <= tbi_tx_d_23[7];
5263
            tbi_tx_d_flip_23[3] <= tbi_tx_d_23[6];
5264
            tbi_tx_d_flip_23[4] <= tbi_tx_d_23[5];
5265
            tbi_tx_d_flip_23[5] <= tbi_tx_d_23[4];
5266
            tbi_tx_d_flip_23[6] <= tbi_tx_d_23[3];
5267
            tbi_tx_d_flip_23[7] <= tbi_tx_d_23[2];
5268
            tbi_tx_d_flip_23[8] <= tbi_tx_d_23[1];
5269
            tbi_tx_d_flip_23[9] <= tbi_tx_d_23[0];
5270
            end
5271
        end
5272
 
5273
    altera_tse_pma_lvds_rx the_altera_tse_pma_lvds_rx_23
5274
     (
5275
         .pll_areset ( reset ),
5276
         .rx_cda_reset ( rx_cda_reset_23 ),
5277
         .rx_channel_data_align ( rx_channel_data_align_23 ),
5278
         .rx_locked ( rx_locked_23 ),
5279
         .rx_divfwdclk (tbi_rx_clk_23),
5280
         .rx_in (rxp_23),
5281
         .rx_inclock (ref_clk),
5282
         .rx_out (tbi_rx_d_lvds_23),
5283
         .rx_outclock (),
5284
         .rx_reset (rx_reset_23)
5285
     );
5286
 
5287
    altera_tse_lvds_reset_sequencer the_altera_tse_lvds_reset_sequencer_23 (
5288
                .clk ( ref_clk ),
5289
                .reset ( reset_ref_clk_int ),
5290
                .rx_locked ( rx_locked_23 ),
5291
                .rx_channel_data_align ( rx_channel_data_align_23 ),
5292
                .pll_areset ( pll_areset_23 ),
5293
                .rx_reset ( rx_reset_23 ),
5294
        .rx_cda_reset ( rx_cda_reset_23 )
5295
        );
5296
 
5297
 
5298
    altera_tse_pma_lvds_tx the_altera_tse_pma_lvds_tx_23
5299
    (
5300
        .tx_in (tbi_tx_d_flip_23),
5301
        .tx_inclock (ref_clk),
5302
                .pll_areset ( reset ),
5303
        .tx_out (txp_23)
5304
    );
5305
 
5306
    end
5307
else
5308
    begin
5309
    assign txp_23 = 1'b0;
5310
    assign tbi_rx_clk_23 = 1'b0;
5311
    end
5312
endgenerate
5313
 
5314
 
5315
 
5316
endmodule // module altera_tse_multi_mac_pcs_pma

powered by: WebSVN 2.1.0

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