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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [tags/] [rel-1-0/] [rtl/] [verilog/] [MAC_tx.v] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 maverickis
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3 7 maverickis
////  MAC_tx.v                                                    ////
4 5 maverickis
////                                                              ////
5
////  This file is part of the Ethernet IP core project           ////
6
////  http://www.opencores.org/projects.cgi/web/ethernet_tri_mode/////
7
////                                                              ////
8
////  Author(s):                                                  ////
9 7 maverickis
////      - Jon Gao (gaojon@yahoo.com)                            ////
10 5 maverickis
////                                                              ////
11
////                                                              ////
12
//////////////////////////////////////////////////////////////////////
13
////                                                              ////
14
//// Copyright (C) 2001 Authors                                   ////
15
////                                                              ////
16
//// This source file may be used and distributed without         ////
17
//// restriction provided that this copyright statement is not    ////
18
//// removed from the file and that any derivative work contains  ////
19
//// the original copyright notice and the associated disclaimer. ////
20
////                                                              ////
21
//// This source file is free software; you can redistribute it   ////
22
//// and/or modify it under the terms of the GNU Lesser General   ////
23
//// Public License as published by the Free Software Foundation; ////
24
//// either version 2.1 of the License, or (at your option) any   ////
25
//// later version.                                               ////
26
////                                                              ////
27
//// This source is distributed in the hope that it will be       ////
28
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
29
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
30
//// PURPOSE.  See the GNU Lesser General Public License for more ////
31
//// details.                                                     ////
32
////                                                              ////
33
//// You should have received a copy of the GNU Lesser General    ////
34
//// Public License along with this source; if not, download it   ////
35
//// from http://www.opencores.org/lgpl.shtml                     ////
36
////                                                              ////
37
//////////////////////////////////////////////////////////////////////
38
//                                                                    
39
// CVS Revision History                                               
40
//                                                                    
41 6 maverickis
// $Log: not supported by cvs2svn $
42 7 maverickis
// Revision 1.2  2005/12/16 06:44:14  Administrator
43
// replaced tab with space.
44
// passed 9.6k length frame test.
45
//
46 6 maverickis
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
47
// no message
48
//   
49 5 maverickis
module MAC_tx(
50 7 maverickis
input           Reset               ,
51
input           Clk                 ,
52
input           Clk_user            ,
53
                //PHY interface
54
output  [7:0]   TxD                 ,
55
output          TxEn                ,
56
input           CRS                 ,
57
                //RMON
58
output  [2:0]   Tx_pkt_type_rmon    ,
59
output  [15:0]  Tx_pkt_length_rmon  ,
60
output          Tx_apply_rmon       ,
61
output  [2:0]   Tx_pkt_err_type_rmon,
62
                //user interface 
63
output          Tx_mac_wa           ,
64
input           Tx_mac_wr           ,
65
input   [31:0]  Tx_mac_data         ,
66
input   [1:0]   Tx_mac_BE           ,//big endian
67
input           Tx_mac_sop          ,
68
input           Tx_mac_eop          ,
69
                //host interface 
70
input   [4:0]   Tx_Hwmark           ,
71
input   [4:0]   Tx_Lwmark           ,
72
input           pause_frame_send_en ,
73
input   [15:0]  pause_quanta_set    ,
74
input           MAC_tx_add_en       ,
75
input           FullDuplex          ,
76
input   [3:0]   MaxRetry            ,
77
input   [5:0]   IFGset              ,
78
input   [7:0]   MAC_add_prom_data   ,
79
input   [2:0]   MAC_add_prom_add    ,
80
input           MAC_add_prom_wr     ,
81
input           tx_pause_en         ,
82
input           xoff_cpu            ,
83
input           xon_cpu             ,
84
                //MAC_rx_flow       ,
85
input   [15:0]  pause_quanta        ,
86
input           pause_quanta_val    ,
87 5 maverickis
);
88 7 maverickis
//******************************************************************************        
89 5 maverickis
//internal signals                                                              
90
//******************************************************************************   
91 7 maverickis
                //CRC_gen Interface 
92
wire            CRC_init            ;
93
wire[7:0]       Frame_data          ;
94
wire            Data_en             ;
95
wire            CRC_rd              ;
96
wire            CRC_end             ;
97
wire[7:0]       CRC_out             ;
98
                //Ramdon_gen interface
99
wire            Random_init         ;
100
wire[3:0]       RetryCnt            ;
101
wire            Random_time_meet    ;//levle hight indicate random time passed away
102
                //flow control
