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

Subversion Repositories ethmac10g

[/] [ethmac10g/] [trunk/] [rtl/] [verilog/] [rx_engine/] [counter.v] - Blame information for rev 41

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

Line No. Rev Author Line
1 41 fisher5090
`include "timescale.v"
2
//////////////////////////////////////////////////////////////////////
3
////                                                                                                                                                                    ////
4
//// MODULE NAME: counter                                                                                               ////
5
////                                                                                                                                                                    ////
6
//// DESCRIPTION: 8bit counter                                    ////
7
////                                                              ////
8
////                                                                                                                                                                    ////
9
//// This file is part of the 10 Gigabit Ethernet IP core project ////
10
////  http://www.opencores.org/projects/ethmac10g/                                              ////
11
////                                                                                                                                                                    ////
12
//// AUTHOR(S):                                                                                                                                 ////
13
//// Zheng Cao                                                               ////
14
////                                                                                                    ////
15
//////////////////////////////////////////////////////////////////////
16
////                                                                                                                                                                    ////
17
//// Copyright (c) 2005 AUTHORS.  All rights reserved.                     ////
18
////                                                                                                                                                                    ////
19
//// This source file may be used and distributed without         ////
20
//// restriction provided that this copyright statement is not    ////
21
//// removed from the file and that any derivative work contains  ////
22
//// the original copyright notice and the associated disclaimer. ////
23
////                                                              ////
24
//// This source file is free software; you can redistribute it   ////
25
//// and/or modify it under the terms of the GNU Lesser General   ////
26
//// Public License as published by the Free Software Foundation; ////
27
//// either version 2.1 of the License, or (at your option) any   ////
28
//// later version.                                               ////
29
////                                                              ////
30
//// This source is distributed in the hope that it will be       ////
31
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
32
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
33
//// PURPOSE.  See the GNU Lesser General Public License for more ////
34
//// details.                                                     ////
35
////                                                              ////
36
//// You should have received a copy of the GNU Lesser General    ////
37
//// Public License along with this source; if not, download it   ////
38
//// from http://www.opencores.org/lgpl.shtml                                                   ////
39
////                                                                                                                                                                    ////
40
//////////////////////////////////////////////////////////////////////
41 39 fisher5090
//
42 41 fisher5090
// CVS REVISION HISTORY:
43 39 fisher5090
//
44 41 fisher5090
// $Log: not supported by cvs2svn $
45
// Revision 1.1  2005/12/25 16:43:10  Zheng Cao
46 39 fisher5090
// 
47
// 
48 41 fisher5090
//
49
//////////////////////////////////////////////////////////////////////
50 39 fisher5090
module counter(clk, reset, load, en, value);
51
    input clk;
52
    input reset;
53
    input load;
54
    input en;
55
 
56
         parameter WIDTH = 8;
57
    output[WIDTH-1:0] value;
58
 
59
         reg [WIDTH-1:0] value;
60
 
61
    always @(posedge clk or posedge reset)
62
       if (reset)
63
          value <= 0;
64
       else begin
65
                    if (load)
66
             value <= 0;
67
          else if (en)
68
             value <= value + 1;
69
                 end
70
 
71
endmodule

powered by: WebSVN 2.1.0

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