Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: fc_csr_cabinet.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 | `include "fc.vh" | |
36 | ||
37 | module fc_csr_cabinet(); | |
38 | ||
39 | ||
40 | wire [63:0] gOutOfBoot; // Vera Interface signal | |
41 | wire boot_done; | |
42 | ||
43 | assign boot_done = `TOP.system_reset.Not_in_Boot; | |
44 | ||
45 | //L2 CSR | |
46 | wire [22:0] l2_ctl_reg; | |
47 | assign l2_ctl_reg = `CPU.l2t0.csr.csr_l2_control_reg; //[22:0] | |
48 | ||
49 | //CCU control reg | |
50 | wire [5:0] ccu_ctl_reg_div1; | |
51 | assign ccu_ctl_reg_div1 = `CCU.csr_blk.pll_div1; | |
52 | wire [5:0] ccu_ctl_reg_div2; | |
53 | assign ccu_ctl_reg_div2 = `CCU.csr_blk.pll_div2; | |
54 | wire [5:0] ccu_ctl_reg_div3; | |
55 | assign ccu_ctl_reg_div3 = `CCU.csr_blk.pll_div3; | |
56 | wire [5:0] ccu_ctl_reg_div4; | |
57 | assign ccu_ctl_reg_div4 = `CCU.csr_blk.pll_div4; | |
58 | ||
59 | //MCU reg bits | |
60 | wire [4:0] mem_density; //DIMM_SIZE | |
61 | assign mem_density[4:0] = {`DRIF_PATH0.drif_eight_bank_mode, `DRIF_PATH0.drif_ras_addr_bits[3:0]}; | |
62 | ||
63 | //channel type | |
64 | wire single_channel; | |
65 | assign single_channel = `DRIF_PATH0.drif_single_channel_mode; | |
66 | ||
67 | //rank sel | |
68 | wire rank_sel; | |
69 | assign rank_sel = `DRIF_PATH0.drif_addr_bank_low_sel; | |
70 | ||
71 | //stack_dimm | |
72 | wire stack_dimm; | |
73 | assign stack_dimm = `DRIF_PATH0.drif_stacked_dimm; | |
74 | ||
75 | //no of dimms | |
76 | wire [2:0] no_of_dimms; | |
77 | assign no_of_dimms[2:0] = `DRIF_PATH0.drif_dimms_present[2:0]; | |
78 | ||
79 | //NCU clk ratio | |
80 | wire ncu_clk_ratio; | |
81 | assign ncu_clk_ratio = `TOP.cpu.ncu.ncu_ssitop_ctl.ncu_scksel; | |
82 | ||
83 | //hash enable | |
84 | wire hash_enable; | |
85 | assign hash_enable = `CPU.ncu.ncu_scd_ctl.ncu_c2iscd_ctl.ncu_ctrl_ctl.l2idxhs_en_status; | |
86 | ||
87 | //mps -- monitor the dmu to piu interface | |
88 | //supported sizez 128, 256, 512 | |
89 | wire [2:0] pcie_mps; | |
90 | assign pcie_mps = `CPU.dmu.p2d_mps; | |
91 | ||
92 | //monitor wether we are in sun4v sun4u mode | |
93 | wire sun4v_mode = `CPU.dmu.dmc.mmu.csr_sun4v_en; | |
94 | ||
95 | //monitor wether we are using FirePIO | |
96 | wire p2d_npwr_stall_en = `CPU.dmu.dmc.clu.crm.p2d_npwr_stall_en; | |
97 | wire im2crm_ilu_stall_en = `CPU.dmu.dmc.clu.crm.im2crm_ilu_stall_en; | |
98 | ||
99 | //power throttle | |
100 | wire power_throttle_en = (|`CPU.PWR_THRTTL_0[2:0]) | (|`CPU.PWR_THRTTL_1[2:0]); | |
101 | ||
102 | //For partial mode monitoring | |
103 | wire spc0_core_available ; | |
104 | wire spc1_core_available ; | |
105 | wire spc2_core_available ; | |
106 | wire spc3_core_available ; | |
107 | wire spc4_core_available ; | |
108 | wire spc5_core_available ; | |
109 | wire spc6_core_available ; | |
110 | wire spc7_core_available ; | |
111 | ||
112 | ||
113 | wire l2t_pm ; | |
114 | wire l2t_ba01; | |
115 | wire l2t_ba23; | |
116 | wire l2t_ba45; | |
117 | wire l2t_ba67; | |
118 | ||
119 | ||
120 | assign spc0_core_available = `CPU.ncu.ncu_spc0_core_available; | |
121 | assign spc1_core_available = `CPU.ncu.ncu_spc1_core_available; | |
122 | assign spc2_core_available = `CPU.ncu.ncu_spc2_core_available; | |
123 | assign spc3_core_available = `CPU.ncu.ncu_spc3_core_available; | |
124 | assign spc4_core_available = `CPU.ncu.ncu_spc4_core_available; | |
125 | assign spc5_core_available = `CPU.ncu.ncu_spc5_core_available; | |
126 | assign spc6_core_available = `CPU.ncu.ncu_spc6_core_available; | |
127 | assign spc7_core_available = `CPU.ncu.ncu_spc7_core_available; | |
128 | ||
129 | ||
130 | assign l2t_pm = `CPU.ncu.ncu_l2t_pm ; | |
131 | assign l2t_ba01 = `CPU.ncu.ncu_l2t_ba01; | |
132 | assign l2t_ba23 = `CPU.ncu.ncu_l2t_ba23; | |
133 | assign l2t_ba45 = `CPU.ncu.ncu_l2t_ba45; | |
134 | assign l2t_ba67 = `CPU.ncu.ncu_l2t_ba67; | |
135 | ||
136 | reg [3:0] denali_link_width; | |
137 | reg [1:0] pcie_ref_clk; | |
138 | reg [1:0] system_clock; | |
139 | reg [1:0] amb_used; | |
140 | reg RANDOM_REDUNDANCY_VALUES; | |
141 | reg RANDOM_PB_RST; | |
142 | reg RANDOM_POR_RST; | |
143 | reg EIGHT_CORE_DTM2_TESTER_SIG; // MSA | |
144 | reg FSR_RTL; | |
145 | integer denaliLink; | |
146 | ||
147 | initial | |
148 | begin | |
149 | #1; | |
150 | //denali link width | |
151 | denali_link_width = 8; //default value | |
152 | denaliLink = $value$plusargs("denali_link_width=%d", denali_link_width); | |
153 | $display("denaliLink = %d, denali_link_width = %d\n\n", denaliLink, denali_link_width); | |
154 | ||
155 | //psr ref clk | |
156 | //$test$plusargs("PCIE_REF_CLK_100") | |
157 | //Defaults for all the parameters | |
158 | system_clock = 2'b00; // 166 MHz | |
159 | pcie_ref_clk = 2'b11; // 250 Mhz | |
160 | RANDOM_REDUNDANCY_VALUES = 1'b0; | |
161 | amb_used = 2'b00; //Corresponds to sun amb | |
162 | RANDOM_PB_RST = 1'b0; | |
163 | RANDOM_POR_RST = 1'b0; | |
164 | EIGHT_CORE_DTM2_TESTER_SIG = 1'b0; // MSA | |
165 | FSR_RTL = 1'b0; | |
166 | //FSR RTL used | |
167 | if($test$plusargs("FSR_RTL_USED")) begin | |
168 | FSR_RTL = 1'b1; | |
169 | end | |
170 | //process for pci ref clock freq | |
171 | if($test$plusargs("PCIE_REF_CLK_100")) begin | |
172 | pcie_ref_clk[1:0] = 2'b00; | |
173 | end | |
174 | if($test$plusargs("PCIE_REF_CLK_125")) begin | |
175 | pcie_ref_clk = 2'b01; | |
176 | end | |
177 | if($test$plusargs("PCIE_REF_CLK_250")) begin | |
178 | pcie_ref_clk = 2'b10; | |
179 | end | |
180 | ||
181 | //process for ref clock freqency | |
182 | if( $test$plusargs("SYSCLK_166")) begin | |
183 | system_clock = 2'b00; | |
184 | end | |
185 | ||
186 | if( $test$plusargs("SYSCLK_133")) begin | |
187 | system_clock = 2'b01; | |
188 | end | |
189 | ||
190 | if( $test$plusargs("SYSCLK_200")) begin | |
191 | system_clock = 2'b10; | |
192 | end | |
193 | ||
194 | if( $test$plusargs("DTM_ENABLED")) begin | |
195 | system_clock = 2'b11; | |
196 | end | |
197 | ||
198 | if( $test$plusargs("RANDOM_REDUNDANCY_VALUES")) begin | |
199 | RANDOM_REDUNDANCY_VALUES = 1'b1; | |
200 | end | |
201 | ||
202 | if( $test$plusargs("SUN_AMB_USED")) begin | |
203 | amb_used = 2'b00; | |
204 | end | |
205 | ||
206 | if( $test$plusargs("IDT_AMB_USED")) begin | |
207 | amb_used = 2'b01; | |
208 | end | |
209 | ||
210 | if( $test$plusargs("MICRON_AMB_USED")) begin | |
211 | amb_used = 2'b10; | |
212 | end | |
213 | ||
214 | if( $test$plusargs("NEC_AMB_USED")) begin | |
215 | amb_used = 2'b10; | |
216 | end | |
217 | ||
218 | if( $test$plusargs("TB_RANDOM_PB_RST")) begin | |
219 | RANDOM_PB_RST = 1'b1; | |
220 | end | |
221 | ||
222 | if( $test$plusargs("TB_RANDOM_POR")) begin | |
223 | RANDOM_POR_RST = 1'b1; | |
224 | end | |
225 | ||
226 | // MSA 12/06/06 | |
227 | if( $test$plusargs("EIGHT_CORE_DTM2_TESTER")) begin | |
228 | EIGHT_CORE_DTM2_TESTER_SIG = 1'b1; | |
229 | end | |
230 | ||
231 | end | |
232 | ||
233 | /* | |
234 | * Detect scrub happening in any of the eight banks | |
235 | */ | |
236 | ||
237 | reg scrub_happened_bank0; | |
238 | reg scrub_happened_bank1; | |
239 | reg scrub_happened_bank2; | |
240 | reg scrub_happened_bank3; | |
241 | reg scrub_happened_bank4; | |
242 | reg scrub_happened_bank5; | |
243 | reg scrub_happened_bank6; | |
244 | reg scrub_happened_bank7; | |
245 | ||
246 | wire scrub_happened; | |
247 | ||
248 | initial begin | |
249 | scrub_happened_bank0 = 0; | |
250 | scrub_happened_bank1 = 0; | |
251 | scrub_happened_bank2 = 0; | |
252 | scrub_happened_bank3 = 0; | |
253 | scrub_happened_bank4 = 0; | |
254 | scrub_happened_bank5 = 0; | |
255 | scrub_happened_bank6 = 0; | |
256 | scrub_happened_bank7 = 0; | |
257 | end | |
258 | ||
259 | always @(posedge `CPU.l2t0.csr.csr_filbuf_scrub_ready) scrub_happened_bank0 = 1; | |
260 | always @(posedge `CPU.l2t1.csr.csr_filbuf_scrub_ready) scrub_happened_bank1 = 1; | |
261 | always @(posedge `CPU.l2t2.csr.csr_filbuf_scrub_ready) scrub_happened_bank2 = 1; | |
262 | always @(posedge `CPU.l2t3.csr.csr_filbuf_scrub_ready) scrub_happened_bank3 = 1; | |
263 | always @(posedge `CPU.l2t4.csr.csr_filbuf_scrub_ready) scrub_happened_bank4 = 1; | |
264 | always @(posedge `CPU.l2t5.csr.csr_filbuf_scrub_ready) scrub_happened_bank5 = 1; | |
265 | always @(posedge `CPU.l2t6.csr.csr_filbuf_scrub_ready) scrub_happened_bank6 = 1; | |
266 | always @(posedge `CPU.l2t7.csr.csr_filbuf_scrub_ready) scrub_happened_bank7 = 1; | |
267 | ||
268 | ||
269 | assign scrub_happened = scrub_happened_bank0 | scrub_happened_bank1 | scrub_happened_bank2 | scrub_happened_bank3 | scrub_happened_bank4 |scrub_happened_bank5 | scrub_happened_bank6 | scrub_happened_bank7; | |
270 | ||
271 | // MSA 12/06/06 `ifdef ONE_CORE_DTM2_TESTER | |
272 | `ifdef DTM_ENABLED | |
273 | ||
274 | // DBG1 signals | |
275 | wire [3:0] cpu0_sigs,cpu1_sigs,cpu2_sigs,cpu3_sigs,cpu4_sigs,cpu5_sigs,cpu6_sigs,cpu7_sigs; | |
276 | wire [5:0] l2t0_sigs,l2t1_sigs,l2t2_sigs,l2t3_sigs,l2t4_sigs,l2t5_sigs,l2t6_sigs,l2t7_sigs; | |
277 | wire io2x_sync_en,dbg1_l2clk; | |
278 | reg io2x_sync_en_r,io2x_sync_en_r2; | |
279 | reg [3:0] cpu0_sigs_lo,cpu0_sigs_hi; | |
280 | reg [7:0] cpu0_sigs_dlyd; | |
281 | wire [3:0] cpu0_sigs_actual_hi,cpu0_sigs_actual_low; | |
282 | reg [3:0] cpu0_sigs_actual_hi_r,cpu0_sigs_actual_low_r; | |
283 | reg [165:0] dtm2_one_core_tester_dbg_pins_dtm,dtm2_one_core_tester_dbg_bus_int_dtm; | |
284 | reg [165:0] dtm2_one_core_tester_dbg_pins_nondtm; | |
285 | wire [165:0] dtm2_one_core_tester_dbg_bus_dtm,dtm2_one_core_tester_dbg_bus_nondtm; | |
286 | wire [165:0] dtm2_one_core_tester_dbg_pins; | |
287 | wire [165:0] dtm2_one_core_tester_dbg_pins_1core; // MSA 12/06/06 | |
288 | wire dtm_mode_on; | |
289 | ||
290 | assign l2t0_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[5:0]; | |
291 | assign l2t1_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[11:6]; | |
292 | assign l2t2_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[17:12]; | |
293 | assign l2t3_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[23:18]; | |
294 | assign l2t4_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[29:24]; | |
295 | assign l2t5_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[35:30]; | |
296 | assign l2t6_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[41:36]; | |
297 | assign l2t7_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[47:42]; | |
298 | assign cpu0_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[51:48]; | |
299 | assign cpu1_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[55:52]; | |
300 | assign cpu2_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[59:56]; | |
301 | assign cpu3_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[63:60]; | |
302 | assign cpu4_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[67:64]; | |
303 | assign cpu5_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[71:68]; | |
304 | assign cpu6_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[75:72]; | |
305 | assign cpu7_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[79:76]; | |
306 | assign dtm_mode_on = `CPU.ccu.ccu_core.ccu_serdes_dtm_lat; | |
307 | ||
308 | assign io2x_sync_en = `CPU.dbg1.dbg1_dbgprt.cmp_io2x_sync_en_2; | |
309 | assign io2x_sync_en_inv = `CPU.dbg1.dbg1_dbgprt.cmp_io2x_sync_en_2_n; | |
310 | assign dbg1_l2clk = `CPU.dbg1.dbg1_dbgprt.l2clk; | |
311 | ||
312 | `ifndef TO_1_0_VECTORS | |
313 | wire [47:0] l2t_sigs_low,l2t_sigs_hi; | |
314 | reg [47:0] l2t_sigs_low_r,l2t_sigs_hi_r; | |
315 | ||
316 | assign l2t_sigs_low = { 3'bx, | |
317 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[44:42], | |
318 | 3'bx, | |
319 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[38:36], | |
320 | 3'bx, | |
321 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[32:30], | |
322 | 3'bx, | |
323 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[26:24], | |
324 | 3'bx, | |
325 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[20:18], | |
326 | 3'bx, | |
327 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[14:12], | |
328 | 3'bx, | |
329 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[8:6], | |
330 | 3'bx, | |
331 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[2:0]}; | |
332 | ||
333 | assign l2t_sigs_hi = { 3'bx, | |
334 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[124:122], | |
335 | 3'bx, | |
336 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[118:116], | |
337 | 3'bx, | |
338 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[112:110], | |
339 | 3'bx, | |
340 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[106:104], | |
341 | 3'bx, | |
342 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[100:98], | |
343 | 3'bx, | |
344 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[94:92], | |
345 | 3'bx, | |
346 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[88:86], | |
347 | 3'bx, | |
348 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[82:80]}; | |
349 | ||
350 | // Debug port ONE_CORE_DTM2_TESTER probe logic | |
351 | always @(posedge dbg1_l2clk) | |
352 | begin | |
353 | io2x_sync_en_r <= io2x_sync_en; | |
354 | io2x_sync_en_r2 <= io2x_sync_en_r; | |
355 | end | |
356 | ||
357 | always @(posedge dbg1_l2clk) | |
358 | if (io2x_sync_en_r) | |
359 | cpu0_sigs_hi <= cpu0_sigs[3:0]; | |
360 | ||
361 | else; | |
362 | ||
363 | always @(posedge dbg1_l2clk) | |
364 | if (io2x_sync_en_r2) | |
365 | begin | |
366 | cpu0_sigs_lo <= cpu0_sigs[3:0]; | |
367 | cpu0_sigs_dlyd <= {cpu0_sigs_hi[3:0],cpu0_sigs_lo[3:0]}; | |
368 | end | |
369 | else; | |
370 | ||
371 | assign cpu0_sigs_actual_low = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[51:48]; | |
372 | assign cpu0_sigs_actual_hi = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[131:128]; | |
373 | ||
374 | assign dtm2_one_core_tester_dbg_bus_dtm = {6'b0,cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
375 | cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
376 | cpu0_sigs_dlyd[7:4], | |
377 | cpu0_sigs_actual_hi[3:0], | |
378 | cpu0_sigs_dlyd[7:4], | |
379 | cpu0_sigs_actual_hi[3:0], | |
380 | l2t_sigs_hi[47:0], | |
381 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
382 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
383 | cpu0_sigs_dlyd[3:0], | |
384 | cpu0_sigs_actual_low[3:0], | |
385 | cpu0_sigs_dlyd[3:0], | |
386 | cpu0_sigs_actual_low[3:0], | |
387 | l2t_sigs_low[47:0]}; | |
388 | always @(posedge dbg1_l2clk) | |
389 | if (io2x_sync_en) | |
390 | begin | |
391 | cpu0_sigs_actual_low_r <= cpu0_sigs_actual_low[3:0]; | |
392 | cpu0_sigs_actual_hi_r <= cpu0_sigs_actual_hi[3:0]; | |
393 | l2t_sigs_low_r <= l2t_sigs_low[47:0]; | |
394 | l2t_sigs_hi_r <= l2t_sigs_hi[47:0]; | |
395 | end | |
396 | else; | |
397 | ||
398 | assign dtm2_one_core_tester_dbg_bus_nondtm = {6'b0,cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
399 | cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
400 | cpu0_sigs_dlyd[7:4], | |
401 | cpu0_sigs_actual_hi_r[3:0], | |
402 | cpu0_sigs_dlyd[7:4], | |
403 | cpu0_sigs_actual_hi_r[3:0], | |
404 | l2t_sigs_hi_r[47:0], | |
405 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
406 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
407 | cpu0_sigs_dlyd[3:0], | |
408 | cpu0_sigs_actual_low_r[3:0], | |
409 | cpu0_sigs_dlyd[3:0], | |
410 | cpu0_sigs_actual_low_r[3:0], | |
411 | l2t_sigs_low_r[47:0]}; | |
412 | ||
413 | always @(posedge dbg1_l2clk) | |
414 | if (io2x_sync_en) | |
415 | begin | |
416 | dtm2_one_core_tester_dbg_bus_int_dtm <= dtm2_one_core_tester_dbg_bus_dtm[165:0]; | |
417 | dtm2_one_core_tester_dbg_pins_dtm <= dtm2_one_core_tester_dbg_bus_int_dtm[165:0]; | |
418 | dtm2_one_core_tester_dbg_pins_nondtm <= dtm2_one_core_tester_dbg_bus_nondtm[165:0]; | |
419 | end | |
420 | else; | |
421 | ||
422 | assign dtm2_one_core_tester_dbg_pins_1core = dtm_mode_on ? | |
423 | dtm2_one_core_tester_dbg_pins_dtm[165:0] : dtm2_one_core_tester_dbg_pins_nondtm[165:0]; // MSA 12/06/06 | |
424 | ||
425 | `else | |
426 | ||
427 | wire [47:0] l2t_sigs_low,l2t_sigs_hi,l2t_sigs_r_low,l2t_sigs_r_hi; | |
428 | reg [47:0] l2t_sigs_low_r,l2t_sigs_hi_r; | |
429 | reg [3:0] cpu0_sigs_r,cpu0_sigs_hi_r,cpu0_sigs_lo_r,cpu0_sigs_lo_act,cpu0_sigs_hi_act; | |
430 | reg [7:0] cpu0_sigs_dlyd_r,cpu0_sigs_act; | |
431 | reg [2:0] l2t0_tid_lo,l2t1_tid_lo,l2t2_tid_lo,l2t3_tid_lo,l2t4_tid_lo,l2t5_tid_lo,l2t6_tid_lo,l2t7_tid_lo; | |
432 | reg [2:0] l2t0_sigs_r,l2t1_sigs_r,l2t2_sigs_r,l2t3_sigs_r,l2t4_sigs_r,l2t5_sigs_r,l2t6_sigs_r,l2t7_sigs_r; | |
433 | reg [2:0] l2t0_tid_hi,l2t1_tid_hi,l2t2_tid_hi,l2t3_tid_hi,l2t4_tid_hi,l2t5_tid_hi,l2t6_tid_hi,l2t7_tid_hi; | |
434 | reg [5:0] l2t0_tid,l2t1_tid,l2t2_tid,l2t3_tid,l2t4_tid,l2t5_tid,l2t6_tid,l2t7_tid; | |
435 | ||
436 | assign l2t_sigs_low = { 3'bx, | |
437 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[44:42], | |
438 | 3'bx, | |
439 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[38:36], | |
440 | 3'bx, | |
441 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[32:30], | |
442 | 3'bx, | |
443 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[26:24], | |
444 | 3'bx, | |
445 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[20:18], | |
446 | 3'bx, | |
447 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[14:12], | |
448 | 3'bx, | |
449 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[8:6], | |
450 | 3'bx, | |
451 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[2:0]}; | |
452 | ||
453 | assign l2t_sigs_hi = { 3'bx, | |
454 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[124:122], | |
455 | 3'bx, | |
456 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[118:116], | |
457 | 3'bx, | |
458 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[112:110], | |
459 | 3'bx, | |
460 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[106:104], | |
461 | 3'bx, | |
462 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[100:98], | |
463 | 3'bx, | |
464 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[94:92], | |
465 | 3'bx, | |
466 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[88:86], | |
467 | 3'bx, | |
468 | `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[82:80]}; | |
469 | ||
470 | always @(posedge dbg1_l2clk) | |
471 | begin | |
472 | io2x_sync_en_r <= io2x_sync_en; | |
473 | io2x_sync_en_r2 <= io2x_sync_en_r; | |
474 | cpu0_sigs_r <= cpu0_sigs[3:0]; | |
475 | l2t0_sigs_r <= l2t0_sigs[2:0]; | |
476 | l2t1_sigs_r <= l2t1_sigs[2:0]; | |
477 | l2t2_sigs_r <= l2t2_sigs[2:0]; | |
478 | l2t3_sigs_r <= l2t3_sigs[2:0]; | |
479 | l2t4_sigs_r <= l2t4_sigs[2:0]; | |
480 | l2t5_sigs_r <= l2t5_sigs[2:0]; | |
481 | l2t6_sigs_r <= l2t6_sigs[2:0]; | |
482 | l2t7_sigs_r <= l2t7_sigs[2:0]; | |
483 | end | |
484 | ||
485 | always @(posedge dbg1_l2clk) | |
486 | if (io2x_sync_en_r) | |
487 | cpu0_sigs_hi <= cpu0_sigs[3:0]; | |
488 | else; | |
489 | ||
490 | ||
491 | always @(posedge dbg1_l2clk) | |
492 | if (io2x_sync_en_r2) | |
493 | begin | |
494 | cpu0_sigs_lo <= cpu0_sigs[3:0]; | |
495 | cpu0_sigs_dlyd <= {cpu0_sigs_hi[3:0],cpu0_sigs_lo[3:0]}; | |
496 | end | |
497 | else; | |
498 | ||
499 | assign cpu0_sigs_actual_low = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[51:48]; | |
500 | assign cpu0_sigs_actual_hi = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus_io2x_fnl[131:128]; | |
501 | ||
502 | always @(posedge dbg1_l2clk) | |
503 | if (io2x_sync_en) | |
504 | begin | |
505 | cpu0_sigs_actual_low_r <= cpu0_sigs_actual_low[3:0]; | |
506 | cpu0_sigs_actual_hi_r <= cpu0_sigs_actual_hi[3:0]; | |
507 | l2t_sigs_low_r <= l2t_sigs_low[47:0]; | |
508 | l2t_sigs_hi_r <= l2t_sigs_hi[47:0]; | |
509 | dtm2_one_core_tester_dbg_pins_nondtm <= dtm2_one_core_tester_dbg_bus_nondtm[165:0]; | |
510 | end | |
511 | else; | |
512 | ||
513 | assign dtm2_one_core_tester_dbg_bus_nondtm = {6'b0,cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
514 | cpu0_sigs_dlyd[7:4],cpu0_sigs_dlyd[7:4], | |
515 | cpu0_sigs_dlyd[7:4], | |
516 | cpu0_sigs_actual_hi_r[3:0], | |
517 | cpu0_sigs_dlyd[7:4], | |
518 | cpu0_sigs_actual_hi_r[3:0], | |
519 | l2t_sigs_hi_r[47:0], | |
520 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
521 | cpu0_sigs_dlyd[3:0],cpu0_sigs_dlyd[3:0], | |
522 | cpu0_sigs_dlyd[3:0], | |
523 | cpu0_sigs_actual_low_r[3:0], | |
524 | cpu0_sigs_dlyd[3:0], | |
525 | cpu0_sigs_actual_low_r[3:0], | |
526 | l2t_sigs_low_r[47:0]}; | |
527 | ||
528 | always @(posedge dbg1_l2clk) | |
529 | if (io2x_sync_en_r) | |
530 | cpu0_sigs_hi_r <= cpu0_sigs_r[3:0]; | |
531 | else; | |
532 | ||
533 | always @(posedge dbg1_l2clk) | |
534 | if (io2x_sync_en_r2) | |
535 | begin | |
536 | cpu0_sigs_lo_r <= cpu0_sigs_r[3:0]; | |
537 | cpu0_sigs_dlyd_r <= {cpu0_sigs_hi_r[3:0],cpu0_sigs_lo_r[3:0]}; | |
538 | end | |
539 | else; | |
540 | ||
541 | always @(posedge dbg1_l2clk) | |
542 | if (io2x_sync_en_inv) | |
543 | begin | |
544 | cpu0_sigs_hi_act <= cpu0_sigs_r[3:0]; | |
545 | l2t0_tid_hi <= l2t0_sigs_r[2:0]; | |
546 | l2t1_tid_hi <= l2t1_sigs_r[2:0]; | |
547 | l2t2_tid_hi <= l2t2_sigs_r[2:0]; | |
548 | l2t3_tid_hi <= l2t3_sigs_r[2:0]; | |
549 | l2t4_tid_hi <= l2t4_sigs_r[2:0]; | |
550 | l2t5_tid_hi <= l2t5_sigs_r[2:0]; | |
551 | l2t6_tid_hi <= l2t6_sigs_r[2:0]; | |
552 | l2t7_tid_hi <= l2t7_sigs_r[2:0]; | |
553 | end | |
554 | ||
555 | always @(posedge dbg1_l2clk) | |
556 | if (io2x_sync_en) | |
557 | begin | |
558 | cpu0_sigs_lo_act <= cpu0_sigs_r[3:0]; | |
559 | l2t0_tid_lo <= l2t0_sigs_r[2:0]; | |
560 | l2t1_tid_lo <= l2t1_sigs_r[2:0]; | |
561 | l2t2_tid_lo <= l2t2_sigs_r[2:0]; | |
562 | l2t3_tid_lo <= l2t3_sigs_r[2:0]; | |
563 | l2t4_tid_lo <= l2t4_sigs_r[2:0]; | |
564 | l2t5_tid_lo <= l2t5_sigs_r[2:0]; | |
565 | l2t6_tid_lo <= l2t6_sigs_r[2:0]; | |
566 | l2t7_tid_lo <= l2t7_sigs_r[2:0]; | |
567 | l2t0_tid <= {l2t0_tid_hi[2:0],l2t0_tid_lo[2:0]}; | |
568 | l2t1_tid <= {l2t1_tid_hi[2:0],l2t1_tid_lo[2:0]}; | |
569 | l2t2_tid <= {l2t2_tid_hi[2:0],l2t2_tid_lo[2:0]}; | |
570 | l2t3_tid <= {l2t3_tid_hi[2:0],l2t3_tid_lo[2:0]}; | |
571 | l2t4_tid <= {l2t4_tid_hi[2:0],l2t4_tid_lo[2:0]}; | |
572 | l2t5_tid <= {l2t5_tid_hi[2:0],l2t5_tid_lo[2:0]}; | |
573 | l2t6_tid <= {l2t6_tid_hi[2:0],l2t6_tid_lo[2:0]}; | |
574 | l2t7_tid <= {l2t7_tid_hi[2:0],l2t7_tid_lo[2:0]}; | |
575 | cpu0_sigs_act <= {cpu0_sigs_hi_act[3:0],cpu0_sigs_lo_act[3:0]}; | |
576 | dtm2_one_core_tester_dbg_bus_int_dtm <= dtm2_one_core_tester_dbg_bus_dtm[165:0]; | |
577 | dtm2_one_core_tester_dbg_pins_dtm <= dtm2_one_core_tester_dbg_bus_int_dtm[165:0]; | |
578 | end | |
579 | else; | |
580 | ||
581 | assign l2t_sigs_r_low = { 3'bx, | |
582 | l2t7_tid[2:0], | |
583 | 3'bx, | |
584 | l2t6_tid[2:0], | |
585 | 3'bx, | |
586 | l2t5_tid[2:0], | |
587 | 3'bx, | |
588 | l2t4_tid[2:0], | |
589 | 3'bx, | |
590 | l2t3_tid[2:0], | |
591 | 3'bx, | |
592 | l2t2_tid[2:0], | |
593 | 3'bx, | |
594 | l2t1_tid[2:0], | |
595 | 3'bx, | |
596 | l2t0_tid[2:0]}; | |
597 | ||
598 | assign l2t_sigs_r_hi = { 3'bx, | |
599 | l2t7_tid[5:3], | |
600 | 3'bx, | |
601 | l2t6_tid[5:3], | |
602 | 3'bx, | |
603 | l2t5_tid[5:3], | |
604 | 3'bx, | |
605 | l2t4_tid[5:3], | |
606 | 3'bx, | |
607 | l2t3_tid[5:3], | |
608 | 3'bx, | |
609 | l2t2_tid[5:3], | |
610 | 3'bx, | |
611 | l2t1_tid[5:3], | |
612 | 3'bx, | |
613 | l2t0_tid[5:3]}; | |
614 | ||
615 | assign dtm2_one_core_tester_dbg_bus_dtm = {6'b0,cpu0_sigs_dlyd_r[7:4],cpu0_sigs_dlyd_r[7:4], | |
616 | cpu0_sigs_dlyd_r[7:4],cpu0_sigs_dlyd_r[7:4], | |
617 | cpu0_sigs_dlyd_r[7:4], | |
618 | cpu0_sigs_act[7:4], | |
619 | cpu0_sigs_dlyd_r[7:4], | |
620 | cpu0_sigs_act[7:4], | |
621 | l2t_sigs_r_hi[47:0], | |
622 | cpu0_sigs_dlyd_r[3:0],cpu0_sigs_dlyd_r[3:0], | |
623 | cpu0_sigs_dlyd_r[3:0],cpu0_sigs_dlyd_r[3:0], | |
624 | cpu0_sigs_dlyd_r[3:0], | |
625 | cpu0_sigs_act[3:0], | |
626 | cpu0_sigs_dlyd_r[3:0], | |
627 | cpu0_sigs_act[3:0], | |
628 | l2t_sigs_r_low[47:0]}; | |
629 | ||
630 | assign dtm2_one_core_tester_dbg_pins_1core = dtm_mode_on ? | |
631 | dtm2_one_core_tester_dbg_pins_dtm[165:0] : dtm2_one_core_tester_dbg_pins_nondtm[165:0]; // MSA 12/06/06 | |
632 | ||
633 | `endif | |
634 | ||
635 | // MSA 12/06/06 `endif | |
636 | ||
637 | ||
638 | // MSA 12/06/06 `ifdef EIGHT_CORE_DTM2_TESTER | |
639 | ||
640 | // MSA 12/06/06 `ifndef TO_1_0_VECTORS | |
641 | ||
642 | // MSA 12/06/06 `else | |
643 | ||
644 | // DBG1 signals | |
645 | // MSA 12/06/06 wire io2x_sync_en,dbg1_l2clk,io2x_sync_en_inv,dtm_mode_on; | |
646 | wire [79:0] dtm2_sigs_act; | |
647 | wire [79:0] dtm2_sigs; | |
648 | reg [79:0] dtm2_sigs_r; | |
649 | reg [79:0] dtm2_sigs_act_low,dtm2_sigs_act_hi; | |
650 | reg [159:0] dtm2_sigs_accu,dtm2_sigs_fnl; | |
651 | reg [165:0] dtm2_one_core_tester_dbg_pins_8core; //MSA 12/06/06 | |
652 | ||
653 | assign dtm2_sigs = `CPU.dbg1.dbg1_dbgprt.charac_signal_bus[79:0]; | |
654 | // MSA 12/06/06 assign dtm_mode_on = `CPU.ccu.ccu_core.ccu_serdes_dtm_lat; | |
655 | ||
656 | // MSA 12/06/06 assign io2x_sync_en = `CPU.dbg1.dbg1_dbgprt.cmp_io2x_sync_en_2; | |
657 | // MSA 12/06/06 assign io2x_sync_en_inv = `CPU.dbg1.dbg1_dbgprt.cmp_io2x_sync_en_2_n; | |
658 | // MSA 12/06/06 assign dbg1_l2clk = `CPU.dbg1.dbg1_dbgprt.l2clk; | |
659 | ||
660 | // MSA 12/06/06 | |
661 | `ifdef TO_1_0_VECTORS | |
662 | ||
663 | always @(posedge dbg1_l2clk) | |
664 | dtm2_sigs_r <= dtm2_sigs[79:0]; | |
665 | ||
666 | // pre/post wrm selection | |
667 | assign dtm2_sigs_act = dtm_mode_on ? dtm2_sigs_r[79:0] : dtm2_sigs[79:0]; | |
668 | `else | |
669 | assign dtm2_sigs_act = dtm2_sigs[79:0]; | |
670 | `endif | |
671 | ||
672 | ||
673 | // rest of the code all matches dbg pipeline | |
674 | ||
675 | always @(posedge dbg1_l2clk) | |
676 | if (io2x_sync_en_inv) | |
677 | dtm2_sigs_act_hi <= dtm2_sigs_act[79:0]; | |
678 | else; | |
679 | ||
680 | ||
681 | always @(posedge dbg1_l2clk) | |
682 | if (io2x_sync_en) | |
683 | begin | |
684 | dtm2_sigs_act_low <= dtm2_sigs_act[79:0]; | |
685 | dtm2_sigs_accu <= {dtm2_sigs_act_hi[79:0],dtm2_sigs_act_low[79:0]}; | |
686 | dtm2_sigs_fnl <= dtm2_sigs_accu[159:0]; | |
687 | dtm2_one_core_tester_dbg_pins_8core <= {6'b0,dtm2_sigs_fnl[159:0]}; // MSA 12/06/06 | |
688 | end | |
689 | else; | |
690 | ||
691 | // MSA 12/06/06 | |
692 | assign dtm2_one_core_tester_dbg_pins = EIGHT_CORE_DTM2_TESTER_SIG ? dtm2_one_core_tester_dbg_pins_8core : dtm2_one_core_tester_dbg_pins_1core; | |
693 | ||
694 | // MSA 12/06/06 `endif | |
695 | ||
696 | `endif | |
697 | ||
698 | ||
699 | endmodule |