103
wire            pause_apply         ;
104
wire            pause_quanta_sub    ;
105
wire            xoff_gen            ;
106
wire            xoff_gen_complete   ;
107
wire            xon_gen             ;
108
wire            xon_gen_complete    ;
109
                //MAC_rx_FF
110
wire[7:0]       Fifo_data           ;
111
wire            Fifo_rd             ;
112
wire            Fifo_eop            ;
113
wire            Fifo_da             ;
114
wire            Fifo_rd_finish      ;
115
wire            Fifo_rd_retry       ;
116
wire            Fifo_ra             ;
117
wire            Fifo_data_err_empty ;
118
wire            Fifo_data_err_full  ;
119
                //MAC_tx_addr_add
120
wire            MAC_tx_addr_init    ;
121
wire            MAC_tx_addr_rd      ;
122
wire[7:0]       MAC_tx_addr_data    ;
123 5 maverickis
 
124 7 maverickis
//******************************************************************************        
125 5 maverickis
//instantiation                                                              
126
//****************************************************************************** 
127
MAC_tx_ctrl U_MAC_tx_ctrl(
128 7 maverickis
.Reset                    (Reset                  ),
129
.Clk                      (Clk                    ),
130 5 maverickis
 //CRC_gen Interface      (//CRC_gen Interface    ),           
131 7 maverickis
.CRC_init                 (CRC_init               ),
132
.Frame_data               (Frame_data             ),
133
.Data_en                  (Data_en                ),
134
.CRC_rd                   (CRC_rd                 ),
135
.CRC_end                  (CRC_end                ),
136
.CRC_out                  (CRC_out                ),
137 5 maverickis
 //Ramdon_gen interfac    (//Ramdon_gen interfac  ),           
138 7 maverickis
.Random_init              (Random_init            ),
139
.RetryCnt                 (RetryCnt               ),
140
.Random_time_meet         (Random_time_meet       ),
141 5 maverickis
 //flow control           (//flow control         ),           
142 7 maverickis
.pause_apply              (pause_apply            ),
143
.pause_quanta_sub         (pause_quanta_sub       ),
144
.xoff_gen                 (xoff_gen               ),
145
.xoff_gen_complete        (xoff_gen_complete      ),
146
.xon_gen                  (xon_gen                ),
147
.xon_gen_complete         (xon_gen_complete       ),
148 5 maverickis
 //MAC_tx_FF              (//MAC_tx_FF            ),           
149 7 maverickis
.Fifo_data                (Fifo_data              ),
150
.Fifo_rd                  (Fifo_rd                ),
151
.Fifo_eop                 (Fifo_eop               ),
152
.Fifo_da                  (Fifo_da                ),
153
.Fifo_rd_finish           (Fifo_rd_finish         ),
154
.Fifo_rd_retry            (Fifo_rd_retry          ),
155
.Fifo_ra                  (Fifo_ra                ),
156
.Fifo_data_err_empty      (Fifo_data_err_empty    ),
157
.Fifo_data_err_full       (Fifo_data_err_full     ),
158 5 maverickis
 //RMII                   (//RMII                 ),           
159 7 maverickis
.TxD                      (TxD                    ),
160
.TxEn                     (TxEn                   ),
161
.CRS                      (CRS                    ),
162 5 maverickis
 //MAC_tx_addr_add        (//MAC_tx_addr_add      ),           
163 7 maverickis
.MAC_tx_addr_rd           (MAC_tx_addr_rd         ),
164
.MAC_tx_addr_data         (MAC_tx_addr_data       ),
165 5 maverickis
.MAC_tx_addr_init         (MAC_tx_addr_init       ),
166
 //RMON                   (//RMON                 ),           
167 7 maverickis
.Tx_pkt_type_rmon         (Tx_pkt_type_rmon       ),
168
.Tx_pkt_length_rmon       (Tx_pkt_length_rmon     ),
169
.Tx_apply_rmon            (Tx_apply_rmon          ),
170 5 maverickis
.Tx_pkt_err_type_rmon     (Tx_pkt_err_type_rmon   ),
171
 //CPU                    (//CPU                  ),           
172 7 maverickis
.pause_frame_send_en      (pause_frame_send_en    ),
173
.pause_quanta_set         (pause_quanta_set       ),
174
.MAC_tx_add_en            (MAC_tx_add_en          ),
175
.FullDuplex               (FullDuplex             ),
176
.MaxRetry                 (MaxRetry               ),
177
.IFGset                   (IFGset                 )
178 5 maverickis
);
179
 
