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

Subversion Repositories ethmac

[/] [ethmac/] [tags/] [rel_23/] [rtl/] [verilog/] [eth_top.v] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  eth_top.v                                                   ////
4
////                                                              ////
5
////  This file is part of the Ethernet IP core project           ////
6 37 mohor
////  http://www.opencores.org/projects/ethmac/                   ////
7 15 mohor
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Igor Mohor (igorM@opencores.org)                      ////
10
////                                                              ////
11 202 mohor
////  All additional information is available in the Readme.txt   ////
12 15 mohor
////  file.                                                       ////
13
////                                                              ////
14
//////////////////////////////////////////////////////////////////////
15
////                                                              ////
16 202 mohor
//// Copyright (C) 2001, 2002 Authors                             ////
17 15 mohor
////                                                              ////
18
//// This source file may be used and distributed without         ////
19
//// restriction provided that this copyright statement is not    ////
20
//// removed from the file and that any derivative work contains  ////
21
//// the original copyright notice and the associated disclaimer. ////
22
////                                                              ////
23
//// This source file is free software; you can redistribute it   ////
24
//// and/or modify it under the terms of the GNU Lesser General   ////
25
//// Public License as published by the Free Software Foundation; ////
26
//// either version 2.1 of the License, or (at your option) any   ////
27
//// later version.                                               ////
28
////                                                              ////
29
//// This source is distributed in the hope that it will be       ////
30
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
31
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
32
//// PURPOSE.  See the GNU Lesser General Public License for more ////
33
//// details.                                                     ////
34
////                                                              ////
35
//// You should have received a copy of the GNU Lesser General    ////
36
//// Public License along with this source; if not, download it   ////
37
//// from http://www.opencores.org/lgpl.shtml                     ////
38
////                                                              ////
39
//////////////////////////////////////////////////////////////////////
40
//
41
// CVS Revision History
42
//
43
// $Log: not supported by cvs2svn $
44 304 tadejm
// Revision 1.48  2003/10/17 07:46:16  markom
45
// mbist signals updated according to newest convention
46
//
47 302 markom
// Revision 1.47  2003/10/06 15:43:45  knguyen
48
// Update RxEnSync only when mrxdv_pad_i is inactive (LOW).
49
//
50 301 knguyen
// Revision 1.46  2003/01/30 13:30:22  tadejm
51
// Defer indication changed.
52
//
53 276 tadejm
// Revision 1.45  2003/01/22 13:49:26  tadejm
54
// When control packets were received, they were ignored in some cases.
55
//
56 272 tadejm
// Revision 1.44  2003/01/21 12:09:40  mohor
57
// When receiving normal data frame and RxFlow control was switched on, RXB
58
// interrupt was not set.
59
//
60 270 mohor
// Revision 1.43  2002/11/22 01:57:06  mohor
61
// Rx Flow control fixed. CF flag added to the RX buffer descriptor. RxAbort
62
// synchronized.
63
//
64 261 mohor
// Revision 1.42  2002/11/21 00:09:19  mohor
65
// TPauseRq synchronized to tx_clk.
66
//
67 255 mohor
// Revision 1.41  2002/11/19 18:13:49  mohor
68
// r_MiiMRst is not used for resetting the MIIM module. wb_rst used instead.
69
//
70 253 mohor
// Revision 1.40  2002/11/19 17:34:25  mohor
71
// AddressMiss status is connecting to the Rx BD. AddressMiss is identifying
72
// that a frame was received because of the promiscous mode.
73
//
74 250 mohor
// Revision 1.39  2002/11/18 17:31:55  mohor
75
// wb_rst_i is used for MIIM reset.
76
//
77 248 mohor
// Revision 1.38  2002/11/14 18:37:20  mohor
78
// r_Rst signal does not reset any module any more and is removed from the design.
79
//
80 244 mohor
// Revision 1.37  2002/11/13 22:25:36  tadejm
81
// All modules are reset with wb_rst instead of the r_Rst. Exception is MII module.
82
//
83 240 tadejm
// Revision 1.36  2002/10/18 17:04:20  tadejm
84
// Changed BIST scan signals.
85
//
86 227 tadejm
// Revision 1.35  2002/10/11 13:36:58  mohor
87
// Typo error fixed. (When using Bist)
88
//
89 218 mohor
// Revision 1.34  2002/10/10 16:49:50  mohor
90
// Signals for WISHBONE B3 compliant interface added.
91
//
92 214 mohor
// Revision 1.33  2002/10/10 16:29:30  mohor
93
// BIST added.
94
//
95 210 mohor
// Revision 1.32  2002/09/20 17:12:58  mohor
96
// CsMiss added. When address between 0x800 and 0xfff is accessed within
97
// Ethernet Core, error acknowledge is generated.
98
//
99 202 mohor
// Revision 1.31  2002/09/12 14:50:17  mohor
100
// CarrierSenseLost bug fixed when operating in full duplex mode.
101
//
102 168 mohor
// Revision 1.30  2002/09/10 10:35:23  mohor
103
// Ethernet debug registers removed.
104
//
105 164 mohor
// Revision 1.29  2002/09/09 13:03:13  mohor
106
// Error acknowledge is generated when accessing BDs and RST bit in the
107
// MODER register (r_Rst) is set.
108
//
109 161 mohor
// Revision 1.28  2002/09/04 18:44:10  mohor
110
// Signals related to the control frames connected. Debug registers reg1, 2, 3, 4
111
// connected.
112
//
113 149 mohor
// Revision 1.27  2002/07/25 18:15:37  mohor
114
// RxAbort changed. Packets received with MRxErr (from PHY) are also
115
// aborted.
116
//
117 125 mohor
// Revision 1.26  2002/07/17 18:51:50  mohor
118
// EXTERNAL_DMA removed. External DMA not supported.
119
//
120 114 mohor
// Revision 1.25  2002/05/03 10:15:50  mohor
121
// Outputs registered. Reset changed for eth_wishbone module.
122
//
123 106 mohor
// Revision 1.24  2002/04/22 14:15:42  mohor
124
// Wishbone signals are registered when ETH_REGISTERED_OUTPUTS is
125
// selected in eth_defines.v
126
//
127 103 mohor
// Revision 1.23  2002/03/25 13:33:53  mohor
128
// md_padoen_o changed to md_padoe_o. Signal was always active high, just
129
// name was incorrect.
130
//
131 95 mohor
// Revision 1.22  2002/02/26 16:59:54  mohor
132
// Small fixes for external/internal DMA missmatches.
133
//
134 80 mohor
// Revision 1.21  2002/02/26 16:21:00  mohor
135
// Interrupts changed in the top file
136
//
137 76 mohor
// Revision 1.20  2002/02/18 10:40:17  mohor
138
// Small fixes.
139
//
140 70 mohor
// Revision 1.19  2002/02/16 14:03:44  mohor
141
// Registered trimmed. Unused registers removed.
142
//
143 68 mohor
// Revision 1.18  2002/02/16 13:06:33  mohor
144
// EXTERNAL_DMA used instead of WISHBONE_DMA.
145
//
146 67 mohor
// Revision 1.17  2002/02/16 07:15:27  mohor
147
// Testbench fixed, code simplified, unused signals removed.
148
//
149 65 mohor
// Revision 1.16  2002/02/15 13:49:39  mohor
150
// RxAbort is connected differently.
151
//
152 63 mohor
// Revision 1.15  2002/02/15 11:38:26  mohor
153
// Changes that were lost when updating from 1.11 to 1.14 fixed.
154
//
155 59 mohor
// Revision 1.14  2002/02/14 20:19:11  billditt
156
// Modified for Address Checking,
157
// addition of eth_addrcheck.v
158
//
159
// Revision 1.13  2002/02/12 17:03:03  mohor
160
// HASH0 and HASH1 registers added. Registers address width was
161
// changed to 8 bits.
162
//
163
// Revision 1.12  2002/02/11 09:18:22  mohor
164
// Tx status is written back to the BD.
165
//
166 43 mohor
// Revision 1.11  2002/02/08 16:21:54  mohor
167
// Rx status is written back to the BD.
168
//
169 42 mohor
// Revision 1.10  2002/02/06 14:10:21  mohor
170
// non-DMA host interface added. Select the right configutation in eth_defines.
171
//
172 41 mohor
// Revision 1.9  2002/01/23 10:28:16  mohor
173
// Link in the header changed.
174
//
175 37 mohor
// Revision 1.8  2001/12/05 15:00:16  mohor
176
// RX_BD_NUM changed to TX_BD_NUM (holds number of TX descriptors
177
// instead of the number of RX descriptors).
178
//
179 34 mohor
// Revision 1.7  2001/12/05 10:45:59  mohor
180
// ETH_RX_BD_ADR register deleted. ETH_RX_BD_NUM is used instead.
181
//
182 33 mohor
// Revision 1.6  2001/10/19 11:24:29  mohor
183
// Number of addresses (wb_adr_i) minimized.
184
//
185 23 mohor
// Revision 1.5  2001/10/19 08:43:51  mohor
186
// eth_timescale.v changed to timescale.v This is done because of the
187
// simulation of the few cores in a one joined project.
188
//
189 22 mohor
// Revision 1.4  2001/10/18 12:07:11  mohor
190
// Status signals changed, Adress decoding changed, interrupt controller
191
// added.
192
//
193 21 mohor
// Revision 1.3  2001/09/24 15:02:56  mohor
194
// Defines changed (All precede with ETH_). Small changes because some
195
// tools generate warnings when two operands are together. Synchronization
196
// between two clocks domains in eth_wishbonedma.v is changed (due to ASIC
197
// demands).
198
//
199 20 mohor
// Revision 1.2  2001/08/15 14:03:59  mohor
200
// Signal names changed on the top level for easier pad insertion (ASIC).
201
//
202 17 mohor
// Revision 1.1  2001/08/06 14:44:29  mohor
203
// A define FPGA added to select between Artisan RAM (for ASIC) and Block Ram (For Virtex).
204
// Include files fixed to contain no path.
205
// File names and module names changed ta have a eth_ prologue in the name.
206
// File eth_timescale.v is used to define timescale
207
// All pin names on the top module are changed to contain _I, _O or _OE at the end.
208
// Bidirectional signal MDIO is changed to three signals (Mdc_O, Mdi_I, Mdo_O
209
// and Mdo_OE. The bidirectional signal must be created on the top level. This
210
// is done due to the ASIC tools.
211
//
212 15 mohor
// Revision 1.2  2001/08/02 09:25:31  mohor
213
// Unconnected signals are now connected.
214
//
215
// Revision 1.1  2001/07/30 21:23:42  mohor
216
// Directory structure changed. Files checked and joind together.
217
//
218
//
219
//
220 20 mohor
// 
221 15 mohor
 
