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

Subversion Repositories ethernet_tri_mode

[/] [ethernet_tri_mode/] [trunk/] [rtl/] [verilog/] [MAC_rx.v] - Blame information for rev 35

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

Line No. Rev Author Line
1 5 maverickis
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3 7 maverickis
////  MAC_rx.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 23 maverickis
// Revision 1.3  2006/01/19 14:07:52  maverickist
43
// verification is complete.
44
//
45 7 maverickis
// Revision 1.2  2005/12/16 06:44:13  Administrator
46
// replaced tab with space.
47
// passed 9.6k length frame test.
48
//
49 6 maverickis
// Revision 1.1.1.1  2005/12/13 01:51:44  Administrator
50
// no message
51
// 
52 5 maverickis
module MAC_rx (
53 7 maverickis
input           Reset   ,
54
input           Clk_user,
55
input           Clk     ,
56
                //RMII interface
57
input           MCrs_dv ,
58
input   [7:0]   MRxD    ,
59
input           MRxErr  ,
60
                //flow_control signals  
61
output  [15:0]  pause_quanta        ,
62
output          pause_quanta_val    ,
63
                //user interface 
64
output          Rx_mac_ra   ,
65
input           Rx_mac_rd   ,
66
output  [31:0]  Rx_mac_data ,
67
output  [1:0]   Rx_mac_BE   ,
68
output          Rx_mac_pa   ,
69
output          Rx_mac_sop  ,
70
output          Rx_mac_eop  ,
71
                //CPU
72
input           MAC_rx_add_chk_en   ,
73
input   [7:0]   MAC_add_prom_data   ,
74
input   [2:0]   MAC_add_prom_add    ,
75
input           MAC_add_prom_wr     ,
76
input           broadcast_filter_en     ,
77
input   [15:0]  broadcast_bucket_depth              ,
78
input   [15:0]  broadcast_bucket_interval           ,
79
input           RX_APPEND_CRC,
80
input   [4:0]   Rx_Hwmark           ,
81
input   [4:0]   Rx_Lwmark           ,
82
input           CRC_chk_en  ,
83
input   [5:0]   RX_IFG_SET    ,
84
input   [15:0]  RX_MAX_LENGTH   ,// 1518
85
input   [6:0]   RX_MIN_LENGTH   ,// 64
86
                //RMON interface
87
output  [15:0]  Rx_pkt_length_rmon      ,
88
output          Rx_apply_rmon           ,
89
output  [2:0]   Rx_pkt_err_type_rmon    ,
90
output  [2:0]   Rx_pkt_type_rmon
91 5 maverickis
);
92
//******************************************************************************
93
//internal signals                                                              
94
//******************************************************************************
95 7 maverickis
                //CRC_chk interface
96
wire            CRC_en  ;
97
wire            CRC_init;
98
wire            CRC_err ;
99
                //MAC_rx_add_chk interface
100
wire            MAC_add_en          ;
101
wire            MAC_rx_add_chk_err  ;
102
                //broadcast_filter
103
wire            broadcast_ptr           ;
104
wire            broadcast_drop          ;
105
                //flow_control signals  
106 23 maverickis
//wire    [15:0]  pause_quanta        ;   
107
//wire            pause_quanta_val    ;
108 7 maverickis
                //MAC_rx_ctrl interface 
109
wire    [7:0]   Fifo_data       ;
110
wire            Fifo_data_en    ;
111
wire            Fifo_full       ;
112
wire            Fifo_data_err   ;
113
wire            Fifo_data_end   ;
114 5 maverickis
//******************************************************************************
115
//instantiation                                                            
116
//******************************************************************************
117
 
118
 
119
MAC_rx_ctrl U_MAC_rx_ctrl(
120 7 maverickis
.Reset                       (Reset                     ),
121
.Clk                         (Clk                       ),
122 5 maverickis
  //RMII interface           ( //RMII interface         ),                                                    
123 7 maverickis
.MCrs_dv                     (MCrs_dv                   ),
124
.MRxD                        (MRxD                      ),
125
.MRxErr                      (MRxErr                    ),
126 5 maverickis
 //CRC_chk interface         (//CRC_chk interface       ),                                                   
127
.CRC_en                      (CRC_en                    ),
128
.CRC_init                    (CRC_init                  ),
129
.CRC_err                     (CRC_err                   ),
130
 //MAC_rx_add_chk interface  (//MAC_rx_add_chk interface),                                                   
131 7 maverickis
.MAC_add_en                  (MAC_add_en                ),
132
.MAC_rx_add_chk_err          (MAC_rx_add_chk_err        ),
133 5 maverickis
 //broadcast_filter          (//broadcast_filter        ),                           
134 7 maverickis
.broadcast_ptr               (broadcast_ptr             ),
135
.broadcast_drop              (broadcast_drop            ),
136 5 maverickis
 //flow_control signals      (//flow_control signals    ),                           
137 7 maverickis
.pause_quanta                (pause_quanta              ),
138
.pause_quanta_val            (pause_quanta_val          ),
139 5 maverickis
 //MAC_rx_FF interface       (//MAC_rx_FF interface     ),                                                   
140 7 maverickis
.Fifo_data                   (Fifo_data                 ),
141
.Fifo_data_en                (Fifo_data_en              ),
142
.Fifo_data_err               (Fifo_data_err             ),
143
.Fifo_data_end               (Fifo_data_end             ),
144
.Fifo_full                   (Fifo_full                 ),
145 5 maverickis
 //RMON interface            (//RMON interface          ),                               
146 7 maverickis
.Rx_pkt_type_rmon            (Rx_pkt_type_rmon          ),
147
.Rx_pkt_length_rmon          (Rx_pkt_length_rmon        ),
148
.Rx_apply_rmon               (Rx_apply_rmon             ),
149
.Rx_pkt_err_type_rmon        (Rx_pkt_err_type_rmon      ),
150
 //CPU                       (//CPU                     ),   
151
.RX_IFG_SET                  (RX_IFG_SET                ),
152 5 maverickis
.RX_MAX_LENGTH               (RX_MAX_LENGTH             ),
153
.RX_MIN_LENGTH               (RX_MIN_LENGTH             )
154
);
155
 