180
CRC_gen U_CRC_gen(
181 7 maverickis
.Reset                    (Reset                  ),
182
.Clk                      (Clk                    ),
183
.Init                     (CRC_init               ),
184
.Frame_data               (Frame_data             ),
185
.Data_en                  (Data_en                ),
186
.CRC_rd                   (CRC_rd                 ),
187
.CRC_out                  (CRC_out                ),
188
.CRC_end                  (CRC_end                )
189 5 maverickis
);
190
 
191
flow_ctrl U_flow_ctrl(
192 7 maverickis
.Reset                    (Reset                  ),
193
.Clk                      (Clk                    ),
194
 //host processor         (//host processor       ),
195
.tx_pause_en              (tx_pause_en            ),
196
.xoff_cpu                 (xoff_cpu               ),
197
.xon_cpu                  (xon_cpu                ),
198
 //MAC_rx_flow            (//MAC_rx_flow          ),
199
.pause_quanta             (pause_quanta           ),
200
.pause_quanta_val         (pause_quanta_val       ),
201
 //MAC_tx_ctrl            (//MAC_tx_ctrl          ),
202
.pause_apply              (pause_apply            ),
203
.pause_quanta_sub         (pause_quanta_sub       ),
204
.xoff_gen                 (xoff_gen               ),
205
.xoff_gen_complete        (xoff_gen_complete      ),
206
.xon_gen                  (xon_gen                ),
207
.xon_gen_complete         (xon_gen_complete       )
208 5 maverickis
);
209
 
210 7 maverickis
`ifdef MAC_SOURCE_REPLACE_EN
211 5 maverickis
MAC_tx_addr_add U_MAC_tx_addr_add(
212 7 maverickis
.Reset                    (Reset                  ),
213
.Clk                      (Clk                    ),
214
.MAC_tx_addr_rd           (MAC_tx_addr_rd         ),
215 5 maverickis
.MAC_tx_addr_init         (MAC_tx_addr_init       ),
216 7 maverickis
.MAC_tx_addr_data         (MAC_tx_addr_data       ),
217 5 maverickis
 //CPU                    (//CPU                  ),
218 7 maverickis
.MAC_add_prom_data        (MAC_add_prom_data      ),
219
.MAC_add_prom_add         (MAC_add_prom_add       ),
220
.MAC_add_prom_wr          (MAC_add_prom_wr        )
221 5 maverickis
);
222 7 maverickis
`else
223
assign MAC_tx_addr_data=0;
224
`endif
225 5 maverickis
MAC_tx_FF U_MAC_tx_FF(
226 7 maverickis
.Reset                    (Reset                  ),
227
.Clk_MAC                  (Clk                    ),
228
.Clk_SYS                  (Clk_user               ),
229 5 maverickis
 //MAC_rx_ctrl interf     (//MAC_rx_ctrl interf   ),
230 7 maverickis
.Fifo_data                (Fifo_data              ),
231
.Fifo_rd                  (Fifo_rd                ),
232
.Fifo_rd_finish           (Fifo_rd_finish         ),
233
.Fifo_rd_retry            (Fifo_rd_retry          ),
234
.Fifo_eop                 (Fifo_eop               ),
235
.Fifo_da                  (Fifo_da                ),
236
.Fifo_ra                  (Fifo_ra                ),
237
.Fifo_data_err_empty      (Fifo_data_err_empty    ),
238
.Fifo_data_err_full       (Fifo_data_err_full     ),
239 5 maverickis
 //user interface         (//user interface       ),
240 7 maverickis
.Tx_mac_wa                (Tx_mac_wa              ),
241
.Tx_mac_wr                (Tx_mac_wr              ),
242
.Tx_mac_data              (Tx_mac_data            ),
243
.Tx_mac_BE                (Tx_mac_BE              ),
244
.Tx_mac_sop               (Tx_mac_sop             ),
245
.Tx_mac_eop               (Tx_mac_eop             ),
246 5 maverickis
 //host interface         (//host interface       ),
247 7 maverickis
.FullDuplex               (FullDuplex             ),
248
.Tx_Hwmark                (Tx_Hwmark              ),
249
.Tx_Lwmark                (Tx_Lwmark              )
250 5 maverickis
);
251
 
252
Ramdon_gen U_Ramdon_gen(
253 7 maverickis
.Reset                    (Reset                  ),
254
.Clk                      (Clk                    ),
255
.Init                     (Random_init            ),
256
.RetryCnt                 (RetryCnt               ),
257 5 maverickis
.Random_time_meet         (Random_time_meet       )
258
);
259
 
260
endmodule

powered by: WebSVN 2.1.0

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