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

Subversion Repositories ac97

[/] [ac97/] [trunk/] [rtl/] [verilog/] [ac97_rst.v] - Blame information for rev 4

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

Line No. Rev Author Line
1 4 rudi
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE AC 97 Controller Reset Module                     ////
4
////                                                             ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/cores/ac97_ctrl/ ////
11
////                                                             ////
12
/////////////////////////////////////////////////////////////////////
13
////                                                             ////
14
//// Copyright (C) 2001 Rudolf Usselmann                         ////
15
////                    rudi@asics.ws                            ////
16
////                                                             ////
17
//// This source file may be used and distributed without        ////
18
//// restriction provided that this copyright statement is not   ////
19
//// removed from the file and that any derivative work contains ////
20
//// the original copyright notice and the associated disclaimer.////
21
////                                                             ////
22
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
23
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
24
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
25
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
26
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
27
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
28
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
29
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
30
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
31
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
32
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
33
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
34
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
35
////                                                             ////
36
/////////////////////////////////////////////////////////////////////
37
 
38
//  CVS Log
39
//
40
//  $Id: ac97_rst.v,v 1.1 2001-08-03 06:54:50 rudi Exp $
41
//
42
//  $Date: 2001-08-03 06:54:50 $
43
//  $Revision: 1.1 $
44
//  $Author: rudi $
45
//  $Locker:  $
46
//  $State: Exp $
47
//
48
// Change History:
49
//               $Log: not supported by cvs2svn $
50
//               Revision 1.1.1.1  2001/05/19 02:29:19  rudi
51
//               Initial Checkin
52
//
53
//
54
//
55
//
56
 
57
`include "ac97_defines.v"
58
 
59
module ac97_rst(clk, rst, rst_force, ps_ce, ac97_rst_);
60
input           clk, rst;
61
input           rst_force;
62
output          ps_ce;
63
output          ac97_rst_;
64
 
65
reg             ac97_rst_;
66
reg     [2:0]    cnt;
67
wire            ce;
68
wire            to;
69
reg     [5:0]    ps_cnt;
70
wire            ps_ce;
71
 
72
always @(posedge clk or negedge rst)
73
        if(!rst)        ac97_rst_ <= #1 0;
74
        else
75
        if(rst_force)   ac97_rst_ <= #1 0;
76
        else
77
        if(to)          ac97_rst_ <= #1 1;
78
 
79
assign to = (cnt == `AC97_RST_DEL);
80
 
81
always @(posedge clk or negedge rst)
82
        if(!rst)        cnt <= #1 0;
83
        else
84
        if(rst_force)   cnt <= #1 0;
85
        else
86
        if(ce)          cnt <= #1 cnt + 1;
87
 
88
assign ce = ps_ce & (cnt != `AC97_RST_DEL);
89
 
90
always @(posedge clk or negedge rst)
91
        if(!rst)                ps_cnt <= #1 0;
92
        else
93
        if(ps_ce | rst_force)   ps_cnt <= #1 0;
94
        else                    ps_cnt <= #1 ps_cnt + 1;
95
 
96
assign ps_ce = (ps_cnt == `AC97_250_PS);
97
 
98
endmodule

powered by: WebSVN 2.1.0

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