Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / ccu / rtl / ccu.v
CommitLineData
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
37module 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
115input gclk;
116output dr_pll_clk;
117output cmp_pll_clk ;
118output ccu_vco_aligned;
119input gclk_aligned;
120input gl_ccu_io_out;
121// CCU-NCU Interface,
122output ccu_ncu_stall;
123input ncu_ccu_vld;
124input [3:0] ncu_ccu_data;
125input ncu_ccu_stall;
126output ccu_ncu_vld;
127output [3:0] ccu_ncu_data;
128// PLL-Bump Interface,
129input pll_sys_clk_p;
130input pll_sys_clk_n;
131input pll_vdd;
132// CCU-RNG Interface,
133output rng_arst_l;
134input rng_data;
135output rng_bypass;
136output [1:0] rng_vcoctrl_sel;
137output [1:0] rng_ch_sel;
138output [1:0] rng_anlg_sel;
139// SCAN Related;
140input tcu_atpg_mode;
141input scan_in;
142input tcu_scan_en;
143input tcu_aclk;
144input tcu_bclk;
145output scan_out;
146// Global Outputs,
147output ccu_serdes_dtm;
148output ccu_cmp_io_sync_en;
149output ccu_io_cmp_sync_en;
150output ccu_io2x_sync_en;
151output ccu_dr_sync_en;
152output ccu_io2x_out;
153output ccu_io_out;
154// CCU-MIO Interface;
155output [1:0] ccu_mio_pll_char_out;
156output ccu_mio_serdes_dtm;
157output ccu_dbg1_serdes_dtm;
158input mio_pll_testmode;
159input mio_ccu_vreg_selbg_l;
160input mio_ccu_pll_clamp_fltr;
161input [5:0] mio_ccu_pll_div2;
162input [6:0] mio_ccu_pll_div4;
163input mio_ccu_pll_trst_l;
164input mio_ccu_pll_char_in;
165// CCU-TCU Interface,
166input gl_ccu_io_clk_stop;
167input gl_ccu_clk_stop;
168input tcu_pce_ov;
169input [1:0] tcu_ccu_mux_sel;
170input tcu_ccu_ext_cmp_clk;
171input tcu_ccu_ext_dr_clk ;
172input tcu_ccu_clk_stretch; // TBD
173// CCU-RST Interface,
174input rst_ccu_pll_;
175input rst_ccu_;
176input rst_wmr_protect;
177output ccu_rst_change;
178output ccu_rst_sys_clk;
179output ccu_sys_cmp_sync_en;
180output ccu_cmp_sys_sync_en;
181output ccu_rst_sync_stable;
182input cluster_arst_l;
183
184
185// ------------------------------------
186// EXTERNAL WIRE/REG DECLARATIONS
187// ------------------------------------
188
189// GCLK Ports
190wire gclk;
191wire dr_pll_clk;
192wire cmp_pll_clk ;
193wire ccu_vco_aligned;
194wire gclk_aligned;
195wire gl_ccu_io_out;
196// CCU-NCU Interface,
197wire ccu_ncu_stall;
198wire ncu_ccu_vld;
199wire [3:0] ncu_ccu_data;
200wire ncu_ccu_stall;
201wire ccu_ncu_vld;
202wire [3:0] ccu_ncu_data;
203// PLL-Bump Interface,
204wire pll_sys_clk_p;
205wire pll_sys_clk_n;
206wire pll_vdd;
207// CCU-RNG Interface,
208wire rng_arst_l;
209wire rng_data;
210wire rng_bypass;
211wire [1:0] rng_vcoctrl_sel;
212wire [1:0] rng_ch_sel;
213wire [1:0] rng_anlg_sel;
214// SCAN Related;
215wire tcu_atpg_mode;
216wire scan_in;
217wire tcu_scan_en;
218wire tcu_aclk;
219wire tcu_bclk;
220wire scan_out;
221// Global Outputs,
222wire ccu_serdes_dtm;
223wire ccu_cmp_io_sync_en;
224wire ccu_io_cmp_sync_en;
225wire ccu_io2x_sync_en;
226wire ccu_dr_sync_en;
227wire ccu_io2x_out;
228wire ccu_io_out;
229// CCU-MIO Interface;
230wire [1:0] ccu_mio_pll_char_out;
231wire ccu_mio_serdes_dtm;
232wire ccu_dbg1_serdes_dtm;
233wire mio_pll_testmode;
234wire mio_ccu_vreg_selbg_l;
235wire mio_ccu_pll_clamp_fltr;
236wire [5:0] mio_ccu_pll_div2;
237wire [6:0] mio_ccu_pll_div4;
238wire mio_ccu_pll_trst_l;
239wire mio_ccu_pll_char_in;
240// CCU-TCU Interface,
241wire tcu_pce_ov;
242wire [1:0] tcu_ccu_mux_sel;
243wire tcu_ccu_ext_cmp_clk;
244wire tcu_ccu_ext_dr_clk ;
245wire tcu_ccu_clk_stretch; // TBD
246// CCU-RST Interface,
247wire rst_ccu_pll_;
248wire rst_ccu_;
249wire rst_wmr_protect;
250wire ccu_rst_change;
251wire ccu_rst_sys_clk;
252wire ccu_sys_cmp_sync_en;
253wire ccu_cmp_sys_sync_en;
254wire ccu_rst_sync_stable;
255wire cluster_arst_l;
256
257// ***********************************************
258// wires for pll
259// ***********************************************
260
261wire dft_rst_a_l;
262wire pll_bypass;
263wire pll_char_in;
264wire [5:0] pll_div1;
265wire [5:0] pll_div2;
266wire [5:0] pll_div3;
267wire [6:0] pll_div4;
268wire [5:0] pll_div3_lat;
269wire [6:0] pll_div4_lat;
270wire vdd_hv15;
271wire vreg_selbg_l;
272wire [1:0] pll_char_out;
273wire dr_pll_clk_l;
274
275// ------------------------------------
276// INTERNAL WIRE/REG DECLARATIONS
277// ------------------------------------
278
279wire [1:0] align_shift;
280wire [4:0] shift_amt;
281wire [4:0] dr_shift_amt;
282
283
284wire l2clk;
285wire iol2clk;
286wire ref_clk;
287wire aligned;
288wire io_phase_180;
289wire io2x_phase_180;
290wire [4:0] ratio;
291
292wire aligned_rst_n;
293
294wire ucb_rd_req_vld;
295wire ucb_wr_req_vld;
296wire ucb_ack_busy;
297wire ucb_req_acpted;
298wire ucb_rd_ack_vld;
299wire ucb_rd_nack_vld;
300wire [5:0] ucb_thr_id_in;
301wire [1:0] ucb_buf_id_in;
302wire [5:0] ucb_thr_id_out;
303wire [1:0] ucb_buf_id_out;
304wire [63:0] ucb_data_in;
305wire [63:0] ucb_data_out;
306wire [39:0] ucb_addr_in;
307
308wire wmr_protect;
309
310wire csr_rst_n;
311
312wire st_phase_hi;
313wire [1:0] st_delay_dr;
314wire [1:0] st_delay_cmp;
315
316wire serdes_dtm1;
317wire serdes_dtm2;
318
319wire [4:0] io_div;
320wire [4:0] io2x_div;
321
322wire io_phase_0;
323wire l1clk;
324
325wire aclk_gated;
326wire bclk_gated;
327wire scan_en_gated;
328
329wire ucb_scan_out;
330wire cmp_hdr_scan_out;
331wire io_hdr_scan_out;
332wire core_scan_out;
333wire aligned_rst_n_gated;
334
335wire [5:0] div2;
336wire [6:0] div4;
337wire ext_dr_clk;
338wire ext_cmp_clk;
339wire pll_arst_l;
340wire clamp_fltr;
341wire pll_clamp_fltr;
342wire char_in;
343
344wire dft_rst_a_l_ungated;
345wire pll_dtm;
346wire [1:0] dr_sel_a;
347
348wire csr_ucb_rst_n;
349wire ucb_rst_n;
350
351// FREEZE FEATURE BEGIN
352wire [4:0] io_cmp_shift_amt;
353wire dtm8_1;
354wire dtm11_1;
355wire dtm15_1;
356wire jtag_mt_mode;
357wire [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
396ccu_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
449ccu_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// ***********************************************
468ccu_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// ***********************************************
481ccu_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// ***********************************************
492ccu_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
505assign dtm8_1 = (ccu_serdes_dtm && (ratio == 5'h07));
506assign dtm11_1 = (ccu_serdes_dtm && (ratio == 5'h0A));
507assign dtm15_1 = (ccu_serdes_dtm && (ratio == 5'h0E));
508assign io_cmp_shift_amt = dtm8_1 ? 5'd07 :
509 dtm11_1 ? 5'd03 :
510 dtm15_1 ? 5'd09 :
511 5'd01 ;
512
513ccu_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
529assign jtag_mt_mode = &tcu_ccu_mux_sel; // both high
530assign ext_dr_clk = (mio_pll_testmode | tcu_atpg_mode | jtag_mt_mode) & tcu_ccu_ext_dr_clk;
531assign ext_cmp_clk = (mio_pll_testmode | tcu_atpg_mode | jtag_mt_mode) & tcu_ccu_ext_cmp_clk;
532assign div2 = mio_pll_testmode ? mio_ccu_pll_div2 : pll_div2;
533assign div4 = mio_pll_testmode ? mio_ccu_pll_div4 : pll_div4_lat;
534assign 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
538assign clamp_fltr = mio_pll_testmode ? mio_ccu_pll_clamp_fltr : pll_clamp_fltr;
539assign char_in = (mio_pll_testmode & mio_ccu_pll_char_in) | pll_char_in;
540assign 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;
544assign pll_bypass = tcu_atpg_mode | tcu_ccu_mux_sel[1] ;
545assign 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
550assign 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
555assign 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// ***********************************************
563n2_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// ***********************************************
602clkgen_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// ***********************************************
641clkgen_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// ***********************************************
684ccu_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// ***********************************************
696ccu_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
745assign aclk_gated = tcu_atpg_mode & aclk;
746assign bclk_gated = tcu_atpg_mode & bclk;
747assign scan_en_gated = tcu_atpg_mode & tcu_scan_en;
748assign aligned_rst_n_gated = tcu_atpg_mode | aligned_rst_n;
749assign 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
757ccu_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//
796cl_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
805endmodule
806