222
 
223
`include "eth_defines.v"
224 22 mohor
`include "timescale.v"
225 15 mohor
 
226
 
227
module eth_top
228
(
229
  // WISHBONE common
230 17 mohor
  wb_clk_i, wb_rst_i, wb_dat_i, wb_dat_o,
231 15 mohor
 
232
  // WISHBONE slave
233 17 mohor
  wb_adr_i, wb_sel_i, wb_we_i, wb_cyc_i, wb_stb_i, wb_ack_o, wb_err_o,
234 15 mohor
 
235 41 mohor
  // WISHBONE master
236
  m_wb_adr_o, m_wb_sel_o, m_wb_we_o,
237
  m_wb_dat_o, m_wb_dat_i, m_wb_cyc_o,
238
  m_wb_stb_o, m_wb_ack_i, m_wb_err_i,
239
 
240 214 mohor
`ifdef ETH_WISHBONE_B3
241
  m_wb_cti_o, m_wb_bte_o,
242
`endif
243
 
244 15 mohor
  //TX
245 20 mohor
  mtx_clk_pad_i, mtxd_pad_o, mtxen_pad_o, mtxerr_pad_o,
246 15 mohor
 
247
  //RX
248 20 mohor
  mrx_clk_pad_i, mrxd_pad_i, mrxdv_pad_i, mrxerr_pad_i, mcoll_pad_i, mcrs_pad_i,
249 15 mohor
 
250
  // MIIM
251 95 mohor
  mdc_pad_o, md_pad_i, md_pad_o, md_padoe_o,
252 17 mohor
 
253 21 mohor
  int_o
254 17 mohor
 
255 210 mohor
  // Bist
256
`ifdef ETH_BIST
257 227 tadejm
  ,
258
  // debug chain signals
259 302 markom
  mbist_si_i,       // bist scan serial in
260
  mbist_so_o,       // bist scan serial out
261
  mbist_ctrl_i        // bist chain shift control
262 210 mohor
`endif
263 21 mohor
 
264 15 mohor
);
265
 
266
 
267
parameter Tp = 1;
268
 
269
 
270
// WISHBONE common
271 17 mohor
input           wb_clk_i;     // WISHBONE clock
272
input           wb_rst_i;     // WISHBONE reset
273
input   [31:0]  wb_dat_i;     // WISHBONE data input
274
output  [31:0]  wb_dat_o;     // WISHBONE data output
275
output          wb_err_o;     // WISHBONE error output
276 15 mohor
 
