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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [rtl/] [gmac/] [mac/] [g_tx_top.v] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 dinesha
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Tubo 8051 cores MAC Interface Module                        ////
4
////                                                              ////
5
////  This file is part of the Turbo 8051 cores project           ////
6
////  http://www.opencores.org/cores/turbo8051/                   ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Turbo 8051 definitions.                                     ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////    nothing                                                   ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Dinesh Annayya, dinesha@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//`timescale 1ns/100ps
44
 
45
/***************************************************************
46
  Description:
47
 
48
 tx_top.v: This module has the top level of the transmit block
49
 It instantiates the following blocks
50
 1. tx_fsm
51
 2. tx_crc
52
 3. tx_fifo_mgmt
53
 4. deferral
54
 5. backoff
55
 ***********************************************************************/
56
module g_tx_top(
57
      app_clk,
58
      send_pause_active,
59
      set_fifo_undrn,
60
 
61
 
62
                //Outputs
63
                //TX FIFO management
64
                tx_commit_read,
65
                tx_dt_rd,
66
 
67
                //MII interface
68
                tx2mi_strt_preamble,
69
                tx2mi_byte_valid,
70
                tx2mi_byte,
71
                tx2mi_end_transmit,
72
                tx_ch_en,            // MANDAR
73
 
74
                //Status to application
75
                tx_sts_vld,
76
                tx_sts_byte_cntr,
77
                tx_sts_fifo_underrun,
78
 
79
 
80
                //Inputs
81
                //MII interface
82
                phy_tx_en,
83
                phy_tx_er,
84
                //application
85
                app_send_pause,
86
 
87
              //rx_top
88
                rx2tx_pause,
89
 
90
                //configuration
91
                cf2tx_tstate_mode,
92
                cf2tx_ch_en,
93
                cf2df_dfl_single,
94
                cf2tx_pad_enable,
95
                cf2tx_append_fcs,
96
                cf_mac_mode,
97
                cf_mac_sa,
98
                cf2tx_pause_quanta,
99
                cf2tx_force_bad_fcs,
100
                //FIFO data
101
                app_tx_dt_in,
102
                app_tx_fifo_empty,
103
                app_tx_rdy,
104
 
105
                //MII
106
                mi2tx_byte_ack,
107
                app_reset_n,
108
                tx_reset_n,
109
                tx_clk);
110
   input              app_reset_n;            // Global app_reset for the MAC
111
   input              tx_reset_n;
112
   input              tx_clk;           // Transmit clock
113
 
114
   input              app_send_pause;
115
   input [8:0]         app_tx_dt_in;
116
   input              app_tx_fifo_empty;
117
   input              app_tx_rdy;
118
 
119
   input              phy_tx_en;            // Transmit data Enable
120
   input              phy_tx_er;            // Transmit Error 
121
   input              cf2tx_tstate_mode;   // OFN auth intf fix
122
   input              cf2tx_ch_en;         // Transmit channel Enable
123
   input [7:0] cf2df_dfl_single;
124
   input       cf2tx_pad_enable;       // Padding Enabled
125
   input       cf2tx_append_fcs;       // Append CRC to packets
126
   input       cf2tx_force_bad_fcs;    // force bad fcs
127
   input [47:0] cf_mac_sa;              // MAC Source Address 
128
   input [15:0] cf2tx_pause_quanta;     // Pause Quanta used when sending a pause frame 
129
   input        cf_mac_mode;       // Gigabit or 10/100
130
 
131
 
132
   input        rx2tx_pause;
133
 
134
   input        mi2tx_byte_ack;    // Transmit byte ack from RMII
135
   output       tx_commit_read;
136
   output       tx_dt_rd; //get the next fsm data
137
 
138
 
139
   output       tx2mi_strt_preamble;   // Start preamble indicated to RMII
140
   output       tx2mi_byte_valid;   // Byte valid from the Tx State Macine
141
   output [7:0] tx2mi_byte;  // Transmit byte to RMII
142
   output       tx2mi_end_transmit;       // Transmit complete
143
 
144
   output       tx_sts_vld;      //tx_sts is valid on valid tx_sts_vld
145
   output [15:0] tx_sts_byte_cntr;
146
   output        tx_sts_fifo_underrun;
147
 
148
   output       tx_ch_en;   // MANDAR
149
 
150
   output        send_pause_active; // condor fix
151
   output        set_fifo_undrn;// Description: At GMII Interface ,
