OpenCores
URL https://opencores.org/ocsvn/kiss-board/kiss-board/trunk

Subversion Repositories kiss-board

[/] [kiss-board/] [tags/] [initial/] [kiss-board_soc/] [src/] [extend/] [wb_dma/] [wb_dma_pri_enc_sub.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fukuchi
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE DMA Priority Encoder Sub-Module                   ////
4
////                                                             ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/cores/wb_dma/    ////
11
////                                                             ////
12
/////////////////////////////////////////////////////////////////////
13
////                                                             ////
14
//// Copyright (C) 2000-2002 Rudolf Usselmann                    ////
15
////                         www.asics.ws                        ////
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: wb_dma_pri_enc_sub.v,v 1.1.1.1 2006-05-29 13:45:18 fukuchi Exp $
42
//
43
//  $Date: 2006-05-29 13:45:18 $
44
//  $Revision: 1.1.1.1 $
45
//  $Author: fukuchi $
46
//  $Locker:  $
47
//  $State: Exp $
48
//
49
// Change History:
50
//               $Log: not supported by cvs2svn $
51
//               Revision 1.4  2002/02/01 01:54:45  rudi
52
//
53
//               - Minor cleanup
54
//
55
//               Revision 1.3  2001/10/19 04:35:04  rudi
56
//
57
//               - Made the core parameterized
58
//
59
//               Revision 1.2  2001/08/15 05:40:30  rudi
60
//
61
//               - Changed IO names to be more clear.
62
//               - Uniquifyed define names to be core specific.
63
//               - Added Section 3.10, describing DMA restart.
64
//
65
//               Revision 1.1  2001/08/07 08:00:43  rudi
66
//
67
//
68
//               Split up priority encoder modules to separate files
69
//
70
//
71
//
72
//
73
//
74
//
75
 
76
`include "wb_dma_defines.v"
77
 
78
// Priority Encoder
79
//
80
// Determines the channel with the highest priority, also takes
81
// the valid bit in consideration
82
 
83
module wb_dma_pri_enc_sub(valid, pri_in, pri_out);
84
 
85
parameter [3:0]  ch_conf = 4'b0000;
86
parameter [1:0]  pri_sel = 2'd0;
87
 
88
input           valid;
89
input   [2:0]    pri_in;
90
output  [7:0]    pri_out;
91
 
92
wire    [7:0]    pri_out;
93
reg     [7:0]    pri_out_d;
94
reg     [7:0]    pri_out_d0;
95
reg     [7:0]    pri_out_d1;
96
reg     [7:0]    pri_out_d2;
97
 
98
assign pri_out = ch_conf[0] ? pri_out_d : 8'h0;
99
 
100
// Select Configured Priority
101
always @(pri_sel or pri_out_d0 or pri_out_d1 or  pri_out_d2)
102
        case(pri_sel)           // synopsys parallel_case full_case
103
           2'd0: pri_out_d = pri_out_d0;
104
           2'd1: pri_out_d = pri_out_d1;
105
           2'd2: pri_out_d = pri_out_d2;
106
        endcase
107
 
108
// 8 Priority Levels
109
always @(valid or pri_in)
110
        if(!valid)              pri_out_d2 = 8'b0000_0001;
111
        else
112
        if(pri_in==3'h0)        pri_out_d2 = 8'b0000_0001;
113
        else
114
        if(pri_in==3'h1)        pri_out_d2 = 8'b0000_0010;
115
        else
116
        if(pri_in==3'h2)        pri_out_d2 = 8'b0000_0100;
117
        else
118
        if(pri_in==3'h3)        pri_out_d2 = 8'b0000_1000;
119
        else
120
        if(pri_in==3'h4)        pri_out_d2 = 8'b0001_0000;
121
        else
122
        if(pri_in==3'h5)        pri_out_d2 = 8'b0010_0000;
123
        else
124
        if(pri_in==3'h6)        pri_out_d2 = 8'b0100_0000;
125
        else                    pri_out_d2 = 8'b1000_0000;
126
 
127
// 4 Priority Levels
128
always @(valid or pri_in)
129
        if(!valid)              pri_out_d1 = 8'b0000_0001;
130
        else
131
        if(pri_in==3'h0)        pri_out_d1 = 8'b0000_0001;
132
        else
133
        if(pri_in==3'h1)        pri_out_d1 = 8'b0000_0010;
134
        else
135
        if(pri_in==3'h2)        pri_out_d1 = 8'b0000_0100;
136
        else                    pri_out_d1 = 8'b0000_1000;
137
 
138
// 2 Priority Levels
139
always @(valid or pri_in)
140
        if(!valid)              pri_out_d0 = 8'b0000_0001;
141
        else
142
        if(pri_in==3'h0)        pri_out_d0 = 8'b0000_0001;
143
        else                    pri_out_d0 = 8'b0000_0010;
144
 
145
endmodule
146
 

powered by: WebSVN 2.1.0

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