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

Subversion Repositories sgmii

[/] [sgmii/] [trunk/] [build/] [OpenCore_MAC/] [MAC_rx.v.bak] - Blame information for rev 26

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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