277
// WISHBONE slave
278 23 mohor
input   [11:2]  wb_adr_i;     // WISHBONE address input
279 17 mohor
input    [3:0]  wb_sel_i;     // WISHBONE byte select input
280
input           wb_we_i;      // WISHBONE write enable input
281
input           wb_cyc_i;     // WISHBONE cycle input
282
input           wb_stb_i;     // WISHBONE strobe input
283
output          wb_ack_o;     // WISHBONE acknowledge output
284 15 mohor
 
285 41 mohor
// WISHBONE master
286
output  [31:0]  m_wb_adr_o;
287
output   [3:0]  m_wb_sel_o;
288
output          m_wb_we_o;
289
input   [31:0]  m_wb_dat_i;
290
output  [31:0]  m_wb_dat_o;
291
output          m_wb_cyc_o;
292
output          m_wb_stb_o;
293
input           m_wb_ack_i;
294
input           m_wb_err_i;
295 15 mohor
 
296 214 mohor
`ifdef ETH_WISHBONE_B3
297
output   [2:0]  m_wb_cti_o;   // Cycle Type Identifier
298
output   [1:0]  m_wb_bte_o;   // Burst Type Extension
299
`endif
300 41 mohor
 
301 15 mohor
// Tx
302 20 mohor
input           mtx_clk_pad_i; // Transmit clock (from PHY)
303 21 mohor
output   [3:0]  mtxd_pad_o;    // Transmit nibble (to PHY)
304
output          mtxen_pad_o;   // Transmit enable (to PHY)
305
output          mtxerr_pad_o;  // Transmit error (to PHY)
306 15 mohor
 
307
// Rx
308 20 mohor
input           mrx_clk_pad_i; // Receive clock (from PHY)
309 21 mohor
input    [3:0]  mrxd_pad_i;    // Receive nibble (from PHY)
310
input           mrxdv_pad_i;   // Receive data valid (from PHY)
311
input           mrxerr_pad_i;  // Receive data error (from PHY)
312 15 mohor
 
313
// Common Tx and Rx
314 21 mohor
input           mcoll_pad_i;   // Collision (from PHY)
315
input           mcrs_pad_i;    // Carrier sense (from PHY)
316 15 mohor
 
317
// MII Management interface
318 21 mohor
input           md_pad_i;      // MII data input (from I/O cell)
319
output          mdc_pad_o;     // MII Management data clock (to PHY)
320
output          md_pad_o;      // MII data output (to I/O cell)
321 95 mohor
output          md_padoe_o;    // MII data output enable (to I/O cell)
322 15 mohor
 
323 21 mohor
output          int_o;         // Interrupt output
324 15 mohor
 
325 210 mohor
// Bist
326
`ifdef ETH_BIST
327 302 markom
input   mbist_si_i;       // bist scan serial in
328
output  mbist_so_o;       // bist scan serial out
329
input [`ETH_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
330 210 mohor
`endif
331
 
332 15 mohor
wire     [7:0]  r_ClkDiv;
333
wire            r_MiiNoPre;
334
wire    [15:0]  r_CtrlData;
335
wire     [4:0]  r_FIAD;
336
wire     [4:0]  r_RGAD;
337
wire            r_WCtrlData;
338
wire            r_RStat;
339
wire            r_ScanStat;
340
wire            NValid_stat;
341
wire            Busy_stat;
342
wire            LinkFail;
343
wire    [15:0]  Prsd;             // Read Status Data (data read from the PHY)
344
wire            WCtrlDataStart;
345
wire            RStatStart;
346
wire            UpdateMIIRX_DATAReg;
347
 
348
wire            TxStartFrm;
349
wire            TxEndFrm;
350
wire            TxUsedData;
351
wire     [7:0]  TxData;
352
wire            TxRetry;
353
wire            TxAbort;
354
wire            TxUnderRun;
355
wire            TxDone;
356 42 mohor
wire     [5:0]  CollValid;
357 15 mohor
 
358
 
359 149 mohor
reg             WillSendControlFrame_sync1;
360
reg             WillSendControlFrame_sync2;
361
reg             WillSendControlFrame_sync3;
362
reg             RstTxPauseRq;
363 15 mohor
 
364 255 mohor
reg             TxPauseRq_sync1;
365
reg             TxPauseRq_sync2;
366
reg             TxPauseRq_sync3;
367
reg             TPauseRq;
368 15 mohor
 
369 255 mohor
 
370 15 mohor
// Connecting Miim module
371
eth_miim miim1
372
(
373 248 mohor
  .Clk(wb_clk_i),                         .Reset(wb_rst_i),                   .Divider(r_ClkDiv),
374 15 mohor
  .NoPre(r_MiiNoPre),                     .CtrlData(r_CtrlData),              .Rgad(r_RGAD),
375
  .Fiad(r_FIAD),                          .WCtrlData(r_WCtrlData),            .RStat(r_RStat),
376 17 mohor
  .ScanStat(r_ScanStat),                  .Mdi(md_pad_i),                     .Mdo(md_pad_o),
377 95 mohor
  .MdoEn(md_padoe_o),                     .Mdc(mdc_pad_o),                    .Busy(Busy_stat),
378 15 mohor
  .Prsd(Prsd),                            .LinkFail(LinkFail),                .Nvalid(NValid_stat),
379
  .WCtrlDataStart(WCtrlDataStart),        .RStatStart(RStatStart),            .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg)
380
);
381
 
382
 
383
 
384
 
385 304 tadejm
wire  [3:0] RegCs;          // Connected to registers
386 17 mohor
wire [31:0] RegDataOut;     // Multiplexed to wb_dat_o
387 42 mohor
wire        r_RecSmall;     // Receive small frames
388 15 mohor
wire        r_LoopBck;      // Loopback
389
wire        r_TxEn;         // Tx Enable
390
wire        r_RxEn;         // Rx Enable
391
 
392
wire        MRxDV_Lb;       // Muxed MII receive data valid
393
wire        MRxErr_Lb;      // Muxed MII Receive Error
394
wire  [3:0] MRxD_Lb;        // Muxed MII Receive Data
395
wire        Transmitting;   // Indication that TxEthMAC is transmitting
396
wire        r_HugEn;        // Huge packet enable
397
wire        r_DlyCrcEn;     // Delayed CRC enabled
398
wire [15:0] r_MaxFL;        // Maximum frame length
399
 
400
wire [15:0] r_MinFL;        // Minimum frame length
401 42 mohor
wire        ShortFrame;
402
wire        DribbleNibble;  // Extra nibble received
403
wire        ReceivedPacketTooBig; // Received packet is too big
404 15 mohor
wire [47:0] r_MAC;          // MAC address
405 42 mohor
wire        LoadRxStatus;   // Rx status was loaded
406 52 billditt
wire [31:0] r_HASH0;        // HASH table, lower 4 bytes
407
wire [31:0] r_HASH1;        // HASH table, upper 4 bytes
408 34 mohor
wire  [7:0] r_TxBDNum;      // Receive buffer descriptor number
409 15 mohor
wire  [6:0] r_IPGT;         // 
410
wire  [6:0] r_IPGR1;        // 
411
wire  [6:0] r_IPGR2;        // 
412
wire  [5:0] r_CollValid;    // 
413 149 mohor
wire [15:0] r_TxPauseTV;    // Transmit PAUSE value
414
wire        r_TxPauseRq;    // Transmit PAUSE request
415 15 mohor
 
416
wire  [3:0] r_MaxRet;       //
417
wire        r_NoBckof;      // 
418
wire        r_ExDfrEn;      // 
419 34 mohor
wire        TX_BD_NUM_Wr;   // Write enable that writes RX_BD_NUM to the registers.
420 15 mohor
wire        r_TxFlow;       // Tx flow control enable
421
wire        r_IFG;          // Minimum interframe gap for incoming packets
422
 
423 21 mohor
wire        TxB_IRQ;        // Interrupt Tx Buffer
424
wire        TxE_IRQ;        // Interrupt Tx Error
425
wire        RxB_IRQ;        // Interrupt Rx Buffer
426 76 mohor
wire        RxE_IRQ;        // Interrupt Rx Error
427 21 mohor
wire        Busy_IRQ;       // Interrupt Busy (lack of buffers)
428 15 mohor
 
429 304 tadejm
//wire        DWord;
430
wire        ByteSelected;
431
wire  [3:0] ByteSel;
432 15 mohor
wire        BDAck;
433 103 mohor
wire [31:0] BD_WB_DAT_O;    // wb_dat_o that comes from the Wishbone module (for buffer descriptors read/write)
434 304 tadejm
wire  [3:0] BDCs;           // Buffer descriptor CS
435 202 mohor
wire        CsMiss;         // When access to the address between 0x800 and 0xfff occurs, acknowledge is set
436
                            // but data is not valid.
437 15 mohor
 
438 103 mohor
wire        temp_wb_ack_o;
439
wire [31:0] temp_wb_dat_o;
440
wire        temp_wb_err_o;
441 15 mohor
 
442 103 mohor
`ifdef ETH_REGISTERED_OUTPUTS
443
  reg         temp_wb_ack_o_reg;
