Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / niu_pio_imask1_decoder.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_pio_imask1_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_pio_imask1_decoder.v
40 * Author Name : John Lo
41 * Description : It contains ldf_mask 64~68 read/write decoder,
42 *
43 * Parent Module: niu_pio_imask1_decoder.v
44 * Child Module:
45 * Interface Mod: many.
46 * Date Created : 3/30/04
47 *
48 * Copyright (c) 2020, Sun Microsystems, Inc.
49 * Sun Proprietary and Confidential
50 *
51 * Modification :
52 *
53 ****************************************************************/
54
55module niu_pio_imask1_decoder (/*AUTOARG*/
56 // Outputs
57 imask1_ack, imask1_rdata, imask1_err, ld_ldf_mask64,
58 ld_ldf_mask65, ld_ldf_mask66, ld_ldf_mask67, ld_ldf_mask68,
59 // Inputs
60 clk, reset, imask1_sel_reg, addr, rd, ldf_mask64,
61 ldf_mask65, ldf_mask66, ldf_mask67, ldf_mask68
62 );
63 input clk;
64 input reset;
65 input imask1_sel_reg;
66 // pio broadcast signals
67 input [18:0] addr;
68 input rd;
69 input [1:0] ldf_mask64;
70 input [1:0] ldf_mask65;
71 input [1:0] ldf_mask66;
72 input [1:0] ldf_mask67;
73 input [1:0] ldf_mask68;
74
75 output imask1_ack;
76 output [63:0] imask1_rdata;
77 output imask1_err;
78
79 output ld_ldf_mask64;
80 output ld_ldf_mask65;
81 output ld_ldf_mask66;
82 output ld_ldf_mask67;
83 output ld_ldf_mask68;
84
85// common reg declaration
86 reg [63:0] rd_data;
87 reg non_qualified_addr_err;
88// common wrie declaration
89 wire [63:0] imask1_rdata;
90 wire rd_en;
91 wire wr_en;
92 wire rasr;
93// output reg declaration
94 reg ld_ldf_mask64;
95 reg ld_ldf_mask65;
96 reg ld_ldf_mask66;
97 reg ld_ldf_mask67;
98 reg ld_ldf_mask68;
99
100`ifdef NEPTUNE
101/* ---------------------------------------------------------- */
102 reg imask1_sel_reg_int;
103 reg rd_int;
104 reg [18:0] addr_int;
105
106always @(posedge clk)
107 if (reset)
108 begin
109 imask1_sel_reg_int <= 1'b0;
110 rd_int <= 1'b0;
111 addr_int <= 19'b0;
112 end
113 else
114 begin
115 imask1_sel_reg_int <= imask1_sel_reg ;
116 rd_int <= rd ;
117 addr_int <= addr;
118 end
119
120`else
121/* ---------------------------------------------------------- */
122
123 wire imask1_sel_reg_int;
124 wire rd_int;
125 wire [18:0] addr_int;
126
127 assign imask1_sel_reg_int = imask1_sel_reg ;
128 assign rd_int = rd ;
129 assign addr_int = addr ;
130/* ----------------------------------------------------------- */
131`endif
132
133
134
135niu_rw_ctl imask1_rw_ctl(
136 // Outputs
137 .wr_en (wr_en),
138 .rd_en (rd_en),
139 .ack (imask1_ack),
140 .rdata (imask1_rdata[63:0]),
141 .err (imask1_err),
142 .rasr (rasr),
143 // Inputs
144 .clk (clk),
145 .sel (imask1_sel_reg_int),
146 .rd (rd_int),
147 .rd_data (rd_data[63:0]),
148 .non_qualified_addr_err(non_qualified_addr_err));
149
150
151always @ (/*AUTOSENSE*/addr_int or ldf_mask64 or ldf_mask65 or ldf_mask66
152 or ldf_mask67 or ldf_mask68 or wr_en)
153 begin
154 non_qualified_addr_err = 0;
155 rd_data = 64'hdead_beef_dead_beef;
156
157 ld_ldf_mask64 = 0;
158 ld_ldf_mask65 = 0;
159 ld_ldf_mask66 = 0;
160 ld_ldf_mask67 = 0;
161 ld_ldf_mask68 = 0;
162
163 case({addr_int[18:3],3'b0}) //synopsys parallel_case full_case
164 19'h0_0000: begin
165 ld_ldf_mask64 = wr_en;
166 rd_data = {62'b0,ldf_mask64};
167 end
168 19'h0_2000: begin
169 ld_ldf_mask65 = wr_en;
170 rd_data = {62'b0,ldf_mask65};
171 end
172 19'h0_4000: begin
173 ld_ldf_mask66 = wr_en;
174 rd_data = {62'b0,ldf_mask66};
175 end
176 19'h0_6000: begin
177 ld_ldf_mask67 = wr_en;
178 rd_data = {62'b0,ldf_mask67};
179 end
180 19'h0_8000: begin
181 ld_ldf_mask68 = wr_en;
182 rd_data = {62'b0,ldf_mask68};
183 end
184
185 default: begin
186 rd_data = 64'hdead_beef_dead_beef;
187 non_qualified_addr_err = 1;
188 end // case: default
189 endcase // case({addr[18:3],3'b0})
190 end // always @ (...
191
192
193
194
195endmodule // niu_pio_imask1_decoder
196
197