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/] [Broadcast_filter.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
////  Broadcast_filter.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:16  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:45  Administrator
47
// no message
48
//    
49 5 maverickis
 
50
module Broadcast_filter (
51 7 maverickis
Reset                   ,
52
Clk                     ,
53 5 maverickis
//MAC_rx_ctrl           ,
54 7 maverickis
broadcast_ptr           ,
55
broadcast_drop          ,
56
//FromCPU               ,
57
broadcast_filter_en     ,
58
broadcast_bucket_depth    ,
59
broadcast_bucket_interval
60 5 maverickis
);
61 7 maverickis
input           Reset                       ;
62
input           Clk                         ;
63
                //MAC_rx_ctrl               
64
input           broadcast_ptr               ;
65
output          broadcast_drop              ;
66
                //FromCPU                   ;
67
input           broadcast_filter_en         ;
68
input   [15:0]  broadcast_bucket_depth      ;
69
input   [15:0]  broadcast_bucket_interval   ;
70 5 maverickis
 
71
//******************************************************************************  
72
//internal signals                                                                
73
//******************************************************************************  
74 7 maverickis
reg     [15:0]  time_counter            ;
75
reg     [15:0]  broadcast_counter        ;
76
reg             broadcast_drop          ;
77 5 maverickis
//******************************************************************************  
78
//                                                               
79
//****************************************************************************** 
80
always @ (posedge Clk or posedge Reset)
81 7 maverickis
    if (Reset)
82
        time_counter    <=0;
83
    else if (time_counter==broadcast_bucket_interval)
84
        time_counter    <=0;
85
    else
86
        time_counter    <=time_counter+1;
87 5 maverickis
 
88
always @ (posedge Clk or posedge Reset)
89 7 maverickis
    if (Reset)
90
        broadcast_counter   <=0;
91
    else if (time_counter==broadcast_bucket_interval)
92
        broadcast_counter   <=0;
93
    else if (broadcast_ptr&&broadcast_counter!=broadcast_bucket_depth)
94
        broadcast_counter   <=broadcast_counter+1;
95
 
96 5 maverickis
always @ (posedge Clk or posedge Reset)
97 7 maverickis
    if (Reset)
98
        broadcast_drop      <=0;
99
    else if(broadcast_filter_en&&broadcast_counter==broadcast_bucket_depth)
100
        broadcast_drop      <=1;
101
    else
102
        broadcast_drop      <=0;
103 5 maverickis
 
104
endmodule

powered by: WebSVN 2.1.0

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