444
  reg [31:0]  temp_wb_dat_o_reg;
445
  reg         temp_wb_err_o_reg;
446
`endif
447
 
448 304 tadejm
//assign DWord = &wb_sel_i;
449
assign ByteSelected = |wb_sel_i;
450
assign RegCs[3] = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] & ~wb_adr_i[10] & wb_sel_i[3];   // 0x0   - 0x3FF
451
assign RegCs[2] = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] & ~wb_adr_i[10] & wb_sel_i[2];   // 0x0   - 0x3FF
452
assign RegCs[1] = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] & ~wb_adr_i[10] & wb_sel_i[1];   // 0x0   - 0x3FF
453
assign RegCs[0] = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] & ~wb_adr_i[10] & wb_sel_i[0];   // 0x0   - 0x3FF
454
assign BDCs[3]  = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] &  wb_adr_i[10] & wb_sel_i[3];   // 0x400 - 0x7FF
455
assign BDCs[2]  = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] &  wb_adr_i[10] & wb_sel_i[2];   // 0x400 - 0x7FF
456
assign BDCs[1]  = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] &  wb_adr_i[10] & wb_sel_i[1];   // 0x400 - 0x7FF
457
assign BDCs[0]  = wb_stb_i & wb_cyc_i & ByteSelected & ~wb_adr_i[11] &  wb_adr_i[10] & wb_sel_i[0];   // 0x400 - 0x7FF
458
assign CsMiss = wb_stb_i & wb_cyc_i & ByteSelected & wb_adr_i[11];                   // 0x800 - 0xfFF
459
assign temp_wb_ack_o = (|RegCs) | BDAck;
460
assign temp_wb_dat_o = ((|RegCs) & ~wb_we_i)? RegDataOut : BD_WB_DAT_O;
461
assign temp_wb_err_o = wb_stb_i & wb_cyc_i & (~ByteSelected | CsMiss);
462 15 mohor
 
463 103 mohor
`ifdef ETH_REGISTERED_OUTPUTS
464
  assign wb_ack_o = temp_wb_ack_o_reg;
465
  assign wb_dat_o[31:0] = temp_wb_dat_o_reg;
466
  assign wb_err_o = temp_wb_err_o_reg;
467
`else
468
  assign wb_ack_o = temp_wb_ack_o;
469
  assign wb_dat_o[31:0] = temp_wb_dat_o;
470
  assign wb_err_o = temp_wb_err_o;
471
`endif
472 15 mohor
 
473
 
474
 
475 103 mohor
`ifdef ETH_REGISTERED_OUTPUTS
476
  always @ (posedge wb_clk_i or posedge wb_rst_i)
477
  begin
478
    if(wb_rst_i)
479
      begin
480
        temp_wb_ack_o_reg <=#Tp 1'b0;
481
        temp_wb_dat_o_reg <=#Tp 32'h0;
482
        temp_wb_err_o_reg <=#Tp 1'b0;
483
      end
484
    else
485
      begin
486 106 mohor
        temp_wb_ack_o_reg <=#Tp temp_wb_ack_o & ~temp_wb_ack_o_reg;
487 103 mohor
        temp_wb_dat_o_reg <=#Tp temp_wb_dat_o;
488 106 mohor
        temp_wb_err_o_reg <=#Tp temp_wb_err_o & ~temp_wb_err_o_reg;
489 103 mohor
      end
490
  end
491
`endif
492
 
493
 
