Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: dmu_cru.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_cru | |
36 | ( | |
37 | // Clock and Reset | |
38 | clk, | |
39 | rst_l, | |
40 | ||
41 | // Instance ID | |
42 | j2d_instance_id, | |
43 | ||
44 | // CSR Ring Interface to from JBC | |
45 | j2d_csr_ring_out, | |
46 | d2j_csr_ring_in, | |
47 | ||
48 | // CSR Ring Interface to from PEC | |
49 | k2y_csr_ring_out, | |
50 | y2k_csr_ring_in, | |
51 | ||
52 | // CSR Bus Signals to IMU | |
53 | cr2im_csrbus_valid, | |
54 | im2cr_csrbus_done, | |
55 | im2cr_csrbus_mapped, | |
56 | cr2im_csrbus_wr_data, | |
57 | cr2im_csrbus_wr, | |
58 | im2cr_csrbus_read_data, | |
59 | cr2im_csrbus_addr, | |
60 | cr2im_csrbus_src_bus, | |
61 | im2cr_csrbus_acc_vio, | |
62 | ||
63 | // CSR Bus Signals to MMU | |
64 | cr2mm_csrbus_valid, | |
65 | mm2cr_csrbus_done, | |
66 | mm2cr_csrbus_mapped, | |
67 | cr2mm_csrbus_wr_data, | |
68 | cr2mm_csrbus_wr, | |
69 | mm2cr_csrbus_read_data, | |
70 | cr2mm_csrbus_addr, | |
71 | cr2mm_csrbus_src_bus, | |
72 | mm2cr_csrbus_acc_vio, | |
73 | ||
74 | // CSR Bus Signals to PSB | |
75 | cr2ps_csrbus_valid, | |
76 | ps2cr_csrbus_done, | |
77 | ps2cr_csrbus_mapped, | |
78 | cr2ps_csrbus_wr_data, | |
79 | cr2ps_csrbus_wr, | |
80 | ps2cr_csrbus_read_data, | |
81 | cr2ps_csrbus_addr, | |
82 | cr2ps_csrbus_src_bus, | |
83 | ps2cr_csrbus_acc_vio, | |
84 | ||
85 | // CSR Bus Signals to TSB | |
86 | cr2ts_csrbus_valid, | |
87 | ts2cr_csrbus_done, | |
88 | ts2cr_csrbus_mapped, | |
89 | cr2ts_csrbus_wr_data, | |
90 | cr2ts_csrbus_wr, | |
91 | ts2cr_csrbus_read_data, | |
92 | cr2ts_csrbus_addr, | |
93 | cr2ts_csrbus_src_bus, | |
94 | ts2cr_csrbus_acc_vio, | |
95 | ||
96 | // Bus Number to CLU | |
97 | cr2cl_bus_num, | |
98 | ||
99 | // Requester ID to RMU | |
100 | cr2rm_req_id, | |
101 | // Requester ID to PEU | |
102 | d2p_req_id, | |
103 | ||
104 | cr2im_dbg_sel_a, | |
105 | cr2im_dbg_sel_b, | |
106 | im2cr_dbg_a, | |
107 | im2cr_dbg_b, | |
108 | ||
109 | cr2cm_dbg_sel_a, | |
110 | cr2cm_dbg_sel_b, | |
111 | cm2cr_dbg_a, | |
112 | cm2cr_dbg_b, | |
113 | ||
114 | cr2cl_dbg_sel_a, | |
115 | cr2cl_dbg_sel_b, | |
116 | cl2cr_dbg_a, | |
117 | cl2cr_dbg_b, | |
118 | ||
119 | cr2ts_dbg_sel_a, | |
120 | cr2ts_dbg_sel_b, | |
121 | ts2cr_dbg_a, | |
122 | ts2cr_dbg_b, | |
123 | ||
124 | cr2tm_dbg_sel_a, | |
125 | cr2tm_dbg_sel_b, | |
126 | tm2cr_dbg_a, | |
127 | tm2cr_dbg_b, | |
128 | ||
129 | cr2rm_dbg_sel_a, | |
130 | cr2rm_dbg_sel_b, | |
131 | rm2cr_dbg_a, | |
132 | rm2cr_dbg_b, | |
133 | ||
134 | cr2ps_dbg_sel_a, | |
135 | cr2ps_dbg_sel_b, | |
136 | ps2cr_dbg_a, | |
137 | ps2cr_dbg_b, | |
138 | ||
139 | cr2pm_dbg_sel_a, | |
140 | cr2pm_dbg_sel_b, | |
141 | pm2cr_dbg_a, | |
142 | pm2cr_dbg_b, | |
143 | ||
144 | cr2mm_dbg_sel_a, | |
145 | cr2mm_dbg_sel_b, | |
146 | mm2cr_dbg_a, | |
147 | mm2cr_dbg_b, | |
148 | ||
149 | k2y_dbg_sel_a, | |
150 | k2y_dbg_sel_b, | |
151 | y2k_dbg_a, | |
152 | y2k_dbg_b, | |
153 | ||
154 | cr2ds_dbg_sel_a, | |
155 | cr2ds_dbg_sel_b, | |
156 | ds2cr_dbg_a, | |
157 | ds2cr_dbg_b, | |
158 | ||
159 | dmu_mio_debug_bus_a, | |
160 | dmu_mio_debug_bus_b | |
161 | ); | |
162 | ||
163 | // ---------------------------------------------------------------------------- | |
164 | // Parameters | |
165 | // ---------------------------------------------------------------------------- | |
166 | ||
167 | // ---------------------------------------------------------------------------- | |
168 | // Ports | |
169 | // ---------------------------------------------------------------------------- | |
170 | ||
171 | //------------------------------------------------------------------------ | |
172 | // Clock and Reset Signals | |
173 | //------------------------------------------------------------------------ | |
174 | input clk; | |
175 | input rst_l; | |
176 | ||
177 | //------------------------------------------------------------------------ | |
178 | // Instance ID | |
179 | //------------------------------------------------------------------------ | |
180 | input [`FIRE_J2D_INSTANCE_ID_WDTH-1:0] j2d_instance_id; | |
181 | ||
182 | //------------------------------------------------------------------------ | |
183 | // Ring Interface to JBC | |
184 | //------------------------------------------------------------------------ | |
185 | input [`FIRE_CSR_RING_BITS] j2d_csr_ring_out; | |
186 | output [`FIRE_CSR_RING_BITS] d2j_csr_ring_in; | |
187 | ||
188 | //------------------------------------------------------------------------ | |
189 | // Ring Interface to JBC | |
190 | //------------------------------------------------------------------------ | |
191 | output [`FIRE_CSR_RING_BITS] k2y_csr_ring_out; | |
192 | input [`FIRE_CSR_RING_BITS] y2k_csr_ring_in; | |
193 | ||
194 | //------------------------------------------------------------------------ | |
195 | // CSR Bus Signals to IMU | |
196 | //------------------------------------------------------------------------ | |
197 | output cr2im_csrbus_valid; | |
198 | input im2cr_csrbus_done; | |
199 | input im2cr_csrbus_mapped; | |
200 | ||
201 | output [`FIRE_CSR_DATA_BITS] cr2im_csrbus_wr_data; | |
202 | output cr2im_csrbus_wr; | |
203 | ||
204 | input [`FIRE_CSR_DATA_BITS] im2cr_csrbus_read_data; | |
205 | ||
206 | output [`FIRE_CSR_ADDR_BITS] cr2im_csrbus_addr; | |
207 | ||
208 | output [`FIRE_CSR_SRCB_BITS] cr2im_csrbus_src_bus; | |
209 | input im2cr_csrbus_acc_vio; | |
210 | ||
211 | //------------------------------------------------------------------------ | |
212 | // CSR Bus Signals to MMU | |
213 | //------------------------------------------------------------------------ | |
214 | output cr2mm_csrbus_valid; | |
215 | input mm2cr_csrbus_done; | |
216 | input mm2cr_csrbus_mapped; | |
217 | ||
218 | output [`FIRE_CSR_DATA_BITS] cr2mm_csrbus_wr_data; | |
219 | output cr2mm_csrbus_wr; | |
220 | ||
221 | input [`FIRE_CSR_DATA_BITS] mm2cr_csrbus_read_data; | |
222 | ||
223 | output [`FIRE_CSR_ADDR_BITS] cr2mm_csrbus_addr; | |
224 | ||
225 | output [`FIRE_CSR_SRCB_BITS] cr2mm_csrbus_src_bus; | |
226 | input mm2cr_csrbus_acc_vio; | |
227 | ||
228 | //------------------------------------------------------------------------ | |
229 | // CSR Bus Signals to PSB | |
230 | //------------------------------------------------------------------------ | |
231 | output cr2ps_csrbus_valid; | |
232 | input ps2cr_csrbus_done; | |
233 | input ps2cr_csrbus_mapped; | |
234 | ||
235 | output [`FIRE_CSR_DATA_BITS] cr2ps_csrbus_wr_data; | |
236 | output cr2ps_csrbus_wr; | |
237 | ||
238 | input [`FIRE_CSR_DATA_BITS] ps2cr_csrbus_read_data; | |
239 | ||
240 | output [`FIRE_CSR_ADDR_BITS] cr2ps_csrbus_addr; | |
241 | ||
242 | output [`FIRE_CSR_SRCB_BITS] cr2ps_csrbus_src_bus; | |
243 | input ps2cr_csrbus_acc_vio; | |
244 | ||
245 | //------------------------------------------------------------------------ | |
246 | // CSR Bus Signals to TSB | |
247 | //------------------------------------------------------------------------ | |
248 | output cr2ts_csrbus_valid; | |
249 | input ts2cr_csrbus_done; | |
250 | input ts2cr_csrbus_mapped; | |
251 | ||
252 | output [`FIRE_CSR_DATA_BITS] cr2ts_csrbus_wr_data; | |
253 | output cr2ts_csrbus_wr; | |
254 | ||
255 | input [`FIRE_CSR_DATA_BITS] ts2cr_csrbus_read_data; | |
256 | ||
257 | output [`FIRE_CSR_ADDR_BITS] cr2ts_csrbus_addr; | |
258 | ||
259 | output [`FIRE_CSR_SRCB_BITS] cr2ts_csrbus_src_bus; | |
260 | input ts2cr_csrbus_acc_vio; | |
261 | ||
262 | //------------------------------------------------------------------------ | |
263 | // Bus Number and Requester ID | |
264 | //------------------------------------------------------------------------ | |
265 | output [`FIRE_PCIE_BUS_NUM_BITS] cr2cl_bus_num; | |
266 | output [`FIRE_PCIE_REQ_ID_BITS] cr2rm_req_id; | |
267 | output [`FIRE_PCIE_REQ_ID_BITS] d2p_req_id; | |
268 | ||
269 | //------------------------------------------------------------------------ | |
270 | // Debug Ports | |
271 | //------------------------------------------------------------------------ | |
272 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2im_dbg_sel_a; | |
273 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2im_dbg_sel_b; | |
274 | input [`FIRE_DEBUG_WDTH-1:0] im2cr_dbg_a; | |
275 | input [`FIRE_DEBUG_WDTH-1:0] im2cr_dbg_b; | |
276 | ||
277 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2cm_dbg_sel_a; | |
278 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2cm_dbg_sel_b; | |
279 | input [`FIRE_DEBUG_WDTH-1:0] cm2cr_dbg_a; | |
280 | input [`FIRE_DEBUG_WDTH-1:0] cm2cr_dbg_b; | |
281 | ||
282 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2cl_dbg_sel_a; | |
283 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2cl_dbg_sel_b; | |
284 | input [`FIRE_DEBUG_WDTH-1:0] cl2cr_dbg_a; | |
285 | input [`FIRE_DEBUG_WDTH-1:0] cl2cr_dbg_b; | |
286 | ||
287 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ts_dbg_sel_a; | |
288 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ts_dbg_sel_b; | |
289 | input [`FIRE_DEBUG_WDTH-1:0] ts2cr_dbg_a; | |
290 | input [`FIRE_DEBUG_WDTH-1:0] ts2cr_dbg_b; | |
291 | ||
292 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2tm_dbg_sel_a; | |
293 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2tm_dbg_sel_b; | |
294 | input [`FIRE_DEBUG_WDTH-1:0] tm2cr_dbg_a; | |
295 | input [`FIRE_DEBUG_WDTH-1:0] tm2cr_dbg_b; | |
296 | ||
297 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2rm_dbg_sel_a; | |
298 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2rm_dbg_sel_b; | |
299 | input [`FIRE_DEBUG_WDTH-1:0] rm2cr_dbg_a; | |
300 | input [`FIRE_DEBUG_WDTH-1:0] rm2cr_dbg_b; | |
301 | ||
302 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ps_dbg_sel_a; | |
303 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ps_dbg_sel_b; | |
304 | input [`FIRE_DEBUG_WDTH-1:0] ps2cr_dbg_a; | |
305 | input [`FIRE_DEBUG_WDTH-1:0] ps2cr_dbg_b; | |
306 | ||
307 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2pm_dbg_sel_a; | |
308 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2pm_dbg_sel_b; | |
309 | input [`FIRE_DEBUG_WDTH-1:0] pm2cr_dbg_a; | |
310 | input [`FIRE_DEBUG_WDTH-1:0] pm2cr_dbg_b; | |
311 | ||
312 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2mm_dbg_sel_a; | |
313 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2mm_dbg_sel_b; | |
314 | input [`FIRE_DEBUG_WDTH-1:0] mm2cr_dbg_a; | |
315 | input [`FIRE_DEBUG_WDTH-1:0] mm2cr_dbg_b; | |
316 | ||
317 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] k2y_dbg_sel_a; | |
318 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] k2y_dbg_sel_b; | |
319 | input [`FIRE_DEBUG_WDTH-1:0] y2k_dbg_a; | |
320 | input [`FIRE_DEBUG_WDTH-1:0] y2k_dbg_b; | |
321 | ||
322 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ds_dbg_sel_a; | |
323 | output [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cr2ds_dbg_sel_b; | |
324 | input [`FIRE_DEBUG_WDTH-1:0] ds2cr_dbg_a; | |
325 | input [`FIRE_DEBUG_WDTH-1:0] ds2cr_dbg_b; | |
326 | ||
327 | output [`FIRE_DEBUG_WDTH-1:0] dmu_mio_debug_bus_a; | |
328 | output [`FIRE_DEBUG_WDTH-1:0] dmu_mio_debug_bus_b; | |
329 | ||
330 | // ---------------------------------------------------------------------------- | |
331 | // Wire | |
332 | // ---------------------------------------------------------------------------- | |
333 | wire [`FIRE_CSR_RING_BITS] byp2imu_csr_ring; | |
334 | wire [`FIRE_CSR_RING_BITS] byp2psb_csr_ring; | |
335 | wire [`FIRE_CSR_RING_BITS] psb2tsb_csr_ring; | |
336 | wire [`FIRE_CSR_RING_BITS] mmu2byp_csr_ring; | |
337 | wire [`FIRE_CSR_RING_BITS] cru2mmu_csr_ring; | |
338 | ||
339 | wire csrbus_valid; | |
340 | wire csrbus_done; | |
341 | wire csrbus_mapped; | |
342 | wire [`FIRE_CSR_DATA_WIDTH-1:0] csrbus_wr_data; | |
343 | wire csrbus_wr; | |
344 | wire [`FIRE_CSR_DATA_WIDTH-1:0] csrbus_read_data; | |
345 | wire [`FIRE_CSR_ADDR_MAX_WIDTH-1:0] csrbus_addr; | |
346 | wire [`FIRE_CSR_SRC_BUS_ID_WIDTH-1:0] csrbus_src_bus; | |
347 | wire csrbus_acc_vio; | |
348 | ||
349 | wire [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cru_dbg_sel_a; | |
350 | wire [`FIRE_DLC_DEBUG_SEL_WDTH-1:0] cru_dbg_sel_b; | |
351 | ||
352 | wire [`FIRE_PCIE_BUS_NUM_BITS] cr2cl_bus_num; | |
353 | wire [`FIRE_PCIE_REQ_ID_BITS] cr2rm_req_id; | |
354 | ||
355 | wire [3:0] dmc_dbg_sel_a; | |
356 | wire [3:0] dmc_dbg_sel_b; | |
357 | ||
358 | wire [2:0] sub_dbg_sel_a; | |
359 | wire [2:0] signal_dbg_sel_a; | |
360 | ||
361 | wire [2:0] sub_dbg_sel_b; | |
362 | wire [2:0] signal_dbg_sel_b; | |
363 | ||
364 | ||
365 | // ---------------------------------------------------------------------------- | |
366 | // Wire | |
367 | // ---------------------------------------------------------------------------- | |
368 | reg [`FIRE_DEBUG_WDTH-1:0] n_d2j_dbg_a; | |
369 | reg [`FIRE_DEBUG_WDTH-1:0] n_d2j_dbg_b; | |
370 | reg [`FIRE_DEBUG_WDTH-1:0] dmu_mio_debug_bus_a; | |
371 | reg [`FIRE_DEBUG_WDTH-1:0] dmu_mio_debug_bus_b; | |
372 | ||
373 | reg [`FIRE_DEBUG_WDTH-1:0] n_cru_dbg_a; | |
374 | reg [`FIRE_DEBUG_WDTH-1:0] n_cru_dbg_b; | |
375 | reg [`FIRE_DEBUG_WDTH-1:0] cru_dbg_a; | |
376 | reg [`FIRE_DEBUG_WDTH-1:0] cru_dbg_b; | |
377 | ||
378 | // ---------------------------------------------------------------------------- | |
379 | // Zero In Checkers | |
380 | // ---------------------------------------------------------------------------- | |
381 | ||
382 | // ---------------------------------------------------------------------------- | |
383 | // Instantiations | |
384 | // ---------------------------------------------------------------------------- | |
385 | ||
386 | // The current hook up of the 6 DCC's is as follows | |
387 | // | |
388 | // to from | |
389 | // JBC JBC | |
390 | // | | | |
391 | // IMU | | |
392 | // | | | |
393 | // -------BYP------- | |
394 | // | | | |
395 | // MMU PSB | |
396 | // | | | |
397 | // CRU TSB | |
398 | // | | | |
399 | // ILU ILU | |
400 | // from to | |
401 | ||
402 | //------------------------------------------------------------------------ | |
403 | // DCB (bypass) | |
404 | //------------------------------------------------------------------------ | |
405 | ||
406 | pcie_common_dcb byp | |
407 | ( | |
408 | .csr_byp_ring_out (byp2imu_csr_ring), | |
409 | .csr_ext_ring_out (byp2psb_csr_ring), | |
410 | .clk (clk), | |
411 | .rst_l (rst_l), | |
412 | .byp_src (`FIRE_CSR_SRCB_FAST), | |
413 | .csr_byp_ring_in (j2d_csr_ring_out), | |
414 | .csr_ext_ring_in (mmu2byp_csr_ring) | |
415 | ); | |
416 | ||
417 | //------------------------------------------------------------------------ | |
418 | // DCC to IMU | |
419 | //------------------------------------------------------------------------ | |
420 | ||
421 | pcie_common_dcc imu | |
422 | ( | |
423 | .csr_ring_out (d2j_csr_ring_in), | |
424 | .csrbus_wr_data (cr2im_csrbus_wr_data), | |
425 | .csrbus_addr (cr2im_csrbus_addr), | |
426 | .csrbus_wr (cr2im_csrbus_wr), | |
427 | .csrbus_valid (cr2im_csrbus_valid), | |
428 | .csrbus_src_bus (cr2im_csrbus_src_bus), | |
429 | .clk (clk), | |
430 | .rst_l (rst_l), | |
431 | .csr_ring_in (byp2imu_csr_ring), | |
432 | .csrbus_read_data (im2cr_csrbus_read_data), | |
433 | .csrbus_done (im2cr_csrbus_done), | |
434 | .csrbus_mapped (im2cr_csrbus_mapped), | |
435 | .csrbus_acc_vio (im2cr_csrbus_acc_vio) | |
436 | ); | |
437 | ||
438 | //------------------------------------------------------------------------ | |
439 | // DCC to MMU | |
440 | //------------------------------------------------------------------------ | |
441 | ||
442 | pcie_common_dcc mmu | |
443 | ( | |
444 | .csr_ring_out (mmu2byp_csr_ring), | |
445 | .csrbus_wr_data (cr2mm_csrbus_wr_data), | |
446 | .csrbus_addr (cr2mm_csrbus_addr), | |
447 | .csrbus_wr (cr2mm_csrbus_wr), | |
448 | .csrbus_valid (cr2mm_csrbus_valid), | |
449 | .csrbus_src_bus (cr2mm_csrbus_src_bus), | |
450 | .clk (clk), | |
451 | .rst_l (rst_l), | |
452 | .csr_ring_in (cru2mmu_csr_ring), | |
453 | .csrbus_read_data (mm2cr_csrbus_read_data), | |
454 | .csrbus_done (mm2cr_csrbus_done), | |
455 | .csrbus_mapped (mm2cr_csrbus_mapped), | |
456 | .csrbus_acc_vio (mm2cr_csrbus_acc_vio) | |
457 | ); | |
458 | ||
459 | //------------------------------------------------------------------------ | |
460 | // DCC to CRU | |
461 | //------------------------------------------------------------------------ | |
462 | ||
463 | pcie_common_dcc cru | |
464 | ( | |
465 | .csr_ring_out (cru2mmu_csr_ring), | |
466 | .csrbus_wr_data (csrbus_wr_data), | |
467 | .csrbus_addr (csrbus_addr), | |
468 | .csrbus_wr (csrbus_wr), | |
469 | .csrbus_valid (csrbus_valid), | |
470 | .csrbus_src_bus (csrbus_src_bus), | |
471 | .clk (clk), | |
472 | .rst_l (rst_l), | |
473 | .csr_ring_in (y2k_csr_ring_in), | |
474 | .csrbus_read_data (csrbus_read_data), | |
475 | .csrbus_done (csrbus_done), | |
476 | .csrbus_mapped (csrbus_mapped), | |
477 | .csrbus_acc_vio (csrbus_acc_vio) | |
478 | ); | |
479 | ||
480 | //------------------------------------------------------------------------ | |
481 | // DCC to PSB | |
482 | //------------------------------------------------------------------------ | |
483 | ||
484 | pcie_common_dcc psb | |
485 | ( | |
486 | .csr_ring_out (psb2tsb_csr_ring), | |
487 | .csrbus_wr_data (cr2ps_csrbus_wr_data), | |
488 | .csrbus_addr (cr2ps_csrbus_addr), | |
489 | .csrbus_wr (cr2ps_csrbus_wr), | |
490 | .csrbus_valid (cr2ps_csrbus_valid), | |
491 | .csrbus_src_bus (cr2ps_csrbus_src_bus), | |
492 | .clk (clk), | |
493 | .rst_l (rst_l), | |
494 | .csr_ring_in (byp2psb_csr_ring), | |
495 | .csrbus_read_data (ps2cr_csrbus_read_data), | |
496 | .csrbus_done (ps2cr_csrbus_done), | |
497 | .csrbus_mapped (ps2cr_csrbus_mapped), | |
498 | .csrbus_acc_vio (ps2cr_csrbus_acc_vio) | |
499 | ); | |
500 | ||
501 | //------------------------------------------------------------------------ | |
502 | // DCC to TSB | |
503 | //------------------------------------------------------------------------ | |
504 | ||
505 | pcie_common_dcc tsb | |
506 | ( | |
507 | .csr_ring_out (k2y_csr_ring_out), | |
508 | .csrbus_wr_data (cr2ts_csrbus_wr_data), | |
509 | .csrbus_addr (cr2ts_csrbus_addr), | |
510 | .csrbus_wr (cr2ts_csrbus_wr), | |
511 | .csrbus_valid (cr2ts_csrbus_valid), | |
512 | .csrbus_src_bus (cr2ts_csrbus_src_bus), | |
513 | .clk (clk), | |
514 | .rst_l (rst_l), | |
515 | .csr_ring_in (psb2tsb_csr_ring), | |
516 | .csrbus_read_data (ts2cr_csrbus_read_data), | |
517 | .csrbus_done (ts2cr_csrbus_done), | |
518 | .csrbus_mapped (ts2cr_csrbus_mapped), | |
519 | .csrbus_acc_vio (ts2cr_csrbus_acc_vio) | |
520 | ); | |
521 | ||
522 | //------------------------------------------------------------------------ | |
523 | // CSRtool | |
524 | //------------------------------------------------------------------------ | |
525 | ||
526 | dmu_cru_csr csr | |
527 | ( | |
528 | .clk (clk), | |
529 | .csrbus_addr (csrbus_addr), | |
530 | .csrbus_wr_data (csrbus_wr_data), | |
531 | .csrbus_wr (csrbus_wr), | |
532 | .csrbus_valid (csrbus_valid), | |
533 | .csrbus_mapped (csrbus_mapped), | |
534 | .csrbus_done (csrbus_done), | |
535 | .csrbus_read_data (csrbus_read_data), | |
536 | .rst_l (rst_l), | |
537 | .csrbus_src_bus (csrbus_src_bus), | |
538 | .csrbus_acc_vio (csrbus_acc_vio), | |
539 | .instance_id (j2d_instance_id), | |
540 | ||
541 | .dmc_dbg_sel_a_reg_block_sel_hw_read (dmc_dbg_sel_a), | |
542 | .dmc_dbg_sel_a_reg_sub_sel_hw_read (sub_dbg_sel_a), | |
543 | .dmc_dbg_sel_a_reg_signal_sel_hw_read (signal_dbg_sel_a), | |
544 | ||
545 | .dmc_dbg_sel_b_reg_block_sel_hw_read (dmc_dbg_sel_b), | |
546 | .dmc_dbg_sel_b_reg_sub_sel_hw_read (sub_dbg_sel_b), | |
547 | .dmc_dbg_sel_b_reg_signal_sel_hw_read (signal_dbg_sel_b), | |
548 | ||
549 | .dmc_pcie_cfg_bus_num_hw_read (cr2cl_bus_num), | |
550 | .dmc_pcie_cfg_req_id_hw_read (cr2rm_req_id) | |
551 | ); | |
552 | ||
553 | assign d2p_req_id = cr2rm_req_id; // BP 8-18-05 | |
554 | //------------------------------------------------------------------------ | |
555 | // Debug Ports | |
556 | //------------------------------------------------------------------------ | |
557 | ||
558 | assign cr2im_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
559 | assign k2y_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
560 | assign cru_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
561 | assign cr2cm_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
562 | assign cr2cl_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
563 | assign cr2ts_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
564 | assign cr2tm_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
565 | assign cr2rm_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
566 | assign cr2ps_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
567 | assign cr2pm_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
568 | assign cr2mm_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
569 | ||
570 | assign cr2im_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
571 | assign k2y_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
572 | assign cru_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
573 | assign cr2cm_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
574 | assign cr2cl_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
575 | assign cr2ts_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
576 | assign cr2tm_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
577 | assign cr2rm_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
578 | assign cr2ps_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
579 | assign cr2pm_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
580 | assign cr2mm_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
581 | ||
582 | assign cr2ds_dbg_sel_a = {sub_dbg_sel_a, signal_dbg_sel_a}; | |
583 | assign cr2ds_dbg_sel_b = {sub_dbg_sel_b, signal_dbg_sel_b}; | |
584 | //----------------------- | |
585 | // create a waveform of 3 1's followed by 1 0 for dbg calibraion | |
586 | //----------------------- | |
587 | ||
588 | reg [1:0] dbg_train; | |
589 | reg [1:0] nxt_dbg_train; | |
590 | wire train_seq; | |
591 | // 3 flops in a row, all reset to 0 | |
592 | always @ (posedge clk) | |
593 | if(~rst_l) begin | |
594 | dbg_train[1:0] <= {2{1'b0}}; | |
595 | end | |
596 | else begin | |
597 | dbg_train[1:0] <= nxt_dbg_train[1:0]; | |
598 | end | |
599 | ||
600 | always @ (dbg_train ) begin | |
601 | case (dbg_train) | |
602 | 2'b00 : nxt_dbg_train[1:0] = {2'b01}; | |
603 | 2'b01 : nxt_dbg_train[1:0] = {2'b10}; | |
604 | 2'b10 : nxt_dbg_train[1:0] = {2'b11}; | |
605 | 2'b11 : nxt_dbg_train[1:0] = {2'b00}; | |
606 | endcase | |
607 | end | |
608 | ||
609 | assign train_seq = dbg_train[1] & dbg_train[0]; | |
610 | ||
611 | //----------------------- | |
612 | // DMC BLOCK Mux Port A | |
613 | //----------------------- | |
614 | ||
615 | always @ (dmc_dbg_sel_a or cl2cr_dbg_a or cm2cr_dbg_a or y2k_dbg_a or | |
616 | im2cr_dbg_a or mm2cr_dbg_a or pm2cr_dbg_a or ps2cr_dbg_a or ds2cr_dbg_a or | |
617 | rm2cr_dbg_a or tm2cr_dbg_a or ts2cr_dbg_a or cru_dbg_a or train_seq) begin | |
618 | case (dmc_dbg_sel_a) // synopsys infer_mux | |
619 | 4'b0000 : n_d2j_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
620 | // 4'b0000 : n_d2j_dbg_a = {`FIRE_DEBUG_WDTH{~train_seq}}; | |
621 | 4'b0001 : n_d2j_dbg_a = cl2cr_dbg_a; | |
622 | 4'b0010 : n_d2j_dbg_a = cm2cr_dbg_a; | |
623 | 4'b0011 : n_d2j_dbg_a = cru_dbg_a; | |
624 | 4'b0100 : n_d2j_dbg_a = ds2cr_dbg_a; | |
625 | 4'b0101 : n_d2j_dbg_a = {`FIRE_DEBUG_WDTH{~train_seq}}; | |
626 | 4'b0110 : n_d2j_dbg_a = y2k_dbg_a; | |
627 | 4'b0111 : n_d2j_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
628 | 4'b1000 : n_d2j_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
629 | 4'b1001 : n_d2j_dbg_a = im2cr_dbg_a; | |
630 | 4'b1010 : n_d2j_dbg_a = mm2cr_dbg_a; | |
631 | 4'b1011 : n_d2j_dbg_a = pm2cr_dbg_a; | |
632 | 4'b1100 : n_d2j_dbg_a = ps2cr_dbg_a; | |
633 | 4'b1101 : n_d2j_dbg_a = rm2cr_dbg_a; | |
634 | 4'b1110 : n_d2j_dbg_a = tm2cr_dbg_a; | |
635 | 4'b1111 : n_d2j_dbg_a = ts2cr_dbg_a; | |
636 | endcase | |
637 | end | |
638 | ||
639 | //----------------------- | |
640 | // DMC BLOCK Mux Port B | |
641 | //----------------------- | |
642 | ||
643 | always @ (dmc_dbg_sel_b or cl2cr_dbg_b or cm2cr_dbg_b or y2k_dbg_b or | |
644 | im2cr_dbg_b or mm2cr_dbg_b or pm2cr_dbg_b or ps2cr_dbg_b or ds2cr_dbg_b or | |
645 | rm2cr_dbg_b or tm2cr_dbg_b or ts2cr_dbg_b or cru_dbg_b or train_seq) begin | |
646 | case (dmc_dbg_sel_b) // synopsys infer_mux | |
647 | 4'b0000 : n_d2j_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
648 | 4'b0001 : n_d2j_dbg_b = cl2cr_dbg_b; | |
649 | 4'b0010 : n_d2j_dbg_b = cm2cr_dbg_b; | |
650 | 4'b0011 : n_d2j_dbg_b = cru_dbg_b; | |
651 | 4'b0100 : n_d2j_dbg_b = ds2cr_dbg_b; | |
652 | 4'b0101 : n_d2j_dbg_b = {`FIRE_DEBUG_WDTH{~train_seq}}; | |
653 | 4'b0110 : n_d2j_dbg_b = y2k_dbg_b; | |
654 | 4'b0111 : n_d2j_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
655 | 4'b1000 : n_d2j_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
656 | 4'b1001 : n_d2j_dbg_b = im2cr_dbg_b; | |
657 | 4'b1010 : n_d2j_dbg_b = mm2cr_dbg_b; | |
658 | 4'b1011 : n_d2j_dbg_b = pm2cr_dbg_b; | |
659 | 4'b1100 : n_d2j_dbg_b = ps2cr_dbg_b; | |
660 | 4'b1101 : n_d2j_dbg_b = rm2cr_dbg_b; | |
661 | 4'b1110 : n_d2j_dbg_b = tm2cr_dbg_b; | |
662 | 4'b1111 : n_d2j_dbg_b = ts2cr_dbg_b; | |
663 | endcase | |
664 | end | |
665 | ||
666 | //----------------------- | |
667 | // Flop The Core Outputs | |
668 | //----------------------- | |
669 | always @ (posedge clk) | |
670 | if(~rst_l) begin | |
671 | dmu_mio_debug_bus_a <= {`FIRE_DEBUG_WDTH{1'b0}}; | |
672 | dmu_mio_debug_bus_b <= {`FIRE_DEBUG_WDTH{1'b0}}; | |
673 | end | |
674 | else begin | |
675 | dmu_mio_debug_bus_a <= n_d2j_dbg_a; | |
676 | dmu_mio_debug_bus_b <= n_d2j_dbg_b; | |
677 | end | |
678 | ||
679 | //----------------------- | |
680 | // CRU Mux Port A | |
681 | //----------------------- | |
682 | ||
683 | always @ (cru_dbg_sel_a) begin | |
684 | case (cru_dbg_sel_a) // synopsys parallel_case infer_mux | |
685 | 6'h0 : n_cru_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
686 | 6'h1 : n_cru_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
687 | 6'h2 : n_cru_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
688 | default : n_cru_dbg_a = {`FIRE_DEBUG_WDTH{1'b0}}; | |
689 | endcase | |
690 | end | |
691 | ||
692 | //----------------------- | |
693 | // CRU Mux Port B | |
694 | //----------------------- | |
695 | ||
696 | always @ (cru_dbg_sel_b) begin | |
697 | case (cru_dbg_sel_b) // synopsys parallel_case infer_mux | |
698 | 6'h0 : n_cru_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
699 | 6'h1 : n_cru_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
700 | 6'h2 : n_cru_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
701 | default: n_cru_dbg_b = {`FIRE_DEBUG_WDTH{1'b0}}; | |
702 | endcase | |
703 | end | |
704 | ||
705 | //---------------------------- | |
706 | // Flop The CRU Block Signals | |
707 | //----------------------------- | |
708 | always @ (posedge clk) | |
709 | if(~rst_l) begin | |
710 | cru_dbg_a <= {`FIRE_DEBUG_WDTH{1'b0}}; | |
711 | cru_dbg_b <= {`FIRE_DEBUG_WDTH{1'b0}}; | |
712 | end | |
713 | else begin | |
714 | cru_dbg_a <= n_cru_dbg_a; | |
715 | cru_dbg_b <= n_cru_dbg_b; | |
716 | end | |
717 | ||
718 | endmodule |