152
                                // abug after a transmit fifo underun was found.
153
                                // The packet after a packet that 
154
                                // underran has 1 too few bytes .
155
 
156
   input         app_clk;           // condor fix
157
 
158
   wire [31:0]    tc2tx_fcs;
159
   wire            set_fifo_undrn;// E3C fix
160
 
161
 
162
 
163
 
164
 
165
   // Instantiate Defferal block
166
   g_deferral U_deferral (
167
                          //Outputs
168
                          .df2tx_dfl_dn(df2tx_dfl_dn),
169
                          .cf2df_dfl_single(cf2df_dfl_single),
170
                          .phy_tx_en(phy_tx_en),
171
                          .phy_tx_er(phy_tx_er),
172
                          .tx_clk(tx_clk),
173
                          .app_reset_n(tx_reset_n));
174
 
175
 
176
 
177
   // Instantiate Transmit State machine block
178
   g_tx_fsm U_tx_fsm(
179
           .send_pause_active_out(send_pause_active), // condor fix
180
           .app_clk(app_clk), // condor fix
181
           .set_fifo_undrn(set_fifo_undrn), // E3C fix
182
 
183
            //Outputs
184
           .tx_commit_read(tx_commit_read),
185
           .tx_dt_rd(tx_dt_rd),
186
            //FCS block interface
187
           .tx2tc_fcs_active(tx2tc_fcs_active),
188
           .tx2tc_gen_crc(tx2tc_gen_crc),
189
            //MII or RMII interface signals
190
           .tx2mi_strt_preamble(tx2mi_strt_preamble),
191
           .tx2mi_byte_valid(tx2mi_byte_valid),
192
           .tx2mi_byte(tx2mi_byte),
193
           .tx2mi_end_transmit(tx2mi_end_transmit),
194
           .tx_ch_en(tx_ch_en),
195
           .phy_tx_en(phy_tx_en), // mfilardo.  for ofn auth fix.
196
          //tx fifo management outputs
197
           .tx_sts_vld(tx_sts_vld),
198
           .tx_sts_byte_cntr(tx_sts_byte_cntr),
199
                     .tx_sts_fifo_underrun(tx_sts_fifo_underrun),
200
                     .app_tx_rdy(app_tx_rdy),
201
                     .tx_end_frame(app_tx_dt_in[8]),
202
                     .app_tx_dt_in(app_tx_dt_in[7:0]),
203
                     .app_tx_fifo_empty(app_tx_fifo_empty),
204
                     //dfl and back off
205
                     .df2tx_dfl_dn(df2tx_dfl_dn),
206
                     .app_send_pause(app_send_pause),
207
                     //inputs from FCS
208
                     .tc2tx_fcs(tc2tx_fcs),
209
                     .cf2tx_tstate_mode(cf2tx_tstate_mode),
210
                     .cf2tx_ch_en(cf2tx_ch_en),
211
                     .cf2tx_pad_enable(cf2tx_pad_enable),
212
                     .cf2tx_append_fcs(cf2tx_append_fcs),
213
                     .cf_mac_mode(cf_mac_mode),
214
                     .cf_mac_sa(cf_mac_sa),
215
                     .cf2tx_pause_quanta(cf2tx_pause_quanta),
216
                     .cf2tx_force_bad_fcs(cf2tx_force_bad_fcs),
217
                     //RX pause frame received
218
                     .rx2tx_pause(rx2tx_pause),
219
                     //MII
220
                     .mi2tx_byte_ack(mi2tx_byte_ack),
221
                     .tx_clk(tx_clk),
222
                     .tx_reset_n(tx_reset_n),
223
                     .app_reset_n(app_reset_n));
224
 
225
 
226
 
227
 
228
   // Instantiate CRC 32 block for Transmit
229
   g_tx_crc32 U_tx_crc32 (
230
                          // List of outputs.
231
                          .tx_fcs (tc2tx_fcs),
232
                          // List of inputs
233
                          .gen_tx_crc(tx2tc_gen_crc),
234
                          .tx_reset_crc(tx2mi_strt_preamble),
235
                          .tx_data(tx2mi_byte),
236
                          .sclk(tx_clk),
237
                          .reset_n(tx_reset_n)
238
                          );
239
 
240
endmodule
241
 
242
 
243
 
244
 
245
 
246
 
247
 
248
 
249
 
250
 
251
 
252
 

powered by: WebSVN 2.1.0

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