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 37

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
      set_fifo_undrn,
59
 
60
 
61
                //Outputs
62
                //TX FIFO management
63
                tx_commit_read,
64
                tx_dt_rd,
65
 
66
                //MII interface
67
                tx2mi_strt_preamble,
68
                tx2mi_byte_valid,
69
                tx2mi_byte,
70
                tx2mi_end_transmit,
71
                tx_ch_en,            // MANDAR
72
 
73
                //Status to application
74
                tx_sts_vld,
75
                tx_sts_byte_cntr,
76
                tx_sts_fifo_underrun,
77
 
78
 
79
                //Inputs
80
                //MII interface
81
                phy_tx_en,
82
                phy_tx_er,
83
 
84
                //configuration
85
                cf2tx_ch_en,
86
                cf2df_dfl_single,
87
                cf2tx_pad_enable,
88
                cf2tx_append_fcs,
89
                cf_mac_mode,
90
                cf_mac_sa,
91
                cf2tx_force_bad_fcs,
92
                //FIFO data
93
                app_tx_dt_in,
94
                app_tx_fifo_empty,
95
                app_tx_rdy,
96
 
97
                //MII
98
                mi2tx_byte_ack,
99
                app_reset_n,
100
                tx_reset_n,
101
                tx_clk);
102
   input              app_reset_n;            // Global app_reset for the MAC
103
   input              tx_reset_n;
104
   input              tx_clk;           // Transmit clock
105
 
106
   input [8:0]         app_tx_dt_in;
107
   input              app_tx_fifo_empty;
108
   input              app_tx_rdy;
109
 
110
   input              phy_tx_en;            // Transmit data Enable
111
   input              phy_tx_er;            // Transmit Error 
112
   input              cf2tx_ch_en;         // Transmit channel Enable
113
   input [7:0] cf2df_dfl_single;
114
   input       cf2tx_pad_enable;       // Padding Enabled
115
   input       cf2tx_append_fcs;       // Append CRC to packets
116
   input       cf2tx_force_bad_fcs;    // force bad fcs
117
   input [47:0] cf_mac_sa;              // MAC Source Address 
118
   input        cf_mac_mode;       // Gigabit or 10/100
119
 
120
 
121
 
122
   input        mi2tx_byte_ack;    // Transmit byte ack from RMII
123
   output       tx_commit_read;
124
   output       tx_dt_rd; //get the next fsm data
125
 
126
 
127
   output       tx2mi_strt_preamble;   // Start preamble indicated to RMII
128
   output       tx2mi_byte_valid;   // Byte valid from the Tx State Macine
129
   output [7:0] tx2mi_byte;  // Transmit byte to RMII
130
   output       tx2mi_end_transmit;       // Transmit complete
131
 
132
   output       tx_sts_vld;      //tx_sts is valid on valid tx_sts_vld
133
   output [15:0] tx_sts_byte_cntr;
134
   output        tx_sts_fifo_underrun;
135
 
136
   output       tx_ch_en;   // MANDAR
137
 
138
   output        set_fifo_undrn;// Description: At GMII Interface ,
139
                                // abug after a transmit fifo underun was found.
140
                                // The packet after a packet that 
141
                                // underran has 1 too few bytes .
142
 
143
   input         app_clk;           // condor fix
144
 
145
   wire [31:0]    tc2tx_fcs;
146
   wire            set_fifo_undrn;// E3C fix
147
 
148
 
149
 
150
 
151
 
152
   // Instantiate Defferal block
153
   g_deferral U_deferral (
154
                          //Outputs
155
                          .df2tx_dfl_dn(df2tx_dfl_dn),
156
                          .cf2df_dfl_single(cf2df_dfl_single),
157
                          .phy_tx_en(phy_tx_en),
158
                          .phy_tx_er(phy_tx_er),
159
                          .tx_clk(tx_clk),
160
                          .app_reset_n(tx_reset_n));
161
 
162
 
163
 
164
   // Instantiate Transmit State machine block
165
   g_tx_fsm U_tx_fsm(
166
           .app_clk(app_clk), // condor fix
167
           .set_fifo_undrn(set_fifo_undrn), // E3C fix
168
 
169
            //Outputs
170
           .tx_commit_read(tx_commit_read),
171
           .tx_dt_rd(tx_dt_rd),
172
            //FCS block interface
173
           .tx2tc_fcs_active(tx2tc_fcs_active),
174
           .tx2tc_gen_crc(tx2tc_gen_crc),
175
            //MII or RMII interface signals
176
           .tx2mi_strt_preamble(tx2mi_strt_preamble),
177
           .tx2mi_byte_valid(tx2mi_byte_valid),
178
           .tx2mi_byte(tx2mi_byte),
179
           .tx2mi_end_transmit(tx2mi_end_transmit),
180
           .tx_ch_en(tx_ch_en),
181
           .phy_tx_en(phy_tx_en), // mfilardo.  for ofn auth fix.
182
          //tx fifo management outputs
183
           .tx_sts_vld(tx_sts_vld),
184
           .tx_sts_byte_cntr(tx_sts_byte_cntr),
185
                     .tx_sts_fifo_underrun(tx_sts_fifo_underrun),
186
                     .app_tx_rdy(app_tx_rdy),
187
                     .tx_end_frame(app_tx_dt_in[8]),
188
                     .app_tx_dt_in(app_tx_dt_in[7:0]),
189
                     .app_tx_fifo_empty(app_tx_fifo_empty),
190
                     //dfl and back off
191
                     .df2tx_dfl_dn(df2tx_dfl_dn),
192
                     //inputs from FCS
193
                     .tc2tx_fcs(tc2tx_fcs),
194
                     .cf2tx_ch_en(cf2tx_ch_en),
195
                     .cf2tx_pad_enable(cf2tx_pad_enable),
196
                     .cf2tx_append_fcs(cf2tx_append_fcs),
197
                     .cf_mac_mode(cf_mac_mode),
198
                     .cf_mac_sa(cf_mac_sa),
199
                     .cf2tx_force_bad_fcs(cf2tx_force_bad_fcs),
200
                     //MII
201
                     .mi2tx_byte_ack(mi2tx_byte_ack),
202
                     .tx_clk(tx_clk),
203
                     .tx_reset_n(tx_reset_n),
204
                     .app_reset_n(app_reset_n));
205
 
206
 
207
 
208
 
209
   // Instantiate CRC 32 block for Transmit
210
   g_tx_crc32 U_tx_crc32 (
211
                          // List of outputs.
212
                          .tx_fcs (tc2tx_fcs),
213
                          // List of inputs
214
                          .gen_tx_crc(tx2tc_gen_crc),
215
                          .tx_reset_crc(tx2mi_strt_preamble),
216
                          .tx_data(tx2mi_byte),
217
                          .sclk(tx_clk),
218
                          .reset_n(tx_reset_n)
219
                          );
220
 
221
endmodule
222
 
223
 
224
 
225
 
226
 
227
 
228
 
229
 
230
 
231
 
232
 
233
 

powered by: WebSVN 2.1.0

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