494 15 mohor
// Connecting Ethernet registers
495
eth_registers ethreg1
496
(
497 47 mohor
  .DataIn(wb_dat_i),                      .Address(wb_adr_i[9:2]),                    .Rw(wb_we_i),
498 17 mohor
  .Cs(RegCs),                             .Clk(wb_clk_i),                             .Reset(wb_rst_i),
499 68 mohor
  .DataOut(RegDataOut),                   .r_RecSmall(r_RecSmall),
500 15 mohor
  .r_Pad(r_Pad),                          .r_HugEn(r_HugEn),                          .r_CrcEn(r_CrcEn),
501 244 mohor
  .r_DlyCrcEn(r_DlyCrcEn),                .r_FullD(r_FullD),
502 15 mohor
  .r_ExDfrEn(r_ExDfrEn),                  .r_NoBckof(r_NoBckof),                      .r_LoopBck(r_LoopBck),
503 52 billditt
  .r_IFG(r_IFG),                          .r_Pro(r_Pro),                              .r_Iam(),
504
  .r_Bro(r_Bro),                          .r_NoPre(r_NoPre),                          .r_TxEn(r_TxEn),
505 76 mohor
  .r_RxEn(r_RxEn),                        .Busy_IRQ(Busy_IRQ),                        .RxE_IRQ(RxE_IRQ),
506 21 mohor
  .RxB_IRQ(RxB_IRQ),                      .TxE_IRQ(TxE_IRQ),                          .TxB_IRQ(TxB_IRQ),
507 149 mohor
  .r_IPGT(r_IPGT),
508 15 mohor
  .r_IPGR1(r_IPGR1),                      .r_IPGR2(r_IPGR2),                          .r_MinFL(r_MinFL),
509
  .r_MaxFL(r_MaxFL),                      .r_MaxRet(r_MaxRet),                        .r_CollValid(r_CollValid),
510
  .r_TxFlow(r_TxFlow),                    .r_RxFlow(r_RxFlow),                        .r_PassAll(r_PassAll),
511 253 mohor
  .r_MiiNoPre(r_MiiNoPre),                .r_ClkDiv(r_ClkDiv),
512 15 mohor
  .r_WCtrlData(r_WCtrlData),              .r_RStat(r_RStat),                          .r_ScanStat(r_ScanStat),
513
  .r_RGAD(r_RGAD),                        .r_FIAD(r_FIAD),                            .r_CtrlData(r_CtrlData),
514
  .NValid_stat(NValid_stat),              .Busy_stat(Busy_stat),
515
  .LinkFail(LinkFail),                    .r_MAC(r_MAC),                              .WCtrlDataStart(WCtrlDataStart),
516
  .RStatStart(RStatStart),                .UpdateMIIRX_DATAReg(UpdateMIIRX_DATAReg),  .Prsd(Prsd),
517 47 mohor
  .r_TxBDNum(r_TxBDNum),                  .TX_BD_NUM_Wr(TX_BD_NUM_Wr),                .int_o(int_o),
518 149 mohor
  .r_HASH0(r_HASH0),                      .r_HASH1(r_HASH1),                          .r_TxPauseRq(r_TxPauseRq),
519
  .r_TxPauseTV(r_TxPauseTV),              .RstTxPauseRq(RstTxPauseRq),                .TxCtrlEndFrm(TxCtrlEndFrm),
520
  .StartTxDone(StartTxDone),              .TxClk(mtx_clk_pad_i),                      .RxClk(mrx_clk_pad_i),
521 261 mohor
  .SetPauseTimer(SetPauseTimer)
522 149 mohor
 
523 15 mohor
);
524
 
525
 
526
 
527
wire  [7:0] RxData;
528
wire        RxValid;
529
wire        RxStartFrm;
530
wire        RxEndFrm;
531 41 mohor
wire        RxAbort;
532 15 mohor
 
533
wire        WillTransmit;            // Will transmit (to RxEthMAC)
534
wire        ResetCollision;          // Reset Collision (for synchronizing collision)
535
wire  [7:0] TxDataOut;               // Transmit Packet Data (to TxEthMAC)
536
wire        WillSendControlFrame;
537
wire        ReceiveEnd;
538
wire        ReceivedPacketGood;
539
wire        ReceivedLengthOK;
540 42 mohor
wire        InvalidSymbol;
541
wire        LatchedCrcError;
542
wire        RxLateCollision;
543 59 mohor
wire  [3:0] RetryCntLatched;
544
wire  [3:0] RetryCnt;
545
wire        StartTxAbort;
546
wire        MaxCollisionOccured;
547
wire        RetryLimit;
548
wire        StatePreamble;
549
wire  [1:0] StateData;
550 15 mohor
 
551
// Connecting MACControl
552
eth_maccontrol maccontrol1
553
(
554 255 mohor
  .MTxClk(mtx_clk_pad_i),                       .TPauseRq(TPauseRq),
555 149 mohor
  .TxPauseTV(r_TxPauseTV),                      .TxDataIn(TxData),
556 15 mohor
  .TxStartFrmIn(TxStartFrm),                    .TxEndFrmIn(TxEndFrm),
557
  .TxUsedDataIn(TxUsedDataIn),                  .TxDoneIn(TxDoneIn),
558 20 mohor
  .TxAbortIn(TxAbortIn),                        .MRxClk(mrx_clk_pad_i),
559 15 mohor
  .RxData(RxData),                              .RxValid(RxValid),
560
  .RxStartFrm(RxStartFrm),                      .RxEndFrm(RxEndFrm),
561
  .ReceiveEnd(ReceiveEnd),                      .ReceivedPacketGood(ReceivedPacketGood),
562 261 mohor
  .TxFlow(r_TxFlow),
563 15 mohor
  .RxFlow(r_RxFlow),                            .DlyCrcEn(r_DlyCrcEn),
564
  .MAC(r_MAC),                                  .PadIn(r_Pad | PerPacketPad),
565
  .PadOut(PadOut),                              .CrcEnIn(r_CrcEn | PerPacketCrcEn),
566 240 tadejm
  .CrcEnOut(CrcEnOut),                          .TxReset(wb_rst_i),
567
  .RxReset(wb_rst_i),                           .ReceivedLengthOK(ReceivedLengthOK),
568 15 mohor
  .TxDataOut(TxDataOut),                        .TxStartFrmOut(TxStartFrmOut),
569
  .TxEndFrmOut(TxEndFrmOut),                    .TxUsedDataOut(TxUsedData),
570
  .TxDoneOut(TxDone),                           .TxAbortOut(TxAbort),
571
  .WillSendControlFrame(WillSendControlFrame),  .TxCtrlEndFrm(TxCtrlEndFrm),
572 261 mohor
  .ReceivedPauseFrm(ReceivedPauseFrm),          .ControlFrmAddressOK(ControlFrmAddressOK),
573 272 tadejm
  .SetPauseTimer(SetPauseTimer),
574
  .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),                .r_PassAll(r_PassAll)
575 15 mohor
);
576
 
577
 
578
 
579
wire TxCarrierSense;          // Synchronized CarrierSense (to Tx clock)
580
wire Collision;               // Synchronized Collision
581
 
