Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / niu_zcp_handle_decoder.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_zcp_handle_decoder.v
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35/*%W% %G%*/
36
37/*****************************************************************
38 *
39 * File Name : niu_zcp_handle_decoder.v
40 * Author Name : John Lo
41 * Description : Generate handle when zc_rdc is available.
42 *
43 * Parent Module: niu_zcp_slv.v
44 * Child Module:
45 * Interface Mod:
46 * Date Created : 8/11/04
47 *
48 * Copyright (c) 2020, Sun Microsystems, Inc.
49 * Sun Proprietary and Confidential
50 *
51 * Modification :
52 *
53 ****************************************************************/
54
55
56`include "niu_zcp.h"
57
58
59module niu_zcp_handle_decoder
60 (/*AUTOARG*/
61 // Outputs
62 fn, handle,
63 // Inputs
64 zc_rdc, rdmc_zcp_func_num, page_handle
65 );
66
67 input [3:0] zc_rdc;
68 input [31:0] rdmc_zcp_func_num;
69 input [`PMS15:0] page_handle; // 20 bit per handle
70 output [1:0] fn;
71 output [19:0] handle;
72
73 wire [19:0] handle0 = page_handle[`PMS0 :`PLS0 ];
74 wire [19:0] handle1 = page_handle[`PMS1 :`PLS1 ];
75 wire [19:0] handle2 = page_handle[`PMS2 :`PLS2 ];
76 wire [19:0] handle3 = page_handle[`PMS3 :`PLS3 ];
77 wire [19:0] handle4 = page_handle[`PMS4 :`PLS4 ];
78 wire [19:0] handle5 = page_handle[`PMS5 :`PLS5 ];
79 wire [19:0] handle6 = page_handle[`PMS6 :`PLS6 ];
80 wire [19:0] handle7 = page_handle[`PMS7 :`PLS7 ];
81 wire [19:0] handle8 = page_handle[`PMS8 :`PLS8 ];
82 wire [19:0] handle9 = page_handle[`PMS9 :`PLS9 ];
83 wire [19:0] handle10 = page_handle[`PMS10:`PLS10];
84 wire [19:0] handle11 = page_handle[`PMS11:`PLS11];
85 wire [19:0] handle12 = page_handle[`PMS12:`PLS12];
86 wire [19:0] handle13 = page_handle[`PMS13:`PLS13];
87 wire [19:0] handle14 = page_handle[`PMS14:`PLS14];
88 wire [19:0] handle15 = page_handle[`PMS15:`PLS15];
89
90 wire [1:0] fn0 = rdmc_zcp_func_num[1:0];
91 wire [1:0] fn1 = rdmc_zcp_func_num[3:2];
92 wire [1:0] fn2 = rdmc_zcp_func_num[5:4];
93 wire [1:0] fn3 = rdmc_zcp_func_num[7:6];
94 wire [1:0] fn4 = rdmc_zcp_func_num[9:8];
95 wire [1:0] fn5 = rdmc_zcp_func_num[11:10];
96 wire [1:0] fn6 = rdmc_zcp_func_num[13:12];
97 wire [1:0] fn7 = rdmc_zcp_func_num[15:14];
98 wire [1:0] fn8 = rdmc_zcp_func_num[17:16];
99 wire [1:0] fn9 = rdmc_zcp_func_num[19:18];
100 wire [1:0] fn10 = rdmc_zcp_func_num[21:20];
101 wire [1:0] fn11 = rdmc_zcp_func_num[23:22];
102 wire [1:0] fn12 = rdmc_zcp_func_num[25:24];
103 wire [1:0] fn13 = rdmc_zcp_func_num[27:26];
104 wire [1:0] fn14 = rdmc_zcp_func_num[29:28];
105 wire [1:0] fn15 = rdmc_zcp_func_num[31:30];
106
107 reg [19:0] handle;
108 reg [1:0] fn;
109
110 always @ (/*AUTOSENSE*/fn0 or fn1 or fn10 or fn11 or fn12 or fn13
111 or fn14 or fn15 or fn2 or fn3 or fn4 or fn5 or fn6 or fn7
112 or fn8 or fn9 or handle0 or handle1 or handle10 or handle11
113 or handle12 or handle13 or handle14 or handle15 or handle2
114 or handle3 or handle4 or handle5 or handle6 or handle7
115 or handle8 or handle9 or zc_rdc)
116 begin
117 casex (zc_rdc[3:0]) //synopsys parallel_case full_case infer_mux
118 4'd0: begin handle = handle0 ; fn = fn0 ; end
119 4'd1: begin handle = handle1 ; fn = fn1 ; end
120 4'd2: begin handle = handle2 ; fn = fn2 ; end
121 4'd3: begin handle = handle3 ; fn = fn3 ; end
122 4'd4: begin handle = handle4 ; fn = fn4 ; end
123 4'd5: begin handle = handle5 ; fn = fn5 ; end
124 4'd6: begin handle = handle6 ; fn = fn6 ; end
125 4'd7: begin handle = handle7 ; fn = fn7 ; end
126 4'd8: begin handle = handle8 ; fn = fn8 ; end
127 4'd9: begin handle = handle9 ; fn = fn9 ; end
128 4'd10: begin handle = handle10; fn = fn10; end
129 4'd11: begin handle = handle11; fn = fn11; end
130 4'd12: begin handle = handle12; fn = fn12; end
131 4'd13: begin handle = handle13; fn = fn13; end
132 4'd14: begin handle = handle14; fn = fn14; end
133 4'd15: begin handle = handle15; fn = fn15; end
134 default:begin handle = handle0 ; fn = fn0 ; end
135 endcase
136 end // always @ (...
137
138
139
140
141
142endmodule // niu_zcp_handle_decoder
143
144