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

Subversion Repositories ac97

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

powered by: WebSVN 2.1.0

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