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 76

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

powered by: WebSVN 2.1.0

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