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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [verilog/] [minsoc/] [wb_conmax/] [tags/] [start/] [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) 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: wb_conmax_pri_dec.v,v 1.1.1.1 2001-10-19 11:01:42 rudi Exp $
41
//
42
//  $Date: 2001-10-19 11:01:42 $
43
//  $Revision: 1.1.1.1 $
44
//  $Author: rudi $
45
//  $Locker:  $
46
//  $State: Exp $
47
//
48
// Change History:
49
//               $Log: not supported by cvs2svn $
50
//
51
//
52
//
53
//
54
 
55
`include "wb_conmax_defines.v"
56
 
57
module wb_conmax_pri_dec(valid, pri_in, pri_out);
58
 
59
////////////////////////////////////////////////////////////////////
60
//
61
// Module Parameters
62
//
63
 
64
parameter [1:0]  pri_sel = 2'd0;
65
 
66
////////////////////////////////////////////////////////////////////
67
//
68
// Module IOs
69
//
70
 
71
input           valid;
72
input   [1:0]    pri_in;
73
output  [3:0]    pri_out;
74
 
75
////////////////////////////////////////////////////////////////////
76
//
77
// Local Wires
78
//
79
 
80
wire    [3:0]    pri_out;
81
reg     [3:0]    pri_out_d0;
82
reg     [3:0]    pri_out_d1;
83
 
84
////////////////////////////////////////////////////////////////////
85
//
86
// Priority Decoder
87
//
88
 
89
// 4 Priority Levels
90
always @(valid or pri_in)
91
        if(!valid)              pri_out_d1 = 4'b0001;
92
        else
93
        if(pri_in==2'h0)        pri_out_d1 = 4'b0001;
94
        else
95
        if(pri_in==2'h1)        pri_out_d1 = 4'b0010;
96
        else
97
        if(pri_in==2'h2)        pri_out_d1 = 4'b0100;
98
        else                    pri_out_d1 = 4'b1000;
99
 
100
// 2 Priority Levels
101
always @(valid or pri_in)
102
        if(!valid)              pri_out_d0 = 4'b0001;
103
        else
104
        if(pri_in==2'h0)        pri_out_d0 = 4'b0001;
105
        else                    pri_out_d0 = 4'b0010;
106
 
107
// Select Configured Priority
108
 
109
assign pri_out = (pri_sel==2'd0) ? 4'h0 : ( (pri_sel==1'd1) ? pri_out_d0 : pri_out_d1 );
110
 
111
endmodule
112
 

powered by: WebSVN 2.1.0

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