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 78

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 77 dinesha
                tx_ch_en,
73 12 dinesha
 
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 77 dinesha
   output       tx_ch_en;
138 12 dinesha
 
139 77 dinesha
   output        set_fifo_undrn;
140 12 dinesha
 
141 77 dinesha
   input         app_clk;
142 12 dinesha
 
143
   wire [31:0]    tc2tx_fcs;
144 77 dinesha
   wire            set_fifo_undrn;
145 12 dinesha
 
146
 
147
 
148
 
149
 
150
   // Instantiate Defferal block
151
   g_deferral U_deferral (
152
                          //Outputs
153
                          .df2tx_dfl_dn(df2tx_dfl_dn),
154
                          .cf2df_dfl_single(cf2df_dfl_single),
155
                          .phy_tx_en(phy_tx_en),
156
                          .phy_tx_er(phy_tx_er),
157
                          .tx_clk(tx_clk),
158
                          .app_reset_n(tx_reset_n));
159
 
160
 
161
 
162
   // Instantiate Transmit State machine block
163
   g_tx_fsm U_tx_fsm(
164 78 dinesha
           .app_clk(app_clk),
165 77 dinesha
           .set_fifo_undrn(set_fifo_undrn),
166 12 dinesha
 
167
            //Outputs
168
           .tx_commit_read(tx_commit_read),
169
           .tx_dt_rd(tx_dt_rd),
170
            //FCS block interface
171
           .tx2tc_fcs_active(tx2tc_fcs_active),
172
           .tx2tc_gen_crc(tx2tc_gen_crc),
173
            //MII or RMII interface signals
174
           .tx2mi_strt_preamble(tx2mi_strt_preamble),
175
           .tx2mi_byte_valid(tx2mi_byte_valid),
176
           .tx2mi_byte(tx2mi_byte),
177
           .tx2mi_end_transmit(tx2mi_end_transmit),
178
           .tx_ch_en(tx_ch_en),
179 77 dinesha
           .phy_tx_en(phy_tx_en),
180 12 dinesha
          //tx fifo management outputs
181
           .tx_sts_vld(tx_sts_vld),
182
           .tx_sts_byte_cntr(tx_sts_byte_cntr),
183
                     .tx_sts_fifo_underrun(tx_sts_fifo_underrun),
184
                     .app_tx_rdy(app_tx_rdy),
185
                     .tx_end_frame(app_tx_dt_in[8]),
186
                     .app_tx_dt_in(app_tx_dt_in[7:0]),
187
                     .app_tx_fifo_empty(app_tx_fifo_empty),
188
                     //dfl and back off
189
                     .df2tx_dfl_dn(df2tx_dfl_dn),
190
                     //inputs from FCS
191
                     .tc2tx_fcs(tc2tx_fcs),
192
                     .cf2tx_ch_en(cf2tx_ch_en),
193
                     .cf2tx_pad_enable(cf2tx_pad_enable),
194
                     .cf2tx_append_fcs(cf2tx_append_fcs),
195
                     .cf_mac_mode(cf_mac_mode),
196
                     .cf_mac_sa(cf_mac_sa),
197
                     .cf2tx_force_bad_fcs(cf2tx_force_bad_fcs),
198
                     //MII
199
                     .mi2tx_byte_ack(mi2tx_byte_ack),
200
                     .tx_clk(tx_clk),
201
                     .tx_reset_n(tx_reset_n),
202
                     .app_reset_n(app_reset_n));
203
 
204
 
205
 
206
 
207
   // Instantiate CRC 32 block for Transmit
208
   g_tx_crc32 U_tx_crc32 (
209
                          // List of outputs.
210
                          .tx_fcs (tc2tx_fcs),
211
                          // List of inputs
212
                          .gen_tx_crc(tx2tc_gen_crc),
213
                          .tx_reset_crc(tx2mi_strt_preamble),
214
                          .tx_data(tx2mi_byte),
215
                          .sclk(tx_clk),
216
                          .reset_n(tx_reset_n)
217
                          );
218
 
219
endmodule
220
 
221
 
222
 
223
 
224
 
225
 
226
 
227
 
228
 
229
 
230
 
231
 

powered by: WebSVN 2.1.0

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