Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: ccu.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 | `timescale 1 ps/ 1 ps | |
36 | ||
37 | module ccu ( | |
38 | // GCLK Ports | |
39 | gclk, | |
40 | dr_pll_clk, | |
41 | cmp_pll_clk , | |
42 | ccu_vco_aligned, | |
43 | gclk_aligned, | |
44 | gl_ccu_io_out, | |
45 | // CCU-NCU Interface, | |
46 | ccu_ncu_stall, | |
47 | ncu_ccu_vld, | |
48 | ncu_ccu_data, | |
49 | ncu_ccu_stall, | |
50 | ccu_ncu_vld, | |
51 | ccu_ncu_data, | |
52 | // PLL-Bump Interface, | |
53 | pll_sys_clk_p, | |
54 | pll_sys_clk_n, | |
55 | pll_vdd, | |
56 | // CCU-RNG Interface, | |
57 | rng_arst_l, | |
58 | rng_data, | |
59 | rng_bypass, | |
60 | rng_vcoctrl_sel, | |
61 | rng_ch_sel, | |
62 | rng_anlg_sel, | |
63 | // SCAN Related, | |
64 | tcu_atpg_mode, | |
65 | scan_in, | |
66 | tcu_scan_en, | |
67 | tcu_aclk, | |
68 | tcu_bclk, | |
69 | scan_out, | |
70 | // Global Outputs, | |
71 | ccu_cmp_io_sync_en, | |
72 | ccu_io_cmp_sync_en, | |
73 | ccu_io2x_sync_en, | |
74 | ccu_dr_sync_en, | |
75 | ccu_io2x_out, | |
76 | ccu_io_out, | |
77 | ccu_serdes_dtm, | |
78 | // CCU-MIO Interface, | |
79 | ccu_mio_pll_char_out, | |
80 | ccu_mio_serdes_dtm, | |
81 | ccu_dbg1_serdes_dtm, | |
82 | mio_pll_testmode, | |
83 | mio_ccu_vreg_selbg_l, | |
84 | mio_ccu_pll_clamp_fltr, | |
85 | mio_ccu_pll_div2, | |
86 | mio_ccu_pll_div4, | |
87 | mio_ccu_pll_trst_l, | |
88 | mio_ccu_pll_char_in, | |
89 | // CCU-TCU Interface, | |
90 | gl_ccu_io_clk_stop, | |
91 | gl_ccu_clk_stop, | |
92 | tcu_pce_ov, | |
93 | tcu_ccu_mux_sel, | |
94 | tcu_ccu_ext_cmp_clk, | |
95 | tcu_ccu_ext_dr_clk , | |
96 | tcu_ccu_clk_stretch, // TBD | |
97 | // CCU-RST Interface, | |
98 | rst_ccu_pll_, | |
99 | rst_ccu_, | |
100 | rst_wmr_protect, | |
101 | ccu_rst_change, | |
102 | ccu_rst_sys_clk, | |
103 | ccu_rst_sync_stable, | |
104 | ccu_sys_cmp_sync_en, | |
105 | ccu_cmp_sys_sync_en, | |
106 | cluster_arst_l | |
107 | ); | |
108 | ||
109 | ||
110 | // ------------------------------------ | |
111 | // INPUT-OUTPUT DECLARATIONS | |
112 | // ------------------------------------ | |
113 | ||
114 | // GCLK Ports | |
115 | input gclk; | |
116 | output dr_pll_clk; | |
117 | output cmp_pll_clk ; | |
118 | output ccu_vco_aligned; | |
119 | input gclk_aligned; | |
120 | input gl_ccu_io_out; | |
121 | // CCU-NCU Interface, | |
122 | output ccu_ncu_stall; | |
123 | input ncu_ccu_vld; | |
124 | input [3:0] ncu_ccu_data; | |
125 | input ncu_ccu_stall; | |
126 | output ccu_ncu_vld; | |
127 | output [3:0] ccu_ncu_data; | |
128 | // PLL-Bump Interface, | |
129 | input pll_sys_clk_p; | |
130 | input pll_sys_clk_n; | |
131 | input pll_vdd; | |
132 | // CCU-RNG Interface, | |
133 | output rng_arst_l; | |
134 | input rng_data; | |
135 | output rng_bypass; | |
136 | output [1:0] rng_vcoctrl_sel; | |
137 | output [1:0] rng_ch_sel; | |
138 | output [1:0] rng_anlg_sel; | |
139 | // SCAN Related; | |
140 | input tcu_atpg_mode; | |
141 | input scan_in; | |
142 | input tcu_scan_en; | |
143 | input tcu_aclk; | |
144 | input tcu_bclk; | |
145 | output scan_out; | |
146 | // Global Outputs, | |
147 | output ccu_serdes_dtm; | |
148 | output ccu_cmp_io_sync_en; | |
149 | output ccu_io_cmp_sync_en; | |
150 | output ccu_io2x_sync_en; | |
151 | output ccu_dr_sync_en; | |
152 | output ccu_io2x_out; | |
153 | output ccu_io_out; | |
154 | // CCU-MIO Interface; | |
155 | output [1:0] ccu_mio_pll_char_out; | |
156 | output ccu_mio_serdes_dtm; | |
157 | output ccu_dbg1_serdes_dtm; | |
158 | input mio_pll_testmode; | |
159 | input mio_ccu_vreg_selbg_l; | |
160 | input mio_ccu_pll_clamp_fltr; | |
161 | input [5:0] mio_ccu_pll_div2; | |
162 | input [6:0] mio_ccu_pll_div4; | |
163 | input mio_ccu_pll_trst_l; | |
164 | input mio_ccu_pll_char_in; | |
165 | // CCU-TCU Interface, | |
166 | input gl_ccu_io_clk_stop; | |
167 | input gl_ccu_clk_stop; | |
168 | input tcu_pce_ov; | |
169 | input [1:0] tcu_ccu_mux_sel; | |
170 | input tcu_ccu_ext_cmp_clk; | |
171 | input tcu_ccu_ext_dr_clk ; | |
172 | input tcu_ccu_clk_stretch; // TBD | |
173 | // CCU-RST Interface, | |
174 | input rst_ccu_pll_; | |
175 | input rst_ccu_; | |
176 | input rst_wmr_protect; | |
177 | output ccu_rst_change; | |
178 | output ccu_rst_sys_clk; | |
179 | output ccu_sys_cmp_sync_en; | |
180 | output ccu_cmp_sys_sync_en; | |
181 | output ccu_rst_sync_stable; | |
182 | input cluster_arst_l; | |
183 | ||
184 | ||
185 | // ------------------------------------ | |
186 | // EXTERNAL WIRE/REG DECLARATIONS | |
187 | // ------------------------------------ | |
188 | ||
189 | // GCLK Ports | |
190 | wire gclk; | |
191 | wire dr_pll_clk; | |
192 | wire cmp_pll_clk ; | |
193 | wire ccu_vco_aligned; | |
194 | wire gclk_aligned; | |
195 | wire gl_ccu_io_out; | |
196 | // CCU-NCU Interface, | |
197 | wire ccu_ncu_stall; | |
198 | wire ncu_ccu_vld; | |
199 | wire [3:0] ncu_ccu_data; | |
200 | wire ncu_ccu_stall; | |
201 | wire ccu_ncu_vld; | |
202 | wire [3:0] ccu_ncu_data; | |
203 | // PLL-Bump Interface, | |
204 | wire pll_sys_clk_p; | |
205 | wire pll_sys_clk_n; | |
206 | wire pll_vdd; | |
207 | // CCU-RNG Interface, | |
208 | wire rng_arst_l; | |
209 | wire rng_data; | |
210 | wire rng_bypass; | |
211 | wire [1:0] rng_vcoctrl_sel; | |
212 | wire [1:0] rng_ch_sel; | |
213 | wire [1:0] rng_anlg_sel; | |
214 | // SCAN Related; | |
215 | wire tcu_atpg_mode; | |
216 | wire scan_in; | |
217 | wire tcu_scan_en; | |
218 | wire tcu_aclk; | |
219 | wire tcu_bclk; | |
220 | wire scan_out; | |
221 | // Global Outputs, | |
222 | wire ccu_serdes_dtm; | |
223 | wire ccu_cmp_io_sync_en; | |
224 | wire ccu_io_cmp_sync_en; | |
225 | wire ccu_io2x_sync_en; | |
226 | wire ccu_dr_sync_en; | |
227 | wire ccu_io2x_out; | |
228 | wire ccu_io_out; | |
229 | // CCU-MIO Interface; | |
230 | wire [1:0] ccu_mio_pll_char_out; | |
231 | wire ccu_mio_serdes_dtm; | |
232 | wire ccu_dbg1_serdes_dtm; | |
233 | wire mio_pll_testmode; | |
234 | wire mio_ccu_vreg_selbg_l; | |
235 | wire mio_ccu_pll_clamp_fltr; | |
236 | wire [5:0] mio_ccu_pll_div2; | |
237 | wire [6:0] mio_ccu_pll_div4; | |
238 | wire mio_ccu_pll_trst_l; | |
239 | wire mio_ccu_pll_char_in; | |
240 | // CCU-TCU Interface, | |
241 | wire tcu_pce_ov; | |
242 | wire [1:0] tcu_ccu_mux_sel; | |
243 | wire tcu_ccu_ext_cmp_clk; | |
244 | wire tcu_ccu_ext_dr_clk ; | |
245 | wire tcu_ccu_clk_stretch; // TBD | |
246 | // CCU-RST Interface, | |
247 | wire rst_ccu_pll_; | |
248 | wire rst_ccu_; | |
249 | wire rst_wmr_protect; | |
250 | wire ccu_rst_change; | |
251 | wire ccu_rst_sys_clk; | |
252 | wire ccu_sys_cmp_sync_en; | |
253 | wire ccu_cmp_sys_sync_en; | |
254 | wire ccu_rst_sync_stable; | |
255 | wire cluster_arst_l; | |
256 | ||
257 | // *********************************************** | |
258 | // wires for pll | |
259 | // *********************************************** | |
260 | ||
261 | wire dft_rst_a_l; | |
262 | wire pll_bypass; | |
263 | wire pll_char_in; | |
264 | wire [5:0] pll_div1; | |
265 | wire [5:0] pll_div2; | |
266 | wire [5:0] pll_div3; | |
267 | wire [6:0] pll_div4; | |
268 | wire [5:0] pll_div3_lat; | |
269 | wire [6:0] pll_div4_lat; | |
270 | wire vdd_hv15; | |
271 | wire vreg_selbg_l; | |
272 | wire [1:0] pll_char_out; | |
273 | wire dr_pll_clk_l; | |
274 | ||
275 | // ------------------------------------ | |
276 | // INTERNAL WIRE/REG DECLARATIONS | |
277 | // ------------------------------------ | |
278 | ||
279 | wire [1:0] align_shift; | |
280 | wire [4:0] shift_amt; | |
281 | wire [4:0] dr_shift_amt; | |
282 | ||
283 | ||
284 | wire l2clk; | |
285 | wire iol2clk; | |
286 | wire ref_clk; | |
287 | wire aligned; | |
288 | wire io_phase_180; | |
289 | wire io2x_phase_180; | |
290 | wire [4:0] ratio; | |
291 | ||
292 | wire aligned_rst_n; | |
293 | ||
294 | wire ucb_rd_req_vld; | |
295 | wire ucb_wr_req_vld; | |
296 | wire ucb_ack_busy; | |
297 | wire ucb_req_acpted; | |
298 | wire ucb_rd_ack_vld; | |
299 | wire ucb_rd_nack_vld; | |
300 | wire [5:0] ucb_thr_id_in; | |
301 | wire [1:0] ucb_buf_id_in; | |
302 | wire [5:0] ucb_thr_id_out; | |
303 | wire [1:0] ucb_buf_id_out; | |
304 | wire [63:0] ucb_data_in; | |
305 | wire [63:0] ucb_data_out; | |
306 | wire [39:0] ucb_addr_in; | |
307 | ||
308 | wire wmr_protect; | |
309 | ||
310 | wire csr_rst_n; | |
311 | ||
312 | wire st_phase_hi; | |
313 | wire [1:0] st_delay_dr; | |
314 | wire [1:0] st_delay_cmp; | |
315 | ||
316 | wire serdes_dtm1; | |
317 | wire serdes_dtm2; | |
318 | ||
319 | wire [4:0] io_div; | |
320 | wire [4:0] io2x_div; | |
321 | ||
322 | wire io_phase_0; | |
323 | wire l1clk; | |
324 | ||
325 | wire aclk_gated; | |
326 | wire bclk_gated; | |
327 | wire scan_en_gated; | |
328 | ||
329 | wire ucb_scan_out; | |
330 | wire cmp_hdr_scan_out; | |
331 | wire io_hdr_scan_out; | |
332 | wire core_scan_out; | |
333 | wire aligned_rst_n_gated; | |
334 | ||
335 | wire [5:0] div2; | |
336 | wire [6:0] div4; | |
337 | wire ext_dr_clk; | |
338 | wire ext_cmp_clk; | |
339 | wire pll_arst_l; | |
340 | wire clamp_fltr; | |
341 | wire pll_clamp_fltr; | |
342 | wire char_in; | |
343 | ||
344 | wire dft_rst_a_l_ungated; | |
345 | wire pll_dtm; | |
346 | wire [1:0] dr_sel_a; | |
347 | ||
348 | wire csr_ucb_rst_n; | |
349 | wire ucb_rst_n; | |
350 | ||
351 | // FREEZE FEATURE BEGIN | |
352 | wire [4:0] io_cmp_shift_amt; | |
353 | wire dtm8_1; | |
354 | wire dtm11_1; | |
355 | wire dtm15_1; | |
356 | wire jtag_mt_mode; | |
357 | wire [1:0] pll_sel_a; | |
358 | // FREEZE FEATURE END | |
359 | ||
360 | // dtm1 dtm2 mio_dtm dbg1_dtm ccu_serdes_dtm | |
361 | // 0 0 0 0 0 | |
362 | // 1 0 1 1 1 | |
363 | // 0 1 0 0 1 | |
364 | // 1 1 1 1 1 | |
365 | ||
366 | ||
367 | ||
368 | // FREEZE FEATURE BEGIN | |
369 | // | |
370 | // 1. | |
371 | // phase info for io/cmp sync pulses (starting w/0) | |
372 | // ================================================ | |
373 | // mode ratio cmp-io io-cmp | |
374 | // FUNC 4:1 1 3 | |
375 | // DTM 8:1 4 7* | |
376 | // DTM 11:1 5 10* | |
377 | // DTM 15:1 7 14* | |
378 | // | |
379 | // * means change | |
380 | // | |
381 | // 2. | |
382 | // tcu_ccu_mux_sel == 00 functional mode | |
383 | // tcu_ccu_mux_sel == 01 clk stretch | |
384 | // tcu_ccu_mux_sel == 10 external clk mode | |
385 | // tcu_ccu_mux_sel == 11 debug event macro test | |
386 | // | |
387 | // ccu interferes w/mux_sel when dtm==1 | |
388 | // when dtm==1, in dr domain mux_sel is forced to 11. | |
389 | // when mux_sel == 11 in macro test mode, external clocks are | |
390 | // allowed to propagate, and pll mux_sel forced to 10 | |
391 | // (pll_testmode | atpg_mode) block off ext clks otherwise | |
392 | // on the pll, pll_dtm and pll_bypass now | |
393 | // needs to be OR'ed w/tcu_ccu_mux_sel[1] | |
394 | // | |
395 | // FREEZE FEATURE END | |
396 | ccu_core ccu_core ( | |
397 | .l1clk (l1clk), | |
398 | .rst_ccu_ (rst_ccu_), // sys_clk domain reset input | |
399 | .aligned (gclk_aligned), // (aligned), | |
400 | .pll_arst_l (pll_arst_l), // async pll reset input | |
401 | .pll_div3 (pll_div3), | |
402 | .pll_div2 (pll_div2), | |
403 | .pll_div4 (pll_div4), | |
404 | .pll_div4_msb (pll_div4_msb), | |
405 | .io2x_phase_180 (io2x_phase_180), | |
406 | .io_phase_0 (io_phase_0), | |
407 | .io_phase_180(io_phase_180), | |
408 | .ccu_sys_cmp_sync_en (ccu_sys_cmp_sync_en), | |
409 | .ccu_rst_sync_stable (ccu_rst_sync_stable), | |
410 | .ccu_cmp_sys_sync_en (ccu_cmp_sys_sync_en), | |
411 | .serdes_dtm1 (serdes_dtm1), | |
412 | .serdes_dtm2 (serdes_dtm2), | |
413 | .io_div (io_div), | |
414 | .io2x_div (io2x_div), | |
415 | .ratio (ratio), | |
416 | // .ccu_vco_aligned (ccu_vco_aligned), | |
417 | .pll_div3_lat (pll_div3_lat), | |
418 | .pll_div4_lat (pll_div4_lat), | |
419 | .csr_rst_n (csr_ucb_rst_n), // cmp domain reset for csr/ucb blocks | |
420 | .ccu_dbg1_serdes_dtm (ccu_dbg1_serdes_dtm), | |
421 | .ccu_mio_serdes_dtm (ccu_mio_serdes_dtm), | |
422 | .ccu_io2x_sync_en (ccu_io2x_sync_en), | |
423 | .ccu_pre_dr_sync_en (ccu_pre_dr_sync_en), // new input | |
424 | .ccu_dr_sync_en (ccu_dr_sync_en), // changed to output | |
425 | .tcu_atpg_mode(tcu_atpg_mode), | |
426 | .scan_in (ucb_scan_out), | |
427 | .aclk (aclk_gated), | |
428 | .bclk (bclk_gated), | |
429 | .scan_out (core_scan_out), | |
430 | .rng_arst_l (rng_arst_l), | |
431 | .ccu_serdes_dtm_lat (ccu_serdes_dtm), | |
432 | .rng_ctl1 (rng_ctl1), | |
433 | .rng_ctl2 (rng_ctl2), | |
434 | .rng_ctl3 (rng_ctl3), | |
435 | .rng_ch_sel (rng_ch_sel), | |
436 | .ccu_cmp_io_sync_en (ccu_cmp_io_sync_en), | |
437 | .ccu_io_cmp_sync_en (ccu_io_cmp_sync_en), | |
438 | .aligned_rst_n (aligned_rst_n), | |
439 | .shift_amt (shift_amt), | |
440 | .dr_shift_amt (dr_shift_amt) | |
441 | ); | |
442 | ||
443 | ||
444 | ||
445 | /////////////////////////////////////////////////////////// | |
446 | // ** CMP PLL CLK DOMAIN ** | |
447 | /////////////////////////////////////////////////////////// | |
448 | ||
449 | ccu_hm_top ccu_hm_wrapper ( | |
450 | .ref_clk (ref_clk), | |
451 | .cmp_pll_clk_l (cmp_pll_clk_l), | |
452 | .shift_amt (shift_amt), | |
453 | .dr_shift_amt (dr_shift_amt), | |
454 | .rst_n (rst_ccu_), // arst_msff non-scan flops | |
455 | .rst_out_n (dft_rst_a_l_ungated), // frac. divider reset out | |
456 | .div_msb (pll_div4_msb), | |
457 | .pulse_out (ccu_vco_aligned) | |
458 | ); | |
459 | ||
460 | ||
461 | /////////////////////////////////////////////////////////// | |
462 | // ** L2 CLK DOMAIN ** | |
463 | /////////////////////////////////////////////////////////// | |
464 | ||
465 | // *********************************************** | |
466 | // generate sync pulse for cmp<->dr | |
467 | // *********************************************** | |
468 | ccu_cmp_dr_sync cmp_dr_sync ( | |
469 | .align_shift (align_shift), | |
470 | .align (gclk_aligned), | |
471 | .ccu_serdes_dtm (ccu_serdes_dtm), | |
472 | .clk (l1clk), | |
473 | .ratio (ratio), | |
474 | .pulse (ccu_pre_dr_sync_en), | |
475 | .rst_n (aligned_rst_n) // syncrst_msff scan flops | |
476 | ); | |
477 | ||
478 | // *********************************************** | |
479 | // generate io phase signal from vco clk | |
480 | // *********************************************** | |
481 | ccu_divider gen_io_phase ( | |
482 | .rst_n (aligned_rst_n_gated), // arst_msff scan flops | |
483 | .div (io_div), | |
484 | .clkin (l1clk), | |
485 | .clkout (ccu_io_out), | |
486 | .phase_180 (io_phase_180) | |
487 | ); | |
488 | ||
489 | // *********************************************** | |
490 | // generate io2x phase signal from vco clk | |
491 | // *********************************************** | |
492 | ccu_divider gen_io2x_phase ( | |
493 | .rst_n (aligned_rst_n_gated), // arst_msff scan flops | |
494 | .div (io2x_div), | |
495 | .clkin (l1clk), | |
496 | .clkout (ccu_io2x_out), | |
497 | .phase_180 (io2x_phase_180) | |
498 | ); | |
499 | ||
500 | ||
501 | // *********************************************** | |
502 | // generate sync pulses for cmp<->io | |
503 | // *********************************************** | |
504 | // FREEZE FEATURE BEGIN | |
505 | assign dtm8_1 = (ccu_serdes_dtm && (ratio == 5'h07)); | |
506 | assign dtm11_1 = (ccu_serdes_dtm && (ratio == 5'h0A)); | |
507 | assign dtm15_1 = (ccu_serdes_dtm && (ratio == 5'h0E)); | |
508 | assign io_cmp_shift_amt = dtm8_1 ? 5'd07 : | |
509 | dtm11_1 ? 5'd03 : | |
510 | dtm15_1 ? 5'd09 : | |
511 | 5'd01 ; | |
512 | ||
513 | ccu_pulse_shift io_cmp_sp_shift ( | |
514 | .rst_n (aligned_rst_n_gated), // arst_msff scan flops | |
515 | .clk (l1clk), | |
516 | // .shift (5'h01), | |
517 | .shift (io_cmp_shift_amt), // now depends on func/dtm | |
518 | .pulse_in (io_phase_180), | |
519 | .pulse_out (io_phase_0) | |
520 | ); | |
521 | // FREEZE FEATURE END | |
522 | ||
523 | ||
524 | ||
525 | // *********************************************** | |
526 | // pll signal gating/muxing | |
527 | // *********************************************** | |
528 | ||
529 | assign jtag_mt_mode = &tcu_ccu_mux_sel; // both high | |
530 | assign ext_dr_clk = (mio_pll_testmode | tcu_atpg_mode | jtag_mt_mode) & tcu_ccu_ext_dr_clk; | |
531 | assign ext_cmp_clk = (mio_pll_testmode | tcu_atpg_mode | jtag_mt_mode) & tcu_ccu_ext_cmp_clk; | |
532 | assign div2 = mio_pll_testmode ? mio_ccu_pll_div2 : pll_div2; | |
533 | assign div4 = mio_pll_testmode ? mio_ccu_pll_div4 : pll_div4_lat; | |
534 | assign pll_arst_l = (tcu_atpg_mode | jtag_mt_mode) ? 1'b0 : | |
535 | mio_pll_testmode ? mio_ccu_pll_trst_l : | |
536 | rst_ccu_pll_; | |
537 | ||
538 | assign clamp_fltr = mio_pll_testmode ? mio_ccu_pll_clamp_fltr : pll_clamp_fltr; | |
539 | assign char_in = (mio_pll_testmode & mio_ccu_pll_char_in) | pll_char_in; | |
540 | assign dft_rst_a_l = ~(tcu_atpg_mode | jtag_mt_mode) & dft_rst_a_l_ungated; | |
541 | // FREEZE FEATURE BEGIN | |
542 | // assign pll_bypass = tcu_atpg_mode; // ccu_serdes_dtm ? ccu_serdes_dtm : tcu_ccu_mux_sel[1] ; | |
543 | // assign pll_dtm = tcu_atpg_mode | ccu_serdes_dtm; | |
544 | assign pll_bypass = tcu_atpg_mode | tcu_ccu_mux_sel[1] ; | |
545 | assign pll_dtm = tcu_atpg_mode | ccu_serdes_dtm | tcu_ccu_mux_sel[1]; | |
546 | // FREEZE FEATURE END | |
547 | ||
548 | // atpg_mode has highest priority just in case any of the | |
549 | // other controls are state based | |
550 | assign dr_sel_a = tcu_atpg_mode ? tcu_ccu_mux_sel : | |
551 | jtag_mt_mode ? 2'b10 : | |
552 | ccu_serdes_dtm ? 2'b11 : | |
553 | tcu_ccu_mux_sel; | |
554 | ||
555 | assign pll_sel_a = tcu_atpg_mode ? tcu_ccu_mux_sel : | |
556 | jtag_mt_mode ? 2'b10 : | |
557 | tcu_ccu_mux_sel; | |
558 | ||
559 | ||
560 | // *********************************************** | |
561 | // pll instantiation | |
562 | // *********************************************** | |
563 | n2_core_pll_cust ccu_pll ( | |
564 | .pll_testmode ( mio_pll_testmode ), | |
565 | .dft_rst_a_l ( dft_rst_a_l ), | |
566 | .dr_ext_clk ( ext_dr_clk ), // bypass clk (tcu) | |
567 | .dr_sdel ( st_delay_dr ), // stretch amnt (csr) | |
568 | .dr_sel_a ( dr_sel_a ), // mux sel (tcu) or set by dtm or macro test | |
569 | .dr_stretch_a ( st_phase_hi ), // stretch hi/lo ph (csr) | |
570 | .l2clk ( cmp_pll_clk ), | |
571 | .pll_arst_l ( pll_arst_l ), // (rst) | |
572 | .pll_bypass ( pll_bypass ), | |
573 | .pll_char_in ( char_in ), // (csr | mio) | |
574 | .pll_clamp_fltr ( clamp_fltr ), // (csr | mio) | |
575 | .pll_div1 ( pll_div1 ), // (csr) | |
576 | .pll_div2 ( div2 ), // (csr | mio) | |
577 | .pll_div3 ( pll_div3_lat ), // (csr) | |
578 | .pll_div4 ( div4 ), // (csr | mio) | |
579 | .ccu_serdes_dtm ( pll_dtm ), // ccu_serdes_dtm | |
580 | .pll_ext_clk ( ext_cmp_clk ), // bypass clk (tcu) | |
581 | .pll_sys_clk ({pll_sys_clk_n,pll_sys_clk_p}), // 0->p, 1->n | |
582 | .pll_sdel ( st_delay_cmp ), // stretch amnt (csr) | |
583 | .pll_sel_a ( pll_sel_a ), // mux sel (tcu) or set by macro test | |
584 | .pll_stretch_a ( st_phase_hi ), // stretch hi/lo ph (csr) | |
585 | .sel_l2clk_fbk ( 1'b0 ), // permanently deselect fdbk | |
586 | .vdd_hv15 ( pll_vdd), // (bump) | |
587 | .vreg_selbg_l ( mio_ccu_vreg_selbg_l ), // (mio) | |
588 | .ccu_rst_ref_buf2 ( ref_clk ), | |
589 | .ccu_rst_sys_clk ( ccu_rst_sys_clk ), | |
590 | .dr_clk_out ( dr_pll_clk ), | |
591 | .dr_clk_out_l ( dr_pll_clk_l ), | |
592 | .pll_char_out ( ccu_mio_pll_char_out ), // to mio - not modeled | |
593 | .pll_clk_out ( cmp_pll_clk ), | |
594 | .pll_clk_out_l ( cmp_pll_clk_l ) | |
595 | ); | |
596 | ||
597 | ||
598 | ||
599 | // *********************************************** | |
600 | // clkgen - cmp | |
601 | // *********************************************** | |
602 | clkgen_ccu_cmp clkgen_cmp ( | |
603 | .l2clk(l2clk), | |
604 | .aclk_wmr(), | |
605 | .ccu_serdes_dtm(1'b0), | |
606 | .aclk(aclk), | |
607 | .bclk(bclk), | |
608 | .scan_out(cmp_hdr_scan_out), | |
609 | .pce_ov(), | |
610 | .wmr_protect(wmr_protect), | |
611 | .wmr_(), | |
612 | .por_(), | |
613 | .cmp_slow_sync_en(), | |
614 | .slow_cmp_sync_en(), | |
615 | .tcu_clk_stop(1'b0), | |
616 | .tcu_pce_ov(1'b0), | |
617 | .rst_wmr_protect(rst_wmr_protect), | |
618 | .rst_wmr_(1'b0), | |
619 | .rst_por_(1'b0), | |
620 | .ccu_cmp_slow_sync_en(1'b0), | |
621 | .ccu_slow_cmp_sync_en(1'b0), | |
622 | .tcu_div_bypass(1'b0), | |
623 | .ccu_div_ph(1'b1), | |
624 | .cluster_div_en(1'b0), | |
625 | .gclk(gclk), | |
626 | .clk_ext(1'b0), | |
627 | .tcu_aclk(tcu_aclk), | |
628 | .tcu_bclk(tcu_bclk), | |
629 | .scan_en(scan_en_gated), | |
630 | .scan_in(scan_in), | |
631 | .tcu_atpg_mode(tcu_atpg_mode), | |
632 | .tcu_wr_inhibit(1'b0), | |
633 | .array_wr_inhibit(), | |
634 | .cluster_arst_l (1'b1) | |
635 | ); | |
636 | ||
637 | ||
638 | // *********************************************** | |
639 | // clkgen - io | |
640 | // *********************************************** | |
641 | clkgen_ccu_io clkgen_io ( | |
642 | .l2clk(iol2clk), | |
643 | .aclk_wmr(), | |
644 | .ccu_serdes_dtm(ccu_serdes_dtm), | |
645 | .aclk(), | |
646 | .bclk(), | |
647 | .scan_out (io_hdr_scan_out), | |
648 | .pce_ov(), | |
649 | .wmr_protect(), | |
650 | .wmr_(), | |
651 | .por_(), | |
652 | .cmp_slow_sync_en(), | |
653 | .slow_cmp_sync_en(), | |
654 | .tcu_clk_stop(1'b0), | |
655 | .tcu_pce_ov(1'b0), | |
656 | .rst_wmr_protect(1'b0), | |
657 | .rst_wmr_(1'b0), | |
658 | .rst_por_(1'b0), | |
659 | .ccu_cmp_slow_sync_en(1'b0), | |
660 | .ccu_slow_cmp_sync_en(1'b0), | |
661 | .tcu_div_bypass(tcu_atpg_mode), | |
662 | .ccu_div_ph(gl_ccu_io_out), | |
663 | .cluster_div_en(1'b1), | |
664 | .gclk(gclk), | |
665 | .clk_ext(1'b0), | |
666 | .tcu_aclk(aclk_gated), | |
667 | .tcu_bclk(bclk_gated), | |
668 | .scan_en(scan_en_gated), | |
669 | .scan_in(scan_in), | |
670 | .tcu_atpg_mode(tcu_atpg_mode), | |
671 | .tcu_wr_inhibit(1'b0), | |
672 | .array_wr_inhibit(), | |
673 | .cluster_arst_l (1'b1) | |
674 | ); | |
675 | ||
676 | ||
677 | /////////////////////////////////////////////////////////// | |
678 | // ** IOL2 CLK DOMAIN ** | |
679 | /////////////////////////////////////////////////////////// | |
680 | ||
681 | // *********************************************** | |
682 | // io domain reset generation | |
683 | // *********************************************** | |
684 | ccu_io_rstgen io_rstgen_blk ( | |
685 | .iol2clk( iol2clk ), | |
686 | .csr_ucb_rst_n( csr_ucb_rst_n ), | |
687 | .tcu_atpg_mode( tcu_atpg_mode ), | |
688 | .csr_rst_n( csr_rst_n ), | |
689 | .ucb_rst_n( ucb_rst_n ) | |
690 | ); | |
691 | ||
692 | ||
693 | // *********************************************** | |
694 | // csr block instantiation | |
695 | // *********************************************** | |
696 | ccu_csr csr_blk ( | |
697 | // ucb connectivity | |
698 | .io_clk(iol2clk), | |
699 | .wr_req_vld (ucb_wr_req_vld), | |
700 | .addr_in(ucb_addr_in), | |
701 | .data_in(ucb_data_in), | |
702 | .req_accepted(ucb_req_acpted), | |
703 | .rd_req_vld(ucb_rd_req_vld), | |
704 | .thr_id_in (ucb_thr_id_in), | |
705 | .buf_id_in (ucb_buf_id_in), | |
706 | .rack_busy(ucb_ack_busy), | |
707 | .data_out(ucb_data_out), | |
708 | .thr_id_out(ucb_thr_id_out), | |
709 | .buf_id_out(ucb_buf_id_out), | |
710 | .rd_ack_vld(ucb_rd_ack_vld), | |
711 | .rd_nack_vld(ucb_rd_nack_vld), | |
712 | .int_busy(), | |
713 | .dev_id (), | |
714 | .int_vld (), | |
715 | // other connectivity | |
716 | .rst_n (csr_rst_n), // arst_msff scan flops | |
717 | .wmr_protect (wmr_protect), | |
718 | .rng_data_in (rng_data), | |
719 | .pll_div1 (pll_div1), | |
720 | .pll_div2 (pll_div2), | |
721 | .pll_div3 (pll_div3), | |
722 | .pll_div4 (pll_div4), | |
723 | .st_phase_hi ( st_phase_hi ), | |
724 | .st_delay_dr ( st_delay_dr ), | |
725 | .st_delay_cmp ( st_delay_cmp ), | |
726 | .serdes_dtm1 (serdes_dtm1), | |
727 | .serdes_dtm2 (serdes_dtm2), | |
728 | .change ( ccu_rst_change ), | |
729 | .align_shift ( align_shift ), | |
730 | .pll_char_in ( pll_char_in ), | |
731 | .pll_clamp_fltr ( pll_clamp_fltr ), | |
732 | // rng | |
733 | .rng_ctl1 (rng_ctl1), | |
734 | .rng_ctl2 (rng_ctl2), | |
735 | .rng_ctl3 (rng_ctl3), | |
736 | .rng_bypass (rng_bypass), | |
737 | .rng_vcoctrl_sel (rng_vcoctrl_sel), | |
738 | .rng_anlg_sel (rng_anlg_sel) | |
739 | ); | |
740 | ||
741 | // *********************************************** | |
742 | // scan gating and muxing | |
743 | // *********************************************** | |
744 | ||
745 | assign aclk_gated = tcu_atpg_mode & aclk; | |
746 | assign bclk_gated = tcu_atpg_mode & bclk; | |
747 | assign scan_en_gated = tcu_atpg_mode & tcu_scan_en; | |
748 | assign aligned_rst_n_gated = tcu_atpg_mode | aligned_rst_n; | |
749 | assign scan_out = tcu_atpg_mode?core_scan_out:scan_in; | |
750 | ||
751 | // *********************************************** | |
752 | // ucb flow ctl instantiation | |
753 | // *********************************************** | |
754 | ||
755 | ||
756 | // the following requires sunv to plain verilog conversion | |
757 | ccu_ucbflow_ctl ucb ( | |
758 | // Outputs | |
759 | .scan_out (ucb_scan_out), | |
760 | .ccu_ncu_stall (ccu_ncu_stall), | |
761 | .ccu_ncu_vld (ccu_ncu_vld), | |
762 | .ccu_ncu_data (ccu_ncu_data), | |
763 | .rd_req_vld (ucb_rd_req_vld), | |
764 | .wr_req_vld (ucb_wr_req_vld), | |
765 | .thr_id_in (ucb_thr_id_in), | |
766 | .buf_id_in (ucb_buf_id_in), | |
767 | .addr_in (ucb_addr_in), | |
768 | .data_in (ucb_data_in), | |
769 | .ack_busy (ucb_ack_busy), | |
770 | // Inputs | |
771 | .rst_n (ucb_rst_n), // syncrst_msff scan flops | |
772 | .iol2clk (iol2clk), | |
773 | .scan_in (io_hdr_scan_out), | |
774 | .tcu_pce_ov (1'b1), | |
775 | .tcu_clk_stop (1'b0), | |
776 | .tcu_aclk (aclk_gated), | |
777 | .tcu_bclk (bclk_gated), | |
778 | .tcu_scan_en (scan_en_gated), | |
779 | .ncu_ccu_vld (ncu_ccu_vld), | |
780 | .ncu_ccu_data (ncu_ccu_data), | |
781 | .ncu_ccu_stall (ncu_ccu_stall), | |
782 | .req_acpted (ucb_req_acpted), | |
783 | .rd_ack_vld (ucb_rd_ack_vld), | |
784 | .rd_nack_vld (ucb_rd_nack_vld), | |
785 | .thr_id_out (ucb_thr_id_out), | |
786 | .buf_id_out (ucb_buf_id_out), | |
787 | .data_out (ucb_data_out) | |
788 | ); | |
789 | ||
790 | ||
791 | ||
792 | // *********************************************************** | |
793 | // L1 header - l2 clk | |
794 | // *********************************************************** | |
795 | // | |
796 | cl_a1_l1hdr_8x header_l2clk ( | |
797 | .l2clk(l2clk), | |
798 | .l1clk(l1clk), | |
799 | .pce(1'b1), | |
800 | .se(1'b0), | |
801 | .pce_ov(1'b1), | |
802 | .stop(1'b0) | |
803 | ); | |
804 | ||
805 | endmodule | |
806 |