Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: dmu_imu_rds_msi_default_grp.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 | module dmu_imu_rds_msi_default_grp | |
36 | ( | |
37 | clk, | |
38 | msi_mapping_ext_select, | |
39 | msi_mapping_select, | |
40 | msi_mapping_ext_read_data, | |
41 | msi_mapping_v_ext_wr_data, | |
42 | msi_mapping_eqnum_ext_wr_data, | |
43 | msi_clear_reg_ext_select, | |
44 | msi_clear_reg_select, | |
45 | msi_clear_reg_ext_read_data, | |
46 | msi_clear_reg_eqwr_n_ext_wr_data, | |
47 | int_mondo_data_0_reg_data_hw_read, | |
48 | int_mondo_data_0_reg_select_pulse, | |
49 | int_mondo_data_1_reg_hw_read, | |
50 | int_mondo_data_1_reg_select_pulse, | |
51 | rst_l, | |
52 | daemon_csrbus_wr_in, | |
53 | daemon_csrbus_wr_out, | |
54 | daemon_csrbus_wr_data_in, | |
55 | ext_addr_in, | |
56 | ext_addr_out, | |
57 | read_data_0_out, | |
58 | read_data_1_out | |
59 | ); | |
60 | ||
61 | //==================================================== | |
62 | // Polarity declarations | |
63 | //==================================================== | |
64 | input clk; // Clock signal | |
65 | output msi_mapping_ext_select; // When set, register msi_mapping is selected. | |
66 | // This signal is a pulse. | |
67 | input msi_mapping_select; // select | |
68 | input [`FIRE_CSRBUS_DATA_WIDTH - 1:0] msi_mapping_ext_read_data; | |
69 | // Read Data | |
70 | output msi_mapping_v_ext_wr_data; // Provides SW write data for external | |
71 | // register "msi_mapping", field "v" | |
72 | output [5:0] msi_mapping_eqnum_ext_wr_data; // Provides SW write data for | |
73 | // external register "msi_mapping", | |
74 | // field "eqnum" | |
75 | output msi_clear_reg_ext_select; // When set, register msi_clear_reg is | |
76 | // selected. This signal is a pulse. | |
77 | input msi_clear_reg_select; // select | |
78 | input [`FIRE_CSRBUS_DATA_WIDTH - 1:0] msi_clear_reg_ext_read_data; | |
79 | // Read Data | |
80 | output msi_clear_reg_eqwr_n_ext_wr_data; // Provides SW write data for external | |
81 | // register "msi_clear_reg", field | |
82 | // "eqwr_n" | |
83 | output [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_0_REG_DATA_INT_SLC] int_mondo_data_0_reg_data_hw_read; | |
84 | // This signal provides the current value of int_mondo_data_0_reg_data. | |
85 | input int_mondo_data_0_reg_select_pulse; // select | |
86 | output [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_1_REG_WIDTH-1:0] int_mondo_data_1_reg_hw_read; | |
87 | // This signal provides the current value of int_mondo_data_1_reg. | |
88 | input int_mondo_data_1_reg_select_pulse; // select | |
89 | input rst_l; // HW reset | |
90 | input daemon_csrbus_wr_in; // csrbus_wr | |
91 | output daemon_csrbus_wr_out; // csrbus_wr | |
92 | input [`FIRE_CSRBUS_DATA_WIDTH-1:0] daemon_csrbus_wr_data_in; // SW write data | |
93 | input [7:0] ext_addr_in; // Ext addr | |
94 | output [7:0] ext_addr_out; // Ext addr | |
95 | output [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_0_out; // Read Data | |
96 | output [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_1_out; // Read Data | |
97 | ||
98 | //==================================================== | |
99 | // Type declarations | |
100 | //==================================================== | |
101 | wire clk; // Clock signal | |
102 | wire msi_mapping_ext_select; // When set, register msi_mapping is selected. | |
103 | // This signal is a pulse. | |
104 | wire msi_mapping_select; // select | |
105 | wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] msi_mapping_ext_read_data; // Read Data | |
106 | wire msi_mapping_v_ext_wr_data; // Provides SW write data for external register | |
107 | // "msi_mapping", field "v" | |
108 | wire [5:0] msi_mapping_eqnum_ext_wr_data; // Provides SW write data for | |
109 | // external register "msi_mapping", | |
110 | // field "eqnum" | |
111 | wire msi_clear_reg_ext_select; // When set, register msi_clear_reg is selected. | |
112 | // This signal is a pulse. | |
113 | wire msi_clear_reg_select; // select | |
114 | wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] msi_clear_reg_ext_read_data; | |
115 | // Read Data | |
116 | wire msi_clear_reg_eqwr_n_ext_wr_data; // Provides SW write data for external | |
117 | // register "msi_clear_reg", field | |
118 | // "eqwr_n" | |
119 | wire [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_0_REG_DATA_INT_SLC] int_mondo_data_0_reg_data_hw_read; | |
120 | // This signal provides the current value of int_mondo_data_0_reg_data. | |
121 | wire int_mondo_data_0_reg_select_pulse; // select | |
122 | wire [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_1_REG_WIDTH-1:0] int_mondo_data_1_reg_hw_read; | |
123 | // This signal provides the current value of int_mondo_data_1_reg. | |
124 | wire int_mondo_data_1_reg_select_pulse; // select | |
125 | wire rst_l; // HW reset | |
126 | wire daemon_csrbus_wr_in; // csrbus_wr | |
127 | wire daemon_csrbus_wr_out; // csrbus_wr | |
128 | wire [`FIRE_CSRBUS_DATA_WIDTH-1:0] daemon_csrbus_wr_data_in; // SW write data | |
129 | wire [7:0] ext_addr_in; // Ext addr | |
130 | wire [7:0] ext_addr_out; // Ext addr | |
131 | wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_0_out; // Read Data | |
132 | wire [`FIRE_CSRBUS_DATA_WIDTH - 1:0] read_data_1_out; // Read Data | |
133 | ||
134 | ||
135 | //==================================================== | |
136 | // Local signals | |
137 | //==================================================== | |
138 | //----- For CSR register: int_mondo_data_0_reg | |
139 | wire [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_0_REG_WIDTH-1:0] int_mondo_data_0_reg_csrbus_read_data; | |
140 | // Entry Based Read Data | |
141 | ||
142 | //----- For CSR register: int_mondo_data_1_reg | |
143 | wire [`FIRE_DLC_IMU_RDS_MSI_CSR_INT_MONDO_DATA_1_REG_WIDTH-1:0] int_mondo_data_1_reg_csrbus_read_data; | |
144 | // Entry Based Read Data | |
145 | ||
146 | ||
147 | //==================================================== | |
148 | // Pipelining (First stage) | |
149 | //==================================================== | |
150 | //----- delayed select for ext_select | |
151 | reg msi_mapping_select_piped; | |
152 | reg msi_mapping_select_piped_delayed; | |
153 | reg msi_clear_reg_select_piped; | |
154 | reg msi_clear_reg_select_piped_delayed; | |
155 | ||
156 | always @(posedge clk) | |
157 | begin | |
158 | if(~rst_l) | |
159 | begin | |
160 | msi_mapping_select_piped <= 1'b0; | |
161 | msi_mapping_select_piped_delayed <= 1'b0; | |
162 | msi_clear_reg_select_piped <= 1'b0; | |
163 | msi_clear_reg_select_piped_delayed <= 1'b0; | |
164 | end | |
165 | else | |
166 | begin | |
167 | msi_mapping_select_piped <= msi_mapping_select; | |
168 | msi_mapping_select_piped_delayed <= msi_mapping_select_piped; | |
169 | msi_clear_reg_select_piped <= msi_clear_reg_select; | |
170 | msi_clear_reg_select_piped_delayed <= msi_clear_reg_select_piped; | |
171 | end | |
172 | end | |
173 | ||
174 | //==================================================== | |
175 | // Assignments only (first stage) | |
176 | //==================================================== | |
177 | wire [`FIRE_CSRBUS_DATA_WIDTH-1:0] daemon_csrbus_wr_data = daemon_csrbus_wr_data_in; | |
178 | wire daemon_csrbus_wr = daemon_csrbus_wr_in; | |
179 | assign daemon_csrbus_wr_out = daemon_csrbus_wr_in; | |
180 | assign msi_mapping_v_ext_wr_data = daemon_csrbus_wr_data_in[63]; | |
181 | assign msi_mapping_eqnum_ext_wr_data = daemon_csrbus_wr_data_in[5:0]; | |
182 | assign msi_clear_reg_eqwr_n_ext_wr_data = daemon_csrbus_wr_data_in[62]; | |
183 | assign ext_addr_out = ext_addr_in; | |
184 | ||
185 | //==================================================== | |
186 | // Automatic hw_ld / hw_write | |
187 | //==================================================== | |
188 | ||
189 | //==================================================== | |
190 | // Extern select | |
191 | //==================================================== | |
192 | assign msi_mapping_ext_select = | |
193 | msi_mapping_select_piped& | |
194 | ~msi_mapping_select_piped_delayed; | |
195 | ||
196 | // msi_mapping_ext_select is a pulse | |
197 | /* 0in assert_timer -name msi_mapping_ext_select_pulse | |
198 | -var msi_mapping_ext_select -max 1 | |
199 | -message "msi_mapping_ext_select pulse length is not 1" | |
200 | -clock clk | |
201 | */ | |
202 | ||
203 | assign msi_clear_reg_ext_select = | |
204 | msi_clear_reg_select_piped& | |
205 | ~msi_clear_reg_select_piped_delayed; | |
206 | ||
207 | // msi_clear_reg_ext_select is a pulse | |
208 | /* 0in assert_timer -name msi_clear_reg_ext_select_pulse | |
209 | -var msi_clear_reg_ext_select -max 1 | |
210 | -message "msi_clear_reg_ext_select pulse length is not 1" | |
211 | -clock clk | |
212 | */ | |
213 | ||
214 | ||
215 | //===================================================== | |
216 | // OUTPUT: read_data_out | |
217 | //===================================================== | |
218 | dmu_imu_rds_msi_csrpipe_3 dmu_imu_rds_msi_csrpipe_3_inst_1 | |
219 | ( | |
220 | .clk (clk), | |
221 | .rst_l (rst_l), | |
222 | .reg_in (1'b1), | |
223 | .reg_out (1'b1), | |
224 | .data0 (msi_mapping_ext_read_data), | |
225 | .sel0 (msi_mapping_select), | |
226 | .data1 (msi_clear_reg_ext_read_data), | |
227 | .sel1 (msi_clear_reg_select), | |
228 | .data2 (int_mondo_data_0_reg_csrbus_read_data), | |
229 | .sel2 (int_mondo_data_0_reg_select_pulse), | |
230 | .out (read_data_0_out) | |
231 | ); | |
232 | ||
233 | dmu_imu_rds_msi_csrpipe_3 dmu_imu_rds_msi_csrpipe_3_inst_2 | |
234 | ( | |
235 | .clk (clk), | |
236 | .rst_l (rst_l), | |
237 | .reg_in (1'b1), | |
238 | .reg_out (1'b1), | |
239 | .data0 (int_mondo_data_1_reg_csrbus_read_data), | |
240 | .sel0 (int_mondo_data_1_reg_select_pulse), | |
241 | .data1 (64'b0), | |
242 | .sel1 (1'b1), | |
243 | .data2 (64'b0), | |
244 | .sel2 (1'b1), | |
245 | .out (read_data_1_out) | |
246 | ); | |
247 | ||
248 | ||
249 | //==================================================== | |
250 | // Instantiation of registers | |
251 | //==================================================== | |
252 | ||
253 | wire int_mondo_data_0_reg_w_ld =int_mondo_data_0_reg_select_pulse & daemon_csrbus_wr; | |
254 | ||
255 | dmu_imu_rds_msi_csr_int_mondo_data_0_reg int_mondo_data_0_reg | |
256 | ( | |
257 | .clk (clk), | |
258 | .rst_l (rst_l), | |
259 | .int_mondo_data_0_reg_w_ld (int_mondo_data_0_reg_w_ld), | |
260 | .csrbus_wr_data (daemon_csrbus_wr_data), | |
261 | .int_mondo_data_0_reg_csrbus_read_data (int_mondo_data_0_reg_csrbus_read_data), | |
262 | .int_mondo_data_0_reg_data_hw_read (int_mondo_data_0_reg_data_hw_read) | |
263 | ); | |
264 | ||
265 | wire int_mondo_data_1_reg_w_ld =int_mondo_data_1_reg_select_pulse & daemon_csrbus_wr; | |
266 | ||
267 | dmu_imu_rds_msi_csr_int_mondo_data_1_reg int_mondo_data_1_reg | |
268 | ( | |
269 | .clk (clk), | |
270 | .rst_l (rst_l), | |
271 | .int_mondo_data_1_reg_w_ld (int_mondo_data_1_reg_w_ld), | |
272 | .csrbus_wr_data (daemon_csrbus_wr_data), | |
273 | .int_mondo_data_1_reg_csrbus_read_data (int_mondo_data_1_reg_csrbus_read_data), | |
274 | .int_mondo_data_1_reg_hw_read (int_mondo_data_1_reg_hw_read) | |
275 | ); | |
276 | ||
277 | endmodule // dmu_imu_rds_msi_default_grp |