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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [verilog/] [minsoc/] [wb_conmax/] [trunk/] [rtl/] [verilog/] [wb_conmax_pri_dec.v] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 parrado
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE Connection Matrix Priority Decoder                ////
4
////                                                             ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/cores/wb_conmax/ ////
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_conmax_pri_dec.v,v 1.2 2002-10-03 05:40:07 rudi Exp $
42
//
43
//  $Date: 2002-10-03 05:40:07 $
44
//  $Revision: 1.2 $
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/10/19 11:01:42  rudi
52
//               WISHBONE CONMAX IP Core
53
//
54
//
55
//
56
//
57
//
58
 
59
`include "wb_conmax_defines.v"
60
 
61
module wb_conmax_pri_dec(valid, pri_in, pri_out);
62
 
63
////////////////////////////////////////////////////////////////////
64
//
65
// Module Parameters
66
//
67
 
68
parameter [1:0]  pri_sel = 2'd0;
69
 
70
////////////////////////////////////////////////////////////////////
71
//
72
// Module IOs
73
//
74
 
75
input           valid;
76
input   [1:0]    pri_in;
77
output  [3:0]    pri_out;
78
 
79
////////////////////////////////////////////////////////////////////
80
//
81
// Local Wires
82
//
83
 
84
wire    [3:0]    pri_out;
85
reg     [3:0]    pri_out_d0;
86
reg     [3:0]    pri_out_d1;
87
 
88
////////////////////////////////////////////////////////////////////
89
//
90
// Priority Decoder
91
//
92
 
93
// 4 Priority Levels
94
always @(valid or pri_in)
95
        if(!valid)              pri_out_d1 = 4'b0001;
96
        else
97
        if(pri_in==2'h0)        pri_out_d1 = 4'b0001;
98
        else
99
        if(pri_in==2'h1)        pri_out_d1 = 4'b0010;
100
        else
101
        if(pri_in==2'h2)        pri_out_d1 = 4'b0100;
102
        else                    pri_out_d1 = 4'b1000;
103
 
104
// 2 Priority Levels
105
always @(valid or pri_in)
106
        if(!valid)              pri_out_d0 = 4'b0001;
107
        else
108
        if(pri_in==2'h0)        pri_out_d0 = 4'b0001;
109
        else                    pri_out_d0 = 4'b0010;
110
 
111
// Select Configured Priority
112
 
113
assign pri_out = (pri_sel==2'd0) ? 4'h0 : ( (pri_sel==1'd1) ? pri_out_d0 : pri_out_d1 );
114
 
115
endmodule
116
 

powered by: WebSVN 2.1.0

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