582
reg CarrierSense_Tx1;
583
reg CarrierSense_Tx2;
584
reg Collision_Tx1;
585
reg Collision_Tx2;
586
 
587
reg RxEnSync;                 // Synchronized Receive Enable
588 301 knguyen
//reg CarrierSense_Rx1;
589
//reg RxCarrierSense;           // Synchronized CarrierSense (to Rx clock)
590 15 mohor
reg WillTransmit_q;
591
reg WillTransmit_q2;
592
 
593
 
594
 
595
// Muxed MII receive data valid
596 17 mohor
assign MRxDV_Lb = r_LoopBck? mtxen_pad_o : mrxdv_pad_i & RxEnSync;
597 15 mohor
 
598
// Muxed MII Receive Error
599 17 mohor
assign MRxErr_Lb = r_LoopBck? mtxerr_pad_o : mrxerr_pad_i & RxEnSync;
600 15 mohor
 
601
// Muxed MII Receive Data
602 17 mohor
assign MRxD_Lb[3:0] = r_LoopBck? mtxd_pad_o[3:0] : mrxd_pad_i[3:0];
603 15 mohor
 
604
 
605
 
606
// Connecting TxEthMAC
607
eth_txethmac txethmac1
608
(
609 240 tadejm
  .MTxClk(mtx_clk_pad_i),             .Reset(wb_rst_i),                   .CarrierSense(TxCarrierSense),
610 15 mohor
  .Collision(Collision),              .TxData(TxDataOut),                 .TxStartFrm(TxStartFrmOut),
611
  .TxUnderRun(TxUnderRun),            .TxEndFrm(TxEndFrmOut),             .Pad(PadOut),
612
  .MinFL(r_MinFL),                    .CrcEn(CrcEnOut),                   .FullD(r_FullD),
613
  .HugEn(r_HugEn),                    .DlyCrcEn(r_DlyCrcEn),              .IPGT(r_IPGT),
614
  .IPGR1(r_IPGR1),                    .IPGR2(r_IPGR2),                    .CollValid(r_CollValid),
615
  .MaxRet(r_MaxRet),                  .NoBckof(r_NoBckof),                .ExDfrEn(r_ExDfrEn),
616 17 mohor
  .MaxFL(r_MaxFL),                    .MTxEn(mtxen_pad_o),                .MTxD(mtxd_pad_o),
617
  .MTxErr(mtxerr_pad_o),              .TxUsedData(TxUsedDataIn),          .TxDone(TxDoneIn),
618 15 mohor
  .TxRetry(TxRetry),                  .TxAbort(TxAbortIn),                .WillTransmit(WillTransmit),
619 59 mohor
  .ResetCollision(ResetCollision),    .RetryCnt(RetryCnt),                .StartTxDone(StartTxDone),
620
  .StartTxAbort(StartTxAbort),        .MaxCollisionOccured(MaxCollisionOccured), .LateCollision(LateCollision),
621 276 tadejm
  .DeferIndication(DeferIndication),  .StatePreamble(StatePreamble),      .StateData(StateData)
622 15 mohor
);
623
 
624
 
625
 
626
 
627
wire  [15:0]  RxByteCnt;
628
wire          RxByteCntEq0;
629
wire          RxByteCntGreat2;
630
wire          RxByteCntMaxFrame;
631
wire          RxCrcError;
632
wire          RxStateIdle;
633
wire          RxStatePreamble;
634
wire          RxStateSFD;
635
wire   [1:0]  RxStateData;
636 250 mohor
wire          AddressMiss;
637 15 mohor
 
638
 
639
 
640
// Connecting RxEthMAC
641
eth_rxethmac rxethmac1
642
(
643 21 mohor
  .MRxClk(mrx_clk_pad_i),               .MRxDV(MRxDV_Lb),                     .MRxD(MRxD_Lb),
644 15 mohor
  .Transmitting(Transmitting),          .HugEn(r_HugEn),                      .DlyCrcEn(r_DlyCrcEn),
645 240 tadejm
  .MaxFL(r_MaxFL),                      .r_IFG(r_IFG),                        .Reset(wb_rst_i),
646 15 mohor
  .RxData(RxData),                      .RxValid(RxValid),                    .RxStartFrm(RxStartFrm),
647 65 mohor
  .RxEndFrm(RxEndFrm),                  .ByteCnt(RxByteCnt),
648 15 mohor
  .ByteCntEq0(RxByteCntEq0),            .ByteCntGreat2(RxByteCntGreat2),      .ByteCntMaxFrame(RxByteCntMaxFrame),
649
  .CrcError(RxCrcError),                .StateIdle(RxStateIdle),              .StatePreamble(RxStatePreamble),
650 52 billditt
  .StateSFD(RxStateSFD),                .StateData(RxStateData),
651 63 mohor
  .MAC(r_MAC),                          .r_Pro(r_Pro),                        .r_Bro(r_Bro),
652 250 mohor
  .r_HASH0(r_HASH0),                    .r_HASH1(r_HASH1),                    .RxAbort(RxAbort),
653 261 mohor
  .AddressMiss(AddressMiss),            .PassAll(r_PassAll),                  .ControlFrmAddressOK(ControlFrmAddressOK)
654 15 mohor
);
655
 
656
 
657
// MII Carrier Sense Synchronization
658 240 tadejm
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
659 15 mohor
begin
660 240 tadejm
  if(wb_rst_i)
661 15 mohor
    begin
662
      CarrierSense_Tx1 <= #Tp 1'b0;
663
      CarrierSense_Tx2 <= #Tp 1'b0;
664
    end
665
  else
666
    begin
667 17 mohor
      CarrierSense_Tx1 <= #Tp mcrs_pad_i;
668 15 mohor
      CarrierSense_Tx2 <= #Tp CarrierSense_Tx1;
669
    end
670
end
671
 
672
assign TxCarrierSense = ~r_FullD & CarrierSense_Tx2;
673
 
674
 
675
// MII Collision Synchronization
676 240 tadejm
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
677 15 mohor
begin
678 240 tadejm
  if(wb_rst_i)
679 15 mohor
    begin
680
      Collision_Tx1 <= #Tp 1'b0;
681
      Collision_Tx2 <= #Tp 1'b0;
682
    end
683
  else
684
    begin
685 17 mohor
      Collision_Tx1 <= #Tp mcoll_pad_i;
686 15 mohor
      if(ResetCollision)
687
        Collision_Tx2 <= #Tp 1'b0;
688
      else
689
      if(Collision_Tx1)
690
        Collision_Tx2 <= #Tp 1'b1;
691
    end
692
end
693
 
694
 
