Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / spc / pmu / rtl / pmu_pct_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: pmu_pct_ctl.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 ============================================
35module pmu_pct_ctl (
36 l2clk,
37 scan_in,
38 tcu_pce_ov,
39 spc_aclk,
40 spc_bclk,
41 tcu_scan_en,
42 scan_out,
43 lsu_asi_clken,
44 lsu_pmu_pmen,
45 dec_pmu_instr0_type_d,
46 dec_pmu_instr1_type_d,
47 dec_br_taken_e,
48 lsu_pmu_mem_type_b,
49 dec_lsu_sel0_d,
50 mmu_pmu_l2ret,
51 mmu_pmu_l2miss,
52 mmu_pmu_dtlb,
53 mmu_pmu_tid,
54 l15_pmu_xbar_optype,
55 spu_pmu_cwq_busy,
56 spu_pmu_cwq_tid,
57 spu_pmu_ma_busy,
58 tlu_pmu_pstate_priv,
59 tlu_pmu_hpstate_hpriv,
60 tlu_pmu_trap_taken,
61 tlu_pmu_trap_mask_e,
62 tlu_flush_pmu_b,
63 tlu_flush_pmu_w,
64 dec_valid_e,
65 dec_flush_m,
66 dec_flush_b,
67 pdp_pich_cout07,
68 pdp_picl_cout07,
69 pdp_pich_wrap,
70 pdp_picl_wrap,
71 in_rngl_cdbus_ctl_ndata,
72 pdp_asi_ctlin_to_pctl_15_8,
73 pdp_asi_ctlin_to_pctl_4_0,
74 pdp_asi_din_to_pctl,
75 pmu_tlu_trap_m,
76 pmu_tlu_debug_event,
77 pct_pich07_add_w2,
78 pct_picl07_add_w2,
79 pmu_lsu_dcmiss_trap_m,
80 pmu_lsu_dtmiss_trap_m,
81 pmu_lsu_l2dmiss_trap_m,
82 pct_rd_pic,
83 pct_rd_a_pic,
84 pct_rd_pic_pcr,
85 pct_bypass_asi,
86 pct_pcr_data,
87 pct_rngl_cdbus_ctl_ndata,
88 pct_exception,
89 pct_wr_pic_w2,
90 pct_incr_pic_w1,
91 pct_incr_asi_w1,
92 pct_pic_clken,
93 pct_pic07_w2_clken,
94 pmu_asi_clken);
95wire pce_ov;
96wire stop;
97wire siclk;
98wire soclk;
99wire se;
100wire l1clk;
101wire pwrm_scanin;
102wire pwrm_scanout;
103wire pmu_pmen;
104wire pmu_busy;
105wire skip_wakeup_in;
106wire pmu_pmen_del_1;
107wire pmu_busy_del_1;
108wire skip_wakeup;
109wire [31:0] pcr7_dout;
110wire [31:0] pcr6_dout;
111wire [31:0] pcr5_dout;
112wire [31:0] pcr4_dout;
113wire [31:0] pcr3_dout;
114wire [31:0] pcr2_dout;
115wire [31:0] pcr1_dout;
116wire [31:0] pcr0_dout;
117wire wakeup;
118wire p_wr;
119wire [7:0] atid;
120wire [7:0] pic_std_w2;
121wire sleep;
122wire sleep_cnt_scanin;
123wire sleep_cnt_scanout;
124wire [3:0] sleep_cntr_din;
125wire [3:0] sleep_cntr;
126wire wait_for_sleep;
127wire l1b;
128wire l1clk_pm1;
129wire ov_busy;
130wire [7:0] wr_pcr;
131wire [7:0] rd_pcr;
132wire l1clk_pm2;
133wire hpstate_scanin;
134wire hpstate_scanout;
135wire [7:0] hpriv;
136wire [7:0] priv;
137wire [5:0] mmu_mtyp;
138wire events_scanin;
139wire events_scanout;
140wire rc4;
141wire hash;
142wire des;
143wire crc;
144wire aes;
145wire [3:0] ma;
146wire [12:0] tg0_e;
147wire [12:0] tg1_e;
148wire [1:0] dec_br_taken_m;
149wire [5:0] mm_mtyp;
150wire [5:0] mem_typ_w;
151wire [6:0] xbar;
152wire [2:0] spu_tid;
153wire rc4_d1;
154wire hash_d1;
155wire des_d1;
156wire crc_d1;
157wire aes_d1;
158wire ma_3_d1;
159wire dec_lsu_sel0_e;
160wire [11:0] tg0_ityp_e;
161wire [11:0] tg1_ityp_e;
162wire [2:0] lsu_tid_e;
163wire lsutid_scanin;
164wire lsutid_scanout;
165wire [2:0] lsu_tid_m;
166wire [2:0] lsu_tid_b;
167wire [2:0] lsu_tid_w;
168wire all_idle_e;
169wire [7:0] th;
170wire [7:0] cwq_tid;
171wire [7:0] desb;
172wire [7:0] aesb;
173wire [7:0] rc4b;
174wire [7:0] hashb;
175wire [7:0] crcb;
176wire [7:0] ma_tid;
177wire [7:0] mab;
178wire [7:0] dcm;
179wire [7:0] dtm;
180wire [7:0] l2m;
181wire [7:0] ov1;
182wire [7:0] set_ovh_spec;
183wire [7:0] ov0;
184wire [7:0] set_ovl_spec;
185wire [7:0] ht_in;
186wire [29:0] pcr0_din;
187wire [7:0] disable_h;
188wire [7:0] disable_l;
189wire l1clk_pm3;
190wire pcr0_scanin;
191wire pcr0_scanout;
192wire bit63;
193wire bit62;
194wire [1:0] x0;
195wire pcr0_ov_scanin;
196wire pcr0_ov_scanout;
197wire [29:0] pcr1_din;
198wire pcr1_scanin;
199wire pcr1_scanout;
200wire [1:0] x1;
201wire pcr1_ov_scanin;
202wire pcr1_ov_scanout;
203wire [29:0] pcr2_din;
204wire pcr2_scanin;
205wire pcr2_scanout;
206wire [1:0] x2;
207wire pcr2_ov_scanin;
208wire pcr2_ov_scanout;
209wire [29:0] pcr3_din;
210wire pcr3_scanin;
211wire pcr3_scanout;
212wire [1:0] x3;
213wire pcr3_ov_scanin;
214wire pcr3_ov_scanout;
215wire [29:0] pcr4_din;
216wire pcr4_scanin;
217wire pcr4_scanout;
218wire [1:0] x4;
219wire pcr4_ov_scanin;
220wire pcr4_ov_scanout;
221wire [29:0] pcr5_din;
222wire pcr5_scanin;
223wire pcr5_scanout;
224wire [1:0] x5;
225wire pcr5_ov_scanin;
226wire pcr5_ov_scanout;
227wire [29:0] pcr6_din;
228wire pcr6_scanin;
229wire pcr6_scanout;
230wire [1:0] x6;
231wire pcr6_ov_scanin;
232wire pcr6_ov_scanout;
233wire [29:0] pcr7_din;
234wire pcr7_scanin;
235wire pcr7_scanout;
236wire [1:0] x7;
237wire pcr7_ov_scanin;
238wire pcr7_ov_scanout;
239wire pcr_ov_del_scanin;
240wire pcr_ov_del_scanout;
241wire [1:0] x7_1;
242wire [1:0] x6_1;
243wire [1:0] x5_1;
244wire [1:0] x4_1;
245wire [1:0] x3_1;
246wire [1:0] x2_1;
247wire [1:0] x1_1;
248wire [1:0] x0_1;
249wire [7:0] p_cnt_en;
250wire [7:0] ph_all_idle;
251wire [7:0] ph_ig;
252wire [7:0] ph_cg;
253wire [7:0] ph_mm;
254wire [7:0] ph_xb;
255wire [7:0] ph_so;
256wire [7:0] ph_sb;
257wire [7:0] pl_all_idle;
258wire [7:0] pl_ig;
259wire [7:0] pl_cg;
260wire [7:0] pl_mm;
261wire [7:0] pl_xb;
262wire [7:0] pl_so;
263wire [7:0] pl_sb;
264wire [7:0] dcm_h;
265wire [7:0] dcm_l;
266wire [7:0] pmu_lsu_dcmiss_trap_e;
267wire [7:0] pich_wrap;
268wire [7:0] picl_wrap;
269wire [7:0] t;
270wire pmu_lsu_dcm_trap_e;
271wire [7:0] dtm_h;
272wire [7:0] dtm_l;
273wire [7:0] pmu_lsu_dtmiss_trap_e;
274wire pmu_lsu_dtm_trap_e;
275wire [7:0] l2dm_h;
276wire [7:0] l2dm_l;
277wire lsu_e2m_scanin;
278wire lsu_e2m_scanout;
279wire [7:0] l2dm_wrap_e;
280wire [7:0] lsu_trap_mask_m_din;
281wire [7:0] l2dm_wrap_m;
282wire [7:0] lsu_trap_mask_m;
283wire [7:0] th_m;
284wire [1:0] tlu_pmu_trap_mask_m;
285wire [7:0] lsu_tidm_update_m;
286wire [1:0] dec_valid_m;
287wire [7:0] ph_ai;
288wire [7:0] pl_ai;
289wire [7:0] ph_ige;
290wire [7:0] pl_ige;
291wire [7:0] ph_bre;
292wire [7:0] pl_bre;
293wire [7:0] dcm_he;
294wire [7:0] dtm_he;
295wire [7:0] l2m_he;
296wire [7:0] dcm_le;
297wire [7:0] dtm_le;
298wire [7:0] l2m_le;
299wire [7:0] ph_icge;
300wire [7:0] pl_icge;
301wire [7:0] mm_tid;
302wire [3:0] mm_l2e;
303wire [7:0] ph_mme;
304wire [7:0] pl_mme;
305wire [5:0] xb;
306wire use_ma;
307wire use_cwq;
308wire [2:0] xbtid;
309wire [7:0] ph_xbe;
310wire [7:0] pl_xbe;
311wire [7:0] spu_des;
312wire [7:0] spu_aes;
313wire [7:0] spu_rc4;
314wire [7:0] spu_hash;
315wire [7:0] spu_ma;
316wire [7:0] spu_crc;
317wire [7:0] ph_soe;
318wire [7:0] pl_soe;
319wire [7:0] ph_sbe;
320wire [7:0] pl_sbe;
321wire [7:0] ovh;
322wire [7:0] ovl;
323wire [7:0] pipeh_incr_e;
324wire [7:0] pipel_incr_e;
325wire [7:0] pipeh_incr_m;
326wire [7:0] ph_brm;
327wire [7:0] pipel_incr_m;
328wire [7:0] pl_brm;
329wire [7:0] pipeh_incr_w;
330wire [7:0] pipel_incr_w;
331wire [7:0] pipeh_async;
332wire [7:0] pipel_async;
333wire tp_scanin;
334wire tp_scanout;
335wire [7:0] trap_e;
336wire [7:0] trap_b_in;
337wire [7:0] trap_w_in;
338wire [7:0] trap_w1_in;
339wire [7:0] tpt;
340wire [7:0] trap_m;
341wire [7:0] trap_b;
342wire [7:0] trap_w;
343wire [7:0] trap_w1;
344wire tp1_scanin;
345wire tp1_scanout;
346wire [7:0] trap_hold_in;
347wire [7:0] trap_hold;
348wire br_scanin;
349wire br_scanout;
350wire [7:0] ph_br_may_trap_m;
351wire [1:0] ifu_fl_b;
352wire [1:0] fl_w;
353wire [7:0] trap_w1_final;
354wire [1:0] tlu_fl_w1;
355wire [7:0] async;
356wire ti_e2m_scanin;
357wire ti_e2m_scanout;
358wire [7:0] ph_incr_m;
359wire [7:0] pl_incr_m;
360wire [7:0] ph_i_m;
361wire [7:0] pl_i_m;
362wire ti_m2b_scanin;
363wire ti_m2b_scanout;
364wire [7:0] ph_incr_b;
365wire [7:0] pl_incr_b;
366wire [7:0] ph_i_b;
367wire [7:0] pl_i_b;
368wire ti_b2w_scanin;
369wire ti_b2w_scanout;
370wire [7:0] ph_incr_w;
371wire [7:0] pl_incr_w;
372wire [7:0] ph_i_w;
373wire [7:0] pl_i_w;
374wire ti_w2w1_scanin;
375wire ti_w2w1_scanout;
376wire [7:0] ph_incr_w1;
377wire [7:0] pl_incr_w1;
378wire [7:0] flush_h;
379wire [7:0] flush_l;
380wire [7:0] ph_final_incr_w1;
381wire [7:0] pl_final_incr_w1;
382wire [7:0] pic_std_w1;
383wire [7:0] pic_st_dout;
384wire [7:0] pic_st_din;
385wire pic_st_scanin;
386wire pic_st_scanout;
387wire [3:0] t0h_din;
388wire [3:0] t0h_dout;
389wire t0h_scanin;
390wire t0h_scanout;
391wire [3:0] t1h_din;
392wire [3:0] t1h_dout;
393wire t1h_scanin;
394wire t1h_scanout;
395wire [3:0] t2h_din;
396wire [3:0] t2h_dout;
397wire t2h_scanin;
398wire t2h_scanout;
399wire [3:0] t3h_din;
400wire [3:0] t3h_dout;
401wire t3h_scanin;
402wire t3h_scanout;
403wire [3:0] t4h_din;
404wire [3:0] t4h_dout;
405wire t4h_scanin;
406wire t4h_scanout;
407wire [3:0] t5h_din;
408wire [3:0] t5h_dout;
409wire t5h_scanin;
410wire t5h_scanout;
411wire [3:0] t6h_din;
412wire [3:0] t6h_dout;
413wire t6h_scanin;
414wire t6h_scanout;
415wire [3:0] t7h_din;
416wire [3:0] t7h_dout;
417wire t7h_scanin;
418wire t7h_scanout;
419wire [3:0] t0l_din;
420wire [3:0] t0l_dout;
421wire t0l_scanin;
422wire t0l_scanout;
423wire [3:0] t1l_din;
424wire [3:0] t1l_dout;
425wire t1l_scanin;
426wire t1l_scanout;
427wire [3:0] t2l_din;
428wire [3:0] t2l_dout;
429wire t2l_scanin;
430wire t2l_scanout;
431wire [3:0] t3l_din;
432wire [3:0] t3l_dout;
433wire t3l_scanin;
434wire t3l_scanout;
435wire [3:0] t4l_din;
436wire [3:0] t4l_dout;
437wire t4l_scanin;
438wire t4l_scanout;
439wire [3:0] t5l_din;
440wire [3:0] t5l_dout;
441wire t5l_scanin;
442wire t5l_scanout;
443wire [3:0] t6l_din;
444wire [3:0] t6l_dout;
445wire t6l_scanin;
446wire t6l_scanout;
447wire [3:0] t7l_din;
448wire [3:0] t7l_dout;
449wire t7l_scanin;
450wire t7l_scanout;
451wire [3:0] pich07_add_in_w1;
452wire [7:0] incr_asi;
453wire [3:0] picl07_add_in_w1;
454wire accum_scanin;
455wire accum_scanout;
456wire [15:8] asi_cntrl_h;
457wire [4:0] asi_cntrl;
458wire asr;
459wire asr_rd;
460wire asi_ctl_ndata;
461wire asr_wr;
462wire pcr;
463wire pic;
464wire pic_rd;
465wire pic_wr;
466wire pcr_rd;
467wire pcr_wr;
468wire [7:0] tid;
469wire [7:0] asr_priv;
470wire priv_ex;
471wire pmu_op;
472wire l1clk_pm4;
473wire asi_scanin;
474wire asi_scanout;
475wire p_rd;
476wire pc_rd;
477wire pc_wr;
478wire [31:0] pcr0_read;
479wire [31:0] pcr1_read;
480wire [31:0] pcr2_read;
481wire [31:0] pcr3_read;
482wire [31:0] pcr4_read;
483wire [31:0] pcr5_read;
484wire [31:0] pcr6_read;
485wire [31:0] pcr7_read;
486wire spares_scanin;
487wire spares_scanout;
488
489
490// *** globals ***
491input l2clk;
492input scan_in;
493input tcu_pce_ov; // scan signals
494input spc_aclk;
495input spc_bclk;
496input tcu_scan_en;
497output scan_out;
498
499// Power management for ASI ring...
500input lsu_asi_clken;
501input lsu_pmu_pmen;
502
503// Instruction decode events
504// if idle, then there is no pick, or other activity... valid would be off.
505//input [2:0] lsu_pmu_tid_b; // tid used by real lsu; for DC and DT misses
506input [12:0] dec_pmu_instr0_type_d; // {12 - valid; 11:10 - tid; 9:0 - {atomic_d, l2imiss, itmiss, icmiss, other, %sethi, store, load, FGU, branch}}
507input [12:0] dec_pmu_instr1_type_d;
508input [1:0] dec_br_taken_e; // branch taken indicator
509input [5:0] lsu_pmu_mem_type_b; // {5:3 - tid (use for l2miss only); 2:0 - {l2 d-miss, dt_miss, d-cache miss}}
510input dec_lsu_sel0_d; // select tg0 for lsu tid
511
512// MMU activity (excluding ITLB/DTLB misses)
513input mmu_pmu_l2ret; // indicates l2 data to MMU
514input mmu_pmu_l2miss; // indicates the return pkt had l2 miss
515input mmu_pmu_dtlb; // indicates that return pkt is for D-side table walk
516input [2:0] mmu_pmu_tid; // thread id
517//input [5:0] mmu_mtyp; // {5 - valid; 4:2 - tid; 1 - D/~I; 0 - L2 hit/miss}
518
519// Crossbar activity
520//input [9:0] lsu_pmu_xbar_optype; // {9 - valid; 8:6 - tid; 5:0 - {mmuld, cpustore, ifetch, cpuld, ststore, stload}}
521input [6:0] l15_pmu_xbar_optype; // {6 - valid; 5:3 - tid; 2:0 - {111 - mastore; 110 - maload; 101 - ifetch; 100 - mmuld; 011 - cwqstore; 010 - cwqload; 001 - cpustore; 000 - cpuld}}
522
523// SPU activity
524input [4:0] spu_pmu_cwq_busy; // CWQ busy {rc4,hash,des,crc,aes}
525input [2:0] spu_pmu_cwq_tid;
526input [3:0] spu_pmu_ma_busy;
527
528// state bits to decide when counters should record
529input [7:0] tlu_pmu_pstate_priv; // pstate.priv for each thread (bit 7 == thread 7)
530input [7:0] tlu_pmu_hpstate_hpriv; // hpstate.hpriv (ditto)
531
532// PMU trap is taken, reset the counter if "-"ve.
533input [7:0] tlu_pmu_trap_taken;
534input [1:0] tlu_pmu_trap_mask_e; // True if TLU enabled for PMU trap {1 - tg1; 0 - tg0}
535
536// Flush requests from TLU and IFU - bit 1 is for TG1, bit 0 for TG0
537input [1:0] tlu_flush_pmu_b; // kill what is in B now
538input [1:0] tlu_flush_pmu_w; // kill what is in W now
539
540input [1:0] dec_valid_e; // bit 1 is for TG1, 0 for TG0; instr valids in the e-stage
541
542input [1:0] dec_flush_m; // kill what is in M now
543input [1:0] dec_flush_b; // kill what is in B now
544
545// Carry-out bits of incrementors to set OV bits in PCRs, valid in cycle W+1
546input pdp_pich_cout07;
547input pdp_picl_cout07;
548
549// Near-overflow values (-16..-1) for each counter
550input [7:0] pdp_pich_wrap;
551input [7:0] pdp_picl_wrap;
552
553// ASI read/write inputs
554input in_rngl_cdbus_ctl_ndata;// Bit 64 of input bus, register here
555input [7:0] pdp_asi_ctlin_to_pctl_15_8; // Bits 63:56 of registered data from PDP (save 8 flop bits)
556input [4:0] pdp_asi_ctlin_to_pctl_4_0; // Bits 52:48 of registered data from PDP (save 5 flop bits)
557input [31:0] pdp_asi_din_to_pctl; // control block needs lower 32 bits too for PCR data...
558
559// Signals to tell TLU if we may/should trap due to counter overflow
560output [7:0] pmu_tlu_trap_m; // Sent at (near) beginning of M to TLU
561output [7:0] pmu_tlu_debug_event; // Tell trap if a perf. monitor event occurred to soft/hard stop/trigger on
562
563// Event outputs
564output [3:0] pct_pich07_add_w2; // Add value for pich
565output [3:0] pct_picl07_add_w2; // Add value for picl
566
567// Signals to LSU for trap on DCmiss, DTmiss, L2Dmiss
568//input [2:0] dec_lsu_tid_e; // TID of LSU instruction in E stage
569output pmu_lsu_dcmiss_trap_m;
570output pmu_lsu_dtmiss_trap_m;
571output [7:0] pmu_lsu_l2dmiss_trap_m;
572
573// ASI read controls
574output [7:0] pct_rd_pic; // ASI read of PIC (bit 7 == read PIC for tid 7)
575output pct_rd_a_pic; // ASI read of any PIC
576output pct_rd_pic_pcr; // ASI read of PIC or PCR (select PIC or PCR)
577output pct_bypass_asi; // Flow this node's ASI data to the output
578output [31:0] pct_pcr_data; // PCR data on ASI read
579output pct_rngl_cdbus_ctl_ndata; // Piped value of uppermost ASI ring ctl/data bus output
580output pct_exception; // True if a privileged exception on ASR read or write to PIC or PCR
581
582// ASI write controls
583output [7:0] pct_wr_pic_w2; // Write corresponding PICH/L from ASI (bit 7 == write PIC7)
584output [6:0] pct_incr_pic_w1; // increment PIC (PICL is enabled for counting) W+1 cycle, prior to adding in W+2
585output pct_incr_asi_w1; // Select new ASI value to increment to deal with simultaneous ASI write and increment
586
587// Clock gates to PICs in DP
588output [7:0] pct_pic_clken; // Only enable when pic configured to count
589output pct_pic07_w2_clken; // Enable for pic_07 flop for ASI/PIC's selected to be added
590
591// Pwr management for ASI ring in DP
592output pmu_asi_clken;
593////////////////////////////////////////////////////////////////////////////////
594
595// scan renames
596assign pce_ov = tcu_pce_ov;
597//assign stop = tcu_clk_stop;
598assign stop = 1'b0;
599assign siclk = spc_aclk;
600assign soclk = spc_bclk;
601assign se = tcu_scan_en;
602// end scan
603
604pmu_pct_ctl_l1clkhdr_ctl_macro clkgen (
605 .l2clk (l2clk ),
606 .l1en (1'b1 ),
607 .l1clk (l1clk ),
608 .pce_ov(pce_ov),
609 .stop(stop),
610 .se(se)
611);
612
613// Flop ASI clken
614pmu_pct_ctl_msff_ctl_macro__width_5 pwrm (
615 .scan_in(pwrm_scanin),
616 .scan_out(pwrm_scanout),
617 .l1clk (l1clk),
618 .din ({lsu_pmu_pmen, pmu_pmen, lsu_asi_clken, pmu_busy, skip_wakeup_in}),
619 .dout ({pmu_pmen, pmu_pmen_del_1, pmu_asi_clken, pmu_busy_del_1, skip_wakeup}),
620 .siclk(siclk),
621 .soclk(soclk)
622);
623
624// Generally busy if any PCR is enabled to count in at least one mode
625assign pmu_busy = (|pcr7_dout[3:1]) | (|pcr6_dout[3:1]) | (|pcr5_dout[3:1]) | (|pcr4_dout[3:1]) |
626 (|pcr3_dout[3:1]) | (|pcr2_dout[3:1]) | (|pcr1_dout[3:1]) | (|pcr0_dout[3:1]);
627
628// exposed a bug. The PMU was being power-managed, and when the last clock fired, counter 0
629// was scheduled to be updated (in W2). However, while the PMU was powered-down, PIC0 was written to. Then,
630// PCR0 was written to, waking up the PMU. Since PIC0 was being updated in W2 (from the stale PIC value in
631// pic07_w2 flop), it proceeded to overwrite the newly-written PIC value. To fix this the following was done.
632
633// We record the fact that the PIC which will be updated upon wakeup has been
634// written to in the interim, so the value in the W+2 add stage is incorrect. We then prevent the update
635// in that case, using the skip_wakeup flop.
636
637assign skip_wakeup_in = ~wakeup & (skip_wakeup |
638 (~pmu_busy & pmu_pmen & (|({8 {p_wr}} & atid[7:0] & pic_std_w2[7:0])))
639 );
640
641assign wakeup = pmu_busy & ~pmu_busy_del_1;
642
643// Sleep when: a) are power managed and pmu goes not busy, or b) pmu is not busy and we become power managed
644assign sleep = (~pmu_busy & pmu_busy_del_1 & pmu_pmen) | (pmu_pmen & ~pmu_pmen_del_1 & ~pmu_busy);
645
646// If events flop was stopped due to power management, then there is junk in it...we let the pipe drain
647// to prevent spurious events on startup
648// When sleep starts, let pipe drain...run for 13 cycles (== time from E->W2 + 7 cycles to account for
649// last possible update of a PIC due to the rotating counter. But we can subtract 1 since the counter is
650// loaded 1 cycle after sleep.
651pmu_pct_ctl_msff_ctl_macro__width_4 sleep_cnt (
652 .scan_in(sleep_cnt_scanin),
653 .scan_out(sleep_cnt_scanout),
654 .l1clk (l1clk),
655 .din (sleep_cntr_din[3:0]),
656 .dout (sleep_cntr[3:0]),
657 .siclk(siclk),
658 .soclk(soclk)
659);
660
661assign wait_for_sleep = |sleep_cntr[3:0];
662
663assign sleep_cntr_din[3:0] = ({4 {sleep}} & 4'b1100) |
664 ({4 {~sleep & wait_for_sleep}} & (sleep_cntr[3:0] - 4'b0001));
665
666// l1clk_pm1 = pmu_busy_l1clk...
667
668assign l1b = pmu_busy | sleep | wait_for_sleep | ~pmu_pmen;
669
670pmu_pct_ctl_l1clkhdr_ctl_macro pmu_busy_clkgen (
671 .l2clk (l2clk ),
672 .l1en (l1b ),
673 .l1clk (l1clk_pm1 ),
674 .pce_ov(pce_ov),
675 .stop(stop),
676 .se(se)
677);
678
679// power manage OV bits; enable during ASI write to PCR, or when any flop is recording
680assign ov_busy = |wr_pcr[7:0] | (|rd_pcr[7:0]) | pmu_busy | sleep | wait_for_sleep;
681
682pmu_pct_ctl_l1clkhdr_ctl_macro ov_busy_clkgen (
683 .l2clk (l2clk ),
684 .l1en (ov_busy | ~pmu_pmen ),
685// .l1clk (ov_busy_l1clk )
686 .l1clk (l1clk_pm2 ),
687 .pce_ov(pce_ov),
688 .stop(stop),
689 .se(se)
690);
691
692// register state input bits
693// these bits are used to 1) check for priv exceptions due to read/writes of pic or pcr, as well as qualifying counting events
694// simplest thing is to keep running all the time (was l1clk_pm1 but
695// this broke priv exception check since asi ring busy not included (bug 86773))
696// attempt to use pmu_busy | asi_clken (PMU is not first on ASI ring)
697// Change to keep busy all the time...not ideal, but need this clock to save pwr for pcr's
698//l1clkhdr_ctl_macro priv_busy_clkgen (
699// .l2clk (l2clk ),
700// .l1en (pmu_busy | pmu_asi_clken | ~pmu_pmen ),
701// .l1clk (priv_busy_l1clk )
702// .l1clk (l1clk_pm3 )
703//);
704
705pmu_pct_ctl_msff_ctl_macro__width_16 hpstate (
706// .l1clk (priv_busy_l1clk),
707 .scan_in(hpstate_scanin),
708 .scan_out(hpstate_scanout),
709 .l1clk (l1clk),
710 .din ({tlu_pmu_hpstate_hpriv[7:0], tlu_pmu_pstate_priv[7:0]}),
711 .dout ({hpriv[7:0], priv[7:0]}),
712 .siclk(siclk),
713 .soclk(soclk)
714);
715
716// register event inputs
717// Make sure only one of the CWQ events is active at a time...
718// 0in bits_on -var (spu_pmu_cwq_busy[4:0]) -message "spu_pmu_cwq_busy[4:0] not mutex"
719
720assign mmu_mtyp[5:0] = {mmu_pmu_l2ret, mmu_pmu_tid[2:0], mmu_pmu_dtlb, mmu_pmu_l2miss};
721
722// delay rc4, hash, des, crc, aes, ma_busy 1 clock to avoid timing problem - edge-detect
723// from flopped version - costs 6 flops
724pmu_pct_ctl_msff_ctl_macro__width_66 events (
725 .scan_in(events_scanin),
726 .scan_out(events_scanout),
727 .l1clk (l1clk_pm1),
728 .din ({dec_pmu_instr0_type_d[12:0], dec_pmu_instr1_type_d[12:0],
729 dec_br_taken_e[1:0], mmu_mtyp[5:0],
730 lsu_pmu_mem_type_b[5:0], l15_pmu_xbar_optype[6:0], spu_pmu_cwq_busy[4:0],
731 spu_pmu_cwq_tid[2:0], spu_pmu_ma_busy[3:0], rc4, hash, des, crc, aes, ma[3], dec_lsu_sel0_d}),
732 .dout ({tg0_e[12:0], tg1_e[12:0],
733 dec_br_taken_m[1:0], mm_mtyp[5:0],
734 mem_typ_w[5:0], xbar[6:0], rc4, hash, des, crc, aes,
735 spu_tid[2:0], ma[3:0], rc4_d1, hash_d1, des_d1, crc_d1, aes_d1, ma_3_d1, dec_lsu_sel0_e}),
736 .siclk(siclk),
737 .soclk(soclk)
738);
739
740assign tg0_ityp_e[11:0] = {12 {tg0_e[12]}} & tg0_e[11:0];
741assign tg1_ityp_e[11:0] = {12 {tg1_e[12]}} & tg1_e[11:0];
742
743// Use dec signal for below
744assign lsu_tid_e[2:0] = {~dec_lsu_sel0_e, ({2 { dec_lsu_sel0_e}} & tg0_ityp_e[11:10]) |
745 ({2 {~dec_lsu_sel0_e}} & tg1_ityp_e[11:10]) };
746
747pmu_pct_ctl_msff_ctl_macro__width_9 lsutid (
748 .scan_in(lsutid_scanin),
749 .scan_out(lsutid_scanout),
750 .l1clk (l1clk_pm1),
751 .din ({lsu_tid_e[2:0], lsu_tid_m[2:0], lsu_tid_b[2:0]}),
752 .dout ({lsu_tid_m[2:0], lsu_tid_b[2:0], lsu_tid_w[2:0]}),
753 .siclk(siclk),
754 .soclk(soclk)
755);
756
757// Decode the events
758
759assign all_idle_e = ~tg0_e[12] & ~tg1_e[12];
760
761// What thread is instruction event for
762// 11:10 - tid;
763assign th[0] = ~tg0_ityp_e[11] & ~tg0_ityp_e[10];
764assign th[1] = ~tg0_ityp_e[11] & tg0_ityp_e[10];
765assign th[2] = tg0_ityp_e[11] & ~tg0_ityp_e[10];
766assign th[3] = tg0_ityp_e[11] & tg0_ityp_e[10];
767assign th[4] = ~tg1_ityp_e[11] & ~tg1_ityp_e[10];
768assign th[5] = ~tg1_ityp_e[11] & tg1_ityp_e[10];
769assign th[6] = tg1_ityp_e[11] & ~tg1_ityp_e[10];
770assign th[7] = tg1_ityp_e[11] & tg1_ityp_e[10];
771
772// DES/3DES busy event
773// 3 - busy/idle; 2:0 - tid;
774assign cwq_tid[0] = ~spu_tid[2] & ~spu_tid[1] & ~spu_tid[0];
775assign cwq_tid[1] = ~spu_tid[2] & ~spu_tid[1] & spu_tid[0];
776assign cwq_tid[2] = ~spu_tid[2] & spu_tid[1] & ~spu_tid[0];
777assign cwq_tid[3] = ~spu_tid[2] & spu_tid[1] & spu_tid[0];
778assign cwq_tid[4] = spu_tid[2] & ~spu_tid[1] & ~spu_tid[0];
779assign cwq_tid[5] = spu_tid[2] & ~spu_tid[1] & spu_tid[0];
780assign cwq_tid[6] = spu_tid[2] & spu_tid[1] & ~spu_tid[0];
781assign cwq_tid[7] = spu_tid[2] & spu_tid[1] & spu_tid[0];
782
783assign desb[7:0] = {8 {des}} & cwq_tid[7:0];
784
785// AES busy event
786assign aesb[7:0] = {8 {aes}} & cwq_tid[7:0];
787
788// RC4 busy event
789assign rc4b[7:0] = {8 {rc4}} & cwq_tid[7:0];
790
791// SHA-1/SHA-256/MD5 busy event
792assign hashb[7:0] = {8 {hash}} & cwq_tid[7:0];
793
794// CRC busy event
795assign crcb[7:0] = {8 {crc}} & cwq_tid[7:0];
796
797// MA busy event
798assign ma_tid[0] = ~ma[2] & ~ma[1] & ~ma[0];
799assign ma_tid[1] = ~ma[2] & ~ma[1] & ma[0];
800assign ma_tid[2] = ~ma[2] & ma[1] & ~ma[0];
801assign ma_tid[3] = ~ma[2] & ma[1] & ma[0];
802assign ma_tid[4] = ma[2] & ~ma[1] & ~ma[0];
803assign ma_tid[5] = ma[2] & ~ma[1] & ma[0];
804assign ma_tid[6] = ma[2] & ma[1] & ~ma[0];
805assign ma_tid[7] = ma[2] & ma[1] & ma[0];
806
807assign mab[7:0] = {8 {ma[3]}} & ma_tid[7:0];
808
809// register spu_ops to detect edges
810// Fundamentally, only need to detect edges on ma[3], des, aes, rc4, crc, hash individually except
811// iff the TID can change from one cycle to the next any busy bit stays high...
812// CWQ can't do this - put in assertions to make sure
813// MA can't do this by design
814// 0in assert -var ~(|(spu_pmu_cwq_busy[4:0] & {rc4,hash,des,crc,aes}) & (spu_pmu_cwq_tid[2:0] != spu_tid[2:0]) & l1clk_pm1) -message "spu_pmu_cwq_busy[4:0] busy but spu_pmu_cwq_tid[2:0] changes"
815
816// dcmiss, dtmiss, l2miss from lsu in previous cycle
817assign dcm[0] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0];
818assign dcm[1] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0];
819assign dcm[2] = ~lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0];
820assign dcm[3] = ~lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0];
821assign dcm[4] = lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0];
822assign dcm[5] = lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0];
823assign dcm[6] = lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0];
824assign dcm[7] = lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0];
825
826assign dtm[0] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1];
827assign dtm[1] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1];
828assign dtm[2] = ~lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1];
829assign dtm[3] = ~lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1];
830assign dtm[4] = lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1];
831assign dtm[5] = lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1];
832assign dtm[6] = lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1];
833assign dtm[7] = lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1];
834
835// 5:3 - tid; 2:0 - {l2 d-miss, dt_miss, d-cache miss}
836assign l2m[0] = ~mem_typ_w[5] & ~mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2];
837assign l2m[1] = ~mem_typ_w[5] & ~mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2];
838assign l2m[2] = ~mem_typ_w[5] & mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2];
839assign l2m[3] = ~mem_typ_w[5] & mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2];
840assign l2m[4] = mem_typ_w[5] & ~mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2];
841assign l2m[5] = mem_typ_w[5] & ~mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2];
842assign l2m[6] = mem_typ_w[5] & mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2];
843assign l2m[7] = mem_typ_w[5] & mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2];
844
845// NEED to HANDLE the potential of a Dmiss and a L2Dmiss at the same time
846
847// PCR's for each thread
848// PCR format is:
849// 31 - OV1
850// 30:27 - SL1
851// 26:19 - Mask1
852// 18 - OV0
853// 17:14 - SL0
854// 13:6 - Mask0
855// 5:4 - TOE
856// 3 - HT
857// 2 - UT
858// 1 - ST
859// 0 - Priv
860
861// where each SL field decoding is:
862// 0 - all idle (async)
863// 1 - unused
864// 2 - instruction group (sync)
865// 3 - cache/tlb group (sync)
866// 4 - unused
867// 5 - xbar group (async)
868// 6 - spu ops (async) -- ops derived from spu busy
869// 7 - spu busy (async)
870
871// generate OV bits for all PCR's
872assign ov1[7:0] = {8 {pdp_pich_cout07}} & {pic_std_w2[7:0]} | set_ovh_spec[7:0];
873assign ov0[7:0] = {8 {pdp_picl_cout07}} & {pic_std_w2[7:0]} | set_ovl_spec[7:0];
874
875// generate clk enables for all PICs; keep it simple for now (enable only when a PIC is configured to count)
876assign pct_pic_clken[7:0] = pct_wr_pic_w2[7:0] | (pic_std_w2[7:0] & ~{8 {skip_wakeup}} &
877 {|pcr7_dout[3:1],|pcr6_dout[3:1],|pcr5_dout[3:1],|pcr4_dout[3:1],
878 |pcr3_dout[3:1],|pcr2_dout[3:1],|pcr1_dout[3:1],|pcr0_dout[3:1]});
879
880// writing to a PCR kills any pending OV updates
881
882// PCR0
883
884// In case of not writing to a PCR, keep the OV state.
885// qualify the pcr0_din with ov1[0];
886// Except! reset OV bits when PCR read...bug!
887
888// Don't write to HT unless in hyperpriv mode...
889assign ht_in[7:0] = ( hpriv[7:0] & {8 {pdp_asi_din_to_pctl[3]}}) |
890 (~hpriv[7:0] & {pcr7_dout[3], pcr6_dout[3], pcr5_dout[3], pcr4_dout[3],
891 pcr3_dout[3], pcr2_dout[3], pcr1_dout[3], pcr0_dout[3]});
892
893assign pcr0_din[29:0] = ({30 { wr_pcr[0]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[0],pdp_asi_din_to_pctl[2:0]}) |
894 ({30 {~wr_pcr[0]}} & {disable_h[0],pcr0_dout[29:19],disable_l[0],pcr0_dout[16:0]});
895
896// Now use one header to control write clocks for all pcr's - still need mux for individual flops
897pmu_pct_ctl_l1clkhdr_ctl_macro wr_pcr_clkgen (
898 .l2clk (l2clk ),
899 .l1en (|wr_pcr[7:0] ),
900 .l1clk (l1clk_pm3 ),
901 .pce_ov(pce_ov),
902 .stop(stop),
903 .se(se)
904);
905
906pmu_pct_ctl_msff_ctl_macro__width_30 pcr0 (
907 .scan_in(pcr0_scanin),
908 .scan_out(pcr0_scanout),
909 .l1clk (l1clk_pm3),
910 .din (pcr0_din[29:0]),
911 .dout ({disable_h[0],pcr0_dout[29:19],disable_l[0],pcr0_dout[16:0]}),
912 .siclk(siclk),
913 .soclk(soclk)
914);
915assign pcr0_dout[30] = 1'b0;
916assign pcr0_dout[17] = 1'b0;
917
918// For selective write to OV:
919// Write OV0 iff bit 62 not set - use negative active to keep compatibility with pre-existing DV tests
920// Write OV1 iff bit 63 not set - use negative active to keep compatibility with pre-existing DV tests
921
922assign bit63 = pdp_asi_ctlin_to_pctl_15_8[7]; // bit 63 of ring data cycle
923assign bit62 = pdp_asi_ctlin_to_pctl_15_8[6]; // bit 62 of ring data cycle
924
925assign x0[1:0] = ( ({2 {wr_pcr[0]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
926 (~({2 {wr_pcr[0]}} & {~bit63,~bit62}) & {(ov1[0] | pcr0_dout[31]), (ov0[0] | pcr0_dout[18])});
927
928pmu_pct_ctl_msff_ctl_macro__width_2 pcr0_ov (
929 .scan_in(pcr0_ov_scanin),
930 .scan_out(pcr0_ov_scanout),
931 .l1clk (l1clk_pm2),
932 .din (x0[1:0]),
933 .dout ({pcr0_dout[31],pcr0_dout[18]}),
934 .siclk(siclk),
935 .soclk(soclk)
936);
937
938// PCR1
939assign pcr1_din[29:0] = ({30 { wr_pcr[1]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[1],pdp_asi_din_to_pctl[2:0]}) |
940 ({30 {~wr_pcr[1]}} & {disable_h[1],pcr1_dout[29:19],disable_l[1],pcr1_dout[16:0]});
941
942pmu_pct_ctl_msff_ctl_macro__width_30 pcr1 (
943 .scan_in(pcr1_scanin),
944 .scan_out(pcr1_scanout),
945 .l1clk (l1clk_pm3),
946 .din (pcr1_din[29:0]),
947 .dout ({disable_h[1],pcr1_dout[29:19],disable_l[1],pcr1_dout[16:0]}),
948 .siclk(siclk),
949 .soclk(soclk)
950);
951assign pcr1_dout[30] = 1'b0;
952assign pcr1_dout[17] = 1'b0;
953
954assign x1[1:0] = ( ({2 {wr_pcr[1]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
955 (~({2 {wr_pcr[1]}} & {~bit63,~bit62}) & {(ov1[1] | pcr1_dout[31]), (ov0[1] | pcr1_dout[18])});
956
957pmu_pct_ctl_msff_ctl_macro__width_2 pcr1_ov (
958 .scan_in(pcr1_ov_scanin),
959 .scan_out(pcr1_ov_scanout),
960 .l1clk (l1clk_pm2),
961 .din (x1[1:0]),
962 .dout ({pcr1_dout[31],pcr1_dout[18]}),
963 .siclk(siclk),
964 .soclk(soclk)
965);
966
967// PCR2
968assign pcr2_din[29:0] = ({30 { wr_pcr[2]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[2],pdp_asi_din_to_pctl[2:0]}) |
969 ({30 {~wr_pcr[2]}} & {disable_h[2],pcr2_dout[29:19],disable_l[2],pcr2_dout[16:0]});
970
971pmu_pct_ctl_msff_ctl_macro__width_30 pcr2 (
972 .scan_in(pcr2_scanin),
973 .scan_out(pcr2_scanout),
974 .l1clk (l1clk_pm3),
975 .din (pcr2_din[29:0]),
976 .dout ({disable_h[2],pcr2_dout[29:19],disable_l[2],pcr2_dout[16:0]}),
977 .siclk(siclk),
978 .soclk(soclk)
979);
980assign pcr2_dout[30] = 1'b0;
981assign pcr2_dout[17] = 1'b0;
982
983assign x2[1:0] = ( ({2 {wr_pcr[2]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
984 (~({2 {wr_pcr[2]}} & {~bit63,~bit62}) & {(ov1[2] | pcr2_dout[31]), (ov0[2] | pcr2_dout[18])});
985
986pmu_pct_ctl_msff_ctl_macro__width_2 pcr2_ov (
987 .scan_in(pcr2_ov_scanin),
988 .scan_out(pcr2_ov_scanout),
989 .l1clk (l1clk_pm2),
990 .din (x2[1:0]),
991 .dout ({pcr2_dout[31],pcr2_dout[18]}),
992 .siclk(siclk),
993 .soclk(soclk)
994);
995
996// PCR3
997assign pcr3_din[29:0] = ({30 { wr_pcr[3]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[3],pdp_asi_din_to_pctl[2:0]}) |
998 ({30 {~wr_pcr[3]}} & {disable_h[3],pcr3_dout[29:19],disable_l[3],pcr3_dout[16:0]});
999
1000pmu_pct_ctl_msff_ctl_macro__width_30 pcr3 (
1001 .scan_in(pcr3_scanin),
1002 .scan_out(pcr3_scanout),
1003 .l1clk (l1clk_pm3),
1004 .din (pcr3_din[29:0]),
1005 .dout ({disable_h[3],pcr3_dout[29:19],disable_l[3],pcr3_dout[16:0]}),
1006 .siclk(siclk),
1007 .soclk(soclk)
1008);
1009assign pcr3_dout[30] = 1'b0;
1010assign pcr3_dout[17] = 1'b0;
1011
1012assign x3[1:0] = ( ({2 {wr_pcr[3]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
1013 (~({2 {wr_pcr[3]}} & {~bit63,~bit62}) & {(ov1[3] | pcr3_dout[31]), (ov0[3] | pcr3_dout[18])});
1014
1015pmu_pct_ctl_msff_ctl_macro__width_2 pcr3_ov (
1016 .scan_in(pcr3_ov_scanin),
1017 .scan_out(pcr3_ov_scanout),
1018 .l1clk (l1clk_pm2),
1019 .din (x3[1:0]),
1020 .dout ({pcr3_dout[31],pcr3_dout[18]}),
1021 .siclk(siclk),
1022 .soclk(soclk)
1023);
1024
1025// PCR4
1026assign pcr4_din[29:0] = ({30 { wr_pcr[4]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[4],pdp_asi_din_to_pctl[2:0]}) |
1027 ({30 {~wr_pcr[4]}} & {disable_h[4],pcr4_dout[29:19],disable_l[4],pcr4_dout[16:0]});
1028
1029pmu_pct_ctl_msff_ctl_macro__width_30 pcr4 (
1030 .scan_in(pcr4_scanin),
1031 .scan_out(pcr4_scanout),
1032 .l1clk (l1clk_pm3),
1033 .din (pcr4_din[29:0]),
1034 .dout ({disable_h[4],pcr4_dout[29:19],disable_l[4],pcr4_dout[16:0]}),
1035 .siclk(siclk),
1036 .soclk(soclk)
1037);
1038assign pcr4_dout[30] = 1'b0;
1039assign pcr4_dout[17] = 1'b0;
1040
1041assign x4[1:0] = ( ({2 {wr_pcr[4]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
1042 (~({2 {wr_pcr[4]}} & {~bit63,~bit62}) & {(ov1[4] | pcr4_dout[31]), (ov0[4] | pcr4_dout[18])});
1043
1044pmu_pct_ctl_msff_ctl_macro__width_2 pcr4_ov (
1045 .scan_in(pcr4_ov_scanin),
1046 .scan_out(pcr4_ov_scanout),
1047 .l1clk (l1clk_pm2),
1048 .din (x4[1:0]),
1049 .dout ({pcr4_dout[31],pcr4_dout[18]}),
1050 .siclk(siclk),
1051 .soclk(soclk)
1052);
1053
1054// PCR5
1055assign pcr5_din[29:0] = ({30 { wr_pcr[5]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[5],pdp_asi_din_to_pctl[2:0]}) |
1056 ({30 {~wr_pcr[5]}} & {disable_h[5],pcr5_dout[29:19],disable_l[5],pcr5_dout[16:0]});
1057
1058pmu_pct_ctl_msff_ctl_macro__width_30 pcr5 (
1059 .scan_in(pcr5_scanin),
1060 .scan_out(pcr5_scanout),
1061 .l1clk (l1clk_pm3),
1062 .din (pcr5_din[29:0]),
1063 .dout ({disable_h[5],pcr5_dout[29:19],disable_l[5],pcr5_dout[16:0]}),
1064 .siclk(siclk),
1065 .soclk(soclk)
1066);
1067assign pcr5_dout[30] = 1'b0;
1068assign pcr5_dout[17] = 1'b0;
1069
1070assign x5[1:0] = ( ({2 {wr_pcr[5]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
1071 (~({2 {wr_pcr[5]}} & {~bit63,~bit62}) & {(ov1[5] | pcr5_dout[31]), (ov0[5] | pcr5_dout[18])});
1072
1073pmu_pct_ctl_msff_ctl_macro__width_2 pcr5_ov (
1074 .scan_in(pcr5_ov_scanin),
1075 .scan_out(pcr5_ov_scanout),
1076 .l1clk (l1clk_pm2),
1077 .din (x5[1:0]),
1078 .dout ({pcr5_dout[31],pcr5_dout[18]}),
1079 .siclk(siclk),
1080 .soclk(soclk)
1081);
1082
1083// PCR6
1084assign pcr6_din[29:0] = ({30 { wr_pcr[6]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[6],pdp_asi_din_to_pctl[2:0]}) |
1085 ({30 {~wr_pcr[6]}} & {disable_h[6],pcr6_dout[29:19],disable_l[6],pcr6_dout[16:0]});
1086
1087pmu_pct_ctl_msff_ctl_macro__width_30 pcr6 (
1088 .scan_in(pcr6_scanin),
1089 .scan_out(pcr6_scanout),
1090 .l1clk (l1clk_pm3),
1091 .din (pcr6_din[29:0]),
1092 .dout ({disable_h[6],pcr6_dout[29:19],disable_l[6],pcr6_dout[16:0]}),
1093 .siclk(siclk),
1094 .soclk(soclk)
1095);
1096assign pcr6_dout[30] = 1'b0;
1097assign pcr6_dout[17] = 1'b0;
1098
1099assign x6[1:0] = ( ({2 {wr_pcr[6]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
1100 (~({2 {wr_pcr[6]}} & {~bit63,~bit62}) & {(ov1[6] | pcr6_dout[31]), (ov0[6] | pcr6_dout[18])});
1101
1102pmu_pct_ctl_msff_ctl_macro__width_2 pcr6_ov (
1103 .scan_in(pcr6_ov_scanin),
1104 .scan_out(pcr6_ov_scanout),
1105 .l1clk (l1clk_pm2),
1106 .din (x6[1:0]),
1107 .dout ({pcr6_dout[31],pcr6_dout[18]}),
1108 .siclk(siclk),
1109 .soclk(soclk)
1110);
1111
1112// PCR7
1113assign pcr7_din[29:0] = ({30 { wr_pcr[7]}} & {pdp_asi_din_to_pctl[30:19],pdp_asi_din_to_pctl[17:4],ht_in[7],pdp_asi_din_to_pctl[2:0]}) |
1114 ({30 {~wr_pcr[7]}} & {disable_h[7],pcr7_dout[29:19],disable_l[7],pcr7_dout[16:0]});
1115
1116pmu_pct_ctl_msff_ctl_macro__width_30 pcr7 (
1117 .scan_in(pcr7_scanin),
1118 .scan_out(pcr7_scanout),
1119 .l1clk (l1clk_pm3),
1120 .din (pcr7_din[29:0]),
1121 .dout ({disable_h[7],pcr7_dout[29:19],disable_l[7],pcr7_dout[16:0]}),
1122 .siclk(siclk),
1123 .soclk(soclk)
1124);
1125assign pcr7_dout[30] = 1'b0;
1126assign pcr7_dout[17] = 1'b0;
1127
1128assign x7[1:0] = ( ({2 {wr_pcr[7]}} & {~bit63,~bit62}) & {pdp_asi_din_to_pctl[31], pdp_asi_din_to_pctl[18]}) |
1129 (~({2 {wr_pcr[7]}} & {~bit63,~bit62}) & {(ov1[7] | pcr7_dout[31]), (ov0[7] | pcr7_dout[18])});
1130
1131pmu_pct_ctl_msff_ctl_macro__width_2 pcr7_ov (
1132 .scan_in(pcr7_ov_scanin),
1133 .scan_out(pcr7_ov_scanout),
1134 .l1clk (l1clk_pm2),
1135 .din (x7[1:0]),
1136 .dout ({pcr7_dout[31],pcr7_dout[18]}),
1137 .siclk(siclk),
1138 .soclk(soclk)
1139);
1140
1141// can't power manage x*_1 signals, otherwise can't do edge detect - need free running l1clk
1142
1143pmu_pct_ctl_msff_ctl_macro__width_16 pcr_ov_del (
1144 .scan_in(pcr_ov_del_scanin),
1145 .scan_out(pcr_ov_del_scanout),
1146 .l1clk (l1clk),
1147 .din ({pcr7_dout[31],pcr7_dout[18],pcr6_dout[31],pcr6_dout[18],pcr5_dout[31],pcr5_dout[18],pcr4_dout[31],pcr4_dout[18],
1148 pcr3_dout[31],pcr3_dout[18],pcr2_dout[31],pcr2_dout[18],pcr1_dout[31],pcr1_dout[18],pcr0_dout[31],pcr0_dout[18]}),
1149 .dout ({x7_1[1:0],x6_1[1:0],x5_1[1:0],x4_1[1:0],x3_1[1:0],x2_1[1:0],x1_1[1:0],x0_1[1:0]}),
1150 .siclk(siclk),
1151 .soclk(soclk)
1152);
1153
1154// Count only if in correct state (HT, UT, ST)
1155assign p_cnt_en[0] = (pcr0_dout[3] & hpriv[0]) | (pcr0_dout[1] & ~hpriv[0] & priv[0]) | (pcr0_dout[2] & ~hpriv[0] & ~priv[0]);
1156assign p_cnt_en[1] = (pcr1_dout[3] & hpriv[1]) | (pcr1_dout[1] & ~hpriv[1] & priv[1]) | (pcr1_dout[2] & ~hpriv[1] & ~priv[1]);
1157assign p_cnt_en[2] = (pcr2_dout[3] & hpriv[2]) | (pcr2_dout[1] & ~hpriv[2] & priv[2]) | (pcr2_dout[2] & ~hpriv[2] & ~priv[2]);
1158assign p_cnt_en[3] = (pcr3_dout[3] & hpriv[3]) | (pcr3_dout[1] & ~hpriv[3] & priv[3]) | (pcr3_dout[2] & ~hpriv[3] & ~priv[3]);
1159assign p_cnt_en[4] = (pcr4_dout[3] & hpriv[4]) | (pcr4_dout[1] & ~hpriv[4] & priv[4]) | (pcr4_dout[2] & ~hpriv[4] & ~priv[4]);
1160assign p_cnt_en[5] = (pcr5_dout[3] & hpriv[5]) | (pcr5_dout[1] & ~hpriv[5] & priv[5]) | (pcr5_dout[2] & ~hpriv[5] & ~priv[5]);
1161assign p_cnt_en[6] = (pcr6_dout[3] & hpriv[6]) | (pcr6_dout[1] & ~hpriv[6] & priv[6]) | (pcr6_dout[2] & ~hpriv[6] & ~priv[6]);
1162assign p_cnt_en[7] = (pcr7_dout[3] & hpriv[7]) | (pcr7_dout[1] & ~hpriv[7] & priv[7]) | (pcr7_dout[2] & ~hpriv[7] & ~priv[7]);
1163
1164// Decode upper counter events
1165
1166// SL[3:0] = 4'b0000
1167assign ph_all_idle[0]= ~|pcr0_dout[30:27] & p_cnt_en[0];
1168assign ph_all_idle[1]= ~|pcr1_dout[30:27] & p_cnt_en[1];
1169assign ph_all_idle[2]= ~|pcr2_dout[30:27] & p_cnt_en[2];
1170assign ph_all_idle[3]= ~|pcr3_dout[30:27] & p_cnt_en[3];
1171assign ph_all_idle[4]= ~|pcr4_dout[30:27] & p_cnt_en[4];
1172assign ph_all_idle[5]= ~|pcr5_dout[30:27] & p_cnt_en[5];
1173assign ph_all_idle[6]= ~|pcr6_dout[30:27] & p_cnt_en[6];
1174assign ph_all_idle[7]= ~|pcr7_dout[30:27] & p_cnt_en[7];
1175
1176// SL[3:0] = 4'b0010 - instruction events
1177assign ph_ig[0] = ~pcr0_dout[30] & ~pcr0_dout[29] & pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0];
1178assign ph_ig[1] = ~pcr1_dout[30] & ~pcr1_dout[29] & pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1];
1179assign ph_ig[2] = ~pcr2_dout[30] & ~pcr2_dout[29] & pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2];
1180assign ph_ig[3] = ~pcr3_dout[30] & ~pcr3_dout[29] & pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3];
1181assign ph_ig[4] = ~pcr4_dout[30] & ~pcr4_dout[29] & pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4];
1182assign ph_ig[5] = ~pcr5_dout[30] & ~pcr5_dout[29] & pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5];
1183assign ph_ig[6] = ~pcr6_dout[30] & ~pcr6_dout[29] & pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6];
1184assign ph_ig[7] = ~pcr7_dout[30] & ~pcr7_dout[29] & pcr7_dout[28] & ~pcr7_dout[27] & p_cnt_en[7];
1185
1186// SL[3:0] = 4'b0011 - cache events
1187assign ph_cg[0] = ~pcr0_dout[30] & ~pcr0_dout[29] & pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0];
1188assign ph_cg[1] = ~pcr1_dout[30] & ~pcr1_dout[29] & pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1];
1189assign ph_cg[2] = ~pcr2_dout[30] & ~pcr2_dout[29] & pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2];
1190assign ph_cg[3] = ~pcr3_dout[30] & ~pcr3_dout[29] & pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3];
1191assign ph_cg[4] = ~pcr4_dout[30] & ~pcr4_dout[29] & pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4];
1192assign ph_cg[5] = ~pcr5_dout[30] & ~pcr5_dout[29] & pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5];
1193assign ph_cg[6] = ~pcr6_dout[30] & ~pcr6_dout[29] & pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6];
1194assign ph_cg[7] = ~pcr7_dout[30] & ~pcr7_dout[29] & pcr7_dout[28] & pcr7_dout[27] & p_cnt_en[7];
1195
1196// SL[3:0] = 4'b0100 - L2 mmu events
1197assign ph_mm[0] = ~pcr0_dout[30] & pcr0_dout[29] & ~pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0];
1198assign ph_mm[1] = ~pcr1_dout[30] & pcr1_dout[29] & ~pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1];
1199assign ph_mm[2] = ~pcr2_dout[30] & pcr2_dout[29] & ~pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2];
1200assign ph_mm[3] = ~pcr3_dout[30] & pcr3_dout[29] & ~pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3];
1201assign ph_mm[4] = ~pcr4_dout[30] & pcr4_dout[29] & ~pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4];
1202assign ph_mm[5] = ~pcr5_dout[30] & pcr5_dout[29] & ~pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5];
1203assign ph_mm[6] = ~pcr6_dout[30] & pcr6_dout[29] & ~pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6];
1204assign ph_mm[7] = ~pcr7_dout[30] & pcr7_dout[29] & ~pcr7_dout[28] & ~pcr7_dout[27] & p_cnt_en[7];
1205
1206// SL[3:0] = 4'b0101 - crossbar events
1207assign ph_xb[0] = ~pcr0_dout[30] & pcr0_dout[29] & ~pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0];
1208assign ph_xb[1] = ~pcr1_dout[30] & pcr1_dout[29] & ~pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1];
1209assign ph_xb[2] = ~pcr2_dout[30] & pcr2_dout[29] & ~pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2];
1210assign ph_xb[3] = ~pcr3_dout[30] & pcr3_dout[29] & ~pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3];
1211assign ph_xb[4] = ~pcr4_dout[30] & pcr4_dout[29] & ~pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4];
1212assign ph_xb[5] = ~pcr5_dout[30] & pcr5_dout[29] & ~pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5];
1213assign ph_xb[6] = ~pcr6_dout[30] & pcr6_dout[29] & ~pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6];
1214assign ph_xb[7] = ~pcr7_dout[30] & pcr7_dout[29] & ~pcr7_dout[28] & pcr7_dout[27] & p_cnt_en[7];
1215
1216// SL[3:0] = 4'b0110 - spu operation events
1217assign ph_so[0] = ~pcr0_dout[30] & pcr0_dout[29] & pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0];
1218assign ph_so[1] = ~pcr1_dout[30] & pcr1_dout[29] & pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1];
1219assign ph_so[2] = ~pcr2_dout[30] & pcr2_dout[29] & pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2];
1220assign ph_so[3] = ~pcr3_dout[30] & pcr3_dout[29] & pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3];
1221assign ph_so[4] = ~pcr4_dout[30] & pcr4_dout[29] & pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4];
1222assign ph_so[5] = ~pcr5_dout[30] & pcr5_dout[29] & pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5];
1223assign ph_so[6] = ~pcr6_dout[30] & pcr6_dout[29] & pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6];
1224assign ph_so[7] = ~pcr7_dout[30] & pcr7_dout[29] & pcr7_dout[28] & ~pcr7_dout[27] & p_cnt_en[7];
1225
1226// SL[3:0] = 4'b0111 - spu busy cycles
1227assign ph_sb[0] = ~pcr0_dout[30] & pcr0_dout[29] & pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0];
1228assign ph_sb[1] = ~pcr1_dout[30] & pcr1_dout[29] & pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1];
1229assign ph_sb[2] = ~pcr2_dout[30] & pcr2_dout[29] & pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2];
1230assign ph_sb[3] = ~pcr3_dout[30] & pcr3_dout[29] & pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3];
1231assign ph_sb[4] = ~pcr4_dout[30] & pcr4_dout[29] & pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4];
1232assign ph_sb[5] = ~pcr5_dout[30] & pcr5_dout[29] & pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5];
1233assign ph_sb[6] = ~pcr6_dout[30] & pcr6_dout[29] & pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6];
1234assign ph_sb[7] = ~pcr7_dout[30] & pcr7_dout[29] & pcr7_dout[28] & pcr7_dout[27] & p_cnt_en[7];
1235
1236// Decode lower counter events
1237
1238// SL[3:0] = 4'b0000
1239assign pl_all_idle[0] = ~|pcr0_dout[17:14] & p_cnt_en[0];
1240assign pl_all_idle[1] = ~|pcr1_dout[17:14] & p_cnt_en[1];
1241assign pl_all_idle[2] = ~|pcr2_dout[17:14] & p_cnt_en[2];
1242assign pl_all_idle[3] = ~|pcr3_dout[17:14] & p_cnt_en[3];
1243assign pl_all_idle[4] = ~|pcr4_dout[17:14] & p_cnt_en[4];
1244assign pl_all_idle[5] = ~|pcr5_dout[17:14] & p_cnt_en[5];
1245assign pl_all_idle[6] = ~|pcr6_dout[17:14] & p_cnt_en[6];
1246assign pl_all_idle[7] = ~|pcr7_dout[17:14] & p_cnt_en[7];
1247
1248// SL[3:0] = 4'b0010 - instruction events
1249assign pl_ig[0] = ~pcr0_dout[17] & ~pcr0_dout[16] & pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0];
1250assign pl_ig[1] = ~pcr1_dout[17] & ~pcr1_dout[16] & pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1];
1251assign pl_ig[2] = ~pcr2_dout[17] & ~pcr2_dout[16] & pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2];
1252assign pl_ig[3] = ~pcr3_dout[17] & ~pcr3_dout[16] & pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3];
1253assign pl_ig[4] = ~pcr4_dout[17] & ~pcr4_dout[16] & pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4];
1254assign pl_ig[5] = ~pcr5_dout[17] & ~pcr5_dout[16] & pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5];
1255assign pl_ig[6] = ~pcr6_dout[17] & ~pcr6_dout[16] & pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6];
1256assign pl_ig[7] = ~pcr7_dout[17] & ~pcr7_dout[16] & pcr7_dout[15] & ~pcr7_dout[14] & p_cnt_en[7];
1257
1258// SL[3:0] = 4'b0011 - cache events
1259assign pl_cg[0] = ~pcr0_dout[17] & ~pcr0_dout[16] & pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0];
1260assign pl_cg[1] = ~pcr1_dout[17] & ~pcr1_dout[16] & pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1];
1261assign pl_cg[2] = ~pcr2_dout[17] & ~pcr2_dout[16] & pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2];
1262assign pl_cg[3] = ~pcr3_dout[17] & ~pcr3_dout[16] & pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3];
1263assign pl_cg[4] = ~pcr4_dout[17] & ~pcr4_dout[16] & pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4];
1264assign pl_cg[5] = ~pcr5_dout[17] & ~pcr5_dout[16] & pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5];
1265assign pl_cg[6] = ~pcr6_dout[17] & ~pcr6_dout[16] & pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6];
1266assign pl_cg[7] = ~pcr7_dout[17] & ~pcr7_dout[16] & pcr7_dout[15] & pcr7_dout[14] & p_cnt_en[7];
1267
1268// SL[3:0] = 4'b0100 - L2 mmu events
1269assign pl_mm[0] = ~pcr0_dout[17] & pcr0_dout[16] & ~pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0];
1270assign pl_mm[1] = ~pcr1_dout[17] & pcr1_dout[16] & ~pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1];
1271assign pl_mm[2] = ~pcr2_dout[17] & pcr2_dout[16] & ~pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2];
1272assign pl_mm[3] = ~pcr3_dout[17] & pcr3_dout[16] & ~pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3];
1273assign pl_mm[4] = ~pcr4_dout[17] & pcr4_dout[16] & ~pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4];
1274assign pl_mm[5] = ~pcr5_dout[17] & pcr5_dout[16] & ~pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5];
1275assign pl_mm[6] = ~pcr6_dout[17] & pcr6_dout[16] & ~pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6];
1276assign pl_mm[7] = ~pcr7_dout[17] & pcr7_dout[16] & ~pcr7_dout[15] & ~pcr7_dout[14] & p_cnt_en[7];
1277
1278// SL[3:0] = 4'b0101 - crossbar events
1279assign pl_xb[0] = ~pcr0_dout[17] & pcr0_dout[16] & ~pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0];
1280assign pl_xb[1] = ~pcr1_dout[17] & pcr1_dout[16] & ~pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1];
1281assign pl_xb[2] = ~pcr2_dout[17] & pcr2_dout[16] & ~pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2];
1282assign pl_xb[3] = ~pcr3_dout[17] & pcr3_dout[16] & ~pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3];
1283assign pl_xb[4] = ~pcr4_dout[17] & pcr4_dout[16] & ~pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4];
1284assign pl_xb[5] = ~pcr5_dout[17] & pcr5_dout[16] & ~pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5];
1285assign pl_xb[6] = ~pcr6_dout[17] & pcr6_dout[16] & ~pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6];
1286assign pl_xb[7] = ~pcr7_dout[17] & pcr7_dout[16] & ~pcr7_dout[15] & pcr7_dout[14] & p_cnt_en[7];
1287
1288// SL[3:0] = 4'b0110 - spu operation events
1289assign pl_so[0] = ~pcr0_dout[17] & pcr0_dout[16] & pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0];
1290assign pl_so[1] = ~pcr1_dout[17] & pcr1_dout[16] & pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1];
1291assign pl_so[2] = ~pcr2_dout[17] & pcr2_dout[16] & pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2];
1292assign pl_so[3] = ~pcr3_dout[17] & pcr3_dout[16] & pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3];
1293assign pl_so[4] = ~pcr4_dout[17] & pcr4_dout[16] & pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4];
1294assign pl_so[5] = ~pcr5_dout[17] & pcr5_dout[16] & pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5];
1295assign pl_so[6] = ~pcr6_dout[17] & pcr6_dout[16] & pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6];
1296assign pl_so[7] = ~pcr7_dout[17] & pcr7_dout[16] & pcr7_dout[15] & ~pcr7_dout[14] & p_cnt_en[7];
1297
1298// SL[3:0] = 4'b0111 - spu busy events
1299assign pl_sb[0] = ~pcr0_dout[17] & pcr0_dout[16] & pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0];
1300assign pl_sb[1] = ~pcr1_dout[17] & pcr1_dout[16] & pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1];
1301assign pl_sb[2] = ~pcr2_dout[17] & pcr2_dout[16] & pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2];
1302assign pl_sb[3] = ~pcr3_dout[17] & pcr3_dout[16] & pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3];
1303assign pl_sb[4] = ~pcr4_dout[17] & pcr4_dout[16] & pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4];
1304assign pl_sb[5] = ~pcr5_dout[17] & pcr5_dout[16] & pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5];
1305assign pl_sb[6] = ~pcr6_dout[17] & pcr6_dout[16] & pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6];
1306assign pl_sb[7] = ~pcr7_dout[17] & pcr7_dout[16] & pcr7_dout[15] & pcr7_dout[14] & p_cnt_en[7];
1307
1308// Generate outputs to let LSU know if we are about to trap on a dcache/dt/l2d/store miss
1309// pdp_pich_wrap need to be qualified with pct_wr_pic_w2? (e.g. PIC gets overwritten with a near overflow value and cause trap?)
1310// Must use flopped wrap signals to avoid a timing path now that PMU is at the upper left and LSU at lower right...
1311// New design - take TID of what is in LSU in E from DEC; mux down PMU signals internally; send 1 bit to LSU for
1312// each one of dcmiss & icmiss trap indicator; still send 8 bits for L2miss since there is no equivalent TID.
1313
1314assign dcm_h[7:0] = ph_cg[7:0] & {pcr7_dout[20], pcr6_dout[20], pcr5_dout[20], pcr4_dout[20],
1315 pcr3_dout[20], pcr2_dout[20], pcr1_dout[20], pcr0_dout[20]};
1316
1317assign dcm_l[7:0] = pl_cg[7:0] & {pcr7_dout[ 7], pcr6_dout[7], pcr5_dout[7], pcr4_dout[7],
1318 pcr3_dout[7], pcr2_dout[7], pcr1_dout[7], pcr0_dout[7]};
1319
1320assign pmu_lsu_dcmiss_trap_e[7:0] = (dcm_h[7:0] & pich_wrap[7:0]) | (dcm_l & picl_wrap[7:0]);
1321
1322// Decode TID from DEC
1323assign t[0] = ~lsu_tid_e[2] & ~lsu_tid_e[1] & ~lsu_tid_e[0];
1324assign t[1] = ~lsu_tid_e[2] & ~lsu_tid_e[1] & lsu_tid_e[0];
1325assign t[2] = ~lsu_tid_e[2] & lsu_tid_e[1] & ~lsu_tid_e[0];
1326assign t[3] = ~lsu_tid_e[2] & lsu_tid_e[1] & lsu_tid_e[0];
1327assign t[4] = lsu_tid_e[2] & ~lsu_tid_e[1] & ~lsu_tid_e[0];
1328assign t[5] = lsu_tid_e[2] & ~lsu_tid_e[1] & lsu_tid_e[0];
1329assign t[6] = lsu_tid_e[2] & lsu_tid_e[1] & ~lsu_tid_e[0];
1330assign t[7] = lsu_tid_e[2] & lsu_tid_e[1] & lsu_tid_e[0];
1331
1332assign pmu_lsu_dcm_trap_e = |(t[7:0] & pmu_lsu_dcmiss_trap_e[7:0] & { {4 {tlu_pmu_trap_mask_e[1]}}, {4 {tlu_pmu_trap_mask_e[0]}} });
1333
1334assign dtm_h[7:0] = ph_cg[7:0] & {pcr7_dout[22], pcr6_dout[22], pcr5_dout[22], pcr4_dout[22],
1335 pcr3_dout[22], pcr2_dout[22], pcr1_dout[22], pcr0_dout[22]};
1336
1337assign dtm_l[7:0] = pl_cg[7:0] & {pcr7_dout[9], pcr6_dout[9], pcr5_dout[9], pcr4_dout[9],
1338 pcr3_dout[9], pcr2_dout[9], pcr1_dout[9], pcr0_dout[9]};
1339
1340assign pmu_lsu_dtmiss_trap_e[7:0] = (dtm_h[7:0] & pich_wrap[7:0]) | (dtm_l & picl_wrap[7:0]);
1341
1342assign pmu_lsu_dtm_trap_e = |(t[7:0] & pmu_lsu_dtmiss_trap_e[7:0] & { {4 {tlu_pmu_trap_mask_e[1]}}, {4 {tlu_pmu_trap_mask_e[0]}} });
1343
1344assign l2dm_h[7:0] = ph_cg[7:0] & {pcr7_dout[24], pcr6_dout[24], pcr5_dout[24], pcr4_dout[24],
1345 pcr3_dout[24], pcr2_dout[24], pcr1_dout[24], pcr0_dout[24]};
1346
1347assign l2dm_l[7:0] = pl_cg[7:0] & {pcr7_dout[11], pcr6_dout[11], pcr5_dout[11], pcr4_dout[11],
1348 pcr3_dout[11], pcr2_dout[11], pcr1_dout[11], pcr0_dout[11]};
1349
1350// Need to do L2 misses on an individual TID basis, as out-of-pipe!
1351//assign pmu_lsu_l2dmiss_trap_e[7:0] = ((l2dm_h[7:0] & pich_wrap[7:0]) | (l2dm_l & picl_wrap[7:0])) & { {4 {tlu_pmu_trap_mask_e[1]}}, {4 {tlu_pmu_trap_mask_e[0]}} };
1352
1353// Must accumulate current value of trap mask for all threads; update when valid tid in E
1354// TLU gives PMU a trap mask per TG; must update trap mask based upon TID of each TG's instruction.
1355// Each cycle a valid instruction comes down the pipe, update the current value of the the lsu trap mask for that thread
1356// Flop to M, then compute for timing reasons (dec_valid_e late)
1357
1358// Flop from E to M
1359pmu_pct_ctl_msff_ctl_macro__width_28 lsu_e2m (
1360 .scan_in(lsu_e2m_scanin),
1361 .scan_out(lsu_e2m_scanout),
1362 .l1clk (l1clk_pm1),
1363 .din ({pmu_lsu_dcm_trap_e, pmu_lsu_dtm_trap_e, l2dm_wrap_e[7:0], lsu_trap_mask_m_din[7:0], th[7:0], tlu_pmu_trap_mask_e[1:0]}),
1364 .dout ({pmu_lsu_dcmiss_trap_m, pmu_lsu_dtmiss_trap_m, l2dm_wrap_m[7:0], lsu_trap_mask_m[7:0], th_m[7:0], tlu_pmu_trap_mask_m[1:0]}),
1365 .siclk(siclk),
1366 .soclk(soclk)
1367);
1368
1369// At most 2 bits should be on in this mask
1370// 0in bits_on -var (lsu_tidm_update_m[7:0]) -max 2 -message "Too many bits on in lsu_tidm_update_m[7:0]"
1371assign lsu_tidm_update_m[7:0] = {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}} & th_m[7:0];
1372
1373assign lsu_trap_mask_m_din[7:0] = ( ~lsu_tidm_update_m[7:0] & lsu_trap_mask_m[7:0]) |
1374 ( lsu_tidm_update_m[7:0] & {{4 {tlu_pmu_trap_mask_m[1]}}, {4 {tlu_pmu_trap_mask_m[0]}}});
1375
1376assign l2dm_wrap_e[7:0] = (l2dm_h[7:0] & pich_wrap[7:0]) | (l2dm_l[7:0] & picl_wrap[7:0]);
1377
1378assign pmu_lsu_l2dmiss_trap_m[7:0] = l2dm_wrap_m[7:0] & lsu_trap_mask_m_din[7:0];
1379
1380// Generate increment values
1381// All idle
1382assign ph_ai[7:0] = ph_all_idle[7:0] & {8 {all_idle_e}};
1383assign pl_ai[7:0] = pl_all_idle[7:0] & {8 {all_idle_e}};
1384
1385// Generate actual increment events (counter is configured and event occurs)
1386
1387// First do instruction group events
1388
1389// For SL[3:0] = 4'b0010... tg0_ityp_e[9:0]: atomic, l2i, it, ic, other, %sethi, store, load, FGU, branch
1390// 0x01, 0x02, 0x04, 0x08, 0x10 and 0x20
1391
1392// taken branch event for TLU is done in M stage... th & dec_br_taken_e[1:0]
1393
1394// High counters
1395assign ph_ige[0] = |({7 {ph_ig[0] & th[0]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr0_dout[26:21], pcr0_dout[19]});
1396assign ph_ige[1] = |({7 {ph_ig[1] & th[1]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr1_dout[26:21], pcr1_dout[19]});
1397assign ph_ige[2] = |({7 {ph_ig[2] & th[2]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr2_dout[26:21], pcr2_dout[19]});
1398assign ph_ige[3] = |({7 {ph_ig[3] & th[3]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr3_dout[26:21], pcr3_dout[19]});
1399assign ph_ige[4] = |({7 {ph_ig[4] & th[4]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr4_dout[26:21], pcr4_dout[19]});
1400assign ph_ige[5] = |({7 {ph_ig[5] & th[5]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr5_dout[26:21], pcr5_dout[19]});
1401assign ph_ige[6] = |({7 {ph_ig[6] & th[6]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr6_dout[26:21], pcr6_dout[19]});
1402assign ph_ige[7] = |({7 {ph_ig[7] & th[7]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr7_dout[26:21], pcr7_dout[19]});
1403
1404// Low counters
1405assign pl_ige[0] = |({7 {pl_ig[0] & th[0]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr0_dout[13:8], pcr0_dout[6]});
1406assign pl_ige[1] = |({7 {pl_ig[1] & th[1]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr1_dout[13:8], pcr1_dout[6]});
1407assign pl_ige[2] = |({7 {pl_ig[2] & th[2]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr2_dout[13:8], pcr2_dout[6]});
1408assign pl_ige[3] = |({7 {pl_ig[3] & th[3]}} & {tg0_ityp_e[9], tg0_ityp_e[5:0]} & {pcr3_dout[13:8], pcr3_dout[6]});
1409assign pl_ige[4] = |({7 {pl_ig[4] & th[4]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr4_dout[13:8], pcr4_dout[6]});
1410assign pl_ige[5] = |({7 {pl_ig[5] & th[5]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr5_dout[13:8], pcr5_dout[6]});
1411assign pl_ige[6] = |({7 {pl_ig[6] & th[6]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr6_dout[13:8], pcr6_dout[6]});
1412assign pl_ige[7] = |({7 {pl_ig[7] & th[7]}} & {tg1_ityp_e[9], tg1_ityp_e[5:0]} & {pcr7_dout[13:8], pcr7_dout[6]});
1413
1414// qualifier for dec_br_taken
1415assign ph_bre[0] = ph_ig[0] & th[0] & pcr0_dout[20];
1416assign ph_bre[1] = ph_ig[1] & th[1] & pcr1_dout[20];
1417assign ph_bre[2] = ph_ig[2] & th[2] & pcr2_dout[20];
1418assign ph_bre[3] = ph_ig[3] & th[3] & pcr3_dout[20];
1419assign ph_bre[4] = ph_ig[4] & th[4] & pcr4_dout[20];
1420assign ph_bre[5] = ph_ig[5] & th[5] & pcr5_dout[20];
1421assign ph_bre[6] = ph_ig[6] & th[6] & pcr6_dout[20];
1422assign ph_bre[7] = ph_ig[7] & th[7] & pcr7_dout[20];
1423
1424assign pl_bre[0] = pl_ig[0] & th[0] & pcr0_dout[7];
1425assign pl_bre[1] = pl_ig[1] & th[1] & pcr1_dout[7];
1426assign pl_bre[2] = pl_ig[2] & th[2] & pcr2_dout[7];
1427assign pl_bre[3] = pl_ig[3] & th[3] & pcr3_dout[7];
1428assign pl_bre[4] = pl_ig[4] & th[4] & pcr4_dout[7];
1429assign pl_bre[5] = pl_ig[5] & th[5] & pcr5_dout[7];
1430assign pl_bre[6] = pl_ig[6] & th[6] & pcr6_dout[7];
1431assign pl_bre[7] = pl_ig[7] & th[7] & pcr7_dout[7];
1432
1433// High and low counters for cache group events
1434// For SL[3:0] = 4'b0011...
1435// 0x02
1436assign dcm_he[0] = ph_cg[0] & pcr0_dout[20] & dcm[0];
1437assign dcm_he[1] = ph_cg[1] & pcr1_dout[20] & dcm[1];
1438assign dcm_he[2] = ph_cg[2] & pcr2_dout[20] & dcm[2];
1439assign dcm_he[3] = ph_cg[3] & pcr3_dout[20] & dcm[3];
1440assign dcm_he[4] = ph_cg[4] & pcr4_dout[20] & dcm[4];
1441assign dcm_he[5] = ph_cg[5] & pcr5_dout[20] & dcm[5];
1442assign dcm_he[6] = ph_cg[6] & pcr6_dout[20] & dcm[6];
1443assign dcm_he[7] = ph_cg[7] & pcr7_dout[20] & dcm[7];
1444
1445// 0x08
1446assign dtm_he[0] = ph_cg[0] & pcr0_dout[22] & dtm[0];
1447assign dtm_he[1] = ph_cg[1] & pcr1_dout[22] & dtm[1];
1448assign dtm_he[2] = ph_cg[2] & pcr2_dout[22] & dtm[2];
1449assign dtm_he[3] = ph_cg[3] & pcr3_dout[22] & dtm[3];
1450assign dtm_he[4] = ph_cg[4] & pcr4_dout[22] & dtm[4];
1451assign dtm_he[5] = ph_cg[5] & pcr5_dout[22] & dtm[5];
1452assign dtm_he[6] = ph_cg[6] & pcr6_dout[22] & dtm[6];
1453assign dtm_he[7] = ph_cg[7] & pcr7_dout[22] & dtm[7];
1454
1455// 0x20
1456assign l2m_he[0] = ph_cg[0] & pcr0_dout[24] & l2m[0];
1457assign l2m_he[1] = ph_cg[1] & pcr1_dout[24] & l2m[1];
1458assign l2m_he[2] = ph_cg[2] & pcr2_dout[24] & l2m[2];
1459assign l2m_he[3] = ph_cg[3] & pcr3_dout[24] & l2m[3];
1460assign l2m_he[4] = ph_cg[4] & pcr4_dout[24] & l2m[4];
1461assign l2m_he[5] = ph_cg[5] & pcr5_dout[24] & l2m[5];
1462assign l2m_he[6] = ph_cg[6] & pcr6_dout[24] & l2m[6];
1463assign l2m_he[7] = ph_cg[7] & pcr7_dout[24] & l2m[7];
1464
1465// 0x02
1466assign dcm_le[0] = pl_cg[0] & pcr0_dout[7] & dcm[0];
1467assign dcm_le[1] = pl_cg[1] & pcr1_dout[7] & dcm[1];
1468assign dcm_le[2] = pl_cg[2] & pcr2_dout[7] & dcm[2];
1469assign dcm_le[3] = pl_cg[3] & pcr3_dout[7] & dcm[3];
1470assign dcm_le[4] = pl_cg[4] & pcr4_dout[7] & dcm[4];
1471assign dcm_le[5] = pl_cg[5] & pcr5_dout[7] & dcm[5];
1472assign dcm_le[6] = pl_cg[6] & pcr6_dout[7] & dcm[6];
1473assign dcm_le[7] = pl_cg[7] & pcr7_dout[7] & dcm[7];
1474
1475// 0x08
1476assign dtm_le[0] = pl_cg[0] & pcr0_dout[9] & dtm[0];
1477assign dtm_le[1] = pl_cg[1] & pcr1_dout[9] & dtm[1];
1478assign dtm_le[2] = pl_cg[2] & pcr2_dout[9] & dtm[2];
1479assign dtm_le[3] = pl_cg[3] & pcr3_dout[9] & dtm[3];
1480assign dtm_le[4] = pl_cg[4] & pcr4_dout[9] & dtm[4];
1481assign dtm_le[5] = pl_cg[5] & pcr5_dout[9] & dtm[5];
1482assign dtm_le[6] = pl_cg[6] & pcr6_dout[9] & dtm[6];
1483assign dtm_le[7] = pl_cg[7] & pcr7_dout[9] & dtm[7];
1484
1485// 0x20
1486assign l2m_le[0] = pl_cg[0] & pcr0_dout[11] & l2m[0];
1487assign l2m_le[1] = pl_cg[1] & pcr1_dout[11] & l2m[1];
1488assign l2m_le[2] = pl_cg[2] & pcr2_dout[11] & l2m[2];
1489assign l2m_le[3] = pl_cg[3] & pcr3_dout[11] & l2m[3];
1490assign l2m_le[4] = pl_cg[4] & pcr4_dout[11] & l2m[4];
1491assign l2m_le[5] = pl_cg[5] & pcr5_dout[11] & l2m[5];
1492assign l2m_le[6] = pl_cg[6] & pcr6_dout[11] & l2m[6];
1493assign l2m_le[7] = pl_cg[7] & pcr7_dout[11] & l2m[7];
1494
1495// Split cache group events into I & D side misses, since they need to get piped in
1496// at different stages...
1497assign ph_icge[0] = |({3 {ph_cg[0] & th[0]}} & tg0_ityp_e[8:6] & {pcr0_dout[23],pcr0_dout[21],pcr0_dout[19]}); // l2i, it, ic miss
1498assign ph_icge[1] = |({3 {ph_cg[1] & th[1]}} & tg0_ityp_e[8:6] & {pcr1_dout[23],pcr1_dout[21],pcr1_dout[19]}); // l2i, it, ic miss
1499assign ph_icge[2] = |({3 {ph_cg[2] & th[2]}} & tg0_ityp_e[8:6] & {pcr2_dout[23],pcr2_dout[21],pcr2_dout[19]}); // l2i, it, ic miss
1500assign ph_icge[3] = |({3 {ph_cg[3] & th[3]}} & tg0_ityp_e[8:6] & {pcr3_dout[23],pcr3_dout[21],pcr3_dout[19]}); // l2i, it, ic miss
1501assign ph_icge[4] = |({3 {ph_cg[4] & th[4]}} & tg1_ityp_e[8:6] & {pcr4_dout[23],pcr4_dout[21],pcr4_dout[19]}); // l2i, it, ic miss
1502assign ph_icge[5] = |({3 {ph_cg[5] & th[5]}} & tg1_ityp_e[8:6] & {pcr5_dout[23],pcr5_dout[21],pcr5_dout[19]}); // l2i, it, ic miss
1503assign ph_icge[6] = |({3 {ph_cg[6] & th[6]}} & tg1_ityp_e[8:6] & {pcr6_dout[23],pcr6_dout[21],pcr6_dout[19]}); // l2i, it, ic miss
1504assign ph_icge[7] = |({3 {ph_cg[7] & th[7]}} & tg1_ityp_e[8:6] & {pcr7_dout[23],pcr7_dout[21],pcr7_dout[19]}); // l2i, it, ic miss
1505
1506//assign ph_dcge[7:0] = dcm_he[7:0] | dtm_he[7:0] | l2m_he[7:0];
1507
1508assign pl_icge[0] = |({3 {pl_cg[0] & th[0]}} & tg0_ityp_e[8:6] & {pcr0_dout[10],pcr0_dout[8],pcr0_dout[6]}); // l2i, it, ic miss
1509assign pl_icge[1] = |({3 {pl_cg[1] & th[1]}} & tg0_ityp_e[8:6] & {pcr1_dout[10],pcr1_dout[8],pcr1_dout[6]}); // l2i, it, ic miss
1510assign pl_icge[2] = |({3 {pl_cg[2] & th[2]}} & tg0_ityp_e[8:6] & {pcr2_dout[10],pcr2_dout[8],pcr2_dout[6]}); // l2i, it, ic miss
1511assign pl_icge[3] = |({3 {pl_cg[3] & th[3]}} & tg0_ityp_e[8:6] & {pcr3_dout[10],pcr3_dout[8],pcr3_dout[6]}); // l2i, it, ic miss
1512assign pl_icge[4] = |({3 {pl_cg[4] & th[4]}} & tg1_ityp_e[8:6] & {pcr4_dout[10],pcr4_dout[8],pcr4_dout[6]}); // l2i, it, ic miss
1513assign pl_icge[5] = |({3 {pl_cg[5] & th[5]}} & tg1_ityp_e[8:6] & {pcr5_dout[10],pcr5_dout[8],pcr5_dout[6]}); // l2i, it, ic miss
1514assign pl_icge[6] = |({3 {pl_cg[6] & th[6]}} & tg1_ityp_e[8:6] & {pcr6_dout[10],pcr6_dout[8],pcr6_dout[6]}); // l2i, it, ic miss
1515assign pl_icge[7] = |({3 {pl_cg[7] & th[7]}} & tg1_ityp_e[8:6] & {pcr7_dout[10],pcr7_dout[8],pcr7_dout[6]}); // l2i, it, ic miss
1516
1517//assign pl_dcge[7:0] = dcm_le[7:0] | dtm_le[7:0] | l2m_le[7:0];
1518
1519// High and low MMU events
1520// first decode MMU tid...
1521assign mm_tid[0] = ~mm_mtyp[4] & ~mm_mtyp[3] & ~mm_mtyp[2];
1522assign mm_tid[1] = ~mm_mtyp[4] & ~mm_mtyp[3] & mm_mtyp[2];
1523assign mm_tid[2] = ~mm_mtyp[4] & mm_mtyp[3] & ~mm_mtyp[2];
1524assign mm_tid[3] = ~mm_mtyp[4] & mm_mtyp[3] & mm_mtyp[2];
1525assign mm_tid[4] = mm_mtyp[4] & ~mm_mtyp[3] & ~mm_mtyp[2];
1526assign mm_tid[5] = mm_mtyp[4] & ~mm_mtyp[3] & mm_mtyp[2];
1527assign mm_tid[6] = mm_mtyp[4] & mm_mtyp[3] & ~mm_mtyp[2];
1528assign mm_tid[7] = mm_mtyp[4] & mm_mtyp[3] & mm_mtyp[2];
1529
1530// Now decode what actually happened {l2dtm, l2itm, l2dtr, l2itr}
1531assign mm_l2e[3:0] = {4 {mm_mtyp[5]}} &
1532 {mm_mtyp[1] & mm_mtyp[0], ~mm_mtyp[1] & mm_mtyp[0], mm_mtyp[1], ~mm_mtyp[1]};
1533
1534assign ph_mme[0] = ph_mm[0] & mm_tid[0] & |(mm_l2e[3:0] & pcr0_dout[24:21]);
1535assign ph_mme[1] = ph_mm[1] & mm_tid[1] & |(mm_l2e[3:0] & pcr1_dout[24:21]);
1536assign ph_mme[2] = ph_mm[2] & mm_tid[2] & |(mm_l2e[3:0] & pcr2_dout[24:21]);
1537assign ph_mme[3] = ph_mm[3] & mm_tid[3] & |(mm_l2e[3:0] & pcr3_dout[24:21]);
1538assign ph_mme[4] = ph_mm[4] & mm_tid[4] & |(mm_l2e[3:0] & pcr4_dout[24:21]);
1539assign ph_mme[5] = ph_mm[5] & mm_tid[5] & |(mm_l2e[3:0] & pcr5_dout[24:21]);
1540assign ph_mme[6] = ph_mm[6] & mm_tid[6] & |(mm_l2e[3:0] & pcr6_dout[24:21]);
1541assign ph_mme[7] = ph_mm[7] & mm_tid[7] & |(mm_l2e[3:0] & pcr7_dout[24:21]);
1542
1543assign pl_mme[0] = pl_mm[0] & mm_tid[0] & |(mm_l2e[3:0] & pcr0_dout[11:8]);
1544assign pl_mme[1] = pl_mm[1] & mm_tid[1] & |(mm_l2e[3:0] & pcr1_dout[11:8]);
1545assign pl_mme[2] = pl_mm[2] & mm_tid[2] & |(mm_l2e[3:0] & pcr2_dout[11:8]);
1546assign pl_mme[3] = pl_mm[3] & mm_tid[3] & |(mm_l2e[3:0] & pcr3_dout[11:8]);
1547assign pl_mme[4] = pl_mm[4] & mm_tid[4] & |(mm_l2e[3:0] & pcr4_dout[11:8]);
1548assign pl_mme[5] = pl_mm[5] & mm_tid[5] & |(mm_l2e[3:0] & pcr5_dout[11:8]);
1549assign pl_mme[6] = pl_mm[6] & mm_tid[6] & |(mm_l2e[3:0] & pcr6_dout[11:8]);
1550assign pl_mme[7] = pl_mm[7] & mm_tid[7] & |(mm_l2e[3:0] & pcr7_dout[11:8]);
1551
1552// High and low xbar events
1553//assign xb[7] = xbar[2] & xbar[1] & xbar[0]; // ma st
1554//assign xb[6] = xbar[2] & xbar[1] & ~xbar[0]; // ma ld
1555assign xb[5] = xbar[2] & ~xbar[1] & ~xbar[0]; // mmuld
1556assign xb[4] = ~xbar[2] & ~xbar[1] & xbar[0]; // cpust
1557assign xb[3] = xbar[2] & ~xbar[1] & xbar[0]; // ifetch
1558assign xb[2] = ~xbar[2] & ~xbar[1] & ~xbar[0]; // cpuld
1559assign xb[1] = (~xbar[2] & xbar[1] & xbar[0]) | (xbar[2] & xbar[1] & xbar[0]); // cwq st or ma st
1560assign xb[0] = (~xbar[2] & xbar[1] & ~xbar[0]) | (xbar[2] & xbar[1] & ~xbar[0]); // cwq ld or ma ld
1561
1562// For stream lds/stores, must munge tid, as xbar tid not accurate
1563
1564assign use_ma = xbar[2] & xbar[1];
1565assign use_cwq = ~xbar[2] & xbar[1];
1566
1567assign xbtid[2:0] = ({3 { use_ma}} & ma[2:0]) |
1568 ({3 { use_cwq}} & spu_tid[2:0]) |
1569 ({3 { ~use_ma & ~use_cwq}} & xbar[5:3]);
1570
1571// SL[3:0] = 4'b0101
1572assign ph_xbe[0] = ph_xb[0] & xbar[6] & ~xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr0_dout[24:19]);
1573assign ph_xbe[1] = ph_xb[1] & xbar[6] & ~xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr1_dout[24:19]);
1574assign ph_xbe[2] = ph_xb[2] & xbar[6] & ~xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr2_dout[24:19]);
1575assign ph_xbe[3] = ph_xb[3] & xbar[6] & ~xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr3_dout[24:19]);
1576assign ph_xbe[4] = ph_xb[4] & xbar[6] & xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr4_dout[24:19]);
1577assign ph_xbe[5] = ph_xb[5] & xbar[6] & xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr5_dout[24:19]);
1578assign ph_xbe[6] = ph_xb[6] & xbar[6] & xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr6_dout[24:19]);
1579assign ph_xbe[7] = ph_xb[7] & xbar[6] & xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr7_dout[24:19]);
1580
1581assign pl_xbe[0] = pl_xb[0] & xbar[6] & ~xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr0_dout[11:6]);
1582assign pl_xbe[1] = pl_xb[1] & xbar[6] & ~xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr1_dout[11:6]);
1583assign pl_xbe[2] = pl_xb[2] & xbar[6] & ~xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr2_dout[11:6]);
1584assign pl_xbe[3] = pl_xb[3] & xbar[6] & ~xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr3_dout[11:6]);
1585assign pl_xbe[4] = pl_xb[4] & xbar[6] & xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr4_dout[11:6]);
1586assign pl_xbe[5] = pl_xb[5] & xbar[6] & xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr5_dout[11:6]);
1587assign pl_xbe[6] = pl_xb[6] & xbar[6] & xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr6_dout[11:6]);
1588assign pl_xbe[7] = pl_xb[7] & xbar[6] & xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr7_dout[11:6]);
1589
1590// High and low SPU ops
1591
1592// SL[3:0] = 4'b0110
1593// increment spu_op only when the current des/aes/rc4/hash/ma/crc is busy and was not the previous cycle.
1594assign spu_des[7:0] = {8 {des & ~des_d1}} & cwq_tid[7:0];
1595assign spu_aes[7:0] = {8 {aes & ~aes_d1}} & cwq_tid[7:0];
1596assign spu_rc4[7:0] = {8 {rc4 & ~rc4_d1}} & cwq_tid[7:0];
1597assign spu_hash[7:0] = {8 {hash & ~hash_d1}} & cwq_tid[7:0];
1598assign spu_ma[7:0] = {8 {ma[3] & ~ma_3_d1}} & ma_tid[7:0];
1599assign spu_crc[7:0] = {8 {crc & ~crc_d1}} & cwq_tid[7:0];
1600
1601assign ph_soe[0] = ph_so[0] & |({spu_crc[0], spu_ma[0], spu_hash[0], spu_rc4[0], spu_aes[0], spu_des[0]} & pcr0_dout[24:19]);
1602assign ph_soe[1] = ph_so[1] & |({spu_crc[1], spu_ma[1], spu_hash[1], spu_rc4[1], spu_aes[1], spu_des[1]} & pcr1_dout[24:19]);
1603assign ph_soe[2] = ph_so[2] & |({spu_crc[2], spu_ma[2], spu_hash[2], spu_rc4[2], spu_aes[2], spu_des[2]} & pcr2_dout[24:19]);
1604assign ph_soe[3] = ph_so[3] & |({spu_crc[3], spu_ma[3], spu_hash[3], spu_rc4[3], spu_aes[3], spu_des[3]} & pcr3_dout[24:19]);
1605assign ph_soe[4] = ph_so[4] & |({spu_crc[4], spu_ma[4], spu_hash[4], spu_rc4[4], spu_aes[4], spu_des[4]} & pcr4_dout[24:19]);
1606assign ph_soe[5] = ph_so[5] & |({spu_crc[5], spu_ma[5], spu_hash[5], spu_rc4[5], spu_aes[5], spu_des[5]} & pcr5_dout[24:19]);
1607assign ph_soe[6] = ph_so[6] & |({spu_crc[6], spu_ma[6], spu_hash[6], spu_rc4[6], spu_aes[6], spu_des[6]} & pcr6_dout[24:19]);
1608assign ph_soe[7] = ph_so[7] & |({spu_crc[7], spu_ma[7], spu_hash[7], spu_rc4[7], spu_aes[7], spu_des[7]} & pcr7_dout[24:19]);
1609
1610assign pl_soe[0] = pl_so[0] & |({spu_crc[0], spu_ma[0], spu_hash[0], spu_rc4[0], spu_aes[0], spu_des[0]} & pcr0_dout[11:6]);
1611assign pl_soe[1] = pl_so[1] & |({spu_crc[1], spu_ma[1], spu_hash[1], spu_rc4[1], spu_aes[1], spu_des[1]} & pcr1_dout[11:6]);
1612assign pl_soe[2] = pl_so[2] & |({spu_crc[2], spu_ma[2], spu_hash[2], spu_rc4[2], spu_aes[2], spu_des[2]} & pcr2_dout[11:6]);
1613assign pl_soe[3] = pl_so[3] & |({spu_crc[3], spu_ma[3], spu_hash[3], spu_rc4[3], spu_aes[3], spu_des[3]} & pcr3_dout[11:6]);
1614assign pl_soe[4] = pl_so[4] & |({spu_crc[4], spu_ma[4], spu_hash[4], spu_rc4[4], spu_aes[4], spu_des[4]} & pcr4_dout[11:6]);
1615assign pl_soe[5] = pl_so[5] & |({spu_crc[5], spu_ma[5], spu_hash[5], spu_rc4[5], spu_aes[5], spu_des[5]} & pcr5_dout[11:6]);
1616assign pl_soe[6] = pl_so[6] & |({spu_crc[6], spu_ma[6], spu_hash[6], spu_rc4[6], spu_aes[6], spu_des[6]} & pcr6_dout[11:6]);
1617assign pl_soe[7] = pl_so[7] & |({spu_crc[7], spu_ma[7], spu_hash[7], spu_rc4[7], spu_aes[7], spu_des[7]} & pcr7_dout[11:6]);
1618
1619// High and low SPU busy cycles
1620// SL[3:0] = 4'b0111
1621assign ph_sbe[0] = ph_sb[0] & |({crcb[0], mab[0], hashb[0], rc4b[0], aesb[0], desb[0]} & pcr0_dout[24:19]);
1622assign ph_sbe[1] = ph_sb[1] & |({crcb[1], mab[1], hashb[1], rc4b[1], aesb[1], desb[1]} & pcr1_dout[24:19]);
1623assign ph_sbe[2] = ph_sb[2] & |({crcb[2], mab[2], hashb[2], rc4b[2], aesb[2], desb[2]} & pcr2_dout[24:19]);
1624assign ph_sbe[3] = ph_sb[3] & |({crcb[3], mab[3], hashb[3], rc4b[3], aesb[3], desb[3]} & pcr3_dout[24:19]);
1625assign ph_sbe[4] = ph_sb[4] & |({crcb[4], mab[4], hashb[4], rc4b[4], aesb[4], desb[4]} & pcr4_dout[24:19]);
1626assign ph_sbe[5] = ph_sb[5] & |({crcb[5], mab[5], hashb[5], rc4b[5], aesb[5], desb[5]} & pcr5_dout[24:19]);
1627assign ph_sbe[6] = ph_sb[6] & |({crcb[6], mab[6], hashb[6], rc4b[6], aesb[6], desb[6]} & pcr6_dout[24:19]);
1628assign ph_sbe[7] = ph_sb[7] & |({crcb[7], mab[7], hashb[7], rc4b[7], aesb[7], desb[7]} & pcr7_dout[24:19]);
1629
1630assign pl_sbe[0] = pl_sb[0] & |({crcb[0], mab[0], hashb[0], rc4b[0], aesb[0], desb[0]} & pcr0_dout[11:6]);
1631assign pl_sbe[1] = pl_sb[1] & |({crcb[1], mab[1], hashb[1], rc4b[1], aesb[1], desb[1]} & pcr1_dout[11:6]);
1632assign pl_sbe[2] = pl_sb[2] & |({crcb[2], mab[2], hashb[2], rc4b[2], aesb[2], desb[2]} & pcr2_dout[11:6]);
1633assign pl_sbe[3] = pl_sb[3] & |({crcb[3], mab[3], hashb[3], rc4b[3], aesb[3], desb[3]} & pcr3_dout[11:6]);
1634assign pl_sbe[4] = pl_sb[4] & |({crcb[4], mab[4], hashb[4], rc4b[4], aesb[4], desb[4]} & pcr4_dout[11:6]);
1635assign pl_sbe[5] = pl_sb[5] & |({crcb[5], mab[5], hashb[5], rc4b[5], aesb[5], desb[5]} & pcr5_dout[11:6]);
1636assign pl_sbe[6] = pl_sb[6] & |({crcb[6], mab[6], hashb[6], rc4b[6], aesb[6], desb[6]} & pcr6_dout[11:6]);
1637assign pl_sbe[7] = pl_sb[7] & |({crcb[7], mab[7], hashb[7], rc4b[7], aesb[7], desb[7]} & pcr7_dout[11:6]);
1638
1639// qualify wrap with whether we should trap
1640assign pich_wrap[0] = pdp_pich_wrap[0] & pcr0_dout[5];
1641assign pich_wrap[1] = pdp_pich_wrap[1] & pcr1_dout[5];
1642assign pich_wrap[2] = pdp_pich_wrap[2] & pcr2_dout[5];
1643assign pich_wrap[3] = pdp_pich_wrap[3] & pcr3_dout[5];
1644assign pich_wrap[4] = pdp_pich_wrap[4] & pcr4_dout[5];
1645assign pich_wrap[5] = pdp_pich_wrap[5] & pcr5_dout[5];
1646assign pich_wrap[6] = pdp_pich_wrap[6] & pcr6_dout[5];
1647assign pich_wrap[7] = pdp_pich_wrap[7] & pcr7_dout[5];
1648
1649assign picl_wrap[0] = pdp_picl_wrap[0] & pcr0_dout[4];
1650assign picl_wrap[1] = pdp_picl_wrap[1] & pcr1_dout[4];
1651assign picl_wrap[2] = pdp_picl_wrap[2] & pcr2_dout[4];
1652assign picl_wrap[3] = pdp_picl_wrap[3] & pcr3_dout[4];
1653assign picl_wrap[4] = pdp_picl_wrap[4] & pcr4_dout[4];
1654assign picl_wrap[5] = pdp_picl_wrap[5] & pcr5_dout[4];
1655assign picl_wrap[6] = pdp_picl_wrap[6] & pcr6_dout[4];
1656assign picl_wrap[7] = pdp_picl_wrap[7] & pcr7_dout[4];
1657
1658// Generate traps if OV bit set (obviously don't increment the counters in this case!)
1659assign ovh[7:0] = {pcr7_dout[31] & pcr7_dout[5],
1660 pcr6_dout[31] & pcr6_dout[5],
1661 pcr5_dout[31] & pcr5_dout[5],
1662 pcr4_dout[31] & pcr4_dout[5],
1663 pcr3_dout[31] & pcr3_dout[5],
1664 pcr2_dout[31] & pcr2_dout[5],
1665 pcr1_dout[31] & pcr1_dout[5],
1666 pcr0_dout[31] & pcr0_dout[5]};
1667
1668assign ovl[7:0] = {pcr7_dout[18] & pcr7_dout[4],
1669 pcr6_dout[18] & pcr6_dout[4],
1670 pcr5_dout[18] & pcr5_dout[4],
1671 pcr4_dout[18] & pcr4_dout[4],
1672 pcr3_dout[18] & pcr3_dout[4],
1673 pcr2_dout[18] & pcr2_dout[4],
1674 pcr1_dout[18] & pcr1_dout[4],
1675 pcr0_dout[18] & pcr0_dout[4]};
1676
1677// According to dec_del_ctl.sv
1678// we don't need to clear the valid_d's for br_mispredict, trap flush or load flush
1679// we will never get a dec_valid_e for these cases
1680// flush means NOT valid... ifu_fl_e[1] = ~tg0_ityp_e[12]; qualified in th[7:0];
1681
1682// There are 3 distinct types of signals.
1683// 1) ige/icge - can get killed by ifu at m/b or tlu at b/w. In either case the kill actually happens
1684// one cycle later since the flush signals are flopped for timing reasons.
1685// 2) the dcge - can get killed by tlu at w (again, 1 cycle later).
1686// 3) the rest - which can't get killed.
1687// So, we have to do 2 things:
1688// A) for the trap signal to TLU, we have to generate a trap request and hold it until TLU acks it
1689// via the tlu_pmu_trap_taken signal. This implies that we have a pipe from e2m, m2b, b2w, and w2w1
1690// where we kill events appropriately, otherwise OR the flops together. All reqs are killed when
1691// the trap_taken signal occurs.
1692// B) for incrementing the counters, a similar pipe holds. Except that group 1) is piped from e2m, m2b,
1693// b2w, w2w1, group 2) is piped from w2w1, and the rest are jammed in during w1.
1694
1695// Must clip off spurious events during wakeup cycle: during that cycle, events flop has junk in it; and 1 pcr is now valid and counting.
1696// So one thread can generate spurious events.
1697assign pipeh_incr_e[7:0] = (ph_ige[7:0] | ph_icge[7:0]) & ~{8 {wakeup}};
1698assign pipel_incr_e[7:0] = (pl_ige[7:0] | pl_icge[7:0]) & ~{8 {wakeup}};
1699
1700// Since dec_br_taken[1:0] is late, flop in E, generate br_taken event in W...
1701assign pipeh_incr_m[7:0] = ph_brm[7:0] & {{4{dec_br_taken_m[1]&dec_valid_m[1]}}, {4 {dec_br_taken_m[0]&dec_valid_m[0]}}};
1702assign pipel_incr_m[7:0] = pl_brm[7:0] & {{4{dec_br_taken_m[1]&dec_valid_m[1]}}, {4 {dec_br_taken_m[0]&dec_valid_m[0]}}};
1703
1704// 9/16/05
1705// Don't consider L2 dcache misses as "flushable" events. If they were supposed to be flushed, they wouldn't
1706// have made it to L2. So OR them in as "async" events.
1707assign pipeh_incr_w[7:0] = (dcm_he[7:0] | dtm_he[7:0]) & ~{8 {wakeup}};
1708assign pipel_incr_w[7:0] = (dcm_le[7:0] | dtm_le[7:0]) & ~{8 {wakeup}};
1709
1710assign pipeh_async[7:0] = (ph_ai[7:0] | ph_xbe[7:0] | ph_soe[7:0] | ph_sbe[7:0] | ph_mme[7:0] | l2m_he[7:0]) & ~{8 {wait_for_sleep | wakeup}};
1711assign pipel_async[7:0] = (pl_ai[7:0] | pl_xbe[7:0] | pl_soe[7:0] | pl_sbe[7:0] | pl_mme[7:0] | l2m_le[7:0]) & ~{8 {wait_for_sleep | wakeup}};
1712
1713// Setup trap pipeline...
1714// Sample ige/icge events during e using pich/picl_wrap, then pipe to w1, kill with appropriate flushes along the way
1715// Sample dcge during w using pich/picl_wrap, pipe to w1, kill in w1 with appropriate flushes
1716// Async sampled at w1 using pich/picl; ov also sampled at w1, but not using pich/picl_wrap
1717// 0in assert -var ~(((|trap_m[7:0]) | (|trap_b[7:0]) | (|trap_w[7:0]) | (|trap_w1[7:0])) & ~l1b) -message "trap_m or trap_b or trap_w or trap_w1 not 0 when clock stopped!"
1718pmu_pct_ctl_msff_ctl_macro__width_32 tp (
1719 .scan_in(tp_scanin),
1720 .scan_out(tp_scanout),
1721 .l1clk (l1clk_pm1),
1722 .din ({trap_e[7:0], trap_b_in[7:0], trap_w_in[7:0], trap_w1_in[7:0]} & ~{4 {tpt[7:0]}}),
1723 .dout ({trap_m[7:0], trap_b[7:0], trap_w[7:0], trap_w1[7:0]}),
1724 .siclk(siclk),
1725 .soclk(soclk)
1726);
1727
1728// Don't power-manage this flop - wait_for_sleep is long enough to get any trap to this flop,
1729pmu_pct_ctl_msff_ctl_macro__width_8 tp1 (
1730 .scan_in(tp1_scanin),
1731 .scan_out(tp1_scanout),
1732 .l1clk (l1clk),
1733 .din (trap_hold_in[7:0]),
1734 .dout (trap_hold[7:0]),
1735 .siclk(siclk),
1736 .soclk(soclk)
1737);
1738
1739// 0in assert -var ~(((|ph_brm[7:0]) | (|pl_brm[7:0]) | (|ph_br_may_trap_m[7:0])) & ~l1b) -message "ph_brm or pl_brm or ph_br_may_trap_m not 0 when clock stopped!"
1740pmu_pct_ctl_msff_ctl_macro__width_24 br (
1741 .scan_in(br_scanin),
1742 .scan_out(br_scanout),
1743 .l1clk (l1clk_pm1),
1744 .din (~{24 {wakeup}} & {ph_bre[7:0], pl_bre[7:0], (ph_bre[7:0] & pich_wrap[7:0]) | (pl_bre[7:0] & picl_wrap[7:0])}),
1745 .dout ({ph_brm[7:0], pl_brm[7:0], ph_br_may_trap_m[7:0]}),
1746 .siclk(siclk),
1747 .soclk(soclk)
1748);
1749
1750// for safety, clear everything when tlu takes a pmu trap for a thread
1751assign tpt[7:0] = tlu_pmu_trap_taken[7:0];
1752
1753assign trap_e[7:0] = (pipeh_incr_e[7:0] & pich_wrap[7:0]) |
1754 (pipel_incr_e[7:0] & picl_wrap[7:0]);
1755
1756// Since dec_br_taken[1:0] is late, flop in E, generate br_taken event in W...
1757
1758//assign trap_b_in[7:0] = trap_m[7:0] & {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}};
1759assign trap_b_in[7:0] = (trap_m[7:0] |
1760 (ph_br_may_trap_m[7:0] & {{4 {dec_br_taken_m[1]}}, {4 {dec_br_taken_m[0]}}}))
1761 & {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}};
1762
1763assign trap_w_in[7:0] = trap_b[7:0] & ~{{4 {ifu_fl_b[1]}}, {4 {ifu_fl_b[0]}}};
1764
1765assign trap_w1_in[7:0] = trap_w[7:0] & ~{{4 {fl_w[1]}}, {4 {fl_w[0]}}};
1766
1767assign trap_w1_final[7:0] = (trap_w1 & ~{{4 {tlu_fl_w1[1]}}, {4 {tlu_fl_w1[0]}}});
1768
1769assign async[7:0] = (pipeh_async[7:0] & pich_wrap[7:0]) |
1770 (pipel_async[7:0] & picl_wrap[7:0]);
1771
1772// Remove ovh & ovl since these will drive the interrupt request directly; also remove trap_hold since
1773// OV will be set. Use "trap_hold" only to pipeline async requests...
1774//assign trap_hold_in[7:0] = async[7:0] | ovh[7:0] | ovl[7:0] | trap_w1_final[7:0] | trap_hold[7:0];
1775assign trap_hold_in[7:0] = async[7:0];
1776
1777// Deal with the trap signal now...
1778// Use trap_hold flop output to avoid timing problem w/async req's
1779// Need to OR in OV bits for the true "hold" function (actually OR the AND of OV & TOE)
1780assign pmu_tlu_trap_m[7:0] = trap_b_in[7:0] | trap_w_in[7:0] | trap_w1_in[7:0] | trap_w1_final[7:0] | trap_hold[7:0] | ovh[7:0] | ovl[7:0];
1781
1782// Now for the increment pipeline
1783
1784// Flop increment signals signals to M stage
1785// Also register kill signals from IFU and TLU, and gate off increment signals appropriately
1786// Don't pipe in precise DCmiss, DTmiss, L2Dmiss until W stage!
1787// Don't gate off "imprecise" events with trap signals, pipe in at "last minute"...
1788// Inject "0" when wait_for_sleep starts, pipe down...
1789// 0in assert -var ~(((|ph_incr_m[7:0]) | (|pl_incr_m[7:0])) & ~l1b) -message "ph_incr_m or pl_incr_m not 0 when clock stopped!"
1790pmu_pct_ctl_msff_ctl_macro__width_18 ti_e2m (
1791 .scan_in(ti_e2m_scanin),
1792 .scan_out(ti_e2m_scanout),
1793 .l1clk (l1clk_pm1),
1794 .din ({(~{16 {wait_for_sleep}} & {pipeh_incr_e[7:0], pipel_incr_e[7:0]}), dec_valid_e[1:0]}),
1795 .dout ({ph_incr_m[7:0], pl_incr_m[7:0], dec_valid_m[1:0]}),
1796 .siclk(siclk),
1797 .soclk(soclk)
1798);
1799
1800// Kill off if was a flush from ifu for E last cycle
1801// Also need to kill off increment signals as events flop and/or these ti_* flops stopped with junk in them...
1802// so need 1 clock to clear out to sync up to pipeline again after restart
1803
1804// Equivalent to flush from D last cycle
1805assign ph_i_m[7:0] = (ph_incr_m[7:0] | pipeh_incr_m[7:0]) & {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}};
1806assign pl_i_m[7:0] = (pl_incr_m[7:0] | pipel_incr_m[7:0]) & {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}};
1807
1808// Pipe increment signals to B stage to wait for possible trap
1809// 0in assert -var ~(((|ph_incr_b[7:0]) | (|pl_incr_b[7:0])) & ~l1b) -message "ph_incr_b or pl_incr_b not 0 when clock stopped!"
1810pmu_pct_ctl_msff_ctl_macro__width_18 ti_m2b (
1811 .scan_in(ti_m2b_scanin),
1812 .scan_out(ti_m2b_scanout),
1813 .l1clk (l1clk_pm1),
1814 .din ({ph_i_m[7:0], pl_i_m[7:0], dec_flush_m[1:0]}),
1815 .dout ({ph_incr_b[7:0], pl_incr_b[7:0], ifu_fl_b[1:0]}),
1816 .siclk(siclk),
1817 .soclk(soclk)
1818);
1819
1820// Kill off if was a flush from ifu for M last cycle
1821assign ph_i_b[7:0] = ph_incr_b[7:0] & ~{{4 {ifu_fl_b[1]}}, {4 {ifu_fl_b[0]}}};
1822assign pl_i_b[7:0] = pl_incr_b[7:0] & ~{{4 {ifu_fl_b[1]}}, {4 {ifu_fl_b[0]}}};
1823
1824// Pipe to W stage, grab trap flush request from IFU or TLU
1825// 0in assert -var ~(((|ph_incr_w[7:0]) | (|pl_incr_w[7:0])) & ~l1b) -message "ph_incr_w or pl_incr_w not 0 when clock stopped!"
1826pmu_pct_ctl_msff_ctl_macro__width_18 ti_b2w (
1827 .scan_in(ti_b2w_scanin),
1828 .scan_out(ti_b2w_scanout),
1829 .l1clk (l1clk_pm1),
1830 .din ({ph_i_b[7:0], pl_i_b[7:0], tlu_flush_pmu_b[1:0] | dec_flush_b[1:0]}),
1831 .dout ({ph_incr_w[7:0], pl_incr_w[7:0], fl_w[1:0]}),
1832 .siclk(siclk),
1833 .soclk(soclk)
1834);
1835
1836// Add in DCmiss, DTmiss, L2Dmiss events from B
1837// Must be exlusive between thread groups, since each thread can only monitor one event group
1838// at a time. Within an event group, the only possibility is for the cache events to
1839// happen on the same instruction (e.g., ICmiss on a load which also DCmisses).
1840// But the event mask field forces them to be counted as one event.
1841
1842assign ph_i_w[7:0] = (ph_incr_w[7:0] | pipeh_incr_w[7:0]) & ~{{4 {fl_w[1]}}, {4 {fl_w[0]}}};
1843assign pl_i_w[7:0] = (pl_incr_w[7:0] | pipel_incr_w[7:0]) & ~{{4 {fl_w[1]}}, {4 {fl_w[0]}}};
1844
1845// Pipe to W+1 stage, grab trap flush request from TLU for W
1846// 0in assert -var ~(((|ph_incr_w1[7:0]) | (|pl_incr_w1[7:0])) & ~l1b) -message "ph_incr_w1 or pl_incr_w1 not 0 when clock stopped!"
1847pmu_pct_ctl_msff_ctl_macro__width_18 ti_w2w1 (
1848 .scan_in(ti_w2w1_scanin),
1849 .scan_out(ti_w2w1_scanout),
1850 .l1clk (l1clk_pm1),
1851 .din ({ph_i_w[7:0], pl_i_w[7:0], tlu_flush_pmu_w[1:0]}),
1852 .dout ({ph_incr_w1[7:0], pl_incr_w1[7:0], tlu_fl_w1[1:0]}),
1853 .siclk(siclk),
1854 .soclk(soclk)
1855);
1856
1857// The counter increment pipeline is as follows:
1858// (Needed to delay this by 1 cycle compared to original design since flush signal
1859// for trapping op, which should not increment counters, comes in W, not B)
1860// In the W+1 stage, generate the final increment signals by gating with trap signals
1861// Add these increment signals to the 4-bit accumulators for each PIC. Meanwhile mux the
1862// accumulators (8:1) and PICs for high, low, and each thread group, then flop. The ST (select thread)
1863// register determines which thread is selected for adding in cycle W+2.
1864// In the W+2 stage, add the flopped accumulator value to the proper PIC.
1865// during W+2 to save another 64-bit register per TG. So critical dataflow path is flopped data ->
1866// -> adder -> incrementor -> incrementor -> PIC mux flop which should be about
1867// 500 pS total.
1868
1869// Generate final increment sums during W1 stage; gate off if tlu flush
1870// check to make sure async events never intersect with non-async (better if the decoding
1871// is done correctly)
1872// 0in assert -var (~|(ph_incr_w1[7:0]&pipeh_async[7:0])) -message "high instruction event and async event not mutex"
1873// 0in assert -var (~|(pl_incr_w1[7:0]&pipel_async[7:0])) -message "low instruction event and async event not mutex"
1874
1875// ECOxxx: For tlb misses must not allow tlu to flush the incr signals
1876//assign ph_final_incr_w1[7:0] = (ph_incr_w1[7:0] & ~{{4 {tlu_fl_w1[1]}}, {4 {tlu_fl_w1[0]}}}) | pipeh_async[7:0];
1877//assign pl_final_incr_w1[7:0] = (pl_incr_w1[7:0] & ~{{4 {tlu_fl_w1[1]}}, {4 {tlu_fl_w1[0]}}}) | pipel_async[7:0];
1878
1879assign flush_h[7:0] = (~disable_h[7:0] & { {4{tlu_fl_w1[1]}}, {4{tlu_fl_w1[0]}} });
1880assign flush_l[7:0] = (~disable_l[7:0] & { {4{tlu_fl_w1[1]}}, {4{tlu_fl_w1[0]}} });
1881
1882assign ph_final_incr_w1[7:0] = (ph_incr_w1[7:0] & ~flush_h[7:0]) | pipeh_async[7:0];
1883assign pl_final_incr_w1[7:0] = (pl_incr_w1[7:0] & ~flush_l[7:0]) | pipel_async[7:0];
1884
1885// Send final increment signals to Trap for debug event (soft/hard stop/trigger)
1886// Fix below so that event only sent to PMU when a counter wraps (actually the OV bit is set)
1887// So we are going to do an edge detection (send a pulse whenever the OV bit transitions from 0 to 1)
1888// assign pmu_tlu_debug_event[7:0] = ph_final_incr_w1[7:0] | pl_final_incr_w1[7:0];
1889assign pmu_tlu_debug_event[7:0] = {|({pcr7_dout[31],pcr7_dout[18]} & ~x7_1[1:0]), |({pcr6_dout[31],pcr6_dout[18]} & ~x6_1[1:0]),
1890 |({pcr5_dout[31],pcr5_dout[18]} & ~x5_1[1:0]), |({pcr4_dout[31],pcr4_dout[18]} & ~x4_1[1:0]),
1891 |({pcr3_dout[31],pcr3_dout[18]} & ~x3_1[1:0]), |({pcr2_dout[31],pcr2_dout[18]} & ~x2_1[1:0]),
1892 |({pcr1_dout[31],pcr1_dout[18]} & ~x1_1[1:0]), |({pcr0_dout[31],pcr0_dout[18]} & ~x0_1[1:0])};
1893
1894// Fix oversight ( - set OV bits when we are within range and a trap occurs...
1895// Assume that if we are going to increment, and we are within range, and TOE is set,
1896// there must already be a trap request. Since the trap is disrupting, the trap may
1897// not occur for some time, but in the meantime we set the OV bit.
1898assign set_ovh_spec[7:0] = ph_final_incr_w1[7:0] & pich_wrap[7:0];
1899assign set_ovl_spec[7:0] = pl_final_incr_w1[7:0] & picl_wrap[7:0];
1900
1901// Now for the increment controls...ST register
1902// ST runs "asynchronously" to the pipeline
1903// Cycle through each TG's PICs every 4th cycle
1904// Logically reset pic_std_w1 to 0x1
1905// Consider having 1 incrementor for all 8 threads...
1906
1907// NEW scheme -- Cycle through each TG's PICs every 8th cycle
1908// Let pct_incr_pic_w1 = 8'h01 => 8'h02 => 8'h04 => 8'h08 => 8'h10 => 8'h20 => 8'h40 => 8'h80
1909
1910// 0in one_hot -var pic_std_w1[7:0]
1911assign pic_std_w1[7:0] = {pic_st_dout[7:1], ~pic_st_dout[0]};
1912assign pic_st_din[7:0] = {pic_std_w1[6:0], ~pic_std_w1[7]};
1913
1914assign pct_incr_pic_w1[6:0] = pic_std_w1[6:0];
1915
1916pmu_pct_ctl_msff_ctl_macro__width_8 pic_st (
1917 .scan_in(pic_st_scanin),
1918 .scan_out(pic_st_scanout),
1919 .l1clk (l1clk_pm1),
1920 .din (pic_st_din[7:0]),
1921 .dout (pic_st_dout[7:0]),
1922 .siclk(siclk),
1923 .soclk(soclk)
1924);
1925
1926// Have 16 4-bit accumulators, one per thread counter
1927// assert - need to make sure counters never get above 8 (e.g., should be <= 0x8 at all times)
1928// Increment, but reset to 0 when read (set to 1 if an instruction completes same cycle as accumulator being read)
1929// If write to PCR, reset accumulator values to 0, under the assumption that accumulated events are leftovers from
1930// previous event in PCR (this doesn't work if the event/mask are not changed...)
1931
1932// This bug is especially apparent when idle is being counted...
1933// find out whether the SL has changed on wr_pcr = 1;
1934// pdp_asi_din_to_pctl[31:27] and pdp_asi_din_to_pctl[17:14]
1935
1936// thread 0 high
1937assign t0h_din[3:0] = (({4 {~pic_std_w1[0]}} & t0h_dout[3:0]) + {3'b0, ph_final_incr_w1[0]}) &
1938 ~{4 {wr_pcr[0] & {pdp_asi_din_to_pctl[30:27] != pcr0_dout[30:27]}}};
1939
1940pmu_pct_ctl_msff_ctl_macro__width_4 t0h (
1941 .scan_in(t0h_scanin),
1942 .scan_out(t0h_scanout),
1943 .l1clk (l1clk_pm1),
1944 .din (t0h_din[3:0]),
1945 .dout (t0h_dout[3:0]),
1946 .siclk(siclk),
1947 .soclk(soclk)
1948);
1949
1950// 0in maximum -var t0h_dout[3:0] -val 8 -message "t0h accumulator overflow"
1951// 0in assert -var ~((|t0h_dout[3:0]) & ~l1b) -message "t0h accumulator non-zero when clocks off!"
1952
1953// thread 1 high
1954assign t1h_din[3:0] = (({4 {~pic_std_w1[1]}} & t1h_dout[3:0]) + {3'b0, ph_final_incr_w1[1]}) &
1955 ~{4 {wr_pcr[1] & {pdp_asi_din_to_pctl[30:27] != pcr1_dout[30:27]}}};
1956
1957pmu_pct_ctl_msff_ctl_macro__width_4 t1h (
1958 .scan_in(t1h_scanin),
1959 .scan_out(t1h_scanout),
1960 .l1clk (l1clk_pm1),
1961 .din (t1h_din[3:0]),
1962 .dout (t1h_dout[3:0]),
1963 .siclk(siclk),
1964 .soclk(soclk)
1965);
1966
1967// 0in maximum -var t1h_dout[3:0] -val 8 -message "t1h accumulator overflow"
1968// 0in assert -var ~((|t1h_dout[3:0]) & ~l1b) -message "t1h accumulator non-zero when clocks off!"
1969
1970// thread 2 high
1971assign t2h_din[3:0] = (({4 {~pic_std_w1[2]}} & t2h_dout[3:0]) + {3'b0, ph_final_incr_w1[2]}) &
1972 ~{4 {wr_pcr[2] & {pdp_asi_din_to_pctl[30:27] != pcr2_dout[30:27]}}};
1973pmu_pct_ctl_msff_ctl_macro__width_4 t2h (
1974 .scan_in(t2h_scanin),
1975 .scan_out(t2h_scanout),
1976 .l1clk (l1clk_pm1),
1977 .din (t2h_din[3:0]),
1978 .dout (t2h_dout[3:0]),
1979 .siclk(siclk),
1980 .soclk(soclk)
1981);
1982
1983// 0in maximum -var t2h_dout[3:0] -val 8 -message "t2h accumulator overflow"
1984// 0in assert -var ~((|t2h_dout[3:0]) & ~l1b) -message "t2h accumulator non-zero when clocks off!"
1985
1986// thread 3 high
1987assign t3h_din[3:0] = (({4 {~pic_std_w1[3]}} & t3h_dout[3:0]) + {3'b0, ph_final_incr_w1[3]}) &
1988 ~{4 {wr_pcr[3] & {pdp_asi_din_to_pctl[30:27] != pcr3_dout[30:27]}}};
1989pmu_pct_ctl_msff_ctl_macro__width_4 t3h (
1990 .scan_in(t3h_scanin),
1991 .scan_out(t3h_scanout),
1992 .l1clk (l1clk_pm1),
1993 .din (t3h_din[3:0]),
1994 .dout (t3h_dout[3:0]),
1995 .siclk(siclk),
1996 .soclk(soclk)
1997);
1998
1999// 0in maximum -var t3h_dout[3:0] -val 8 -message "t3h accumulator overflow"
2000// 0in assert -var ~((|t3h_dout[3:0]) & ~l1b) -message "t3h accumulator non-zero when clocks off!"
2001
2002// thread 4 high
2003assign t4h_din[3:0] = (({4 {~pic_std_w1[4]}} & t4h_dout[3:0]) + {3'b0, ph_final_incr_w1[4]}) &
2004 ~{4 {wr_pcr[4] & {pdp_asi_din_to_pctl[30:27] != pcr4_dout[30:27]}}};
2005pmu_pct_ctl_msff_ctl_macro__width_4 t4h (
2006 .scan_in(t4h_scanin),
2007 .scan_out(t4h_scanout),
2008 .l1clk (l1clk_pm1),
2009 .din (t4h_din[3:0]),
2010 .dout (t4h_dout[3:0]),
2011 .siclk(siclk),
2012 .soclk(soclk)
2013);
2014
2015// 0in maximum -var t4h_dout[3:0] -val 8 -message "t4h accumulator overflow"
2016// 0in assert -var ~((|t4h_dout[3:0]) & ~l1b) -message "t4h accumulator non-zero when clocks off!"
2017
2018// thread 5 high
2019assign t5h_din[3:0] = (({4 {~pic_std_w1[5]}} & t5h_dout[3:0]) + {3'b0, ph_final_incr_w1[5]}) &
2020 ~{4 {wr_pcr[5] & {pdp_asi_din_to_pctl[30:27] != pcr5_dout[30:27]}}};
2021pmu_pct_ctl_msff_ctl_macro__width_4 t5h (
2022 .scan_in(t5h_scanin),
2023 .scan_out(t5h_scanout),
2024 .l1clk (l1clk_pm1),
2025 .din (t5h_din[3:0]),
2026 .dout (t5h_dout[3:0]),
2027 .siclk(siclk),
2028 .soclk(soclk)
2029);
2030
2031// 0in maximum -var t5h_dout[3:0] -val 8 -message "t5h accumulator overflow"
2032// 0in assert -var ~((|t5h_dout[3:0]) & ~l1b) -message "t5h accumulator non-zero when clocks off!"
2033
2034// thread 6 high
2035assign t6h_din[3:0] = (({4 {~pic_std_w1[6]}} & t6h_dout[3:0]) + {3'b0, ph_final_incr_w1[6]}) &
2036 ~{4 {wr_pcr[6] & {pdp_asi_din_to_pctl[30:27] != pcr6_dout[30:27]}}};
2037pmu_pct_ctl_msff_ctl_macro__width_4 t6h (
2038 .scan_in(t6h_scanin),
2039 .scan_out(t6h_scanout),
2040 .l1clk (l1clk_pm1),
2041 .din (t6h_din[3:0]),
2042 .dout (t6h_dout[3:0]),
2043 .siclk(siclk),
2044 .soclk(soclk)
2045);
2046
2047// 0in maximum -var t6h_dout[3:0] -val 8 -message "t6h accumulator overflow"
2048// 0in assert -var ~((|t6h_dout[3:0]) & ~l1b) -message "t6h accumulator non-zero when clocks off!"
2049
2050// thread 7 high
2051assign t7h_din[3:0] = (({4 {~pic_std_w1[7]}} & t7h_dout[3:0]) + {3'b0, ph_final_incr_w1[7]}) &
2052 ~{4 {wr_pcr[7] & {pdp_asi_din_to_pctl[30:27] != pcr7_dout[30:27]}}};
2053pmu_pct_ctl_msff_ctl_macro__width_4 t7h (
2054 .scan_in(t7h_scanin),
2055 .scan_out(t7h_scanout),
2056 .l1clk (l1clk_pm1),
2057 .din (t7h_din[3:0]),
2058 .dout (t7h_dout[3:0]),
2059 .siclk(siclk),
2060 .soclk(soclk)
2061);
2062
2063// 0in maximum -var t7h_dout[3:0] -val 8 -message "t7h accumulator overflow"
2064// 0in assert -var ~((|t7h_dout[3:0]) & ~l1b) -message "t7h accumulator non-zero when clocks off!"
2065
2066// thread 0 low
2067assign t0l_din[3:0] = (({4 {~pic_std_w1[0]}} & t0l_dout[3:0]) + {3'b0, pl_final_incr_w1[0]}) &
2068 ~{4 {wr_pcr[0] & {pdp_asi_din_to_pctl[17:14] != pcr0_dout[17:14]}}};
2069pmu_pct_ctl_msff_ctl_macro__width_4 t0l (
2070 .scan_in(t0l_scanin),
2071 .scan_out(t0l_scanout),
2072 .l1clk (l1clk_pm1),
2073 .din (t0l_din[3:0]),
2074 .dout (t0l_dout[3:0]),
2075 .siclk(siclk),
2076 .soclk(soclk)
2077);
2078
2079// 0in maximum -var t0l_dout[3:0] -val 8 -message "t0l accumulator overflow"
2080// 0in assert -var ~((|t0l_dout[3:0]) & ~l1b) -message "t0l accumulator non-zero when clocks off!"
2081
2082// thread 1 low
2083assign t1l_din[3:0] = (({4 {~pic_std_w1[1]}} & t1l_dout[3:0]) + {3'b0, pl_final_incr_w1[1]}) &
2084 ~{4 {wr_pcr[1] & {pdp_asi_din_to_pctl[17:14] != pcr1_dout[17:14]}}};
2085pmu_pct_ctl_msff_ctl_macro__width_4 t1l (
2086 .scan_in(t1l_scanin),
2087 .scan_out(t1l_scanout),
2088 .l1clk (l1clk_pm1),
2089 .din (t1l_din[3:0]),
2090 .dout (t1l_dout[3:0]),
2091 .siclk(siclk),
2092 .soclk(soclk)
2093);
2094
2095// 0in maximum -var t1l_dout[3:0] -val 8 -message "t1l accumulator overflow"
2096// 0in assert -var ~((|t1l_dout[3:0]) & ~l1b) -message "t1l accumulator non-zero when clocks off!"
2097
2098// thread 2 low
2099assign t2l_din[3:0] = (({4 {~pic_std_w1[2]}} & t2l_dout[3:0]) + {3'b0, pl_final_incr_w1[2]}) &
2100 ~{4 {wr_pcr[2] & {pdp_asi_din_to_pctl[17:14] != pcr2_dout[17:14]}}};
2101pmu_pct_ctl_msff_ctl_macro__width_4 t2l (
2102 .scan_in(t2l_scanin),
2103 .scan_out(t2l_scanout),
2104 .l1clk (l1clk_pm1),
2105 .din (t2l_din[3:0]),
2106 .dout (t2l_dout[3:0]),
2107 .siclk(siclk),
2108 .soclk(soclk)
2109);
2110
2111// 0in maximum -var t2l_dout[3:0] -val 8 -message "t2l accumulator overflow"
2112// 0in assert -var ~((|t2l_dout[3:0]) & ~l1b) -message "t2l accumulator non-zero when clocks off!"
2113
2114// thread 3 low
2115assign t3l_din[3:0] = (({4 {~pic_std_w1[3]}} & t3l_dout[3:0]) + {3'b0, pl_final_incr_w1[3]}) &
2116 ~{4 {wr_pcr[3] & {pdp_asi_din_to_pctl[17:14] != pcr3_dout[17:14]}}};
2117pmu_pct_ctl_msff_ctl_macro__width_4 t3l (
2118 .scan_in(t3l_scanin),
2119 .scan_out(t3l_scanout),
2120 .l1clk (l1clk_pm1),
2121 .din (t3l_din[3:0]),
2122 .dout (t3l_dout[3:0]),
2123 .siclk(siclk),
2124 .soclk(soclk)
2125);
2126
2127// 0in maximum -var t3l_dout[3:0] -val 8 -message "t3l accumulator overflow"
2128// 0in assert -var ~((|t3l_dout[3:0]) & ~l1b) -message "t3l accumulator non-zero when clocks off!"
2129
2130// thread 4 low
2131assign t4l_din[3:0] = (({4 {~pic_std_w1[4]}} & t4l_dout[3:0]) + {3'b0, pl_final_incr_w1[4]}) &
2132 ~{4 {wr_pcr[4] & {pdp_asi_din_to_pctl[17:14] != pcr4_dout[17:14]}}};
2133pmu_pct_ctl_msff_ctl_macro__width_4 t4l (
2134 .scan_in(t4l_scanin),
2135 .scan_out(t4l_scanout),
2136 .l1clk (l1clk_pm1),
2137 .din (t4l_din[3:0]),
2138 .dout (t4l_dout[3:0]),
2139 .siclk(siclk),
2140 .soclk(soclk)
2141);
2142
2143// 0in maximum -var t4l_dout[3:0] -val 8 -message "t4l accumulator overflow"
2144// 0in assert -var ~((|t4l_dout[3:0]) & ~l1b) -message "t4l accumulator non-zero when clocks off!"
2145
2146// thread 5 low
2147assign t5l_din[3:0] = (({4 {~pic_std_w1[5]}} & t5l_dout[3:0]) + {3'b0, pl_final_incr_w1[5]}) &
2148 ~{4 {wr_pcr[5] & {pdp_asi_din_to_pctl[17:14] != pcr5_dout[17:14]}}};
2149pmu_pct_ctl_msff_ctl_macro__width_4 t5l (
2150 .scan_in(t5l_scanin),
2151 .scan_out(t5l_scanout),
2152 .l1clk (l1clk_pm1),
2153 .din (t5l_din[3:0]),
2154 .dout (t5l_dout[3:0]),
2155 .siclk(siclk),
2156 .soclk(soclk)
2157);
2158
2159// 0in maximum -var t5l_dout[3:0] -val 8 -message "t5l accumulator overflow"
2160// 0in assert -var ~((|t5l_dout[3:0]) & ~l1b) -message "t0l accumulator non-zero when clocks off!"
2161
2162// thread 6 low
2163assign t6l_din[3:0] = (({4 {~pic_std_w1[6]}} & t6l_dout[3:0]) + {3'b0, pl_final_incr_w1[6]}) &
2164 ~{4 {wr_pcr[6] & {pdp_asi_din_to_pctl[17:14] != pcr6_dout[17:14]}}};
2165pmu_pct_ctl_msff_ctl_macro__width_4 t6l (
2166 .scan_in(t6l_scanin),
2167 .scan_out(t6l_scanout),
2168 .l1clk (l1clk_pm1),
2169 .din (t6l_din[3:0]),
2170 .dout (t6l_dout[3:0]),
2171 .siclk(siclk),
2172 .soclk(soclk)
2173);
2174
2175// 0in maximum -var t6l_dout[3:0] -val 8 -message "t6l accumulator overflow"
2176// 0in assert -var ~((|t6l_dout[3:0]) & ~l1b) -message "t6l accumulator non-zero when clocks off!"
2177
2178// thread 7 low
2179assign t7l_din[3:0] = (({4 {~pic_std_w1[7]}} & t7l_dout[3:0]) + {3'b0, pl_final_incr_w1[7]}) &
2180 ~{4 {wr_pcr[7] & {pdp_asi_din_to_pctl[17:14] != pcr7_dout[17:14]}}};
2181pmu_pct_ctl_msff_ctl_macro__width_4 t7l (
2182 .scan_in(t7l_scanin),
2183 .scan_out(t7l_scanout),
2184 .l1clk (l1clk_pm1),
2185 .din (t7l_din[3:0]),
2186 .dout (t7l_dout[3:0]),
2187 .siclk(siclk),
2188 .soclk(soclk)
2189);
2190
2191// 0in maximum -var t7l_dout[3:0] -val 8 -message "t7l accumulator overflow"
2192// 0in assert -var ~((|t7l_dout[3:0]) & ~l1b) -message "t7l accumulator non-zero when clocks off!"
2193
2194// Mux during W1
2195// Force a zero value iff are writing to the PIC from the ASI this cycle,
2196// to prevent overwriting the PIC with the previous PIC + accum. value
2197// Instead we write the PIC in 2 successive cycles...to save 8 flop bits
2198
2199assign pich07_add_in_w1[3:0] = ({4 {pic_std_w1[7] & ~incr_asi[7]}} & t7h_dout[3:0]) |
2200 ({4 {pic_std_w1[6] & ~incr_asi[6]}} & t6h_dout[3:0]) |
2201 ({4 {pic_std_w1[5] & ~incr_asi[5]}} & t5h_dout[3:0]) |
2202 ({4 {pic_std_w1[4] & ~incr_asi[4]}} & t4h_dout[3:0]) |
2203 ({4 {pic_std_w1[3] & ~incr_asi[3]}} & t3h_dout[3:0]) |
2204 ({4 {pic_std_w1[2] & ~incr_asi[2]}} & t2h_dout[3:0]) |
2205 ({4 {pic_std_w1[1] & ~incr_asi[1]}} & t1h_dout[3:0]) |
2206 ({4 {pic_std_w1[0] & ~incr_asi[0]}} & t0h_dout[3:0]);
2207
2208assign picl07_add_in_w1[3:0] = ({4 {pic_std_w1[7] & ~incr_asi[7]}} & t7l_dout[3:0]) |
2209 ({4 {pic_std_w1[6] & ~incr_asi[6]}} & t6l_dout[3:0]) |
2210 ({4 {pic_std_w1[5] & ~incr_asi[5]}} & t5l_dout[3:0]) |
2211 ({4 {pic_std_w1[4] & ~incr_asi[4]}} & t4l_dout[3:0]) |
2212 ({4 {pic_std_w1[3] & ~incr_asi[3]}} & t3l_dout[3:0]) |
2213 ({4 {pic_std_w1[2] & ~incr_asi[2]}} & t2l_dout[3:0]) |
2214 ({4 {pic_std_w1[1] & ~incr_asi[1]}} & t1l_dout[3:0]) |
2215 ({4 {pic_std_w1[0] & ~incr_asi[0]}} & t0l_dout[3:0]);
2216
2217
2218// Now register and drive to datapath adder during W+1;
2219// also register the ST signals to drive the PIC muxes during W+1
2220pmu_pct_ctl_msff_ctl_macro__width_8 accum (
2221 .scan_in(accum_scanin),
2222 .scan_out(accum_scanout),
2223 .l1clk (l1clk_pm1),
2224 .din ({pich07_add_in_w1[3:0], picl07_add_in_w1[3:0]}),
2225 .dout ({pct_pich07_add_w2[3:0], pct_picl07_add_w2[3:0]}),
2226 .siclk(siclk),
2227 .soclk(soclk)
2228);
2229
2230// w2 is w1 from the previous cycle; e.g., rotate w1 right
2231assign pic_std_w2[7:0] = {pic_std_w1[0], pic_std_w1[7:1]};
2232
2233// ASI write timing:
2234// 1st cycle: decode ASI data bus (contains address) & control field;
2235// pipe ASI to output flop; flop if request for us & which op to do
2236// 2nd cycle: if ASI not for us, pipe ASI input flop to output flop; else
2237// for ASI write, write ASI data into selected PIC or PCR; else for
2238// ASI read, drive mux controls and select PIC/PCR at ASI output flop
2239
2240// Format of ASI data in bus:
2241// 64 - ctl/data
2242// 63 - valid/hole
2243// 62 - ack/nack
2244// 61:60 - 00-ASI, 01-ASR, 10-PR, 11-HPR
2245// 59 - rd/wr
2246// 58:56 - Thread ID
2247// 55:48 - ASI field/exception: if illegal opcode, set bit 48; if privileged operation, set bit 49
2248// 47:0 - Virtual Address
2249
2250// PCR ASR = 16 (decimal), PIC = 17 decimal
2251// PCR is privileged, PIC is privileged if PCR.PRIV is set...
2252
2253// 1st cycle decode
2254// See if this op is for us
2255assign asi_cntrl_h[15:8] = pdp_asi_ctlin_to_pctl_15_8[7:0];
2256assign asi_cntrl[4:0] = pdp_asi_ctlin_to_pctl_4_0[4:0];
2257
2258assign asr = ~asi_cntrl_h[13] & asi_cntrl_h[12];
2259assign asr_rd = asi_ctl_ndata & asi_cntrl_h[15] & ~asi_cntrl_h[14] & asr & asi_cntrl_h[11];
2260assign asr_wr = asi_ctl_ndata & asi_cntrl_h[15] & ~asi_cntrl_h[14] & asr & ~asi_cntrl_h[11];
2261assign pcr = asi_cntrl[4] & ~asi_cntrl[3] & ~asi_cntrl[2] & ~asi_cntrl[1] & ~asi_cntrl[0]; // 16
2262assign pic = asi_cntrl[4] & ~asi_cntrl[3] & ~asi_cntrl[2] & ~asi_cntrl[1] & asi_cntrl[0]; // 17
2263
2264assign pic_rd = asr_rd & pic;
2265assign pic_wr = asr_wr & pic;
2266assign pcr_rd = asr_rd & pcr;
2267assign pcr_wr = asr_wr & pcr;
2268
2269// If this op is for us, make sure the ack bit is not set...otherwise there is a decode conflict on
2270// the local ring; this actually isn't a full check unless the pmu is the last link on the ring before
2271// returning to the lsu
2272// 0in assert -var (~((pic | pcr) & asr & asi_ctl_ndata & asi_cntrl_h[15] & asi_cntrl_h[14])) -message "ack set for pic or pcr operation"
2273
2274assign tid[7:0] = {
2275 asi_cntrl_h[10] & asi_cntrl_h[9] & asi_cntrl_h[8],
2276 asi_cntrl_h[10] & asi_cntrl_h[9] & ~asi_cntrl_h[8],
2277 asi_cntrl_h[10] & ~asi_cntrl_h[9] & asi_cntrl_h[8],
2278 asi_cntrl_h[10] & ~asi_cntrl_h[9] & ~asi_cntrl_h[8],
2279 ~asi_cntrl_h[10] & asi_cntrl_h[9] & asi_cntrl_h[8],
2280 ~asi_cntrl_h[10] & asi_cntrl_h[9] & ~asi_cntrl_h[8],
2281 ~asi_cntrl_h[10] & ~asi_cntrl_h[9] & asi_cntrl_h[8],
2282 ~asi_cntrl_h[10] & ~asi_cntrl_h[9] & ~asi_cntrl_h[8]
2283 };
2284
2285// Check for exceptions...if no exception set ack bit
2286assign asr_priv[7:0] = tid[7:0] & ~(hpriv[7:0] | priv[7:0]) & (
2287 ({8 {pcr_rd | pcr_wr}}) |
2288 ({8 {pic_rd | pic_wr}} & {pcr7_dout[0], pcr6_dout[0],
2289 pcr5_dout[0], pcr4_dout[0],
2290 pcr3_dout[0], pcr2_dout[0],
2291 pcr1_dout[0], pcr0_dout[0]})
2292 );
2293
2294assign priv_ex = |asr_priv[7:0];
2295assign pmu_op = pic_rd | pic_wr | pcr_rd | pcr_wr;
2296assign pct_exception = priv_ex;
2297
2298pmu_pct_ctl_l1clkhdr_ctl_macro asi_busy_clkgen (
2299 .l2clk (l2clk ),
2300 .l1en (pmu_asi_clken ),
2301// .l1clk (asi_busy_l1clk )
2302 .l1clk (l1clk_pm4 ),
2303 .pce_ov(pce_ov),
2304 .stop(stop),
2305 .se(se)
2306);
2307
2308pmu_pct_ctl_msff_ctl_macro__width_14 asi (
2309 .scan_in(asi_scanin),
2310 .scan_out(asi_scanout),
2311 .l1clk (l1clk_pm4),
2312 .din ({pic_rd & ~priv_ex, pic_wr & ~priv_ex, pcr_rd & ~priv_ex, pcr_wr & ~priv_ex, tid[7:0],
2313 in_rngl_cdbus_ctl_ndata, asi_ctl_ndata}),
2314 .dout ({p_rd, p_wr, pc_rd, pc_wr, atid[7:0],
2315 asi_ctl_ndata, pct_rngl_cdbus_ctl_ndata}),
2316 .siclk(siclk),
2317 .soclk(soclk)
2318);
2319
2320// Mux down PCR for read
2321// save power at expense of time if can by gating with pc_rd
2322// Restore read of bits 30 and 17
2323assign pcr0_read[31:0] = {pcr0_dout[31], disable_h[0], pcr0_dout[29:18], disable_l[0], pcr0_dout[16:0]};
2324assign pcr1_read[31:0] = {pcr1_dout[31], disable_h[1], pcr1_dout[29:18], disable_l[1], pcr1_dout[16:0]};
2325assign pcr2_read[31:0] = {pcr2_dout[31], disable_h[2], pcr2_dout[29:18], disable_l[2], pcr2_dout[16:0]};
2326assign pcr3_read[31:0] = {pcr3_dout[31], disable_h[3], pcr3_dout[29:18], disable_l[3], pcr3_dout[16:0]};
2327assign pcr4_read[31:0] = {pcr4_dout[31], disable_h[4], pcr4_dout[29:18], disable_l[4], pcr4_dout[16:0]};
2328assign pcr5_read[31:0] = {pcr5_dout[31], disable_h[5], pcr5_dout[29:18], disable_l[5], pcr5_dout[16:0]};
2329assign pcr6_read[31:0] = {pcr6_dout[31], disable_h[6], pcr6_dout[29:18], disable_l[6], pcr6_dout[16:0]};
2330assign pcr7_read[31:0] = {pcr7_dout[31], disable_h[7], pcr7_dout[29:18], disable_l[7], pcr7_dout[16:0]};
2331
2332assign pct_pcr_data[31:0] = ({32 {pc_rd & atid[0]}} & pcr0_read[31:0]) |
2333 ({32 {pc_rd & atid[1]}} & pcr1_read[31:0]) |
2334 ({32 {pc_rd & atid[2]}} & pcr2_read[31:0]) |
2335 ({32 {pc_rd & atid[3]}} & pcr3_read[31:0]) |
2336 ({32 {pc_rd & atid[4]}} & pcr4_read[31:0]) |
2337 ({32 {pc_rd & atid[5]}} & pcr5_read[31:0]) |
2338 ({32 {pc_rd & atid[6]}} & pcr6_read[31:0]) |
2339 ({32 {pc_rd & atid[7]}} & pcr7_read[31:0]);
2340
2341assign pct_rd_pic_pcr = p_rd | pc_rd;
2342
2343// Generate PIC mux selects for read
2344assign pct_rd_pic[7:0] = {8 {p_rd}} & atid[7:0];
2345assign pct_rd_a_pic = p_rd;
2346
2347// Always bypass unless doing an ASR/PR read for this node
2348assign pct_bypass_asi = ~(p_rd | pc_rd | pmu_op);
2349
2350// There is a 2 cycle pipeline for writing to a PIC
2351// In cycle 1 (which corresponds to W+1), pic_std_w1 selects a thread for adding the next cycle;
2352// the thread's PIC is muxed into a staging register in pdp. The accumulator has also been selected
2353// and is flopped in pct_pic*_add_w1 above.
2354// In cycle 2, the PIC and the accumulator value are added in the DP block.
2355
2356// Simple enough but we have to consider the case of writing to a PIC from the ASI and doing an
2357// increment the same cycle...We consider this architecturally undefined, but we would like
2358// to have a predictable value for validation purposes. The cleanest solution is to always
2359// select the ASI value.
2360
2361// Note: At the current time, wr %pic is post-syncing...and there is a 5-cycle delay between
2362// the pic update in W+2 and the ASI write to the PIC. The delay will increase when the FGU is
2363// added in the local ring ahead of the PMU. Due to the post-syncing, there isn't a way to
2364// keep the PIC counting events past a wr %pic...so we can't test a simultaneous write to
2365// an incrementing PIC using instructions. This has to be tested via async. events.
2366
2367// Since there is a 2-cycle pipeline, there are 4 cases:
2368// 1. Write to ASI in W+2 and add PIC in W+2. Here we should overwrite the updated PIC with the new ASI value. Note:
2369// we may lose counts due to this. The only way to fix this is to put a mux in front of the adder during W+2.
2370// 2. Write to ASI in W+1 and add PIC in W+2. Here we should select the ASI value, otherwise,
2371// we will lose the ASI data by overwriting it with the previous PIC + accumulator value.
2372// 3. Write to ASI in W+3 and add PIC in W+2. This works fine.
2373// 4. Write to ASI in W and add PIC in W+2. This works fine.
2374// We could disable the write during case 2) above which would guarantee that the ASI value always wins
2375// over a current update. We could handle this either by forcing an add of 0 to the ASI value, or disabling writing the
2376// PIC with the ASI+accumulator in W+2. For now we choose the former, to avoid having 8 flops to degate pct_incr_pic_w2
2377// (below) if incr_asi was set the previous cycle.
2378
2379// Decode for PIC write; force ASI over increment value if both happen during W2
2380assign pct_wr_pic_w2[7:0] = {8 {p_wr}} & atid[7:0];
2381//assign pct_incr_pic_w2[7:0] = {pic_std_w2[7:0]} & ~pct_wr_pic_w2[7:0];
2382
2383// Selects for pre-add flop port...select asi if incrementing and writing
2384assign incr_asi[7:0] = pic_std_w1[7:0] & {8 {p_wr}} & atid[7:0];
2385assign pct_incr_asi_w1 = {|incr_asi[7:0]};
2386
2387// Clock enable for pic07_w2 flop (adder for PIC incrementors)
2388//assign pct_pic07_w2_clken = pct_incr_asi_w1 | (|pct_pic_clken[7:0]);
2389// add in wr_pcr below - if pcr is not active now, but will be next cycle, need to make sure we
2390// select the proper pic value this cycle; else may add in wrong pic value (e.g., leftover from a previous thread)
2391assign pct_pic07_w2_clken = ~pmu_pmen | pct_incr_asi_w1 | (|(pic_std_w1[7:0] & (wr_pcr[7:0] | (
2392 {|pcr7_dout[3:1],|pcr6_dout[3:1],|pcr5_dout[3:1],|pcr4_dout[3:1],
2393 |pcr3_dout[3:1],|pcr2_dout[3:1],|pcr1_dout[3:1],|pcr0_dout[3:1]}))));
2394
2395
2396// Update PCR on write
2397assign wr_pcr[7:0] = {8 {pc_wr}} & atid[7:0];
2398
2399// Clear PCR OV bits on read...
2400assign rd_pcr[7:0] = {8 {pc_rd}} & atid[7:0];
2401
2402supply0 vss;
2403supply1 vdd;
2404
2405pmu_pct_ctl_spare_ctl_macro__num_12 spares (
2406 .scan_in(spares_scanin),
2407 .scan_out(spares_scanout),
2408 .l1clk (l1clk),
2409 .siclk(siclk),
2410 .soclk(soclk));
2411
2412// fixscan start:
2413assign pwrm_scanin = scan_in ;
2414assign sleep_cnt_scanin = pwrm_scanout ;
2415assign hpstate_scanin = sleep_cnt_scanout ;
2416assign events_scanin = hpstate_scanout ;
2417assign lsutid_scanin = events_scanout ;
2418assign pcr0_scanin = lsutid_scanout ;
2419assign pcr0_ov_scanin = pcr0_scanout ;
2420assign pcr1_scanin = pcr0_ov_scanout ;
2421assign pcr1_ov_scanin = pcr1_scanout ;
2422assign pcr2_scanin = pcr1_ov_scanout ;
2423assign pcr2_ov_scanin = pcr2_scanout ;
2424assign pcr3_scanin = pcr2_ov_scanout ;
2425assign pcr3_ov_scanin = pcr3_scanout ;
2426assign pcr4_scanin = pcr3_ov_scanout ;
2427assign pcr4_ov_scanin = pcr4_scanout ;
2428assign pcr5_scanin = pcr4_ov_scanout ;
2429assign pcr5_ov_scanin = pcr5_scanout ;
2430assign pcr6_scanin = pcr5_ov_scanout ;
2431assign pcr6_ov_scanin = pcr6_scanout ;
2432assign pcr7_scanin = pcr6_ov_scanout ;
2433assign pcr7_ov_scanin = pcr7_scanout ;
2434assign pcr_ov_del_scanin = pcr7_ov_scanout ;
2435assign lsu_e2m_scanin = pcr_ov_del_scanout ;
2436assign tp_scanin = lsu_e2m_scanout ;
2437assign tp1_scanin = tp_scanout ;
2438assign br_scanin = tp1_scanout ;
2439assign ti_e2m_scanin = br_scanout ;
2440assign ti_m2b_scanin = ti_e2m_scanout ;
2441assign ti_b2w_scanin = ti_m2b_scanout ;
2442assign ti_w2w1_scanin = ti_b2w_scanout ;
2443assign pic_st_scanin = ti_w2w1_scanout ;
2444assign t0h_scanin = pic_st_scanout ;
2445assign t1h_scanin = t0h_scanout ;
2446assign t2h_scanin = t1h_scanout ;
2447assign t3h_scanin = t2h_scanout ;
2448assign t4h_scanin = t3h_scanout ;
2449assign t5h_scanin = t4h_scanout ;
2450assign t6h_scanin = t5h_scanout ;
2451assign t7h_scanin = t6h_scanout ;
2452assign t0l_scanin = t7h_scanout ;
2453assign t1l_scanin = t0l_scanout ;
2454assign t2l_scanin = t1l_scanout ;
2455assign t3l_scanin = t2l_scanout ;
2456assign t4l_scanin = t3l_scanout ;
2457assign t5l_scanin = t4l_scanout ;
2458assign t6l_scanin = t5l_scanout ;
2459assign t7l_scanin = t6l_scanout ;
2460assign accum_scanin = t7l_scanout ;
2461assign asi_scanin = accum_scanout ;
2462assign spares_scanin = asi_scanout ;
2463assign scan_out = spares_scanout ;
2464// fixscan end:
2465endmodule
2466
2467
2468
2469
2470
2471
2472// any PARAMS parms go into naming of macro
2473
2474module pmu_pct_ctl_l1clkhdr_ctl_macro (
2475 l2clk,
2476 l1en,
2477 pce_ov,
2478 stop,
2479 se,
2480 l1clk);
2481
2482
2483 input l2clk;
2484 input l1en;
2485 input pce_ov;
2486 input stop;
2487 input se;
2488 output l1clk;
2489
2490
2491
2492
2493
2494cl_sc1_l1hdr_8x c_0 (
2495
2496
2497 .l2clk(l2clk),
2498 .pce(l1en),
2499 .l1clk(l1clk),
2500 .se(se),
2501 .pce_ov(pce_ov),
2502 .stop(stop)
2503);
2504
2505
2506
2507endmodule
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521// any PARAMS parms go into naming of macro
2522
2523module pmu_pct_ctl_msff_ctl_macro__width_5 (
2524 din,
2525 l1clk,
2526 scan_in,
2527 siclk,
2528 soclk,
2529 dout,
2530 scan_out);
2531wire [4:0] fdin;
2532wire [3:0] so;
2533
2534 input [4:0] din;
2535 input l1clk;
2536 input scan_in;
2537
2538
2539 input siclk;
2540 input soclk;
2541
2542 output [4:0] dout;
2543 output scan_out;
2544assign fdin[4:0] = din[4:0];
2545
2546
2547
2548
2549
2550
2551dff #(5) d0_0 (
2552.l1clk(l1clk),
2553.siclk(siclk),
2554.soclk(soclk),
2555.d(fdin[4:0]),
2556.si({scan_in,so[3:0]}),
2557.so({so[3:0],scan_out}),
2558.q(dout[4:0])
2559);
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572endmodule
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586// any PARAMS parms go into naming of macro
2587
2588module pmu_pct_ctl_msff_ctl_macro__width_4 (
2589 din,
2590 l1clk,
2591 scan_in,
2592 siclk,
2593 soclk,
2594 dout,
2595 scan_out);
2596wire [3:0] fdin;
2597wire [2:0] so;
2598
2599 input [3:0] din;
2600 input l1clk;
2601 input scan_in;
2602
2603
2604 input siclk;
2605 input soclk;
2606
2607 output [3:0] dout;
2608 output scan_out;
2609assign fdin[3:0] = din[3:0];
2610
2611
2612
2613
2614
2615
2616dff #(4) d0_0 (
2617.l1clk(l1clk),
2618.siclk(siclk),
2619.soclk(soclk),
2620.d(fdin[3:0]),
2621.si({scan_in,so[2:0]}),
2622.so({so[2:0],scan_out}),
2623.q(dout[3:0])
2624);
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637endmodule
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651// any PARAMS parms go into naming of macro
2652
2653module pmu_pct_ctl_msff_ctl_macro__width_16 (
2654 din,
2655 l1clk,
2656 scan_in,
2657 siclk,
2658 soclk,
2659 dout,
2660 scan_out);
2661wire [15:0] fdin;
2662wire [14:0] so;
2663
2664 input [15:0] din;
2665 input l1clk;
2666 input scan_in;
2667
2668
2669 input siclk;
2670 input soclk;
2671
2672 output [15:0] dout;
2673 output scan_out;
2674assign fdin[15:0] = din[15:0];
2675
2676
2677
2678
2679
2680
2681dff #(16) d0_0 (
2682.l1clk(l1clk),
2683.siclk(siclk),
2684.soclk(soclk),
2685.d(fdin[15:0]),
2686.si({scan_in,so[14:0]}),
2687.so({so[14:0],scan_out}),
2688.q(dout[15:0])
2689);
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702endmodule
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716// any PARAMS parms go into naming of macro
2717
2718module pmu_pct_ctl_msff_ctl_macro__width_66 (
2719 din,
2720 l1clk,
2721 scan_in,
2722 siclk,
2723 soclk,
2724 dout,
2725 scan_out);
2726wire [65:0] fdin;
2727wire [64:0] so;
2728
2729 input [65:0] din;
2730 input l1clk;
2731 input scan_in;
2732
2733
2734 input siclk;
2735 input soclk;
2736
2737 output [65:0] dout;
2738 output scan_out;
2739assign fdin[65:0] = din[65:0];
2740
2741
2742
2743
2744
2745
2746dff #(66) d0_0 (
2747.l1clk(l1clk),
2748.siclk(siclk),
2749.soclk(soclk),
2750.d(fdin[65:0]),
2751.si({scan_in,so[64:0]}),
2752.so({so[64:0],scan_out}),
2753.q(dout[65:0])
2754);
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767endmodule
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781// any PARAMS parms go into naming of macro
2782
2783module pmu_pct_ctl_msff_ctl_macro__width_9 (
2784 din,
2785 l1clk,
2786 scan_in,
2787 siclk,
2788 soclk,
2789 dout,
2790 scan_out);
2791wire [8:0] fdin;
2792wire [7:0] so;
2793
2794 input [8:0] din;
2795 input l1clk;
2796 input scan_in;
2797
2798
2799 input siclk;
2800 input soclk;
2801
2802 output [8:0] dout;
2803 output scan_out;
2804assign fdin[8:0] = din[8:0];
2805
2806
2807
2808
2809
2810
2811dff #(9) d0_0 (
2812.l1clk(l1clk),
2813.siclk(siclk),
2814.soclk(soclk),
2815.d(fdin[8:0]),
2816.si({scan_in,so[7:0]}),
2817.so({so[7:0],scan_out}),
2818.q(dout[8:0])
2819);
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832endmodule
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846// any PARAMS parms go into naming of macro
2847
2848module pmu_pct_ctl_msff_ctl_macro__width_30 (
2849 din,
2850 l1clk,
2851 scan_in,
2852 siclk,
2853 soclk,
2854 dout,
2855 scan_out);
2856wire [29:0] fdin;
2857wire [28:0] so;
2858
2859 input [29:0] din;
2860 input l1clk;
2861 input scan_in;
2862
2863
2864 input siclk;
2865 input soclk;
2866
2867 output [29:0] dout;
2868 output scan_out;
2869assign fdin[29:0] = din[29:0];
2870
2871
2872
2873
2874
2875
2876dff #(30) d0_0 (
2877.l1clk(l1clk),
2878.siclk(siclk),
2879.soclk(soclk),
2880.d(fdin[29:0]),
2881.si({scan_in,so[28:0]}),
2882.so({so[28:0],scan_out}),
2883.q(dout[29:0])
2884);
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897endmodule
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911// any PARAMS parms go into naming of macro
2912
2913module pmu_pct_ctl_msff_ctl_macro__width_2 (
2914 din,
2915 l1clk,
2916 scan_in,
2917 siclk,
2918 soclk,
2919 dout,
2920 scan_out);
2921wire [1:0] fdin;
2922wire [0:0] so;
2923
2924 input [1:0] din;
2925 input l1clk;
2926 input scan_in;
2927
2928
2929 input siclk;
2930 input soclk;
2931
2932 output [1:0] dout;
2933 output scan_out;
2934assign fdin[1:0] = din[1:0];
2935
2936
2937
2938
2939
2940
2941dff #(2) d0_0 (
2942.l1clk(l1clk),
2943.siclk(siclk),
2944.soclk(soclk),
2945.d(fdin[1:0]),
2946.si({scan_in,so[0:0]}),
2947.so({so[0:0],scan_out}),
2948.q(dout[1:0])
2949);
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962endmodule
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976// any PARAMS parms go into naming of macro
2977
2978module pmu_pct_ctl_msff_ctl_macro__width_28 (
2979 din,
2980 l1clk,
2981 scan_in,
2982 siclk,
2983 soclk,
2984 dout,
2985 scan_out);
2986wire [27:0] fdin;
2987wire [26:0] so;
2988
2989 input [27:0] din;
2990 input l1clk;
2991 input scan_in;
2992
2993
2994 input siclk;
2995 input soclk;
2996
2997 output [27:0] dout;
2998 output scan_out;
2999assign fdin[27:0] = din[27:0];
3000
3001
3002
3003
3004
3005
3006dff #(28) d0_0 (
3007.l1clk(l1clk),
3008.siclk(siclk),
3009.soclk(soclk),
3010.d(fdin[27:0]),
3011.si({scan_in,so[26:0]}),
3012.so({so[26:0],scan_out}),
3013.q(dout[27:0])
3014);
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027endmodule
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041// any PARAMS parms go into naming of macro
3042
3043module pmu_pct_ctl_msff_ctl_macro__width_32 (
3044 din,
3045 l1clk,
3046 scan_in,
3047 siclk,
3048 soclk,
3049 dout,
3050 scan_out);
3051wire [31:0] fdin;
3052wire [30:0] so;
3053
3054 input [31:0] din;
3055 input l1clk;
3056 input scan_in;
3057
3058
3059 input siclk;
3060 input soclk;
3061
3062 output [31:0] dout;
3063 output scan_out;
3064assign fdin[31:0] = din[31:0];
3065
3066
3067
3068
3069
3070
3071dff #(32) d0_0 (
3072.l1clk(l1clk),
3073.siclk(siclk),
3074.soclk(soclk),
3075.d(fdin[31:0]),
3076.si({scan_in,so[30:0]}),
3077.so({so[30:0],scan_out}),
3078.q(dout[31:0])
3079);
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092endmodule
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106// any PARAMS parms go into naming of macro
3107
3108module pmu_pct_ctl_msff_ctl_macro__width_8 (
3109 din,
3110 l1clk,
3111 scan_in,
3112 siclk,
3113 soclk,
3114 dout,
3115 scan_out);
3116wire [7:0] fdin;
3117wire [6:0] so;
3118
3119 input [7:0] din;
3120 input l1clk;
3121 input scan_in;
3122
3123
3124 input siclk;
3125 input soclk;
3126
3127 output [7:0] dout;
3128 output scan_out;
3129assign fdin[7:0] = din[7:0];
3130
3131
3132
3133
3134
3135
3136dff #(8) d0_0 (
3137.l1clk(l1clk),
3138.siclk(siclk),
3139.soclk(soclk),
3140.d(fdin[7:0]),
3141.si({scan_in,so[6:0]}),
3142.so({so[6:0],scan_out}),
3143.q(dout[7:0])
3144);
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157endmodule
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171// any PARAMS parms go into naming of macro
3172
3173module pmu_pct_ctl_msff_ctl_macro__width_24 (
3174 din,
3175 l1clk,
3176 scan_in,
3177 siclk,
3178 soclk,
3179 dout,
3180 scan_out);
3181wire [23:0] fdin;
3182wire [22:0] so;
3183
3184 input [23:0] din;
3185 input l1clk;
3186 input scan_in;
3187
3188
3189 input siclk;
3190 input soclk;
3191
3192 output [23:0] dout;
3193 output scan_out;
3194assign fdin[23:0] = din[23:0];
3195
3196
3197
3198
3199
3200
3201dff #(24) d0_0 (
3202.l1clk(l1clk),
3203.siclk(siclk),
3204.soclk(soclk),
3205.d(fdin[23:0]),
3206.si({scan_in,so[22:0]}),
3207.so({so[22:0],scan_out}),
3208.q(dout[23:0])
3209);
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222endmodule
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236// any PARAMS parms go into naming of macro
3237
3238module pmu_pct_ctl_msff_ctl_macro__width_18 (
3239 din,
3240 l1clk,
3241 scan_in,
3242 siclk,
3243 soclk,
3244 dout,
3245 scan_out);
3246wire [17:0] fdin;
3247wire [16:0] so;
3248
3249 input [17:0] din;
3250 input l1clk;
3251 input scan_in;
3252
3253
3254 input siclk;
3255 input soclk;
3256
3257 output [17:0] dout;
3258 output scan_out;
3259assign fdin[17:0] = din[17:0];
3260
3261
3262
3263
3264
3265
3266dff #(18) d0_0 (
3267.l1clk(l1clk),
3268.siclk(siclk),
3269.soclk(soclk),
3270.d(fdin[17:0]),
3271.si({scan_in,so[16:0]}),
3272.so({so[16:0],scan_out}),
3273.q(dout[17:0])
3274);
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287endmodule
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301// any PARAMS parms go into naming of macro
3302
3303module pmu_pct_ctl_msff_ctl_macro__width_14 (
3304 din,
3305 l1clk,
3306 scan_in,
3307 siclk,
3308 soclk,
3309 dout,
3310 scan_out);
3311wire [13:0] fdin;
3312wire [12:0] so;
3313
3314 input [13:0] din;
3315 input l1clk;
3316 input scan_in;
3317
3318
3319 input siclk;
3320 input soclk;
3321
3322 output [13:0] dout;
3323 output scan_out;
3324assign fdin[13:0] = din[13:0];
3325
3326
3327
3328
3329
3330
3331dff #(14) d0_0 (
3332.l1clk(l1clk),
3333.siclk(siclk),
3334.soclk(soclk),
3335.d(fdin[13:0]),
3336.si({scan_in,so[12:0]}),
3337.so({so[12:0],scan_out}),
3338.q(dout[13:0])
3339);
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352endmodule
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362// Description: Spare gate macro for control blocks
3363//
3364// Param num controls the number of times the macro is added
3365// flops=0 can be used to use only combination spare logic
3366
3367
3368module pmu_pct_ctl_spare_ctl_macro__num_12 (
3369 l1clk,
3370 scan_in,
3371 siclk,
3372 soclk,
3373 scan_out);
3374wire si_0;
3375wire so_0;
3376wire spare0_flop_unused;
3377wire spare0_buf_32x_unused;
3378wire spare0_nand3_8x_unused;
3379wire spare0_inv_8x_unused;
3380wire spare0_aoi22_4x_unused;
3381wire spare0_buf_8x_unused;
3382wire spare0_oai22_4x_unused;
3383wire spare0_inv_16x_unused;
3384wire spare0_nand2_16x_unused;
3385wire spare0_nor3_4x_unused;
3386wire spare0_nand2_8x_unused;
3387wire spare0_buf_16x_unused;
3388wire spare0_nor2_16x_unused;
3389wire spare0_inv_32x_unused;
3390wire si_1;
3391wire so_1;
3392wire spare1_flop_unused;
3393wire spare1_buf_32x_unused;
3394wire spare1_nand3_8x_unused;
3395wire spare1_inv_8x_unused;
3396wire spare1_aoi22_4x_unused;
3397wire spare1_buf_8x_unused;
3398wire spare1_oai22_4x_unused;
3399wire spare1_inv_16x_unused;
3400wire spare1_nand2_16x_unused;
3401wire spare1_nor3_4x_unused;
3402wire spare1_nand2_8x_unused;
3403wire spare1_buf_16x_unused;
3404wire spare1_nor2_16x_unused;
3405wire spare1_inv_32x_unused;
3406wire si_2;
3407wire so_2;
3408wire spare2_flop_unused;
3409wire spare2_buf_32x_unused;
3410wire spare2_nand3_8x_unused;
3411wire spare2_inv_8x_unused;
3412wire spare2_aoi22_4x_unused;
3413wire spare2_buf_8x_unused;
3414wire spare2_oai22_4x_unused;
3415wire spare2_inv_16x_unused;
3416wire spare2_nand2_16x_unused;
3417wire spare2_nor3_4x_unused;
3418wire spare2_nand2_8x_unused;
3419wire spare2_buf_16x_unused;
3420wire spare2_nor2_16x_unused;
3421wire spare2_inv_32x_unused;
3422wire si_3;
3423wire so_3;
3424wire spare3_flop_unused;
3425wire spare3_buf_32x_unused;
3426wire spare3_nand3_8x_unused;
3427wire spare3_inv_8x_unused;
3428wire spare3_aoi22_4x_unused;
3429wire spare3_buf_8x_unused;
3430wire spare3_oai22_4x_unused;
3431wire spare3_inv_16x_unused;
3432wire spare3_nand2_16x_unused;
3433wire spare3_nor3_4x_unused;
3434wire spare3_nand2_8x_unused;
3435wire spare3_buf_16x_unused;
3436wire spare3_nor2_16x_unused;
3437wire spare3_inv_32x_unused;
3438wire si_4;
3439wire so_4;
3440wire spare4_flop_unused;
3441wire spare4_buf_32x_unused;
3442wire spare4_nand3_8x_unused;
3443wire spare4_inv_8x_unused;
3444wire spare4_aoi22_4x_unused;
3445wire spare4_buf_8x_unused;
3446wire spare4_oai22_4x_unused;
3447wire spare4_inv_16x_unused;
3448wire spare4_nand2_16x_unused;
3449wire spare4_nor3_4x_unused;
3450wire spare4_nand2_8x_unused;
3451wire spare4_buf_16x_unused;
3452wire spare4_nor2_16x_unused;
3453wire spare4_inv_32x_unused;
3454wire si_5;
3455wire so_5;
3456wire spare5_flop_unused;
3457wire spare5_buf_32x_unused;
3458wire spare5_nand3_8x_unused;
3459wire spare5_inv_8x_unused;
3460wire spare5_aoi22_4x_unused;
3461wire spare5_buf_8x_unused;
3462wire spare5_oai22_4x_unused;
3463wire spare5_inv_16x_unused;
3464wire spare5_nand2_16x_unused;
3465wire spare5_nor3_4x_unused;
3466wire spare5_nand2_8x_unused;
3467wire spare5_buf_16x_unused;
3468wire spare5_nor2_16x_unused;
3469wire spare5_inv_32x_unused;
3470wire si_6;
3471wire so_6;
3472wire spare6_flop_unused;
3473wire spare6_buf_32x_unused;
3474wire spare6_nand3_8x_unused;
3475wire spare6_inv_8x_unused;
3476wire spare6_aoi22_4x_unused;
3477wire spare6_buf_8x_unused;
3478wire spare6_oai22_4x_unused;
3479wire spare6_inv_16x_unused;
3480wire spare6_nand2_16x_unused;
3481wire spare6_nor3_4x_unused;
3482wire spare6_nand2_8x_unused;
3483wire spare6_buf_16x_unused;
3484wire spare6_nor2_16x_unused;
3485wire spare6_inv_32x_unused;
3486wire si_7;
3487wire so_7;
3488wire spare7_flop_unused;
3489wire spare7_buf_32x_unused;
3490wire spare7_nand3_8x_unused;
3491wire spare7_inv_8x_unused;
3492wire spare7_aoi22_4x_unused;
3493wire spare7_buf_8x_unused;
3494wire spare7_oai22_4x_unused;
3495wire spare7_inv_16x_unused;
3496wire spare7_nand2_16x_unused;
3497wire spare7_nor3_4x_unused;
3498wire spare7_nand2_8x_unused;
3499wire spare7_buf_16x_unused;
3500wire spare7_nor2_16x_unused;
3501wire spare7_inv_32x_unused;
3502wire si_8;
3503wire so_8;
3504wire spare8_flop_unused;
3505wire spare8_buf_32x_unused;
3506wire spare8_nand3_8x_unused;
3507wire spare8_inv_8x_unused;
3508wire spare8_aoi22_4x_unused;
3509wire spare8_buf_8x_unused;
3510wire spare8_oai22_4x_unused;
3511wire spare8_inv_16x_unused;
3512wire spare8_nand2_16x_unused;
3513wire spare8_nor3_4x_unused;
3514wire spare8_nand2_8x_unused;
3515wire spare8_buf_16x_unused;
3516wire spare8_nor2_16x_unused;
3517wire spare8_inv_32x_unused;
3518wire si_9;
3519wire so_9;
3520wire spare9_flop_unused;
3521wire spare9_buf_32x_unused;
3522wire spare9_nand3_8x_unused;
3523wire spare9_inv_8x_unused;
3524wire spare9_aoi22_4x_unused;
3525wire spare9_buf_8x_unused;
3526wire spare9_oai22_4x_unused;
3527wire spare9_inv_16x_unused;
3528wire spare9_nand2_16x_unused;
3529wire spare9_nor3_4x_unused;
3530wire spare9_nand2_8x_unused;
3531wire spare9_buf_16x_unused;
3532wire spare9_nor2_16x_unused;
3533wire spare9_inv_32x_unused;
3534wire si_10;
3535wire so_10;
3536wire spare10_flop_unused;
3537wire spare10_buf_32x_unused;
3538wire spare10_nand3_8x_unused;
3539wire spare10_inv_8x_unused;
3540wire spare10_aoi22_4x_unused;
3541wire spare10_buf_8x_unused;
3542wire spare10_oai22_4x_unused;
3543wire spare10_inv_16x_unused;
3544wire spare10_nand2_16x_unused;
3545wire spare10_nor3_4x_unused;
3546wire spare10_nand2_8x_unused;
3547wire spare10_buf_16x_unused;
3548wire spare10_nor2_16x_unused;
3549wire spare10_inv_32x_unused;
3550wire si_11;
3551wire so_11;
3552wire spare11_flop_unused;
3553wire spare11_buf_32x_unused;
3554wire spare11_nand3_8x_unused;
3555wire spare11_inv_8x_unused;
3556wire spare11_aoi22_4x_unused;
3557wire spare11_buf_8x_unused;
3558wire spare11_oai22_4x_unused;
3559wire spare11_inv_16x_unused;
3560wire spare11_nand2_16x_unused;
3561wire spare11_nor3_4x_unused;
3562wire spare11_nand2_8x_unused;
3563wire spare11_buf_16x_unused;
3564wire spare11_nor2_16x_unused;
3565wire spare11_inv_32x_unused;
3566
3567
3568input l1clk;
3569input scan_in;
3570input siclk;
3571input soclk;
3572output scan_out;
3573
3574cl_sc1_msff_8x spare0_flop (.l1clk(l1clk),
3575 .siclk(siclk),
3576 .soclk(soclk),
3577 .si(si_0),
3578 .so(so_0),
3579 .d(1'b0),
3580 .q(spare0_flop_unused));
3581assign si_0 = scan_in;
3582
3583cl_u1_buf_32x spare0_buf_32x (.in(1'b1),
3584 .out(spare0_buf_32x_unused));
3585cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1),
3586 .in1(1'b1),
3587 .in2(1'b1),
3588 .out(spare0_nand3_8x_unused));
3589cl_u1_inv_8x spare0_inv_8x (.in(1'b1),
3590 .out(spare0_inv_8x_unused));
3591cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1),
3592 .in01(1'b1),
3593 .in10(1'b1),
3594 .in11(1'b1),
3595 .out(spare0_aoi22_4x_unused));
3596cl_u1_buf_8x spare0_buf_8x (.in(1'b1),
3597 .out(spare0_buf_8x_unused));
3598cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1),
3599 .in01(1'b1),
3600 .in10(1'b1),
3601 .in11(1'b1),
3602 .out(spare0_oai22_4x_unused));
3603cl_u1_inv_16x spare0_inv_16x (.in(1'b1),
3604 .out(spare0_inv_16x_unused));
3605cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1),
3606 .in1(1'b1),
3607 .out(spare0_nand2_16x_unused));
3608cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0),
3609 .in1(1'b0),
3610 .in2(1'b0),
3611 .out(spare0_nor3_4x_unused));
3612cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1),
3613 .in1(1'b1),
3614 .out(spare0_nand2_8x_unused));
3615cl_u1_buf_16x spare0_buf_16x (.in(1'b1),
3616 .out(spare0_buf_16x_unused));
3617cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0),
3618 .in1(1'b0),
3619 .out(spare0_nor2_16x_unused));
3620cl_u1_inv_32x spare0_inv_32x (.in(1'b1),
3621 .out(spare0_inv_32x_unused));
3622
3623cl_sc1_msff_8x spare1_flop (.l1clk(l1clk),
3624 .siclk(siclk),
3625 .soclk(soclk),
3626 .si(si_1),
3627 .so(so_1),
3628 .d(1'b0),
3629 .q(spare1_flop_unused));
3630assign si_1 = so_0;
3631
3632cl_u1_buf_32x spare1_buf_32x (.in(1'b1),
3633 .out(spare1_buf_32x_unused));
3634cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1),
3635 .in1(1'b1),
3636 .in2(1'b1),
3637 .out(spare1_nand3_8x_unused));
3638cl_u1_inv_8x spare1_inv_8x (.in(1'b1),
3639 .out(spare1_inv_8x_unused));
3640cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1),
3641 .in01(1'b1),
3642 .in10(1'b1),
3643 .in11(1'b1),
3644 .out(spare1_aoi22_4x_unused));
3645cl_u1_buf_8x spare1_buf_8x (.in(1'b1),
3646 .out(spare1_buf_8x_unused));
3647cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1),
3648 .in01(1'b1),
3649 .in10(1'b1),
3650 .in11(1'b1),
3651 .out(spare1_oai22_4x_unused));
3652cl_u1_inv_16x spare1_inv_16x (.in(1'b1),
3653 .out(spare1_inv_16x_unused));
3654cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1),
3655 .in1(1'b1),
3656 .out(spare1_nand2_16x_unused));
3657cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0),
3658 .in1(1'b0),
3659 .in2(1'b0),
3660 .out(spare1_nor3_4x_unused));
3661cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1),
3662 .in1(1'b1),
3663 .out(spare1_nand2_8x_unused));
3664cl_u1_buf_16x spare1_buf_16x (.in(1'b1),
3665 .out(spare1_buf_16x_unused));
3666cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0),
3667 .in1(1'b0),
3668 .out(spare1_nor2_16x_unused));
3669cl_u1_inv_32x spare1_inv_32x (.in(1'b1),
3670 .out(spare1_inv_32x_unused));
3671
3672cl_sc1_msff_8x spare2_flop (.l1clk(l1clk),
3673 .siclk(siclk),
3674 .soclk(soclk),
3675 .si(si_2),
3676 .so(so_2),
3677 .d(1'b0),
3678 .q(spare2_flop_unused));
3679assign si_2 = so_1;
3680
3681cl_u1_buf_32x spare2_buf_32x (.in(1'b1),
3682 .out(spare2_buf_32x_unused));
3683cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1),
3684 .in1(1'b1),
3685 .in2(1'b1),
3686 .out(spare2_nand3_8x_unused));
3687cl_u1_inv_8x spare2_inv_8x (.in(1'b1),
3688 .out(spare2_inv_8x_unused));
3689cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1),
3690 .in01(1'b1),
3691 .in10(1'b1),
3692 .in11(1'b1),
3693 .out(spare2_aoi22_4x_unused));
3694cl_u1_buf_8x spare2_buf_8x (.in(1'b1),
3695 .out(spare2_buf_8x_unused));
3696cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1),
3697 .in01(1'b1),
3698 .in10(1'b1),
3699 .in11(1'b1),
3700 .out(spare2_oai22_4x_unused));
3701cl_u1_inv_16x spare2_inv_16x (.in(1'b1),
3702 .out(spare2_inv_16x_unused));
3703cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1),
3704 .in1(1'b1),
3705 .out(spare2_nand2_16x_unused));
3706cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0),
3707 .in1(1'b0),
3708 .in2(1'b0),
3709 .out(spare2_nor3_4x_unused));
3710cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1),
3711 .in1(1'b1),
3712 .out(spare2_nand2_8x_unused));
3713cl_u1_buf_16x spare2_buf_16x (.in(1'b1),
3714 .out(spare2_buf_16x_unused));
3715cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0),
3716 .in1(1'b0),
3717 .out(spare2_nor2_16x_unused));
3718cl_u1_inv_32x spare2_inv_32x (.in(1'b1),
3719 .out(spare2_inv_32x_unused));
3720
3721cl_sc1_msff_8x spare3_flop (.l1clk(l1clk),
3722 .siclk(siclk),
3723 .soclk(soclk),
3724 .si(si_3),
3725 .so(so_3),
3726 .d(1'b0),
3727 .q(spare3_flop_unused));
3728assign si_3 = so_2;
3729
3730cl_u1_buf_32x spare3_buf_32x (.in(1'b1),
3731 .out(spare3_buf_32x_unused));
3732cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1),
3733 .in1(1'b1),
3734 .in2(1'b1),
3735 .out(spare3_nand3_8x_unused));
3736cl_u1_inv_8x spare3_inv_8x (.in(1'b1),
3737 .out(spare3_inv_8x_unused));
3738cl_u1_aoi22_4x spare3_aoi22_4x (.in00(1'b1),
3739 .in01(1'b1),
3740 .in10(1'b1),
3741 .in11(1'b1),
3742 .out(spare3_aoi22_4x_unused));
3743cl_u1_buf_8x spare3_buf_8x (.in(1'b1),
3744 .out(spare3_buf_8x_unused));
3745cl_u1_oai22_4x spare3_oai22_4x (.in00(1'b1),
3746 .in01(1'b1),
3747 .in10(1'b1),
3748 .in11(1'b1),
3749 .out(spare3_oai22_4x_unused));
3750cl_u1_inv_16x spare3_inv_16x (.in(1'b1),
3751 .out(spare3_inv_16x_unused));
3752cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1),
3753 .in1(1'b1),
3754 .out(spare3_nand2_16x_unused));
3755cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0),
3756 .in1(1'b0),
3757 .in2(1'b0),
3758 .out(spare3_nor3_4x_unused));
3759cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1),
3760 .in1(1'b1),
3761 .out(spare3_nand2_8x_unused));
3762cl_u1_buf_16x spare3_buf_16x (.in(1'b1),
3763 .out(spare3_buf_16x_unused));
3764cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0),
3765 .in1(1'b0),
3766 .out(spare3_nor2_16x_unused));
3767cl_u1_inv_32x spare3_inv_32x (.in(1'b1),
3768 .out(spare3_inv_32x_unused));
3769
3770cl_sc1_msff_8x spare4_flop (.l1clk(l1clk),
3771 .siclk(siclk),
3772 .soclk(soclk),
3773 .si(si_4),
3774 .so(so_4),
3775 .d(1'b0),
3776 .q(spare4_flop_unused));
3777assign si_4 = so_3;
3778
3779cl_u1_buf_32x spare4_buf_32x (.in(1'b1),
3780 .out(spare4_buf_32x_unused));
3781cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1),
3782 .in1(1'b1),
3783 .in2(1'b1),
3784 .out(spare4_nand3_8x_unused));
3785cl_u1_inv_8x spare4_inv_8x (.in(1'b1),
3786 .out(spare4_inv_8x_unused));
3787cl_u1_aoi22_4x spare4_aoi22_4x (.in00(1'b1),
3788 .in01(1'b1),
3789 .in10(1'b1),
3790 .in11(1'b1),
3791 .out(spare4_aoi22_4x_unused));
3792cl_u1_buf_8x spare4_buf_8x (.in(1'b1),
3793 .out(spare4_buf_8x_unused));
3794cl_u1_oai22_4x spare4_oai22_4x (.in00(1'b1),
3795 .in01(1'b1),
3796 .in10(1'b1),
3797 .in11(1'b1),
3798 .out(spare4_oai22_4x_unused));
3799cl_u1_inv_16x spare4_inv_16x (.in(1'b1),
3800 .out(spare4_inv_16x_unused));
3801cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1),
3802 .in1(1'b1),
3803 .out(spare4_nand2_16x_unused));
3804cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0),
3805 .in1(1'b0),
3806 .in2(1'b0),
3807 .out(spare4_nor3_4x_unused));
3808cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1),
3809 .in1(1'b1),
3810 .out(spare4_nand2_8x_unused));
3811cl_u1_buf_16x spare4_buf_16x (.in(1'b1),
3812 .out(spare4_buf_16x_unused));
3813cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0),
3814 .in1(1'b0),
3815 .out(spare4_nor2_16x_unused));
3816cl_u1_inv_32x spare4_inv_32x (.in(1'b1),
3817 .out(spare4_inv_32x_unused));
3818
3819cl_sc1_msff_8x spare5_flop (.l1clk(l1clk),
3820 .siclk(siclk),
3821 .soclk(soclk),
3822 .si(si_5),
3823 .so(so_5),
3824 .d(1'b0),
3825 .q(spare5_flop_unused));
3826assign si_5 = so_4;
3827
3828cl_u1_buf_32x spare5_buf_32x (.in(1'b1),
3829 .out(spare5_buf_32x_unused));
3830cl_u1_nand3_8x spare5_nand3_8x (.in0(1'b1),
3831 .in1(1'b1),
3832 .in2(1'b1),
3833 .out(spare5_nand3_8x_unused));
3834cl_u1_inv_8x spare5_inv_8x (.in(1'b1),
3835 .out(spare5_inv_8x_unused));
3836cl_u1_aoi22_4x spare5_aoi22_4x (.in00(1'b1),
3837 .in01(1'b1),
3838 .in10(1'b1),
3839 .in11(1'b1),
3840 .out(spare5_aoi22_4x_unused));
3841cl_u1_buf_8x spare5_buf_8x (.in(1'b1),
3842 .out(spare5_buf_8x_unused));
3843cl_u1_oai22_4x spare5_oai22_4x (.in00(1'b1),
3844 .in01(1'b1),
3845 .in10(1'b1),
3846 .in11(1'b1),
3847 .out(spare5_oai22_4x_unused));
3848cl_u1_inv_16x spare5_inv_16x (.in(1'b1),
3849 .out(spare5_inv_16x_unused));
3850cl_u1_nand2_16x spare5_nand2_16x (.in0(1'b1),
3851 .in1(1'b1),
3852 .out(spare5_nand2_16x_unused));
3853cl_u1_nor3_4x spare5_nor3_4x (.in0(1'b0),
3854 .in1(1'b0),
3855 .in2(1'b0),
3856 .out(spare5_nor3_4x_unused));
3857cl_u1_nand2_8x spare5_nand2_8x (.in0(1'b1),
3858 .in1(1'b1),
3859 .out(spare5_nand2_8x_unused));
3860cl_u1_buf_16x spare5_buf_16x (.in(1'b1),
3861 .out(spare5_buf_16x_unused));
3862cl_u1_nor2_16x spare5_nor2_16x (.in0(1'b0),
3863 .in1(1'b0),
3864 .out(spare5_nor2_16x_unused));
3865cl_u1_inv_32x spare5_inv_32x (.in(1'b1),
3866 .out(spare5_inv_32x_unused));
3867
3868cl_sc1_msff_8x spare6_flop (.l1clk(l1clk),
3869 .siclk(siclk),
3870 .soclk(soclk),
3871 .si(si_6),
3872 .so(so_6),
3873 .d(1'b0),
3874 .q(spare6_flop_unused));
3875assign si_6 = so_5;
3876
3877cl_u1_buf_32x spare6_buf_32x (.in(1'b1),
3878 .out(spare6_buf_32x_unused));
3879cl_u1_nand3_8x spare6_nand3_8x (.in0(1'b1),
3880 .in1(1'b1),
3881 .in2(1'b1),
3882 .out(spare6_nand3_8x_unused));
3883cl_u1_inv_8x spare6_inv_8x (.in(1'b1),
3884 .out(spare6_inv_8x_unused));
3885cl_u1_aoi22_4x spare6_aoi22_4x (.in00(1'b1),
3886 .in01(1'b1),
3887 .in10(1'b1),
3888 .in11(1'b1),
3889 .out(spare6_aoi22_4x_unused));
3890cl_u1_buf_8x spare6_buf_8x (.in(1'b1),
3891 .out(spare6_buf_8x_unused));
3892cl_u1_oai22_4x spare6_oai22_4x (.in00(1'b1),
3893 .in01(1'b1),
3894 .in10(1'b1),
3895 .in11(1'b1),
3896 .out(spare6_oai22_4x_unused));
3897cl_u1_inv_16x spare6_inv_16x (.in(1'b1),
3898 .out(spare6_inv_16x_unused));
3899cl_u1_nand2_16x spare6_nand2_16x (.in0(1'b1),
3900 .in1(1'b1),
3901 .out(spare6_nand2_16x_unused));
3902cl_u1_nor3_4x spare6_nor3_4x (.in0(1'b0),
3903 .in1(1'b0),
3904 .in2(1'b0),
3905 .out(spare6_nor3_4x_unused));
3906cl_u1_nand2_8x spare6_nand2_8x (.in0(1'b1),
3907 .in1(1'b1),
3908 .out(spare6_nand2_8x_unused));
3909cl_u1_buf_16x spare6_buf_16x (.in(1'b1),
3910 .out(spare6_buf_16x_unused));
3911cl_u1_nor2_16x spare6_nor2_16x (.in0(1'b0),
3912 .in1(1'b0),
3913 .out(spare6_nor2_16x_unused));
3914cl_u1_inv_32x spare6_inv_32x (.in(1'b1),
3915 .out(spare6_inv_32x_unused));
3916
3917cl_sc1_msff_8x spare7_flop (.l1clk(l1clk),
3918 .siclk(siclk),
3919 .soclk(soclk),
3920 .si(si_7),
3921 .so(so_7),
3922 .d(1'b0),
3923 .q(spare7_flop_unused));
3924assign si_7 = so_6;
3925
3926cl_u1_buf_32x spare7_buf_32x (.in(1'b1),
3927 .out(spare7_buf_32x_unused));
3928cl_u1_nand3_8x spare7_nand3_8x (.in0(1'b1),
3929 .in1(1'b1),
3930 .in2(1'b1),
3931 .out(spare7_nand3_8x_unused));
3932cl_u1_inv_8x spare7_inv_8x (.in(1'b1),
3933 .out(spare7_inv_8x_unused));
3934cl_u1_aoi22_4x spare7_aoi22_4x (.in00(1'b1),
3935 .in01(1'b1),
3936 .in10(1'b1),
3937 .in11(1'b1),
3938 .out(spare7_aoi22_4x_unused));
3939cl_u1_buf_8x spare7_buf_8x (.in(1'b1),
3940 .out(spare7_buf_8x_unused));
3941cl_u1_oai22_4x spare7_oai22_4x (.in00(1'b1),
3942 .in01(1'b1),
3943 .in10(1'b1),
3944 .in11(1'b1),
3945 .out(spare7_oai22_4x_unused));
3946cl_u1_inv_16x spare7_inv_16x (.in(1'b1),
3947 .out(spare7_inv_16x_unused));
3948cl_u1_nand2_16x spare7_nand2_16x (.in0(1'b1),
3949 .in1(1'b1),
3950 .out(spare7_nand2_16x_unused));
3951cl_u1_nor3_4x spare7_nor3_4x (.in0(1'b0),
3952 .in1(1'b0),
3953 .in2(1'b0),
3954 .out(spare7_nor3_4x_unused));
3955cl_u1_nand2_8x spare7_nand2_8x (.in0(1'b1),
3956 .in1(1'b1),
3957 .out(spare7_nand2_8x_unused));
3958cl_u1_buf_16x spare7_buf_16x (.in(1'b1),
3959 .out(spare7_buf_16x_unused));
3960cl_u1_nor2_16x spare7_nor2_16x (.in0(1'b0),
3961 .in1(1'b0),
3962 .out(spare7_nor2_16x_unused));
3963cl_u1_inv_32x spare7_inv_32x (.in(1'b1),
3964 .out(spare7_inv_32x_unused));
3965
3966cl_sc1_msff_8x spare8_flop (.l1clk(l1clk),
3967 .siclk(siclk),
3968 .soclk(soclk),
3969 .si(si_8),
3970 .so(so_8),
3971 .d(1'b0),
3972 .q(spare8_flop_unused));
3973assign si_8 = so_7;
3974
3975cl_u1_buf_32x spare8_buf_32x (.in(1'b1),
3976 .out(spare8_buf_32x_unused));
3977cl_u1_nand3_8x spare8_nand3_8x (.in0(1'b1),
3978 .in1(1'b1),
3979 .in2(1'b1),
3980 .out(spare8_nand3_8x_unused));
3981cl_u1_inv_8x spare8_inv_8x (.in(1'b1),
3982 .out(spare8_inv_8x_unused));
3983cl_u1_aoi22_4x spare8_aoi22_4x (.in00(1'b1),
3984 .in01(1'b1),
3985 .in10(1'b1),
3986 .in11(1'b1),
3987 .out(spare8_aoi22_4x_unused));
3988cl_u1_buf_8x spare8_buf_8x (.in(1'b1),
3989 .out(spare8_buf_8x_unused));
3990cl_u1_oai22_4x spare8_oai22_4x (.in00(1'b1),
3991 .in01(1'b1),
3992 .in10(1'b1),
3993 .in11(1'b1),
3994 .out(spare8_oai22_4x_unused));
3995cl_u1_inv_16x spare8_inv_16x (.in(1'b1),
3996 .out(spare8_inv_16x_unused));
3997cl_u1_nand2_16x spare8_nand2_16x (.in0(1'b1),
3998 .in1(1'b1),
3999 .out(spare8_nand2_16x_unused));
4000cl_u1_nor3_4x spare8_nor3_4x (.in0(1'b0),
4001 .in1(1'b0),
4002 .in2(1'b0),
4003 .out(spare8_nor3_4x_unused));
4004cl_u1_nand2_8x spare8_nand2_8x (.in0(1'b1),
4005 .in1(1'b1),
4006 .out(spare8_nand2_8x_unused));
4007cl_u1_buf_16x spare8_buf_16x (.in(1'b1),
4008 .out(spare8_buf_16x_unused));
4009cl_u1_nor2_16x spare8_nor2_16x (.in0(1'b0),
4010 .in1(1'b0),
4011 .out(spare8_nor2_16x_unused));
4012cl_u1_inv_32x spare8_inv_32x (.in(1'b1),
4013 .out(spare8_inv_32x_unused));
4014
4015cl_sc1_msff_8x spare9_flop (.l1clk(l1clk),
4016 .siclk(siclk),
4017 .soclk(soclk),
4018 .si(si_9),
4019 .so(so_9),
4020 .d(1'b0),
4021 .q(spare9_flop_unused));
4022assign si_9 = so_8;
4023
4024cl_u1_buf_32x spare9_buf_32x (.in(1'b1),
4025 .out(spare9_buf_32x_unused));
4026cl_u1_nand3_8x spare9_nand3_8x (.in0(1'b1),
4027 .in1(1'b1),
4028 .in2(1'b1),
4029 .out(spare9_nand3_8x_unused));
4030cl_u1_inv_8x spare9_inv_8x (.in(1'b1),
4031 .out(spare9_inv_8x_unused));
4032cl_u1_aoi22_4x spare9_aoi22_4x (.in00(1'b1),
4033 .in01(1'b1),
4034 .in10(1'b1),
4035 .in11(1'b1),
4036 .out(spare9_aoi22_4x_unused));
4037cl_u1_buf_8x spare9_buf_8x (.in(1'b1),
4038 .out(spare9_buf_8x_unused));
4039cl_u1_oai22_4x spare9_oai22_4x (.in00(1'b1),
4040 .in01(1'b1),
4041 .in10(1'b1),
4042 .in11(1'b1),
4043 .out(spare9_oai22_4x_unused));
4044cl_u1_inv_16x spare9_inv_16x (.in(1'b1),
4045 .out(spare9_inv_16x_unused));
4046cl_u1_nand2_16x spare9_nand2_16x (.in0(1'b1),
4047 .in1(1'b1),
4048 .out(spare9_nand2_16x_unused));
4049cl_u1_nor3_4x spare9_nor3_4x (.in0(1'b0),
4050 .in1(1'b0),
4051 .in2(1'b0),
4052 .out(spare9_nor3_4x_unused));
4053cl_u1_nand2_8x spare9_nand2_8x (.in0(1'b1),
4054 .in1(1'b1),
4055 .out(spare9_nand2_8x_unused));
4056cl_u1_buf_16x spare9_buf_16x (.in(1'b1),
4057 .out(spare9_buf_16x_unused));
4058cl_u1_nor2_16x spare9_nor2_16x (.in0(1'b0),
4059 .in1(1'b0),
4060 .out(spare9_nor2_16x_unused));
4061cl_u1_inv_32x spare9_inv_32x (.in(1'b1),
4062 .out(spare9_inv_32x_unused));
4063
4064cl_sc1_msff_8x spare10_flop (.l1clk(l1clk),
4065 .siclk(siclk),
4066 .soclk(soclk),
4067 .si(si_10),
4068 .so(so_10),
4069 .d(1'b0),
4070 .q(spare10_flop_unused));
4071assign si_10 = so_9;
4072
4073cl_u1_buf_32x spare10_buf_32x (.in(1'b1),
4074 .out(spare10_buf_32x_unused));
4075cl_u1_nand3_8x spare10_nand3_8x (.in0(1'b1),
4076 .in1(1'b1),
4077 .in2(1'b1),
4078 .out(spare10_nand3_8x_unused));
4079cl_u1_inv_8x spare10_inv_8x (.in(1'b1),
4080 .out(spare10_inv_8x_unused));
4081cl_u1_aoi22_4x spare10_aoi22_4x (.in00(1'b1),
4082 .in01(1'b1),
4083 .in10(1'b1),
4084 .in11(1'b1),
4085 .out(spare10_aoi22_4x_unused));
4086cl_u1_buf_8x spare10_buf_8x (.in(1'b1),
4087 .out(spare10_buf_8x_unused));
4088cl_u1_oai22_4x spare10_oai22_4x (.in00(1'b1),
4089 .in01(1'b1),
4090 .in10(1'b1),
4091 .in11(1'b1),
4092 .out(spare10_oai22_4x_unused));
4093cl_u1_inv_16x spare10_inv_16x (.in(1'b1),
4094 .out(spare10_inv_16x_unused));
4095cl_u1_nand2_16x spare10_nand2_16x (.in0(1'b1),
4096 .in1(1'b1),
4097 .out(spare10_nand2_16x_unused));
4098cl_u1_nor3_4x spare10_nor3_4x (.in0(1'b0),
4099 .in1(1'b0),
4100 .in2(1'b0),
4101 .out(spare10_nor3_4x_unused));
4102cl_u1_nand2_8x spare10_nand2_8x (.in0(1'b1),
4103 .in1(1'b1),
4104 .out(spare10_nand2_8x_unused));
4105cl_u1_buf_16x spare10_buf_16x (.in(1'b1),
4106 .out(spare10_buf_16x_unused));
4107cl_u1_nor2_16x spare10_nor2_16x (.in0(1'b0),
4108 .in1(1'b0),
4109 .out(spare10_nor2_16x_unused));
4110cl_u1_inv_32x spare10_inv_32x (.in(1'b1),
4111 .out(spare10_inv_32x_unused));
4112
4113cl_sc1_msff_8x spare11_flop (.l1clk(l1clk),
4114 .siclk(siclk),
4115 .soclk(soclk),
4116 .si(si_11),
4117 .so(so_11),
4118 .d(1'b0),
4119 .q(spare11_flop_unused));
4120assign si_11 = so_10;
4121
4122cl_u1_buf_32x spare11_buf_32x (.in(1'b1),
4123 .out(spare11_buf_32x_unused));
4124cl_u1_nand3_8x spare11_nand3_8x (.in0(1'b1),
4125 .in1(1'b1),
4126 .in2(1'b1),
4127 .out(spare11_nand3_8x_unused));
4128cl_u1_inv_8x spare11_inv_8x (.in(1'b1),
4129 .out(spare11_inv_8x_unused));
4130cl_u1_aoi22_4x spare11_aoi22_4x (.in00(1'b1),
4131 .in01(1'b1),
4132 .in10(1'b1),
4133 .in11(1'b1),
4134 .out(spare11_aoi22_4x_unused));
4135cl_u1_buf_8x spare11_buf_8x (.in(1'b1),
4136 .out(spare11_buf_8x_unused));
4137cl_u1_oai22_4x spare11_oai22_4x (.in00(1'b1),
4138 .in01(1'b1),
4139 .in10(1'b1),
4140 .in11(1'b1),
4141 .out(spare11_oai22_4x_unused));
4142cl_u1_inv_16x spare11_inv_16x (.in(1'b1),
4143 .out(spare11_inv_16x_unused));
4144cl_u1_nand2_16x spare11_nand2_16x (.in0(1'b1),
4145 .in1(1'b1),
4146 .out(spare11_nand2_16x_unused));
4147cl_u1_nor3_4x spare11_nor3_4x (.in0(1'b0),
4148 .in1(1'b0),
4149 .in2(1'b0),
4150 .out(spare11_nor3_4x_unused));
4151cl_u1_nand2_8x spare11_nand2_8x (.in0(1'b1),
4152 .in1(1'b1),
4153 .out(spare11_nand2_8x_unused));
4154cl_u1_buf_16x spare11_buf_16x (.in(1'b1),
4155 .out(spare11_buf_16x_unused));
4156cl_u1_nor2_16x spare11_nor2_16x (.in0(1'b0),
4157 .in1(1'b0),
4158 .out(spare11_nor2_16x_unused));
4159cl_u1_inv_32x spare11_inv_32x (.in(1'b1),
4160 .out(spare11_inv_32x_unused));
4161assign scan_out = so_11;
4162
4163
4164
4165endmodule
4166