1 |
4 |
rudi |
/////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// WISHBONE AC 97 Controller Definitions ////
|
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_defines.v,v 1.1 2001-08-03 06:54:49 rudi Exp $
|
41 |
|
|
//
|
42 |
|
|
// $Date: 2001-08-03 06:54:49 $
|
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:14 rudi
|
51 |
|
|
// Initial Checkin
|
52 |
|
|
//
|
53 |
|
|
//
|
54 |
|
|
//
|
55 |
|
|
//
|
56 |
|
|
|
57 |
|
|
`timescale 1ns / 10ps
|
58 |
|
|
|
59 |
|
|
/////////////////////////////////////////////////////////////////////
|
60 |
|
|
// This AC97 Controller supports up to 6 Output and 3 Input Channels.
|
61 |
|
|
// Comment out the define statement for which channels you do not wish
|
62 |
|
|
// to support in your implementation. The main Left and Right channels
|
63 |
|
|
// are always supported.
|
64 |
|
|
|
65 |
|
|
// Surround Left + Right
|
66 |
|
|
`define SURROUND 1
|
67 |
|
|
|
68 |
|
|
// Center Channel
|
69 |
|
|
`define CENTER 1
|
70 |
|
|
|
71 |
|
|
// LFE Channel
|
72 |
|
|
`define LFE 1
|
73 |
|
|
|
74 |
|
|
// Stereo Input
|
75 |
|
|
`define SIN 1
|
76 |
|
|
|
77 |
|
|
// Mono Microphone Input
|
78 |
|
|
`define MICIN 1
|
79 |
|
|
|
80 |
|
|
/////////////////////////////////////////////////////////////////////
|
81 |
|
|
//
|
82 |
|
|
// This define selects how the WISHBONE interface determines if
|
83 |
|
|
// the internal register file is selected.
|
84 |
|
|
// This should be a simple address decoder. "wb_addr_i" is the
|
85 |
|
|
// WISHBONE address bus (32 bits wide).
|
86 |
|
|
`define REG_SEL (wb_addr_i[31:29] == 3'h0)
|
87 |
|
|
|
88 |
|
|
/////////////////////////////////////////////////////////////////////
|
89 |
|
|
//
|
90 |
|
|
// This is a prescaler that generates a pulse every 250 nS.
|
91 |
|
|
// The value here should one less than the actually calculated
|
92 |
|
|
// value.
|
93 |
|
|
// For a 200 MHz wishbone clock, this value is 49 (50-1).
|
94 |
|
|
`define AC97_250_PS 6'd49
|
95 |
|
|
|
96 |
|
|
/////////////////////////////////////////////////////////////////////
|
97 |
|
|
//
|
98 |
|
|
// AC97 Cold reset Must be asserted for at least 1uS. The AC97
|
99 |
|
|
// controller will stretch the reset pulse to at least 1uS.
|
100 |
|
|
// The reset timer is driven by the AC97_250_PS prescaler.
|
101 |
|
|
// This value should probably be never changed. Adjust the
|
102 |
|
|
// AC97_250_PS instead.
|
103 |
|
|
`define AC97_RST_DEL 3'd4
|
104 |
|
|
|
105 |
|
|
/////////////////////////////////////////////////////////////////////
|
106 |
|
|
//
|
107 |
|
|
// This value indicates for how long the resume signaling (asserting sync)
|
108 |
|
|
// should be done. This counter is driven by the AC97_250_PS prescaler.
|
109 |
|
|
// This value times 250nS is the duration of the resume signaling.
|
110 |
|
|
// The actual value must be incremented by one, as we do not know
|
111 |
|
|
// the current state of the prescaler, and must somehow insure we
|
112 |
|
|
// meet the minimum 1uS length. This value should probably be never
|
113 |
|
|
// changed. Modify the AC97_250_PS instead.
|
114 |
|
|
`define AC97_RES_SIG 3'd5
|
115 |
|
|
|
116 |
|
|
/////////////////////////////////////////////////////////////////////
|
117 |
|
|
//
|
118 |
|
|
// If the bit clock is absent for at least two "predicted" bit
|
119 |
|
|
// clock periods (163 nS) we should signal "suspended".
|
120 |
|
|
// This value defines how many WISHBONE cycles must pass without
|
121 |
|
|
// any change on the bit clock input before we signal "suspended".
|
122 |
|
|
// For a 200 MHz WISHBONE clock this would be about (163/5) 33 cycles.
|
123 |
|
|
`define AC97_SUSP_DET 6'd33
|
124 |
|
|
|