695
// Synchronized Collision
696
assign Collision = ~r_FullD & Collision_Tx2;
697
 
698
 
699
 
700
// Carrier sense is synchronized to receive clock.
701 301 knguyen
//always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
702
//begin
703
//  if(wb_rst_i)
704
//    begin
705
//      CarrierSense_Rx1 <= #Tp 1'h0;
706
//      RxCarrierSense <= #Tp 1'h0;
707
//    end
708
//  else
709
//    begin
710
//      CarrierSense_Rx1 <= #Tp mcrs_pad_i;
711
//      RxCarrierSense <= #Tp CarrierSense_Rx1;
712
//    end
713
//end
714 15 mohor
 
715
 
716
// Delayed WillTransmit
717 20 mohor
always @ (posedge mrx_clk_pad_i)
718 15 mohor
begin
719
  WillTransmit_q <= #Tp WillTransmit;
720
  WillTransmit_q2 <= #Tp WillTransmit_q;
721
end
722
 
723
 
724
assign Transmitting = ~r_FullD & WillTransmit_q2;
725
 
726
 
727
 
728
// Synchronized Receive Enable
729 240 tadejm
always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
730 15 mohor
begin
731 240 tadejm
  if(wb_rst_i)
732 15 mohor
    RxEnSync <= #Tp 1'b0;
733
  else
734 301 knguyen
  //if(~RxCarrierSense | RxCarrierSense & Transmitting)
735
  if(~mrxdv_pad_i)
736 15 mohor
    RxEnSync <= #Tp r_RxEn;
737
end
738
 
739
 
740
 
741 149 mohor
// Synchronizing WillSendControlFrame to WB_CLK;
742
always @ (posedge wb_clk_i or posedge wb_rst_i)
743
begin
744
  if(wb_rst_i)
745
    WillSendControlFrame_sync1 <= 1'b0;
746
  else
747
    WillSendControlFrame_sync1 <=#Tp WillSendControlFrame;
748
end
749 15 mohor
 
750 149 mohor
always @ (posedge wb_clk_i or posedge wb_rst_i)
751
begin
752
  if(wb_rst_i)
753
    WillSendControlFrame_sync2 <= 1'b0;
754
  else
755
    WillSendControlFrame_sync2 <=#Tp WillSendControlFrame_sync1;
756
end
757
 
758
always @ (posedge wb_clk_i or posedge wb_rst_i)
759
begin
760
  if(wb_rst_i)
761
    WillSendControlFrame_sync3 <= 1'b0;
762
  else
763
    WillSendControlFrame_sync3 <=#Tp WillSendControlFrame_sync2;
764
end
765
 
766
always @ (posedge wb_clk_i or posedge wb_rst_i)
767
begin
768
  if(wb_rst_i)
769
    RstTxPauseRq <= 1'b0;
770
  else
771
    RstTxPauseRq <=#Tp WillSendControlFrame_sync2 & ~WillSendControlFrame_sync3;
772
end
773
 
774
 
775 255 mohor
 
776
 
777
// TX Pause request Synchronization
778
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
779
begin
780
  if(wb_rst_i)
781
    begin
782
      TxPauseRq_sync1 <= #Tp 1'b0;
783
      TxPauseRq_sync2 <= #Tp 1'b0;
784
      TxPauseRq_sync3 <= #Tp 1'b0;
785
    end
786
  else
787
    begin
788
      TxPauseRq_sync1 <= #Tp (r_TxPauseRq & r_TxFlow);
789
      TxPauseRq_sync2 <= #Tp TxPauseRq_sync1;
790
      TxPauseRq_sync3 <= #Tp TxPauseRq_sync2;
791
    end
792
end
793
 
794
 
795
always @ (posedge mtx_clk_pad_i or posedge wb_rst_i)
796
begin
797
  if(wb_rst_i)
798
    TPauseRq <= #Tp 1'b0;
799
  else
800
    TPauseRq <= #Tp TxPauseRq_sync2 & (~TxPauseRq_sync3);
801
end
802
 
803
 
804 261 mohor
wire LatchedMRxErr;
805
reg RxAbort_latch;
806
reg RxAbort_sync1;
807
reg RxAbort_sync2;
808
reg RxAbort_wb;
809
reg RxAbortRst_sync1;
810
reg RxAbortRst;
811 255 mohor
 
812 261 mohor
// Synchronizing RxAbort to the WISHBONE clock
813
always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
814
begin
815
  if(wb_rst_i)
816
    RxAbort_latch <= #Tp 1'b0;
817
  else if(RxAbort | (ShortFrame & ~r_RecSmall) | LatchedMRxErr & ~InvalidSymbol | (ReceivedPauseFrm & (~r_PassAll)))
818
    RxAbort_latch <= #Tp 1'b1;
819
  else if(RxAbortRst)
820
    RxAbort_latch <= #Tp 1'b0;
821
end
822 255 mohor
 
823 261 mohor
always @ (posedge wb_clk_i or posedge wb_rst_i)
824
begin
825
  if(wb_rst_i)
826
    begin
827
      RxAbort_sync1 <= #Tp 1'b0;
828
      RxAbort_wb    <= #Tp 1'b0;
829
      RxAbort_wb    <= #Tp 1'b0;
830
    end
831
  else
832
    begin
833
      RxAbort_sync1 <= #Tp RxAbort_latch;
834
      RxAbort_wb    <= #Tp RxAbort_sync1;
835
    end
836
end
837
 
838
always @ (posedge mrx_clk_pad_i or posedge wb_rst_i)
839
begin
840
  if(wb_rst_i)
841
    begin
842
      RxAbortRst_sync1 <= #Tp 1'b0;
843
      RxAbortRst       <= #Tp 1'b0;
844
    end
845
  else
846
    begin
847
      RxAbortRst_sync1 <= #Tp RxAbort_wb;
848
      RxAbortRst       <= #Tp RxAbortRst_sync1;
849
    end
850
end
851
 
852
 
853
 