156
MAC_rx_FF  U_MAC_rx_FF (
157 7 maverickis
.Reset                       (Reset                     ),
158
.Clk_MAC                     (Clk                       ),
159
.Clk_SYS                     (Clk_user                  ),
160 5 maverickis
 //MAC_rx_ctrl interface     (//MAC_rx_ctrl interface   ),
161 7 maverickis
.Fifo_data                   (Fifo_data                 ),
162
.Fifo_data_en                (Fifo_data_en              ),
163
.Fifo_full                   (Fifo_full                 ),
164
.Fifo_data_err               (Fifo_data_err             ),
165
.Fifo_data_end               (Fifo_data_end             ),
166 5 maverickis
 //CPU                       (//CPU                     ),
167 7 maverickis
.Rx_Hwmark                   (Rx_Hwmark                 ),
168
.Rx_Lwmark                   (Rx_Lwmark                 ),
169 5 maverickis
.RX_APPEND_CRC               (RX_APPEND_CRC             ),
170
 //user interface            (//user interface          ),
171 7 maverickis
.Rx_mac_ra                   (Rx_mac_ra                 ),
172
.Rx_mac_rd                   (Rx_mac_rd                 ),
173
.Rx_mac_data                 (Rx_mac_data               ),
174
.Rx_mac_BE                   (Rx_mac_BE                 ),
175
.Rx_mac_sop                  (Rx_mac_sop                ),
176 5 maverickis
.Rx_mac_pa                   (Rx_mac_pa                 ),
177 7 maverickis
.Rx_mac_eop                  (Rx_mac_eop                )
178 5 maverickis
);
179
 
180 7 maverickis
`ifdef MAC_BROADCAST_FILTER_EN
181 5 maverickis
Broadcast_filter U_Broadcast_filter(
182 7 maverickis
.Reset                      (Reset                      ),
183
.Clk                        (Clk                        ),
184 5 maverickis
 //MAC_rx_ctrl              (//MAC_rx_ctrl              ),
185 7 maverickis
.broadcast_ptr              (broadcast_ptr              ),
186
.broadcast_drop             (broadcast_drop             ),
187
 //FromCPU                  (//FromCPU                  ),
188
.broadcast_filter_en        (broadcast_filter_en        ),
189
.broadcast_bucket_depth     (broadcast_bucket_depth     ),
190
.broadcast_bucket_interval  (broadcast_bucket_interval  )
191 5 maverickis
);
192 7 maverickis
`else
193
assign broadcast_drop=0;
194
`endif
195 5 maverickis
 
196
CRC_chk U_CRC_chk(
197 7 maverickis
.Reset                      (Reset                      ),
198
.Clk                        (Clk                        ),
199
.CRC_data                   (Fifo_data                  ),
200
.CRC_init                   (CRC_init                   ),
201
.CRC_en                     (CRC_en                     ),
202 5 maverickis
 //From CPU                 (//From CPU                 ),
203 7 maverickis
.CRC_chk_en                 (CRC_chk_en                 ),
204
.CRC_err                    (CRC_err                    )
205 5 maverickis
);
206
 
207 7 maverickis
`ifdef MAC_TARGET_CHECK_EN
208 5 maverickis
MAC_rx_add_chk U_MAC_rx_add_chk(
209 7 maverickis
.Reset                      (Reset                      ),
210
.Clk                        (Clk                        ),
211
.Init                       (CRC_init                   ),
212
.data                       (Fifo_data                  ),
213
.MAC_add_en                 (MAC_add_en                 ),
214
.MAC_rx_add_chk_err         (MAC_rx_add_chk_err         ),
215 5 maverickis
 //From CPU                 (//From CPU                 ),
216 7 maverickis
.MAC_rx_add_chk_en          (MAC_rx_add_chk_en          ),
217
.MAC_add_prom_data          (MAC_add_prom_data          ),
218
.MAC_add_prom_add           (MAC_add_prom_add           ),
219
.MAC_add_prom_wr            (MAC_add_prom_wr            )
220 5 maverickis
);
221 7 maverickis
`else
222
assign MAC_rx_add_chk_err=0;
223
`endif
224 5 maverickis
 
225 7 maverickis
 
226
 
227 5 maverickis
endmodule

powered by: WebSVN 2.1.0

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