854 114 mohor
// Connecting Wishbone module
855 41 mohor
eth_wishbone wishbone
856 15 mohor
(
857 41 mohor
  .WB_CLK_I(wb_clk_i),                .WB_DAT_I(wb_dat_i),
858 103 mohor
  .WB_DAT_O(BD_WB_DAT_O),
859 15 mohor
 
860
  // WISHBONE slave
861 76 mohor
  .WB_ADR_I(wb_adr_i[9:2]),           .WB_WE_I(wb_we_i),
862 21 mohor
  .BDCs(BDCs),                        .WB_ACK_O(BDAck),
863 15 mohor
 
864 240 tadejm
  .Reset(wb_rst_i),
865 41 mohor
 
866
  // WISHBONE master
867
  .m_wb_adr_o(m_wb_adr_o),            .m_wb_sel_o(m_wb_sel_o),                  .m_wb_we_o(m_wb_we_o),
868
  .m_wb_dat_i(m_wb_dat_i),            .m_wb_dat_o(m_wb_dat_o),                  .m_wb_cyc_o(m_wb_cyc_o),
869
  .m_wb_stb_o(m_wb_stb_o),            .m_wb_ack_i(m_wb_ack_i),                  .m_wb_err_i(m_wb_err_i),
870 214 mohor
 
871
`ifdef ETH_WISHBONE_B3
872
  .m_wb_cti_o(m_wb_cti_o),            .m_wb_bte_o(m_wb_bte_o),
873
`endif
874
 
875 41 mohor
 
876 15 mohor
    //TX
877 21 mohor
  .MTxClk(mtx_clk_pad_i),             .TxStartFrm(TxStartFrm),                  .TxEndFrm(TxEndFrm),
878 59 mohor
  .TxUsedData(TxUsedData),            .TxData(TxData),
879 15 mohor
  .TxRetry(TxRetry),                  .TxAbort(TxAbort),                        .TxUnderRun(TxUnderRun),
880 149 mohor
  .TxDone(TxDone),
881
  .PerPacketCrcEn(PerPacketCrcEn),    .PerPacketPad(PerPacketPad),
882 15 mohor
 
883
  // Register
884 34 mohor
  .r_TxEn(r_TxEn),                    .r_RxEn(r_RxEn),                          .r_TxBDNum(r_TxBDNum),
885 270 mohor
  .TX_BD_NUM_Wr(TX_BD_NUM_Wr),        .r_RxFlow(r_RxFlow),                      .r_PassAll(r_PassAll),
886 15 mohor
 
887
  //RX
888 21 mohor
  .MRxClk(mrx_clk_pad_i),             .RxData(RxData),                          .RxValid(RxValid),
889 41 mohor
  .RxStartFrm(RxStartFrm),            .RxEndFrm(RxEndFrm),
890 76 mohor
  .Busy_IRQ(Busy_IRQ),                .RxE_IRQ(RxE_IRQ),                        .RxB_IRQ(RxB_IRQ),
891 149 mohor
  .TxE_IRQ(TxE_IRQ),                  .TxB_IRQ(TxB_IRQ),
892 21 mohor
 
893 272 tadejm
  .RxAbort(RxAbort_wb),               .RxStatusWriteLatched_sync2(RxStatusWriteLatched_sync2),
894 41 mohor
 
895 42 mohor
  .InvalidSymbol(InvalidSymbol),      .LatchedCrcError(LatchedCrcError),        .RxLength(RxByteCnt),
896
  .RxLateCollision(RxLateCollision),  .ShortFrame(ShortFrame),                  .DribbleNibble(DribbleNibble),
897 59 mohor
  .ReceivedPacketTooBig(ReceivedPacketTooBig), .LoadRxStatus(LoadRxStatus),     .RetryCntLatched(RetryCntLatched),
898
  .RetryLimit(RetryLimit),            .LateCollLatched(LateCollLatched),        .DeferLatched(DeferLatched),
899 261 mohor
  .CarrierSenseLost(CarrierSenseLost),.ReceivedPacketGood(ReceivedPacketGood),  .AddressMiss(AddressMiss),
900
  .ReceivedPauseFrm(ReceivedPauseFrm)
901 59 mohor
 
902 210 mohor
`ifdef ETH_BIST
903 218 mohor
  ,
904 302 markom
  .mbist_si_i       (mbist_si_i),
905
  .mbist_so_o       (mbist_so_o),
906
  .mbist_ctrl_i       (mbist_ctrl_i)
907 210 mohor
`endif
908 15 mohor
);
909
 
910
 
911
 
912
// Connecting MacStatus module
913
eth_macstatus macstatus1
914
(
915 240 tadejm
  .MRxClk(mrx_clk_pad_i),             .Reset(wb_rst_i),
916 42 mohor
  .ReceiveEnd(ReceiveEnd),            .ReceivedPacketGood(ReceivedPacketGood),     .ReceivedLengthOK(ReceivedLengthOK),
917
  .RxCrcError(RxCrcError),            .MRxErr(MRxErr_Lb),                          .MRxDV(MRxDV_Lb),
918
  .RxStateSFD(RxStateSFD),            .RxStateData(RxStateData),                   .RxStatePreamble(RxStatePreamble),
919
  .RxStateIdle(RxStateIdle),          .Transmitting(Transmitting),                 .RxByteCnt(RxByteCnt),
920
  .RxByteCntEq0(RxByteCntEq0),        .RxByteCntGreat2(RxByteCntGreat2),           .RxByteCntMaxFrame(RxByteCntMaxFrame),
921 261 mohor
  .InvalidSymbol(InvalidSymbol),
922 42 mohor
  .MRxD(MRxD_Lb),                     .LatchedCrcError(LatchedCrcError),           .Collision(mcoll_pad_i),
923
  .CollValid(r_CollValid),            .RxLateCollision(RxLateCollision),           .r_RecSmall(r_RecSmall),
924
  .r_MinFL(r_MinFL),                  .r_MaxFL(r_MaxFL),                           .ShortFrame(ShortFrame),
925
  .DribbleNibble(DribbleNibble),      .ReceivedPacketTooBig(ReceivedPacketTooBig), .r_HugEn(r_HugEn),
926 59 mohor
  .LoadRxStatus(LoadRxStatus),        .RetryCnt(RetryCnt),                         .StartTxDone(StartTxDone),
927
  .StartTxAbort(StartTxAbort),        .RetryCntLatched(RetryCntLatched),           .MTxClk(mtx_clk_pad_i),
928
  .MaxCollisionOccured(MaxCollisionOccured), .RetryLimit(RetryLimit),              .LateCollision(LateCollision),
929 276 tadejm
  .LateCollLatched(LateCollLatched),  .DeferIndication(DeferIndication),           .DeferLatched(DeferLatched),
930 59 mohor
  .TxStartFrm(TxStartFrmOut),         .StatePreamble(StatePreamble),               .StateData(StateData),
931 125 mohor
  .CarrierSense(CarrierSense_Tx2),    .CarrierSenseLost(CarrierSenseLost),         .TxUsedData(TxUsedDataIn),
932 168 mohor
  .LatchedMRxErr(LatchedMRxErr),      .Loopback(r_LoopBck),                        .r_FullD(r_FullD)
933 15 mohor
);
934
 
935
 
936
endmodule

powered by: WebSVN 2.1.0

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