Commit | Line | Data |
---|---|---|
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 ============================================ | |
35 | module 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); | |
95 | wire pce_ov; | |
96 | wire stop; | |
97 | wire siclk; | |
98 | wire soclk; | |
99 | wire se; | |
100 | wire l1clk; | |
101 | wire pwrm_scanin; | |
102 | wire pwrm_scanout; | |
103 | wire pmu_pmen; | |
104 | wire pmu_busy; | |
105 | wire skip_wakeup_in; | |
106 | wire pmu_pmen_del_1; | |
107 | wire pmu_busy_del_1; | |
108 | wire skip_wakeup; | |
109 | wire [31:0] pcr7_dout; | |
110 | wire [31:0] pcr6_dout; | |
111 | wire [31:0] pcr5_dout; | |
112 | wire [31:0] pcr4_dout; | |
113 | wire [31:0] pcr3_dout; | |
114 | wire [31:0] pcr2_dout; | |
115 | wire [31:0] pcr1_dout; | |
116 | wire [31:0] pcr0_dout; | |
117 | wire wakeup; | |
118 | wire p_wr; | |
119 | wire [7:0] atid; | |
120 | wire [7:0] pic_std_w2; | |
121 | wire sleep; | |
122 | wire sleep_cnt_scanin; | |
123 | wire sleep_cnt_scanout; | |
124 | wire [3:0] sleep_cntr_din; | |
125 | wire [3:0] sleep_cntr; | |
126 | wire wait_for_sleep; | |
127 | wire l1b; | |
128 | wire l1clk_pm1; | |
129 | wire ov_busy; | |
130 | wire [7:0] wr_pcr; | |
131 | wire [7:0] rd_pcr; | |
132 | wire l1clk_pm2; | |
133 | wire hpstate_scanin; | |
134 | wire hpstate_scanout; | |
135 | wire [7:0] hpriv; | |
136 | wire [7:0] priv; | |
137 | wire [5:0] mmu_mtyp; | |
138 | wire events_scanin; | |
139 | wire events_scanout; | |
140 | wire rc4; | |
141 | wire hash; | |
142 | wire des; | |
143 | wire crc; | |
144 | wire aes; | |
145 | wire [3:0] ma; | |
146 | wire [12:0] tg0_e; | |
147 | wire [12:0] tg1_e; | |
148 | wire [1:0] dec_br_taken_m; | |
149 | wire [5:0] mm_mtyp; | |
150 | wire [5:0] mem_typ_w; | |
151 | wire [6:0] xbar; | |
152 | wire [2:0] spu_tid; | |
153 | wire rc4_d1; | |
154 | wire hash_d1; | |
155 | wire des_d1; | |
156 | wire crc_d1; | |
157 | wire aes_d1; | |
158 | wire ma_3_d1; | |
159 | wire dec_lsu_sel0_e; | |
160 | wire [11:0] tg0_ityp_e; | |
161 | wire [11:0] tg1_ityp_e; | |
162 | wire [2:0] lsu_tid_e; | |
163 | wire lsutid_scanin; | |
164 | wire lsutid_scanout; | |
165 | wire [2:0] lsu_tid_m; | |
166 | wire [2:0] lsu_tid_b; | |
167 | wire [2:0] lsu_tid_w; | |
168 | wire all_idle_e; | |
169 | wire [7:0] th; | |
170 | wire [7:0] cwq_tid; | |
171 | wire [7:0] desb; | |
172 | wire [7:0] aesb; | |
173 | wire [7:0] rc4b; | |
174 | wire [7:0] hashb; | |
175 | wire [7:0] crcb; | |
176 | wire [7:0] ma_tid; | |
177 | wire [7:0] mab; | |
178 | wire [7:0] dcm; | |
179 | wire [7:0] dtm; | |
180 | wire [7:0] l2m; | |
181 | wire [7:0] ov1; | |
182 | wire [7:0] set_ovh_spec; | |
183 | wire [7:0] ov0; | |
184 | wire [7:0] set_ovl_spec; | |
185 | wire [7:0] ht_in; | |
186 | wire [29:0] pcr0_din; | |
187 | wire [7:0] disable_h; | |
188 | wire [7:0] disable_l; | |
189 | wire l1clk_pm3; | |
190 | wire pcr0_scanin; | |
191 | wire pcr0_scanout; | |
192 | wire bit63; | |
193 | wire bit62; | |
194 | wire [1:0] x0; | |
195 | wire pcr0_ov_scanin; | |
196 | wire pcr0_ov_scanout; | |
197 | wire [29:0] pcr1_din; | |
198 | wire pcr1_scanin; | |
199 | wire pcr1_scanout; | |
200 | wire [1:0] x1; | |
201 | wire pcr1_ov_scanin; | |
202 | wire pcr1_ov_scanout; | |
203 | wire [29:0] pcr2_din; | |
204 | wire pcr2_scanin; | |
205 | wire pcr2_scanout; | |
206 | wire [1:0] x2; | |
207 | wire pcr2_ov_scanin; | |
208 | wire pcr2_ov_scanout; | |
209 | wire [29:0] pcr3_din; | |
210 | wire pcr3_scanin; | |
211 | wire pcr3_scanout; | |
212 | wire [1:0] x3; | |
213 | wire pcr3_ov_scanin; | |
214 | wire pcr3_ov_scanout; | |
215 | wire [29:0] pcr4_din; | |
216 | wire pcr4_scanin; | |
217 | wire pcr4_scanout; | |
218 | wire [1:0] x4; | |
219 | wire pcr4_ov_scanin; | |
220 | wire pcr4_ov_scanout; | |
221 | wire [29:0] pcr5_din; | |
222 | wire pcr5_scanin; | |
223 | wire pcr5_scanout; | |
224 | wire [1:0] x5; | |
225 | wire pcr5_ov_scanin; | |
226 | wire pcr5_ov_scanout; | |
227 | wire [29:0] pcr6_din; | |
228 | wire pcr6_scanin; | |
229 | wire pcr6_scanout; | |
230 | wire [1:0] x6; | |
231 | wire pcr6_ov_scanin; | |
232 | wire pcr6_ov_scanout; | |
233 | wire [29:0] pcr7_din; | |
234 | wire pcr7_scanin; | |
235 | wire pcr7_scanout; | |
236 | wire [1:0] x7; | |
237 | wire pcr7_ov_scanin; | |
238 | wire pcr7_ov_scanout; | |
239 | wire pcr_ov_del_scanin; | |
240 | wire pcr_ov_del_scanout; | |
241 | wire [1:0] x7_1; | |
242 | wire [1:0] x6_1; | |
243 | wire [1:0] x5_1; | |
244 | wire [1:0] x4_1; | |
245 | wire [1:0] x3_1; | |
246 | wire [1:0] x2_1; | |
247 | wire [1:0] x1_1; | |
248 | wire [1:0] x0_1; | |
249 | wire [7:0] p_cnt_en; | |
250 | wire [7:0] ph_all_idle; | |
251 | wire [7:0] ph_ig; | |
252 | wire [7:0] ph_cg; | |
253 | wire [7:0] ph_mm; | |
254 | wire [7:0] ph_xb; | |
255 | wire [7:0] ph_so; | |
256 | wire [7:0] ph_sb; | |
257 | wire [7:0] pl_all_idle; | |
258 | wire [7:0] pl_ig; | |
259 | wire [7:0] pl_cg; | |
260 | wire [7:0] pl_mm; | |
261 | wire [7:0] pl_xb; | |
262 | wire [7:0] pl_so; | |
263 | wire [7:0] pl_sb; | |
264 | wire [7:0] dcm_h; | |
265 | wire [7:0] dcm_l; | |
266 | wire [7:0] pmu_lsu_dcmiss_trap_e; | |
267 | wire [7:0] pich_wrap; | |
268 | wire [7:0] picl_wrap; | |
269 | wire [7:0] t; | |
270 | wire pmu_lsu_dcm_trap_e; | |
271 | wire [7:0] dtm_h; | |
272 | wire [7:0] dtm_l; | |
273 | wire [7:0] pmu_lsu_dtmiss_trap_e; | |
274 | wire pmu_lsu_dtm_trap_e; | |
275 | wire [7:0] l2dm_h; | |
276 | wire [7:0] l2dm_l; | |
277 | wire lsu_e2m_scanin; | |
278 | wire lsu_e2m_scanout; | |
279 | wire [7:0] l2dm_wrap_e; | |
280 | wire [7:0] lsu_trap_mask_m_din; | |
281 | wire [7:0] l2dm_wrap_m; | |
282 | wire [7:0] lsu_trap_mask_m; | |
283 | wire [7:0] th_m; | |
284 | wire [1:0] tlu_pmu_trap_mask_m; | |
285 | wire [7:0] lsu_tidm_update_m; | |
286 | wire [1:0] dec_valid_m; | |
287 | wire [7:0] ph_ai; | |
288 | wire [7:0] pl_ai; | |
289 | wire [7:0] ph_ige; | |
290 | wire [7:0] pl_ige; | |
291 | wire [7:0] ph_bre; | |
292 | wire [7:0] pl_bre; | |
293 | wire [7:0] dcm_he; | |
294 | wire [7:0] dtm_he; | |
295 | wire [7:0] l2m_he; | |
296 | wire [7:0] dcm_le; | |
297 | wire [7:0] dtm_le; | |
298 | wire [7:0] l2m_le; | |
299 | wire [7:0] ph_icge; | |
300 | wire [7:0] pl_icge; | |
301 | wire [7:0] mm_tid; | |
302 | wire [3:0] mm_l2e; | |
303 | wire [7:0] ph_mme; | |
304 | wire [7:0] pl_mme; | |
305 | wire [5:0] xb; | |
306 | wire use_ma; | |
307 | wire use_cwq; | |
308 | wire [2:0] xbtid; | |
309 | wire [7:0] ph_xbe; | |
310 | wire [7:0] pl_xbe; | |
311 | wire [7:0] spu_des; | |
312 | wire [7:0] spu_aes; | |
313 | wire [7:0] spu_rc4; | |
314 | wire [7:0] spu_hash; | |
315 | wire [7:0] spu_ma; | |
316 | wire [7:0] spu_crc; | |
317 | wire [7:0] ph_soe; | |
318 | wire [7:0] pl_soe; | |
319 | wire [7:0] ph_sbe; | |
320 | wire [7:0] pl_sbe; | |
321 | wire [7:0] ovh; | |
322 | wire [7:0] ovl; | |
323 | wire [7:0] pipeh_incr_e; | |
324 | wire [7:0] pipel_incr_e; | |
325 | wire [7:0] pipeh_incr_m; | |
326 | wire [7:0] ph_brm; | |
327 | wire [7:0] pipel_incr_m; | |
328 | wire [7:0] pl_brm; | |
329 | wire [7:0] pipeh_incr_w; | |
330 | wire [7:0] pipel_incr_w; | |
331 | wire [7:0] pipeh_async; | |
332 | wire [7:0] pipel_async; | |
333 | wire tp_scanin; | |
334 | wire tp_scanout; | |
335 | wire [7:0] trap_e; | |
336 | wire [7:0] trap_b_in; | |
337 | wire [7:0] trap_w_in; | |
338 | wire [7:0] trap_w1_in; | |
339 | wire [7:0] tpt; | |
340 | wire [7:0] trap_m; | |
341 | wire [7:0] trap_b; | |
342 | wire [7:0] trap_w; | |
343 | wire [7:0] trap_w1; | |
344 | wire tp1_scanin; | |
345 | wire tp1_scanout; | |
346 | wire [7:0] trap_hold_in; | |
347 | wire [7:0] trap_hold; | |
348 | wire br_scanin; | |
349 | wire br_scanout; | |
350 | wire [7:0] ph_br_may_trap_m; | |
351 | wire [1:0] ifu_fl_b; | |
352 | wire [1:0] fl_w; | |
353 | wire [7:0] trap_w1_final; | |
354 | wire [1:0] tlu_fl_w1; | |
355 | wire [7:0] async; | |
356 | wire ti_e2m_scanin; | |
357 | wire ti_e2m_scanout; | |
358 | wire [7:0] ph_incr_m; | |
359 | wire [7:0] pl_incr_m; | |
360 | wire [7:0] ph_i_m; | |
361 | wire [7:0] pl_i_m; | |
362 | wire ti_m2b_scanin; | |
363 | wire ti_m2b_scanout; | |
364 | wire [7:0] ph_incr_b; | |
365 | wire [7:0] pl_incr_b; | |
366 | wire [7:0] ph_i_b; | |
367 | wire [7:0] pl_i_b; | |
368 | wire ti_b2w_scanin; | |
369 | wire ti_b2w_scanout; | |
370 | wire [7:0] ph_incr_w; | |
371 | wire [7:0] pl_incr_w; | |
372 | wire [7:0] ph_i_w; | |
373 | wire [7:0] pl_i_w; | |
374 | wire ti_w2w1_scanin; | |
375 | wire ti_w2w1_scanout; | |
376 | wire [7:0] ph_incr_w1; | |
377 | wire [7:0] pl_incr_w1; | |
378 | wire [7:0] flush_h; | |
379 | wire [7:0] flush_l; | |
380 | wire [7:0] ph_final_incr_w1; | |
381 | wire [7:0] pl_final_incr_w1; | |
382 | wire [7:0] pic_std_w1; | |
383 | wire [7:0] pic_st_dout; | |
384 | wire [7:0] pic_st_din; | |
385 | wire pic_st_scanin; | |
386 | wire pic_st_scanout; | |
387 | wire [3:0] t0h_din; | |
388 | wire [3:0] t0h_dout; | |
389 | wire t0h_scanin; | |
390 | wire t0h_scanout; | |
391 | wire [3:0] t1h_din; | |
392 | wire [3:0] t1h_dout; | |
393 | wire t1h_scanin; | |
394 | wire t1h_scanout; | |
395 | wire [3:0] t2h_din; | |
396 | wire [3:0] t2h_dout; | |
397 | wire t2h_scanin; | |
398 | wire t2h_scanout; | |
399 | wire [3:0] t3h_din; | |
400 | wire [3:0] t3h_dout; | |
401 | wire t3h_scanin; | |
402 | wire t3h_scanout; | |
403 | wire [3:0] t4h_din; | |
404 | wire [3:0] t4h_dout; | |
405 | wire t4h_scanin; | |
406 | wire t4h_scanout; | |
407 | wire [3:0] t5h_din; | |
408 | wire [3:0] t5h_dout; | |
409 | wire t5h_scanin; | |
410 | wire t5h_scanout; | |
411 | wire [3:0] t6h_din; | |
412 | wire [3:0] t6h_dout; | |
413 | wire t6h_scanin; | |
414 | wire t6h_scanout; | |
415 | wire [3:0] t7h_din; | |
416 | wire [3:0] t7h_dout; | |
417 | wire t7h_scanin; | |
418 | wire t7h_scanout; | |
419 | wire [3:0] t0l_din; | |
420 | wire [3:0] t0l_dout; | |
421 | wire t0l_scanin; | |
422 | wire t0l_scanout; | |
423 | wire [3:0] t1l_din; | |
424 | wire [3:0] t1l_dout; | |
425 | wire t1l_scanin; | |
426 | wire t1l_scanout; | |
427 | wire [3:0] t2l_din; | |
428 | wire [3:0] t2l_dout; | |
429 | wire t2l_scanin; | |
430 | wire t2l_scanout; | |
431 | wire [3:0] t3l_din; | |
432 | wire [3:0] t3l_dout; | |
433 | wire t3l_scanin; | |
434 | wire t3l_scanout; | |
435 | wire [3:0] t4l_din; | |
436 | wire [3:0] t4l_dout; | |
437 | wire t4l_scanin; | |
438 | wire t4l_scanout; | |
439 | wire [3:0] t5l_din; | |
440 | wire [3:0] t5l_dout; | |
441 | wire t5l_scanin; | |
442 | wire t5l_scanout; | |
443 | wire [3:0] t6l_din; | |
444 | wire [3:0] t6l_dout; | |
445 | wire t6l_scanin; | |
446 | wire t6l_scanout; | |
447 | wire [3:0] t7l_din; | |
448 | wire [3:0] t7l_dout; | |
449 | wire t7l_scanin; | |
450 | wire t7l_scanout; | |
451 | wire [3:0] pich07_add_in_w1; | |
452 | wire [7:0] incr_asi; | |
453 | wire [3:0] picl07_add_in_w1; | |
454 | wire accum_scanin; | |
455 | wire accum_scanout; | |
456 | wire [15:8] asi_cntrl_h; | |
457 | wire [4:0] asi_cntrl; | |
458 | wire asr; | |
459 | wire asr_rd; | |
460 | wire asi_ctl_ndata; | |
461 | wire asr_wr; | |
462 | wire pcr; | |
463 | wire pic; | |
464 | wire pic_rd; | |
465 | wire pic_wr; | |
466 | wire pcr_rd; | |
467 | wire pcr_wr; | |
468 | wire [7:0] tid; | |
469 | wire [7:0] asr_priv; | |
470 | wire priv_ex; | |
471 | wire pmu_op; | |
472 | wire l1clk_pm4; | |
473 | wire asi_scanin; | |
474 | wire asi_scanout; | |
475 | wire p_rd; | |
476 | wire pc_rd; | |
477 | wire pc_wr; | |
478 | wire [31:0] pcr0_read; | |
479 | wire [31:0] pcr1_read; | |
480 | wire [31:0] pcr2_read; | |
481 | wire [31:0] pcr3_read; | |
482 | wire [31:0] pcr4_read; | |
483 | wire [31:0] pcr5_read; | |
484 | wire [31:0] pcr6_read; | |
485 | wire [31:0] pcr7_read; | |
486 | wire spares_scanin; | |
487 | wire spares_scanout; | |
488 | ||
489 | ||
490 | // *** globals *** | |
491 | input l2clk; | |
492 | input scan_in; | |
493 | input tcu_pce_ov; // scan signals | |
494 | input spc_aclk; | |
495 | input spc_bclk; | |
496 | input tcu_scan_en; | |
497 | output scan_out; | |
498 | ||
499 | // Power management for ASI ring... | |
500 | input lsu_asi_clken; | |
501 | input 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 | |
506 | input [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}} | |
507 | input [12:0] dec_pmu_instr1_type_d; | |
508 | input [1:0] dec_br_taken_e; // branch taken indicator | |
509 | input [5:0] lsu_pmu_mem_type_b; // {5:3 - tid (use for l2miss only); 2:0 - {l2 d-miss, dt_miss, d-cache miss}} | |
510 | input dec_lsu_sel0_d; // select tg0 for lsu tid | |
511 | ||
512 | // MMU activity (excluding ITLB/DTLB misses) | |
513 | input mmu_pmu_l2ret; // indicates l2 data to MMU | |
514 | input mmu_pmu_l2miss; // indicates the return pkt had l2 miss | |
515 | input mmu_pmu_dtlb; // indicates that return pkt is for D-side table walk | |
516 | input [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}} | |
521 | input [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 | |
524 | input [4:0] spu_pmu_cwq_busy; // CWQ busy {rc4,hash,des,crc,aes} | |
525 | input [2:0] spu_pmu_cwq_tid; | |
526 | input [3:0] spu_pmu_ma_busy; | |
527 | ||
528 | // state bits to decide when counters should record | |
529 | input [7:0] tlu_pmu_pstate_priv; // pstate.priv for each thread (bit 7 == thread 7) | |
530 | input [7:0] tlu_pmu_hpstate_hpriv; // hpstate.hpriv (ditto) | |
531 | ||
532 | // PMU trap is taken, reset the counter if "-"ve. | |
533 | input [7:0] tlu_pmu_trap_taken; | |
534 | input [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 | |
537 | input [1:0] tlu_flush_pmu_b; // kill what is in B now | |
538 | input [1:0] tlu_flush_pmu_w; // kill what is in W now | |
539 | ||
540 | input [1:0] dec_valid_e; // bit 1 is for TG1, 0 for TG0; instr valids in the e-stage | |
541 | ||
542 | input [1:0] dec_flush_m; // kill what is in M now | |
543 | input [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 | |
546 | input pdp_pich_cout07; | |
547 | input pdp_picl_cout07; | |
548 | ||
549 | // Near-overflow values (-16..-1) for each counter | |
550 | input [7:0] pdp_pich_wrap; | |
551 | input [7:0] pdp_picl_wrap; | |
552 | ||
553 | // ASI read/write inputs | |
554 | input in_rngl_cdbus_ctl_ndata;// Bit 64 of input bus, register here | |
555 | input [7:0] pdp_asi_ctlin_to_pctl_15_8; // Bits 63:56 of registered data from PDP (save 8 flop bits) | |
556 | input [4:0] pdp_asi_ctlin_to_pctl_4_0; // Bits 52:48 of registered data from PDP (save 5 flop bits) | |
557 | input [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 | |
560 | output [7:0] pmu_tlu_trap_m; // Sent at (near) beginning of M to TLU | |
561 | output [7:0] pmu_tlu_debug_event; // Tell trap if a perf. monitor event occurred to soft/hard stop/trigger on | |
562 | ||
563 | // Event outputs | |
564 | output [3:0] pct_pich07_add_w2; // Add value for pich | |
565 | output [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 | |
569 | output pmu_lsu_dcmiss_trap_m; | |
570 | output pmu_lsu_dtmiss_trap_m; | |
571 | output [7:0] pmu_lsu_l2dmiss_trap_m; | |
572 | ||
573 | // ASI read controls | |
574 | output [7:0] pct_rd_pic; // ASI read of PIC (bit 7 == read PIC for tid 7) | |
575 | output pct_rd_a_pic; // ASI read of any PIC | |
576 | output pct_rd_pic_pcr; // ASI read of PIC or PCR (select PIC or PCR) | |
577 | output pct_bypass_asi; // Flow this node's ASI data to the output | |
578 | output [31:0] pct_pcr_data; // PCR data on ASI read | |
579 | output pct_rngl_cdbus_ctl_ndata; // Piped value of uppermost ASI ring ctl/data bus output | |
580 | output pct_exception; // True if a privileged exception on ASR read or write to PIC or PCR | |
581 | ||
582 | // ASI write controls | |
583 | output [7:0] pct_wr_pic_w2; // Write corresponding PICH/L from ASI (bit 7 == write PIC7) | |
584 | output [6:0] pct_incr_pic_w1; // increment PIC (PICL is enabled for counting) W+1 cycle, prior to adding in W+2 | |
585 | output 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 | |
588 | output [7:0] pct_pic_clken; // Only enable when pic configured to count | |
589 | output 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 | |
592 | output pmu_asi_clken; | |
593 | //////////////////////////////////////////////////////////////////////////////// | |
594 | ||
595 | // scan renames | |
596 | assign pce_ov = tcu_pce_ov; | |
597 | //assign stop = tcu_clk_stop; | |
598 | assign stop = 1'b0; | |
599 | assign siclk = spc_aclk; | |
600 | assign soclk = spc_bclk; | |
601 | assign se = tcu_scan_en; | |
602 | // end scan | |
603 | ||
604 | pmu_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 | |
614 | pmu_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 | |
625 | assign 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 | ||
637 | assign skip_wakeup_in = ~wakeup & (skip_wakeup | | |
638 | (~pmu_busy & pmu_pmen & (|({8 {p_wr}} & atid[7:0] & pic_std_w2[7:0]))) | |
639 | ); | |
640 | ||
641 | assign 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 | |
644 | assign 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. | |
651 | pmu_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 | ||
661 | assign wait_for_sleep = |sleep_cntr[3:0]; | |
662 | ||
663 | assign 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 | ||
668 | assign l1b = pmu_busy | sleep | wait_for_sleep | ~pmu_pmen; | |
669 | ||
670 | pmu_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 | |
680 | assign ov_busy = |wr_pcr[7:0] | (|rd_pcr[7:0]) | pmu_busy | sleep | wait_for_sleep; | |
681 | ||
682 | pmu_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 | ||
705 | pmu_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 | ||
720 | assign 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 | |
724 | pmu_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 | ||
740 | assign tg0_ityp_e[11:0] = {12 {tg0_e[12]}} & tg0_e[11:0]; | |
741 | assign tg1_ityp_e[11:0] = {12 {tg1_e[12]}} & tg1_e[11:0]; | |
742 | ||
743 | // Use dec signal for below | |
744 | assign 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 | ||
747 | pmu_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 | ||
759 | assign all_idle_e = ~tg0_e[12] & ~tg1_e[12]; | |
760 | ||
761 | // What thread is instruction event for | |
762 | // 11:10 - tid; | |
763 | assign th[0] = ~tg0_ityp_e[11] & ~tg0_ityp_e[10]; | |
764 | assign th[1] = ~tg0_ityp_e[11] & tg0_ityp_e[10]; | |
765 | assign th[2] = tg0_ityp_e[11] & ~tg0_ityp_e[10]; | |
766 | assign th[3] = tg0_ityp_e[11] & tg0_ityp_e[10]; | |
767 | assign th[4] = ~tg1_ityp_e[11] & ~tg1_ityp_e[10]; | |
768 | assign th[5] = ~tg1_ityp_e[11] & tg1_ityp_e[10]; | |
769 | assign th[6] = tg1_ityp_e[11] & ~tg1_ityp_e[10]; | |
770 | assign th[7] = tg1_ityp_e[11] & tg1_ityp_e[10]; | |
771 | ||
772 | // DES/3DES busy event | |
773 | // 3 - busy/idle; 2:0 - tid; | |
774 | assign cwq_tid[0] = ~spu_tid[2] & ~spu_tid[1] & ~spu_tid[0]; | |
775 | assign cwq_tid[1] = ~spu_tid[2] & ~spu_tid[1] & spu_tid[0]; | |
776 | assign cwq_tid[2] = ~spu_tid[2] & spu_tid[1] & ~spu_tid[0]; | |
777 | assign cwq_tid[3] = ~spu_tid[2] & spu_tid[1] & spu_tid[0]; | |
778 | assign cwq_tid[4] = spu_tid[2] & ~spu_tid[1] & ~spu_tid[0]; | |
779 | assign cwq_tid[5] = spu_tid[2] & ~spu_tid[1] & spu_tid[0]; | |
780 | assign cwq_tid[6] = spu_tid[2] & spu_tid[1] & ~spu_tid[0]; | |
781 | assign cwq_tid[7] = spu_tid[2] & spu_tid[1] & spu_tid[0]; | |
782 | ||
783 | assign desb[7:0] = {8 {des}} & cwq_tid[7:0]; | |
784 | ||
785 | // AES busy event | |
786 | assign aesb[7:0] = {8 {aes}} & cwq_tid[7:0]; | |
787 | ||
788 | // RC4 busy event | |
789 | assign rc4b[7:0] = {8 {rc4}} & cwq_tid[7:0]; | |
790 | ||
791 | // SHA-1/SHA-256/MD5 busy event | |
792 | assign hashb[7:0] = {8 {hash}} & cwq_tid[7:0]; | |
793 | ||
794 | // CRC busy event | |
795 | assign crcb[7:0] = {8 {crc}} & cwq_tid[7:0]; | |
796 | ||
797 | // MA busy event | |
798 | assign ma_tid[0] = ~ma[2] & ~ma[1] & ~ma[0]; | |
799 | assign ma_tid[1] = ~ma[2] & ~ma[1] & ma[0]; | |
800 | assign ma_tid[2] = ~ma[2] & ma[1] & ~ma[0]; | |
801 | assign ma_tid[3] = ~ma[2] & ma[1] & ma[0]; | |
802 | assign ma_tid[4] = ma[2] & ~ma[1] & ~ma[0]; | |
803 | assign ma_tid[5] = ma[2] & ~ma[1] & ma[0]; | |
804 | assign ma_tid[6] = ma[2] & ma[1] & ~ma[0]; | |
805 | assign ma_tid[7] = ma[2] & ma[1] & ma[0]; | |
806 | ||
807 | assign 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 | |
817 | assign dcm[0] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0]; | |
818 | assign dcm[1] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0]; | |
819 | assign dcm[2] = ~lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0]; | |
820 | assign dcm[3] = ~lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0]; | |
821 | assign dcm[4] = lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0]; | |
822 | assign dcm[5] = lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0]; | |
823 | assign dcm[6] = lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[0]; | |
824 | assign dcm[7] = lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[0]; | |
825 | ||
826 | assign dtm[0] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1]; | |
827 | assign dtm[1] = ~lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1]; | |
828 | assign dtm[2] = ~lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1]; | |
829 | assign dtm[3] = ~lsu_tid_w[2] & lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1]; | |
830 | assign dtm[4] = lsu_tid_w[2] & ~lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1]; | |
831 | assign dtm[5] = lsu_tid_w[2] & ~lsu_tid_w[1] & lsu_tid_w[0] & mem_typ_w[1]; | |
832 | assign dtm[6] = lsu_tid_w[2] & lsu_tid_w[1] & ~lsu_tid_w[0] & mem_typ_w[1]; | |
833 | assign 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} | |
836 | assign l2m[0] = ~mem_typ_w[5] & ~mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2]; | |
837 | assign l2m[1] = ~mem_typ_w[5] & ~mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2]; | |
838 | assign l2m[2] = ~mem_typ_w[5] & mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2]; | |
839 | assign l2m[3] = ~mem_typ_w[5] & mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2]; | |
840 | assign l2m[4] = mem_typ_w[5] & ~mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2]; | |
841 | assign l2m[5] = mem_typ_w[5] & ~mem_typ_w[4] & mem_typ_w[3] & mem_typ_w[2]; | |
842 | assign l2m[6] = mem_typ_w[5] & mem_typ_w[4] & ~mem_typ_w[3] & mem_typ_w[2]; | |
843 | assign 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 | |
872 | assign ov1[7:0] = {8 {pdp_pich_cout07}} & {pic_std_w2[7:0]} | set_ovh_spec[7:0]; | |
873 | assign 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) | |
876 | assign 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... | |
889 | assign 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 | ||
893 | assign 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 | |
897 | pmu_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 | ||
906 | pmu_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 | ); | |
915 | assign pcr0_dout[30] = 1'b0; | |
916 | assign 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 | ||
922 | assign bit63 = pdp_asi_ctlin_to_pctl_15_8[7]; // bit 63 of ring data cycle | |
923 | assign bit62 = pdp_asi_ctlin_to_pctl_15_8[6]; // bit 62 of ring data cycle | |
924 | ||
925 | assign 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 | ||
928 | pmu_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 | |
939 | assign 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 | ||
942 | pmu_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 | ); | |
951 | assign pcr1_dout[30] = 1'b0; | |
952 | assign pcr1_dout[17] = 1'b0; | |
953 | ||
954 | assign 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 | ||
957 | pmu_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 | |
968 | assign 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 | ||
971 | pmu_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 | ); | |
980 | assign pcr2_dout[30] = 1'b0; | |
981 | assign pcr2_dout[17] = 1'b0; | |
982 | ||
983 | assign 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 | ||
986 | pmu_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 | |
997 | assign 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 | ||
1000 | pmu_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 | ); | |
1009 | assign pcr3_dout[30] = 1'b0; | |
1010 | assign pcr3_dout[17] = 1'b0; | |
1011 | ||
1012 | assign 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 | ||
1015 | pmu_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 | |
1026 | assign 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 | ||
1029 | pmu_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 | ); | |
1038 | assign pcr4_dout[30] = 1'b0; | |
1039 | assign pcr4_dout[17] = 1'b0; | |
1040 | ||
1041 | assign 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 | ||
1044 | pmu_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 | |
1055 | assign 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 | ||
1058 | pmu_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 | ); | |
1067 | assign pcr5_dout[30] = 1'b0; | |
1068 | assign pcr5_dout[17] = 1'b0; | |
1069 | ||
1070 | assign 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 | ||
1073 | pmu_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 | |
1084 | assign 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 | ||
1087 | pmu_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 | ); | |
1096 | assign pcr6_dout[30] = 1'b0; | |
1097 | assign pcr6_dout[17] = 1'b0; | |
1098 | ||
1099 | assign 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 | ||
1102 | pmu_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 | |
1113 | assign 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 | ||
1116 | pmu_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 | ); | |
1125 | assign pcr7_dout[30] = 1'b0; | |
1126 | assign pcr7_dout[17] = 1'b0; | |
1127 | ||
1128 | assign 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 | ||
1131 | pmu_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 | ||
1143 | pmu_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) | |
1155 | assign p_cnt_en[0] = (pcr0_dout[3] & hpriv[0]) | (pcr0_dout[1] & ~hpriv[0] & priv[0]) | (pcr0_dout[2] & ~hpriv[0] & ~priv[0]); | |
1156 | assign p_cnt_en[1] = (pcr1_dout[3] & hpriv[1]) | (pcr1_dout[1] & ~hpriv[1] & priv[1]) | (pcr1_dout[2] & ~hpriv[1] & ~priv[1]); | |
1157 | assign p_cnt_en[2] = (pcr2_dout[3] & hpriv[2]) | (pcr2_dout[1] & ~hpriv[2] & priv[2]) | (pcr2_dout[2] & ~hpriv[2] & ~priv[2]); | |
1158 | assign p_cnt_en[3] = (pcr3_dout[3] & hpriv[3]) | (pcr3_dout[1] & ~hpriv[3] & priv[3]) | (pcr3_dout[2] & ~hpriv[3] & ~priv[3]); | |
1159 | assign p_cnt_en[4] = (pcr4_dout[3] & hpriv[4]) | (pcr4_dout[1] & ~hpriv[4] & priv[4]) | (pcr4_dout[2] & ~hpriv[4] & ~priv[4]); | |
1160 | assign p_cnt_en[5] = (pcr5_dout[3] & hpriv[5]) | (pcr5_dout[1] & ~hpriv[5] & priv[5]) | (pcr5_dout[2] & ~hpriv[5] & ~priv[5]); | |
1161 | assign p_cnt_en[6] = (pcr6_dout[3] & hpriv[6]) | (pcr6_dout[1] & ~hpriv[6] & priv[6]) | (pcr6_dout[2] & ~hpriv[6] & ~priv[6]); | |
1162 | assign 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 | |
1167 | assign ph_all_idle[0]= ~|pcr0_dout[30:27] & p_cnt_en[0]; | |
1168 | assign ph_all_idle[1]= ~|pcr1_dout[30:27] & p_cnt_en[1]; | |
1169 | assign ph_all_idle[2]= ~|pcr2_dout[30:27] & p_cnt_en[2]; | |
1170 | assign ph_all_idle[3]= ~|pcr3_dout[30:27] & p_cnt_en[3]; | |
1171 | assign ph_all_idle[4]= ~|pcr4_dout[30:27] & p_cnt_en[4]; | |
1172 | assign ph_all_idle[5]= ~|pcr5_dout[30:27] & p_cnt_en[5]; | |
1173 | assign ph_all_idle[6]= ~|pcr6_dout[30:27] & p_cnt_en[6]; | |
1174 | assign ph_all_idle[7]= ~|pcr7_dout[30:27] & p_cnt_en[7]; | |
1175 | ||
1176 | // SL[3:0] = 4'b0010 - instruction events | |
1177 | assign ph_ig[0] = ~pcr0_dout[30] & ~pcr0_dout[29] & pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0]; | |
1178 | assign ph_ig[1] = ~pcr1_dout[30] & ~pcr1_dout[29] & pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1]; | |
1179 | assign ph_ig[2] = ~pcr2_dout[30] & ~pcr2_dout[29] & pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2]; | |
1180 | assign ph_ig[3] = ~pcr3_dout[30] & ~pcr3_dout[29] & pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3]; | |
1181 | assign ph_ig[4] = ~pcr4_dout[30] & ~pcr4_dout[29] & pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4]; | |
1182 | assign ph_ig[5] = ~pcr5_dout[30] & ~pcr5_dout[29] & pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5]; | |
1183 | assign ph_ig[6] = ~pcr6_dout[30] & ~pcr6_dout[29] & pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6]; | |
1184 | assign 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 | |
1187 | assign ph_cg[0] = ~pcr0_dout[30] & ~pcr0_dout[29] & pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0]; | |
1188 | assign ph_cg[1] = ~pcr1_dout[30] & ~pcr1_dout[29] & pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1]; | |
1189 | assign ph_cg[2] = ~pcr2_dout[30] & ~pcr2_dout[29] & pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2]; | |
1190 | assign ph_cg[3] = ~pcr3_dout[30] & ~pcr3_dout[29] & pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3]; | |
1191 | assign ph_cg[4] = ~pcr4_dout[30] & ~pcr4_dout[29] & pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4]; | |
1192 | assign ph_cg[5] = ~pcr5_dout[30] & ~pcr5_dout[29] & pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5]; | |
1193 | assign ph_cg[6] = ~pcr6_dout[30] & ~pcr6_dout[29] & pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6]; | |
1194 | assign 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 | |
1197 | assign ph_mm[0] = ~pcr0_dout[30] & pcr0_dout[29] & ~pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0]; | |
1198 | assign ph_mm[1] = ~pcr1_dout[30] & pcr1_dout[29] & ~pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1]; | |
1199 | assign ph_mm[2] = ~pcr2_dout[30] & pcr2_dout[29] & ~pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2]; | |
1200 | assign ph_mm[3] = ~pcr3_dout[30] & pcr3_dout[29] & ~pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3]; | |
1201 | assign ph_mm[4] = ~pcr4_dout[30] & pcr4_dout[29] & ~pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4]; | |
1202 | assign ph_mm[5] = ~pcr5_dout[30] & pcr5_dout[29] & ~pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5]; | |
1203 | assign ph_mm[6] = ~pcr6_dout[30] & pcr6_dout[29] & ~pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6]; | |
1204 | assign 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 | |
1207 | assign ph_xb[0] = ~pcr0_dout[30] & pcr0_dout[29] & ~pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0]; | |
1208 | assign ph_xb[1] = ~pcr1_dout[30] & pcr1_dout[29] & ~pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1]; | |
1209 | assign ph_xb[2] = ~pcr2_dout[30] & pcr2_dout[29] & ~pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2]; | |
1210 | assign ph_xb[3] = ~pcr3_dout[30] & pcr3_dout[29] & ~pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3]; | |
1211 | assign ph_xb[4] = ~pcr4_dout[30] & pcr4_dout[29] & ~pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4]; | |
1212 | assign ph_xb[5] = ~pcr5_dout[30] & pcr5_dout[29] & ~pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5]; | |
1213 | assign ph_xb[6] = ~pcr6_dout[30] & pcr6_dout[29] & ~pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6]; | |
1214 | assign 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 | |
1217 | assign ph_so[0] = ~pcr0_dout[30] & pcr0_dout[29] & pcr0_dout[28] & ~pcr0_dout[27] & p_cnt_en[0]; | |
1218 | assign ph_so[1] = ~pcr1_dout[30] & pcr1_dout[29] & pcr1_dout[28] & ~pcr1_dout[27] & p_cnt_en[1]; | |
1219 | assign ph_so[2] = ~pcr2_dout[30] & pcr2_dout[29] & pcr2_dout[28] & ~pcr2_dout[27] & p_cnt_en[2]; | |
1220 | assign ph_so[3] = ~pcr3_dout[30] & pcr3_dout[29] & pcr3_dout[28] & ~pcr3_dout[27] & p_cnt_en[3]; | |
1221 | assign ph_so[4] = ~pcr4_dout[30] & pcr4_dout[29] & pcr4_dout[28] & ~pcr4_dout[27] & p_cnt_en[4]; | |
1222 | assign ph_so[5] = ~pcr5_dout[30] & pcr5_dout[29] & pcr5_dout[28] & ~pcr5_dout[27] & p_cnt_en[5]; | |
1223 | assign ph_so[6] = ~pcr6_dout[30] & pcr6_dout[29] & pcr6_dout[28] & ~pcr6_dout[27] & p_cnt_en[6]; | |
1224 | assign 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 | |
1227 | assign ph_sb[0] = ~pcr0_dout[30] & pcr0_dout[29] & pcr0_dout[28] & pcr0_dout[27] & p_cnt_en[0]; | |
1228 | assign ph_sb[1] = ~pcr1_dout[30] & pcr1_dout[29] & pcr1_dout[28] & pcr1_dout[27] & p_cnt_en[1]; | |
1229 | assign ph_sb[2] = ~pcr2_dout[30] & pcr2_dout[29] & pcr2_dout[28] & pcr2_dout[27] & p_cnt_en[2]; | |
1230 | assign ph_sb[3] = ~pcr3_dout[30] & pcr3_dout[29] & pcr3_dout[28] & pcr3_dout[27] & p_cnt_en[3]; | |
1231 | assign ph_sb[4] = ~pcr4_dout[30] & pcr4_dout[29] & pcr4_dout[28] & pcr4_dout[27] & p_cnt_en[4]; | |
1232 | assign ph_sb[5] = ~pcr5_dout[30] & pcr5_dout[29] & pcr5_dout[28] & pcr5_dout[27] & p_cnt_en[5]; | |
1233 | assign ph_sb[6] = ~pcr6_dout[30] & pcr6_dout[29] & pcr6_dout[28] & pcr6_dout[27] & p_cnt_en[6]; | |
1234 | assign 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 | |
1239 | assign pl_all_idle[0] = ~|pcr0_dout[17:14] & p_cnt_en[0]; | |
1240 | assign pl_all_idle[1] = ~|pcr1_dout[17:14] & p_cnt_en[1]; | |
1241 | assign pl_all_idle[2] = ~|pcr2_dout[17:14] & p_cnt_en[2]; | |
1242 | assign pl_all_idle[3] = ~|pcr3_dout[17:14] & p_cnt_en[3]; | |
1243 | assign pl_all_idle[4] = ~|pcr4_dout[17:14] & p_cnt_en[4]; | |
1244 | assign pl_all_idle[5] = ~|pcr5_dout[17:14] & p_cnt_en[5]; | |
1245 | assign pl_all_idle[6] = ~|pcr6_dout[17:14] & p_cnt_en[6]; | |
1246 | assign pl_all_idle[7] = ~|pcr7_dout[17:14] & p_cnt_en[7]; | |
1247 | ||
1248 | // SL[3:0] = 4'b0010 - instruction events | |
1249 | assign pl_ig[0] = ~pcr0_dout[17] & ~pcr0_dout[16] & pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0]; | |
1250 | assign pl_ig[1] = ~pcr1_dout[17] & ~pcr1_dout[16] & pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1]; | |
1251 | assign pl_ig[2] = ~pcr2_dout[17] & ~pcr2_dout[16] & pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2]; | |
1252 | assign pl_ig[3] = ~pcr3_dout[17] & ~pcr3_dout[16] & pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3]; | |
1253 | assign pl_ig[4] = ~pcr4_dout[17] & ~pcr4_dout[16] & pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4]; | |
1254 | assign pl_ig[5] = ~pcr5_dout[17] & ~pcr5_dout[16] & pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5]; | |
1255 | assign pl_ig[6] = ~pcr6_dout[17] & ~pcr6_dout[16] & pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6]; | |
1256 | assign 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 | |
1259 | assign pl_cg[0] = ~pcr0_dout[17] & ~pcr0_dout[16] & pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0]; | |
1260 | assign pl_cg[1] = ~pcr1_dout[17] & ~pcr1_dout[16] & pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1]; | |
1261 | assign pl_cg[2] = ~pcr2_dout[17] & ~pcr2_dout[16] & pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2]; | |
1262 | assign pl_cg[3] = ~pcr3_dout[17] & ~pcr3_dout[16] & pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3]; | |
1263 | assign pl_cg[4] = ~pcr4_dout[17] & ~pcr4_dout[16] & pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4]; | |
1264 | assign pl_cg[5] = ~pcr5_dout[17] & ~pcr5_dout[16] & pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5]; | |
1265 | assign pl_cg[6] = ~pcr6_dout[17] & ~pcr6_dout[16] & pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6]; | |
1266 | assign 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 | |
1269 | assign pl_mm[0] = ~pcr0_dout[17] & pcr0_dout[16] & ~pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0]; | |
1270 | assign pl_mm[1] = ~pcr1_dout[17] & pcr1_dout[16] & ~pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1]; | |
1271 | assign pl_mm[2] = ~pcr2_dout[17] & pcr2_dout[16] & ~pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2]; | |
1272 | assign pl_mm[3] = ~pcr3_dout[17] & pcr3_dout[16] & ~pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3]; | |
1273 | assign pl_mm[4] = ~pcr4_dout[17] & pcr4_dout[16] & ~pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4]; | |
1274 | assign pl_mm[5] = ~pcr5_dout[17] & pcr5_dout[16] & ~pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5]; | |
1275 | assign pl_mm[6] = ~pcr6_dout[17] & pcr6_dout[16] & ~pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6]; | |
1276 | assign 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 | |
1279 | assign pl_xb[0] = ~pcr0_dout[17] & pcr0_dout[16] & ~pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0]; | |
1280 | assign pl_xb[1] = ~pcr1_dout[17] & pcr1_dout[16] & ~pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1]; | |
1281 | assign pl_xb[2] = ~pcr2_dout[17] & pcr2_dout[16] & ~pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2]; | |
1282 | assign pl_xb[3] = ~pcr3_dout[17] & pcr3_dout[16] & ~pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3]; | |
1283 | assign pl_xb[4] = ~pcr4_dout[17] & pcr4_dout[16] & ~pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4]; | |
1284 | assign pl_xb[5] = ~pcr5_dout[17] & pcr5_dout[16] & ~pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5]; | |
1285 | assign pl_xb[6] = ~pcr6_dout[17] & pcr6_dout[16] & ~pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6]; | |
1286 | assign 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 | |
1289 | assign pl_so[0] = ~pcr0_dout[17] & pcr0_dout[16] & pcr0_dout[15] & ~pcr0_dout[14] & p_cnt_en[0]; | |
1290 | assign pl_so[1] = ~pcr1_dout[17] & pcr1_dout[16] & pcr1_dout[15] & ~pcr1_dout[14] & p_cnt_en[1]; | |
1291 | assign pl_so[2] = ~pcr2_dout[17] & pcr2_dout[16] & pcr2_dout[15] & ~pcr2_dout[14] & p_cnt_en[2]; | |
1292 | assign pl_so[3] = ~pcr3_dout[17] & pcr3_dout[16] & pcr3_dout[15] & ~pcr3_dout[14] & p_cnt_en[3]; | |
1293 | assign pl_so[4] = ~pcr4_dout[17] & pcr4_dout[16] & pcr4_dout[15] & ~pcr4_dout[14] & p_cnt_en[4]; | |
1294 | assign pl_so[5] = ~pcr5_dout[17] & pcr5_dout[16] & pcr5_dout[15] & ~pcr5_dout[14] & p_cnt_en[5]; | |
1295 | assign pl_so[6] = ~pcr6_dout[17] & pcr6_dout[16] & pcr6_dout[15] & ~pcr6_dout[14] & p_cnt_en[6]; | |
1296 | assign 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 | |
1299 | assign pl_sb[0] = ~pcr0_dout[17] & pcr0_dout[16] & pcr0_dout[15] & pcr0_dout[14] & p_cnt_en[0]; | |
1300 | assign pl_sb[1] = ~pcr1_dout[17] & pcr1_dout[16] & pcr1_dout[15] & pcr1_dout[14] & p_cnt_en[1]; | |
1301 | assign pl_sb[2] = ~pcr2_dout[17] & pcr2_dout[16] & pcr2_dout[15] & pcr2_dout[14] & p_cnt_en[2]; | |
1302 | assign pl_sb[3] = ~pcr3_dout[17] & pcr3_dout[16] & pcr3_dout[15] & pcr3_dout[14] & p_cnt_en[3]; | |
1303 | assign pl_sb[4] = ~pcr4_dout[17] & pcr4_dout[16] & pcr4_dout[15] & pcr4_dout[14] & p_cnt_en[4]; | |
1304 | assign pl_sb[5] = ~pcr5_dout[17] & pcr5_dout[16] & pcr5_dout[15] & pcr5_dout[14] & p_cnt_en[5]; | |
1305 | assign pl_sb[6] = ~pcr6_dout[17] & pcr6_dout[16] & pcr6_dout[15] & pcr6_dout[14] & p_cnt_en[6]; | |
1306 | assign 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 | ||
1314 | assign 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 | ||
1317 | assign 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 | ||
1320 | assign 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 | |
1323 | assign t[0] = ~lsu_tid_e[2] & ~lsu_tid_e[1] & ~lsu_tid_e[0]; | |
1324 | assign t[1] = ~lsu_tid_e[2] & ~lsu_tid_e[1] & lsu_tid_e[0]; | |
1325 | assign t[2] = ~lsu_tid_e[2] & lsu_tid_e[1] & ~lsu_tid_e[0]; | |
1326 | assign t[3] = ~lsu_tid_e[2] & lsu_tid_e[1] & lsu_tid_e[0]; | |
1327 | assign t[4] = lsu_tid_e[2] & ~lsu_tid_e[1] & ~lsu_tid_e[0]; | |
1328 | assign t[5] = lsu_tid_e[2] & ~lsu_tid_e[1] & lsu_tid_e[0]; | |
1329 | assign t[6] = lsu_tid_e[2] & lsu_tid_e[1] & ~lsu_tid_e[0]; | |
1330 | assign t[7] = lsu_tid_e[2] & lsu_tid_e[1] & lsu_tid_e[0]; | |
1331 | ||
1332 | assign 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 | ||
1334 | assign 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 | ||
1337 | assign 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 | ||
1340 | assign pmu_lsu_dtmiss_trap_e[7:0] = (dtm_h[7:0] & pich_wrap[7:0]) | (dtm_l & picl_wrap[7:0]); | |
1341 | ||
1342 | assign 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 | ||
1344 | assign 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 | ||
1347 | assign 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 | |
1359 | pmu_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]" | |
1371 | assign lsu_tidm_update_m[7:0] = {{4 {dec_valid_m[1]}}, {4 {dec_valid_m[0]}}} & th_m[7:0]; | |
1372 | ||
1373 | assign 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 | ||
1376 | assign l2dm_wrap_e[7:0] = (l2dm_h[7:0] & pich_wrap[7:0]) | (l2dm_l[7:0] & picl_wrap[7:0]); | |
1377 | ||
1378 | assign 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 | |
1382 | assign ph_ai[7:0] = ph_all_idle[7:0] & {8 {all_idle_e}}; | |
1383 | assign 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 | |
1395 | assign 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]}); | |
1396 | assign 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]}); | |
1397 | assign 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]}); | |
1398 | assign 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]}); | |
1399 | assign 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]}); | |
1400 | assign 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]}); | |
1401 | assign 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]}); | |
1402 | assign 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 | |
1405 | assign 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]}); | |
1406 | assign 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]}); | |
1407 | assign 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]}); | |
1408 | assign 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]}); | |
1409 | assign 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]}); | |
1410 | assign 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]}); | |
1411 | assign 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]}); | |
1412 | assign 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 | |
1415 | assign ph_bre[0] = ph_ig[0] & th[0] & pcr0_dout[20]; | |
1416 | assign ph_bre[1] = ph_ig[1] & th[1] & pcr1_dout[20]; | |
1417 | assign ph_bre[2] = ph_ig[2] & th[2] & pcr2_dout[20]; | |
1418 | assign ph_bre[3] = ph_ig[3] & th[3] & pcr3_dout[20]; | |
1419 | assign ph_bre[4] = ph_ig[4] & th[4] & pcr4_dout[20]; | |
1420 | assign ph_bre[5] = ph_ig[5] & th[5] & pcr5_dout[20]; | |
1421 | assign ph_bre[6] = ph_ig[6] & th[6] & pcr6_dout[20]; | |
1422 | assign ph_bre[7] = ph_ig[7] & th[7] & pcr7_dout[20]; | |
1423 | ||
1424 | assign pl_bre[0] = pl_ig[0] & th[0] & pcr0_dout[7]; | |
1425 | assign pl_bre[1] = pl_ig[1] & th[1] & pcr1_dout[7]; | |
1426 | assign pl_bre[2] = pl_ig[2] & th[2] & pcr2_dout[7]; | |
1427 | assign pl_bre[3] = pl_ig[3] & th[3] & pcr3_dout[7]; | |
1428 | assign pl_bre[4] = pl_ig[4] & th[4] & pcr4_dout[7]; | |
1429 | assign pl_bre[5] = pl_ig[5] & th[5] & pcr5_dout[7]; | |
1430 | assign pl_bre[6] = pl_ig[6] & th[6] & pcr6_dout[7]; | |
1431 | assign 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 | |
1436 | assign dcm_he[0] = ph_cg[0] & pcr0_dout[20] & dcm[0]; | |
1437 | assign dcm_he[1] = ph_cg[1] & pcr1_dout[20] & dcm[1]; | |
1438 | assign dcm_he[2] = ph_cg[2] & pcr2_dout[20] & dcm[2]; | |
1439 | assign dcm_he[3] = ph_cg[3] & pcr3_dout[20] & dcm[3]; | |
1440 | assign dcm_he[4] = ph_cg[4] & pcr4_dout[20] & dcm[4]; | |
1441 | assign dcm_he[5] = ph_cg[5] & pcr5_dout[20] & dcm[5]; | |
1442 | assign dcm_he[6] = ph_cg[6] & pcr6_dout[20] & dcm[6]; | |
1443 | assign dcm_he[7] = ph_cg[7] & pcr7_dout[20] & dcm[7]; | |
1444 | ||
1445 | // 0x08 | |
1446 | assign dtm_he[0] = ph_cg[0] & pcr0_dout[22] & dtm[0]; | |
1447 | assign dtm_he[1] = ph_cg[1] & pcr1_dout[22] & dtm[1]; | |
1448 | assign dtm_he[2] = ph_cg[2] & pcr2_dout[22] & dtm[2]; | |
1449 | assign dtm_he[3] = ph_cg[3] & pcr3_dout[22] & dtm[3]; | |
1450 | assign dtm_he[4] = ph_cg[4] & pcr4_dout[22] & dtm[4]; | |
1451 | assign dtm_he[5] = ph_cg[5] & pcr5_dout[22] & dtm[5]; | |
1452 | assign dtm_he[6] = ph_cg[6] & pcr6_dout[22] & dtm[6]; | |
1453 | assign dtm_he[7] = ph_cg[7] & pcr7_dout[22] & dtm[7]; | |
1454 | ||
1455 | // 0x20 | |
1456 | assign l2m_he[0] = ph_cg[0] & pcr0_dout[24] & l2m[0]; | |
1457 | assign l2m_he[1] = ph_cg[1] & pcr1_dout[24] & l2m[1]; | |
1458 | assign l2m_he[2] = ph_cg[2] & pcr2_dout[24] & l2m[2]; | |
1459 | assign l2m_he[3] = ph_cg[3] & pcr3_dout[24] & l2m[3]; | |
1460 | assign l2m_he[4] = ph_cg[4] & pcr4_dout[24] & l2m[4]; | |
1461 | assign l2m_he[5] = ph_cg[5] & pcr5_dout[24] & l2m[5]; | |
1462 | assign l2m_he[6] = ph_cg[6] & pcr6_dout[24] & l2m[6]; | |
1463 | assign l2m_he[7] = ph_cg[7] & pcr7_dout[24] & l2m[7]; | |
1464 | ||
1465 | // 0x02 | |
1466 | assign dcm_le[0] = pl_cg[0] & pcr0_dout[7] & dcm[0]; | |
1467 | assign dcm_le[1] = pl_cg[1] & pcr1_dout[7] & dcm[1]; | |
1468 | assign dcm_le[2] = pl_cg[2] & pcr2_dout[7] & dcm[2]; | |
1469 | assign dcm_le[3] = pl_cg[3] & pcr3_dout[7] & dcm[3]; | |
1470 | assign dcm_le[4] = pl_cg[4] & pcr4_dout[7] & dcm[4]; | |
1471 | assign dcm_le[5] = pl_cg[5] & pcr5_dout[7] & dcm[5]; | |
1472 | assign dcm_le[6] = pl_cg[6] & pcr6_dout[7] & dcm[6]; | |
1473 | assign dcm_le[7] = pl_cg[7] & pcr7_dout[7] & dcm[7]; | |
1474 | ||
1475 | // 0x08 | |
1476 | assign dtm_le[0] = pl_cg[0] & pcr0_dout[9] & dtm[0]; | |
1477 | assign dtm_le[1] = pl_cg[1] & pcr1_dout[9] & dtm[1]; | |
1478 | assign dtm_le[2] = pl_cg[2] & pcr2_dout[9] & dtm[2]; | |
1479 | assign dtm_le[3] = pl_cg[3] & pcr3_dout[9] & dtm[3]; | |
1480 | assign dtm_le[4] = pl_cg[4] & pcr4_dout[9] & dtm[4]; | |
1481 | assign dtm_le[5] = pl_cg[5] & pcr5_dout[9] & dtm[5]; | |
1482 | assign dtm_le[6] = pl_cg[6] & pcr6_dout[9] & dtm[6]; | |
1483 | assign dtm_le[7] = pl_cg[7] & pcr7_dout[9] & dtm[7]; | |
1484 | ||
1485 | // 0x20 | |
1486 | assign l2m_le[0] = pl_cg[0] & pcr0_dout[11] & l2m[0]; | |
1487 | assign l2m_le[1] = pl_cg[1] & pcr1_dout[11] & l2m[1]; | |
1488 | assign l2m_le[2] = pl_cg[2] & pcr2_dout[11] & l2m[2]; | |
1489 | assign l2m_le[3] = pl_cg[3] & pcr3_dout[11] & l2m[3]; | |
1490 | assign l2m_le[4] = pl_cg[4] & pcr4_dout[11] & l2m[4]; | |
1491 | assign l2m_le[5] = pl_cg[5] & pcr5_dout[11] & l2m[5]; | |
1492 | assign l2m_le[6] = pl_cg[6] & pcr6_dout[11] & l2m[6]; | |
1493 | assign 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... | |
1497 | assign 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 | |
1498 | assign 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 | |
1499 | assign 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 | |
1500 | assign 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 | |
1501 | assign 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 | |
1502 | assign 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 | |
1503 | assign 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 | |
1504 | assign 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 | ||
1508 | assign 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 | |
1509 | assign 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 | |
1510 | assign 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 | |
1511 | assign 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 | |
1512 | assign 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 | |
1513 | assign 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 | |
1514 | assign 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 | |
1515 | assign 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... | |
1521 | assign mm_tid[0] = ~mm_mtyp[4] & ~mm_mtyp[3] & ~mm_mtyp[2]; | |
1522 | assign mm_tid[1] = ~mm_mtyp[4] & ~mm_mtyp[3] & mm_mtyp[2]; | |
1523 | assign mm_tid[2] = ~mm_mtyp[4] & mm_mtyp[3] & ~mm_mtyp[2]; | |
1524 | assign mm_tid[3] = ~mm_mtyp[4] & mm_mtyp[3] & mm_mtyp[2]; | |
1525 | assign mm_tid[4] = mm_mtyp[4] & ~mm_mtyp[3] & ~mm_mtyp[2]; | |
1526 | assign mm_tid[5] = mm_mtyp[4] & ~mm_mtyp[3] & mm_mtyp[2]; | |
1527 | assign mm_tid[6] = mm_mtyp[4] & mm_mtyp[3] & ~mm_mtyp[2]; | |
1528 | assign mm_tid[7] = mm_mtyp[4] & mm_mtyp[3] & mm_mtyp[2]; | |
1529 | ||
1530 | // Now decode what actually happened {l2dtm, l2itm, l2dtr, l2itr} | |
1531 | assign 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 | ||
1534 | assign ph_mme[0] = ph_mm[0] & mm_tid[0] & |(mm_l2e[3:0] & pcr0_dout[24:21]); | |
1535 | assign ph_mme[1] = ph_mm[1] & mm_tid[1] & |(mm_l2e[3:0] & pcr1_dout[24:21]); | |
1536 | assign ph_mme[2] = ph_mm[2] & mm_tid[2] & |(mm_l2e[3:0] & pcr2_dout[24:21]); | |
1537 | assign ph_mme[3] = ph_mm[3] & mm_tid[3] & |(mm_l2e[3:0] & pcr3_dout[24:21]); | |
1538 | assign ph_mme[4] = ph_mm[4] & mm_tid[4] & |(mm_l2e[3:0] & pcr4_dout[24:21]); | |
1539 | assign ph_mme[5] = ph_mm[5] & mm_tid[5] & |(mm_l2e[3:0] & pcr5_dout[24:21]); | |
1540 | assign ph_mme[6] = ph_mm[6] & mm_tid[6] & |(mm_l2e[3:0] & pcr6_dout[24:21]); | |
1541 | assign ph_mme[7] = ph_mm[7] & mm_tid[7] & |(mm_l2e[3:0] & pcr7_dout[24:21]); | |
1542 | ||
1543 | assign pl_mme[0] = pl_mm[0] & mm_tid[0] & |(mm_l2e[3:0] & pcr0_dout[11:8]); | |
1544 | assign pl_mme[1] = pl_mm[1] & mm_tid[1] & |(mm_l2e[3:0] & pcr1_dout[11:8]); | |
1545 | assign pl_mme[2] = pl_mm[2] & mm_tid[2] & |(mm_l2e[3:0] & pcr2_dout[11:8]); | |
1546 | assign pl_mme[3] = pl_mm[3] & mm_tid[3] & |(mm_l2e[3:0] & pcr3_dout[11:8]); | |
1547 | assign pl_mme[4] = pl_mm[4] & mm_tid[4] & |(mm_l2e[3:0] & pcr4_dout[11:8]); | |
1548 | assign pl_mme[5] = pl_mm[5] & mm_tid[5] & |(mm_l2e[3:0] & pcr5_dout[11:8]); | |
1549 | assign pl_mme[6] = pl_mm[6] & mm_tid[6] & |(mm_l2e[3:0] & pcr6_dout[11:8]); | |
1550 | assign 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 | |
1555 | assign xb[5] = xbar[2] & ~xbar[1] & ~xbar[0]; // mmuld | |
1556 | assign xb[4] = ~xbar[2] & ~xbar[1] & xbar[0]; // cpust | |
1557 | assign xb[3] = xbar[2] & ~xbar[1] & xbar[0]; // ifetch | |
1558 | assign xb[2] = ~xbar[2] & ~xbar[1] & ~xbar[0]; // cpuld | |
1559 | assign xb[1] = (~xbar[2] & xbar[1] & xbar[0]) | (xbar[2] & xbar[1] & xbar[0]); // cwq st or ma st | |
1560 | assign 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 | ||
1564 | assign use_ma = xbar[2] & xbar[1]; | |
1565 | assign use_cwq = ~xbar[2] & xbar[1]; | |
1566 | ||
1567 | assign 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 | |
1572 | assign ph_xbe[0] = ph_xb[0] & xbar[6] & ~xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr0_dout[24:19]); | |
1573 | assign ph_xbe[1] = ph_xb[1] & xbar[6] & ~xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr1_dout[24:19]); | |
1574 | assign ph_xbe[2] = ph_xb[2] & xbar[6] & ~xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr2_dout[24:19]); | |
1575 | assign ph_xbe[3] = ph_xb[3] & xbar[6] & ~xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr3_dout[24:19]); | |
1576 | assign ph_xbe[4] = ph_xb[4] & xbar[6] & xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr4_dout[24:19]); | |
1577 | assign ph_xbe[5] = ph_xb[5] & xbar[6] & xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr5_dout[24:19]); | |
1578 | assign ph_xbe[6] = ph_xb[6] & xbar[6] & xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr6_dout[24:19]); | |
1579 | assign ph_xbe[7] = ph_xb[7] & xbar[6] & xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr7_dout[24:19]); | |
1580 | ||
1581 | assign pl_xbe[0] = pl_xb[0] & xbar[6] & ~xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr0_dout[11:6]); | |
1582 | assign pl_xbe[1] = pl_xb[1] & xbar[6] & ~xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr1_dout[11:6]); | |
1583 | assign pl_xbe[2] = pl_xb[2] & xbar[6] & ~xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr2_dout[11:6]); | |
1584 | assign pl_xbe[3] = pl_xb[3] & xbar[6] & ~xbtid[2] & xbtid[1] & xbtid[0] & |(xb[5:0] & pcr3_dout[11:6]); | |
1585 | assign pl_xbe[4] = pl_xb[4] & xbar[6] & xbtid[2] & ~xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr4_dout[11:6]); | |
1586 | assign pl_xbe[5] = pl_xb[5] & xbar[6] & xbtid[2] & ~xbtid[1] & xbtid[0] & |(xb[5:0] & pcr5_dout[11:6]); | |
1587 | assign pl_xbe[6] = pl_xb[6] & xbar[6] & xbtid[2] & xbtid[1] & ~xbtid[0] & |(xb[5:0] & pcr6_dout[11:6]); | |
1588 | assign 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. | |
1594 | assign spu_des[7:0] = {8 {des & ~des_d1}} & cwq_tid[7:0]; | |
1595 | assign spu_aes[7:0] = {8 {aes & ~aes_d1}} & cwq_tid[7:0]; | |
1596 | assign spu_rc4[7:0] = {8 {rc4 & ~rc4_d1}} & cwq_tid[7:0]; | |
1597 | assign spu_hash[7:0] = {8 {hash & ~hash_d1}} & cwq_tid[7:0]; | |
1598 | assign spu_ma[7:0] = {8 {ma[3] & ~ma_3_d1}} & ma_tid[7:0]; | |
1599 | assign spu_crc[7:0] = {8 {crc & ~crc_d1}} & cwq_tid[7:0]; | |
1600 | ||
1601 | assign 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]); | |
1602 | assign 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]); | |
1603 | assign 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]); | |
1604 | assign 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]); | |
1605 | assign 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]); | |
1606 | assign 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]); | |
1607 | assign 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]); | |
1608 | assign 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 | ||
1610 | assign 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]); | |
1611 | assign 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]); | |
1612 | assign 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]); | |
1613 | assign 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]); | |
1614 | assign 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]); | |
1615 | assign 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]); | |
1616 | assign 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]); | |
1617 | assign 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 | |
1621 | assign ph_sbe[0] = ph_sb[0] & |({crcb[0], mab[0], hashb[0], rc4b[0], aesb[0], desb[0]} & pcr0_dout[24:19]); | |
1622 | assign ph_sbe[1] = ph_sb[1] & |({crcb[1], mab[1], hashb[1], rc4b[1], aesb[1], desb[1]} & pcr1_dout[24:19]); | |
1623 | assign ph_sbe[2] = ph_sb[2] & |({crcb[2], mab[2], hashb[2], rc4b[2], aesb[2], desb[2]} & pcr2_dout[24:19]); | |
1624 | assign ph_sbe[3] = ph_sb[3] & |({crcb[3], mab[3], hashb[3], rc4b[3], aesb[3], desb[3]} & pcr3_dout[24:19]); | |
1625 | assign ph_sbe[4] = ph_sb[4] & |({crcb[4], mab[4], hashb[4], rc4b[4], aesb[4], desb[4]} & pcr4_dout[24:19]); | |
1626 | assign ph_sbe[5] = ph_sb[5] & |({crcb[5], mab[5], hashb[5], rc4b[5], aesb[5], desb[5]} & pcr5_dout[24:19]); | |
1627 | assign ph_sbe[6] = ph_sb[6] & |({crcb[6], mab[6], hashb[6], rc4b[6], aesb[6], desb[6]} & pcr6_dout[24:19]); | |
1628 | assign ph_sbe[7] = ph_sb[7] & |({crcb[7], mab[7], hashb[7], rc4b[7], aesb[7], desb[7]} & pcr7_dout[24:19]); | |
1629 | ||
1630 | assign pl_sbe[0] = pl_sb[0] & |({crcb[0], mab[0], hashb[0], rc4b[0], aesb[0], desb[0]} & pcr0_dout[11:6]); | |
1631 | assign pl_sbe[1] = pl_sb[1] & |({crcb[1], mab[1], hashb[1], rc4b[1], aesb[1], desb[1]} & pcr1_dout[11:6]); | |
1632 | assign pl_sbe[2] = pl_sb[2] & |({crcb[2], mab[2], hashb[2], rc4b[2], aesb[2], desb[2]} & pcr2_dout[11:6]); | |
1633 | assign pl_sbe[3] = pl_sb[3] & |({crcb[3], mab[3], hashb[3], rc4b[3], aesb[3], desb[3]} & pcr3_dout[11:6]); | |
1634 | assign pl_sbe[4] = pl_sb[4] & |({crcb[4], mab[4], hashb[4], rc4b[4], aesb[4], desb[4]} & pcr4_dout[11:6]); | |
1635 | assign pl_sbe[5] = pl_sb[5] & |({crcb[5], mab[5], hashb[5], rc4b[5], aesb[5], desb[5]} & pcr5_dout[11:6]); | |
1636 | assign pl_sbe[6] = pl_sb[6] & |({crcb[6], mab[6], hashb[6], rc4b[6], aesb[6], desb[6]} & pcr6_dout[11:6]); | |
1637 | assign 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 | |
1640 | assign pich_wrap[0] = pdp_pich_wrap[0] & pcr0_dout[5]; | |
1641 | assign pich_wrap[1] = pdp_pich_wrap[1] & pcr1_dout[5]; | |
1642 | assign pich_wrap[2] = pdp_pich_wrap[2] & pcr2_dout[5]; | |
1643 | assign pich_wrap[3] = pdp_pich_wrap[3] & pcr3_dout[5]; | |
1644 | assign pich_wrap[4] = pdp_pich_wrap[4] & pcr4_dout[5]; | |
1645 | assign pich_wrap[5] = pdp_pich_wrap[5] & pcr5_dout[5]; | |
1646 | assign pich_wrap[6] = pdp_pich_wrap[6] & pcr6_dout[5]; | |
1647 | assign pich_wrap[7] = pdp_pich_wrap[7] & pcr7_dout[5]; | |
1648 | ||
1649 | assign picl_wrap[0] = pdp_picl_wrap[0] & pcr0_dout[4]; | |
1650 | assign picl_wrap[1] = pdp_picl_wrap[1] & pcr1_dout[4]; | |
1651 | assign picl_wrap[2] = pdp_picl_wrap[2] & pcr2_dout[4]; | |
1652 | assign picl_wrap[3] = pdp_picl_wrap[3] & pcr3_dout[4]; | |
1653 | assign picl_wrap[4] = pdp_picl_wrap[4] & pcr4_dout[4]; | |
1654 | assign picl_wrap[5] = pdp_picl_wrap[5] & pcr5_dout[4]; | |
1655 | assign picl_wrap[6] = pdp_picl_wrap[6] & pcr6_dout[4]; | |
1656 | assign 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!) | |
1659 | assign 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 | ||
1668 | assign 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. | |
1697 | assign pipeh_incr_e[7:0] = (ph_ige[7:0] | ph_icge[7:0]) & ~{8 {wakeup}}; | |
1698 | assign 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... | |
1701 | assign 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]}}}; | |
1702 | assign 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. | |
1707 | assign pipeh_incr_w[7:0] = (dcm_he[7:0] | dtm_he[7:0]) & ~{8 {wakeup}}; | |
1708 | assign pipel_incr_w[7:0] = (dcm_le[7:0] | dtm_le[7:0]) & ~{8 {wakeup}}; | |
1709 | ||
1710 | assign 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}}; | |
1711 | assign 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!" | |
1718 | pmu_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, | |
1729 | pmu_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!" | |
1740 | pmu_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 | |
1751 | assign tpt[7:0] = tlu_pmu_trap_taken[7:0]; | |
1752 | ||
1753 | assign 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]}}}; | |
1759 | assign 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 | ||
1763 | assign trap_w_in[7:0] = trap_b[7:0] & ~{{4 {ifu_fl_b[1]}}, {4 {ifu_fl_b[0]}}}; | |
1764 | ||
1765 | assign trap_w1_in[7:0] = trap_w[7:0] & ~{{4 {fl_w[1]}}, {4 {fl_w[0]}}}; | |
1766 | ||
1767 | assign trap_w1_final[7:0] = (trap_w1 & ~{{4 {tlu_fl_w1[1]}}, {4 {tlu_fl_w1[0]}}}); | |
1768 | ||
1769 | assign 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]; | |
1775 | assign 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) | |
1780 | assign 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!" | |
1790 | pmu_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 | |
1805 | assign 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]}}}; | |
1806 | assign 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!" | |
1810 | pmu_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 | |
1821 | assign ph_i_b[7:0] = ph_incr_b[7:0] & ~{{4 {ifu_fl_b[1]}}, {4 {ifu_fl_b[0]}}}; | |
1822 | assign 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!" | |
1826 | pmu_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 | ||
1842 | assign ph_i_w[7:0] = (ph_incr_w[7:0] | pipeh_incr_w[7:0]) & ~{{4 {fl_w[1]}}, {4 {fl_w[0]}}}; | |
1843 | assign 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!" | |
1847 | pmu_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 | ||
1879 | assign flush_h[7:0] = (~disable_h[7:0] & { {4{tlu_fl_w1[1]}}, {4{tlu_fl_w1[0]}} }); | |
1880 | assign flush_l[7:0] = (~disable_l[7:0] & { {4{tlu_fl_w1[1]}}, {4{tlu_fl_w1[0]}} }); | |
1881 | ||
1882 | assign ph_final_incr_w1[7:0] = (ph_incr_w1[7:0] & ~flush_h[7:0]) | pipeh_async[7:0]; | |
1883 | assign 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]; | |
1889 | assign 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. | |
1898 | assign set_ovh_spec[7:0] = ph_final_incr_w1[7:0] & pich_wrap[7:0]; | |
1899 | assign 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] | |
1911 | assign pic_std_w1[7:0] = {pic_st_dout[7:1], ~pic_st_dout[0]}; | |
1912 | assign pic_st_din[7:0] = {pic_std_w1[6:0], ~pic_std_w1[7]}; | |
1913 | ||
1914 | assign pct_incr_pic_w1[6:0] = pic_std_w1[6:0]; | |
1915 | ||
1916 | pmu_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 | |
1937 | assign 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 | ||
1940 | pmu_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 | |
1954 | assign 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 | ||
1957 | pmu_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 | |
1971 | assign 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]}}}; | |
1973 | pmu_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 | |
1987 | assign 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]}}}; | |
1989 | pmu_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 | |
2003 | assign 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]}}}; | |
2005 | pmu_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 | |
2019 | assign 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]}}}; | |
2021 | pmu_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 | |
2035 | assign 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]}}}; | |
2037 | pmu_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 | |
2051 | assign 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]}}}; | |
2053 | pmu_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 | |
2067 | assign 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]}}}; | |
2069 | pmu_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 | |
2083 | assign 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]}}}; | |
2085 | pmu_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 | |
2099 | assign 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]}}}; | |
2101 | pmu_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 | |
2115 | assign 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]}}}; | |
2117 | pmu_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 | |
2131 | assign 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]}}}; | |
2133 | pmu_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 | |
2147 | assign 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]}}}; | |
2149 | pmu_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 | |
2163 | assign 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]}}}; | |
2165 | pmu_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 | |
2179 | assign 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]}}}; | |
2181 | pmu_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 | ||
2199 | assign 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 | ||
2208 | assign 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 | |
2220 | pmu_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 | |
2231 | assign 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 | |
2255 | assign asi_cntrl_h[15:8] = pdp_asi_ctlin_to_pctl_15_8[7:0]; | |
2256 | assign asi_cntrl[4:0] = pdp_asi_ctlin_to_pctl_4_0[4:0]; | |
2257 | ||
2258 | assign asr = ~asi_cntrl_h[13] & asi_cntrl_h[12]; | |
2259 | assign asr_rd = asi_ctl_ndata & asi_cntrl_h[15] & ~asi_cntrl_h[14] & asr & asi_cntrl_h[11]; | |
2260 | assign asr_wr = asi_ctl_ndata & asi_cntrl_h[15] & ~asi_cntrl_h[14] & asr & ~asi_cntrl_h[11]; | |
2261 | assign pcr = asi_cntrl[4] & ~asi_cntrl[3] & ~asi_cntrl[2] & ~asi_cntrl[1] & ~asi_cntrl[0]; // 16 | |
2262 | assign pic = asi_cntrl[4] & ~asi_cntrl[3] & ~asi_cntrl[2] & ~asi_cntrl[1] & asi_cntrl[0]; // 17 | |
2263 | ||
2264 | assign pic_rd = asr_rd & pic; | |
2265 | assign pic_wr = asr_wr & pic; | |
2266 | assign pcr_rd = asr_rd & pcr; | |
2267 | assign 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 | ||
2274 | assign 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 | |
2286 | assign 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 | ||
2294 | assign priv_ex = |asr_priv[7:0]; | |
2295 | assign pmu_op = pic_rd | pic_wr | pcr_rd | pcr_wr; | |
2296 | assign pct_exception = priv_ex; | |
2297 | ||
2298 | pmu_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 | ||
2308 | pmu_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 | |
2323 | assign pcr0_read[31:0] = {pcr0_dout[31], disable_h[0], pcr0_dout[29:18], disable_l[0], pcr0_dout[16:0]}; | |
2324 | assign pcr1_read[31:0] = {pcr1_dout[31], disable_h[1], pcr1_dout[29:18], disable_l[1], pcr1_dout[16:0]}; | |
2325 | assign pcr2_read[31:0] = {pcr2_dout[31], disable_h[2], pcr2_dout[29:18], disable_l[2], pcr2_dout[16:0]}; | |
2326 | assign pcr3_read[31:0] = {pcr3_dout[31], disable_h[3], pcr3_dout[29:18], disable_l[3], pcr3_dout[16:0]}; | |
2327 | assign pcr4_read[31:0] = {pcr4_dout[31], disable_h[4], pcr4_dout[29:18], disable_l[4], pcr4_dout[16:0]}; | |
2328 | assign pcr5_read[31:0] = {pcr5_dout[31], disable_h[5], pcr5_dout[29:18], disable_l[5], pcr5_dout[16:0]}; | |
2329 | assign pcr6_read[31:0] = {pcr6_dout[31], disable_h[6], pcr6_dout[29:18], disable_l[6], pcr6_dout[16:0]}; | |
2330 | assign pcr7_read[31:0] = {pcr7_dout[31], disable_h[7], pcr7_dout[29:18], disable_l[7], pcr7_dout[16:0]}; | |
2331 | ||
2332 | assign 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 | ||
2341 | assign pct_rd_pic_pcr = p_rd | pc_rd; | |
2342 | ||
2343 | // Generate PIC mux selects for read | |
2344 | assign pct_rd_pic[7:0] = {8 {p_rd}} & atid[7:0]; | |
2345 | assign pct_rd_a_pic = p_rd; | |
2346 | ||
2347 | // Always bypass unless doing an ASR/PR read for this node | |
2348 | assign 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 | |
2380 | assign 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 | |
2384 | assign incr_asi[7:0] = pic_std_w1[7:0] & {8 {p_wr}} & atid[7:0]; | |
2385 | assign 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) | |
2391 | assign 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 | |
2397 | assign wr_pcr[7:0] = {8 {pc_wr}} & atid[7:0]; | |
2398 | ||
2399 | // Clear PCR OV bits on read... | |
2400 | assign rd_pcr[7:0] = {8 {pc_rd}} & atid[7:0]; | |
2401 | ||
2402 | supply0 vss; | |
2403 | supply1 vdd; | |
2404 | ||
2405 | pmu_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: | |
2413 | assign pwrm_scanin = scan_in ; | |
2414 | assign sleep_cnt_scanin = pwrm_scanout ; | |
2415 | assign hpstate_scanin = sleep_cnt_scanout ; | |
2416 | assign events_scanin = hpstate_scanout ; | |
2417 | assign lsutid_scanin = events_scanout ; | |
2418 | assign pcr0_scanin = lsutid_scanout ; | |
2419 | assign pcr0_ov_scanin = pcr0_scanout ; | |
2420 | assign pcr1_scanin = pcr0_ov_scanout ; | |
2421 | assign pcr1_ov_scanin = pcr1_scanout ; | |
2422 | assign pcr2_scanin = pcr1_ov_scanout ; | |
2423 | assign pcr2_ov_scanin = pcr2_scanout ; | |
2424 | assign pcr3_scanin = pcr2_ov_scanout ; | |
2425 | assign pcr3_ov_scanin = pcr3_scanout ; | |
2426 | assign pcr4_scanin = pcr3_ov_scanout ; | |
2427 | assign pcr4_ov_scanin = pcr4_scanout ; | |
2428 | assign pcr5_scanin = pcr4_ov_scanout ; | |
2429 | assign pcr5_ov_scanin = pcr5_scanout ; | |
2430 | assign pcr6_scanin = pcr5_ov_scanout ; | |
2431 | assign pcr6_ov_scanin = pcr6_scanout ; | |
2432 | assign pcr7_scanin = pcr6_ov_scanout ; | |
2433 | assign pcr7_ov_scanin = pcr7_scanout ; | |
2434 | assign pcr_ov_del_scanin = pcr7_ov_scanout ; | |
2435 | assign lsu_e2m_scanin = pcr_ov_del_scanout ; | |
2436 | assign tp_scanin = lsu_e2m_scanout ; | |
2437 | assign tp1_scanin = tp_scanout ; | |
2438 | assign br_scanin = tp1_scanout ; | |
2439 | assign ti_e2m_scanin = br_scanout ; | |
2440 | assign ti_m2b_scanin = ti_e2m_scanout ; | |
2441 | assign ti_b2w_scanin = ti_m2b_scanout ; | |
2442 | assign ti_w2w1_scanin = ti_b2w_scanout ; | |
2443 | assign pic_st_scanin = ti_w2w1_scanout ; | |
2444 | assign t0h_scanin = pic_st_scanout ; | |
2445 | assign t1h_scanin = t0h_scanout ; | |
2446 | assign t2h_scanin = t1h_scanout ; | |
2447 | assign t3h_scanin = t2h_scanout ; | |
2448 | assign t4h_scanin = t3h_scanout ; | |
2449 | assign t5h_scanin = t4h_scanout ; | |
2450 | assign t6h_scanin = t5h_scanout ; | |
2451 | assign t7h_scanin = t6h_scanout ; | |
2452 | assign t0l_scanin = t7h_scanout ; | |
2453 | assign t1l_scanin = t0l_scanout ; | |
2454 | assign t2l_scanin = t1l_scanout ; | |
2455 | assign t3l_scanin = t2l_scanout ; | |
2456 | assign t4l_scanin = t3l_scanout ; | |
2457 | assign t5l_scanin = t4l_scanout ; | |
2458 | assign t6l_scanin = t5l_scanout ; | |
2459 | assign t7l_scanin = t6l_scanout ; | |
2460 | assign accum_scanin = t7l_scanout ; | |
2461 | assign asi_scanin = accum_scanout ; | |
2462 | assign spares_scanin = asi_scanout ; | |
2463 | assign scan_out = spares_scanout ; | |
2464 | // fixscan end: | |
2465 | endmodule | |
2466 | ||
2467 | ||
2468 | ||
2469 | ||
2470 | ||
2471 | ||
2472 | // any PARAMS parms go into naming of macro | |
2473 | ||
2474 | module 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 | ||
2494 | cl_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 | ||
2507 | endmodule | |
2508 | ||
2509 | ||
2510 | ||
2511 | ||
2512 | ||
2513 | ||
2514 | ||
2515 | ||
2516 | ||
2517 | ||
2518 | ||
2519 | ||
2520 | ||
2521 | // any PARAMS parms go into naming of macro | |
2522 | ||
2523 | module pmu_pct_ctl_msff_ctl_macro__width_5 ( | |
2524 | din, | |
2525 | l1clk, | |
2526 | scan_in, | |
2527 | siclk, | |
2528 | soclk, | |
2529 | dout, | |
2530 | scan_out); | |
2531 | wire [4:0] fdin; | |
2532 | wire [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; | |
2544 | assign fdin[4:0] = din[4:0]; | |
2545 | ||
2546 | ||
2547 | ||
2548 | ||
2549 | ||
2550 | ||
2551 | dff #(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 | ||
2572 | endmodule | |
2573 | ||
2574 | ||
2575 | ||
2576 | ||
2577 | ||
2578 | ||
2579 | ||
2580 | ||
2581 | ||
2582 | ||
2583 | ||
2584 | ||
2585 | ||
2586 | // any PARAMS parms go into naming of macro | |
2587 | ||
2588 | module pmu_pct_ctl_msff_ctl_macro__width_4 ( | |
2589 | din, | |
2590 | l1clk, | |
2591 | scan_in, | |
2592 | siclk, | |
2593 | soclk, | |
2594 | dout, | |
2595 | scan_out); | |
2596 | wire [3:0] fdin; | |
2597 | wire [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; | |
2609 | assign fdin[3:0] = din[3:0]; | |
2610 | ||
2611 | ||
2612 | ||
2613 | ||
2614 | ||
2615 | ||
2616 | dff #(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 | ||
2637 | endmodule | |
2638 | ||
2639 | ||
2640 | ||
2641 | ||
2642 | ||
2643 | ||
2644 | ||
2645 | ||
2646 | ||
2647 | ||
2648 | ||
2649 | ||
2650 | ||
2651 | // any PARAMS parms go into naming of macro | |
2652 | ||
2653 | module pmu_pct_ctl_msff_ctl_macro__width_16 ( | |
2654 | din, | |
2655 | l1clk, | |
2656 | scan_in, | |
2657 | siclk, | |
2658 | soclk, | |
2659 | dout, | |
2660 | scan_out); | |
2661 | wire [15:0] fdin; | |
2662 | wire [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; | |
2674 | assign fdin[15:0] = din[15:0]; | |
2675 | ||
2676 | ||
2677 | ||
2678 | ||
2679 | ||
2680 | ||
2681 | dff #(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 | ||
2702 | endmodule | |
2703 | ||
2704 | ||
2705 | ||
2706 | ||
2707 | ||
2708 | ||
2709 | ||
2710 | ||
2711 | ||
2712 | ||
2713 | ||
2714 | ||
2715 | ||
2716 | // any PARAMS parms go into naming of macro | |
2717 | ||
2718 | module pmu_pct_ctl_msff_ctl_macro__width_66 ( | |
2719 | din, | |
2720 | l1clk, | |
2721 | scan_in, | |
2722 | siclk, | |
2723 | soclk, | |
2724 | dout, | |
2725 | scan_out); | |
2726 | wire [65:0] fdin; | |
2727 | wire [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; | |
2739 | assign fdin[65:0] = din[65:0]; | |
2740 | ||
2741 | ||
2742 | ||
2743 | ||
2744 | ||
2745 | ||
2746 | dff #(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 | ||
2767 | endmodule | |
2768 | ||
2769 | ||
2770 | ||
2771 | ||
2772 | ||
2773 | ||
2774 | ||
2775 | ||
2776 | ||
2777 | ||
2778 | ||
2779 | ||
2780 | ||
2781 | // any PARAMS parms go into naming of macro | |
2782 | ||
2783 | module pmu_pct_ctl_msff_ctl_macro__width_9 ( | |
2784 | din, | |
2785 | l1clk, | |
2786 | scan_in, | |
2787 | siclk, | |
2788 | soclk, | |
2789 | dout, | |
2790 | scan_out); | |
2791 | wire [8:0] fdin; | |
2792 | wire [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; | |
2804 | assign fdin[8:0] = din[8:0]; | |
2805 | ||
2806 | ||
2807 | ||
2808 | ||
2809 | ||
2810 | ||
2811 | dff #(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 | ||
2832 | endmodule | |
2833 | ||
2834 | ||
2835 | ||
2836 | ||
2837 | ||
2838 | ||
2839 | ||
2840 | ||
2841 | ||
2842 | ||
2843 | ||
2844 | ||
2845 | ||
2846 | // any PARAMS parms go into naming of macro | |
2847 | ||
2848 | module pmu_pct_ctl_msff_ctl_macro__width_30 ( | |
2849 | din, | |
2850 | l1clk, | |
2851 | scan_in, | |
2852 | siclk, | |
2853 | soclk, | |
2854 | dout, | |
2855 | scan_out); | |
2856 | wire [29:0] fdin; | |
2857 | wire [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; | |
2869 | assign fdin[29:0] = din[29:0]; | |
2870 | ||
2871 | ||
2872 | ||
2873 | ||
2874 | ||
2875 | ||
2876 | dff #(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 | ||
2897 | endmodule | |
2898 | ||
2899 | ||
2900 | ||
2901 | ||
2902 | ||
2903 | ||
2904 | ||
2905 | ||
2906 | ||
2907 | ||
2908 | ||
2909 | ||
2910 | ||
2911 | // any PARAMS parms go into naming of macro | |
2912 | ||
2913 | module pmu_pct_ctl_msff_ctl_macro__width_2 ( | |
2914 | din, | |
2915 | l1clk, | |
2916 | scan_in, | |
2917 | siclk, | |
2918 | soclk, | |
2919 | dout, | |
2920 | scan_out); | |
2921 | wire [1:0] fdin; | |
2922 | wire [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; | |
2934 | assign fdin[1:0] = din[1:0]; | |
2935 | ||
2936 | ||
2937 | ||
2938 | ||
2939 | ||
2940 | ||
2941 | dff #(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 | ||
2962 | endmodule | |
2963 | ||
2964 | ||
2965 | ||
2966 | ||
2967 | ||
2968 | ||
2969 | ||
2970 | ||
2971 | ||
2972 | ||
2973 | ||
2974 | ||
2975 | ||
2976 | // any PARAMS parms go into naming of macro | |
2977 | ||
2978 | module pmu_pct_ctl_msff_ctl_macro__width_28 ( | |
2979 | din, | |
2980 | l1clk, | |
2981 | scan_in, | |
2982 | siclk, | |
2983 | soclk, | |
2984 | dout, | |
2985 | scan_out); | |
2986 | wire [27:0] fdin; | |
2987 | wire [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; | |
2999 | assign fdin[27:0] = din[27:0]; | |
3000 | ||
3001 | ||
3002 | ||
3003 | ||
3004 | ||
3005 | ||
3006 | dff #(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 | ||
3027 | endmodule | |
3028 | ||
3029 | ||
3030 | ||
3031 | ||
3032 | ||
3033 | ||
3034 | ||
3035 | ||
3036 | ||
3037 | ||
3038 | ||
3039 | ||
3040 | ||
3041 | // any PARAMS parms go into naming of macro | |
3042 | ||
3043 | module pmu_pct_ctl_msff_ctl_macro__width_32 ( | |
3044 | din, | |
3045 | l1clk, | |
3046 | scan_in, | |
3047 | siclk, | |
3048 | soclk, | |
3049 | dout, | |
3050 | scan_out); | |
3051 | wire [31:0] fdin; | |
3052 | wire [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; | |
3064 | assign fdin[31:0] = din[31:0]; | |
3065 | ||
3066 | ||
3067 | ||
3068 | ||
3069 | ||
3070 | ||
3071 | dff #(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 | ||
3092 | endmodule | |
3093 | ||
3094 | ||
3095 | ||
3096 | ||
3097 | ||
3098 | ||
3099 | ||
3100 | ||
3101 | ||
3102 | ||
3103 | ||
3104 | ||
3105 | ||
3106 | // any PARAMS parms go into naming of macro | |
3107 | ||
3108 | module pmu_pct_ctl_msff_ctl_macro__width_8 ( | |
3109 | din, | |
3110 | l1clk, | |
3111 | scan_in, | |
3112 | siclk, | |
3113 | soclk, | |
3114 | dout, | |
3115 | scan_out); | |
3116 | wire [7:0] fdin; | |
3117 | wire [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; | |
3129 | assign fdin[7:0] = din[7:0]; | |
3130 | ||
3131 | ||
3132 | ||
3133 | ||
3134 | ||
3135 | ||
3136 | dff #(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 | ||
3157 | endmodule | |
3158 | ||
3159 | ||
3160 | ||
3161 | ||
3162 | ||
3163 | ||
3164 | ||
3165 | ||
3166 | ||
3167 | ||
3168 | ||
3169 | ||
3170 | ||
3171 | // any PARAMS parms go into naming of macro | |
3172 | ||
3173 | module pmu_pct_ctl_msff_ctl_macro__width_24 ( | |
3174 | din, | |
3175 | l1clk, | |
3176 | scan_in, | |
3177 | siclk, | |
3178 | soclk, | |
3179 | dout, | |
3180 | scan_out); | |
3181 | wire [23:0] fdin; | |
3182 | wire [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; | |
3194 | assign fdin[23:0] = din[23:0]; | |
3195 | ||
3196 | ||
3197 | ||
3198 | ||
3199 | ||
3200 | ||
3201 | dff #(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 | ||
3222 | endmodule | |
3223 | ||
3224 | ||
3225 | ||
3226 | ||
3227 | ||
3228 | ||
3229 | ||
3230 | ||
3231 | ||
3232 | ||
3233 | ||
3234 | ||
3235 | ||
3236 | // any PARAMS parms go into naming of macro | |
3237 | ||
3238 | module pmu_pct_ctl_msff_ctl_macro__width_18 ( | |
3239 | din, | |
3240 | l1clk, | |
3241 | scan_in, | |
3242 | siclk, | |
3243 | soclk, | |
3244 | dout, | |
3245 | scan_out); | |
3246 | wire [17:0] fdin; | |
3247 | wire [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; | |
3259 | assign fdin[17:0] = din[17:0]; | |
3260 | ||
3261 | ||
3262 | ||
3263 | ||
3264 | ||
3265 | ||
3266 | dff #(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 | ||
3287 | endmodule | |
3288 | ||
3289 | ||
3290 | ||
3291 | ||
3292 | ||
3293 | ||
3294 | ||
3295 | ||
3296 | ||
3297 | ||
3298 | ||
3299 | ||
3300 | ||
3301 | // any PARAMS parms go into naming of macro | |
3302 | ||
3303 | module pmu_pct_ctl_msff_ctl_macro__width_14 ( | |
3304 | din, | |
3305 | l1clk, | |
3306 | scan_in, | |
3307 | siclk, | |
3308 | soclk, | |
3309 | dout, | |
3310 | scan_out); | |
3311 | wire [13:0] fdin; | |
3312 | wire [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; | |
3324 | assign fdin[13:0] = din[13:0]; | |
3325 | ||
3326 | ||
3327 | ||
3328 | ||
3329 | ||
3330 | ||
3331 | dff #(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 | ||
3352 | endmodule | |
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 | ||
3368 | module pmu_pct_ctl_spare_ctl_macro__num_12 ( | |
3369 | l1clk, | |
3370 | scan_in, | |
3371 | siclk, | |
3372 | soclk, | |
3373 | scan_out); | |
3374 | wire si_0; | |
3375 | wire so_0; | |
3376 | wire spare0_flop_unused; | |
3377 | wire spare0_buf_32x_unused; | |
3378 | wire spare0_nand3_8x_unused; | |
3379 | wire spare0_inv_8x_unused; | |
3380 | wire spare0_aoi22_4x_unused; | |
3381 | wire spare0_buf_8x_unused; | |
3382 | wire spare0_oai22_4x_unused; | |
3383 | wire spare0_inv_16x_unused; | |
3384 | wire spare0_nand2_16x_unused; | |
3385 | wire spare0_nor3_4x_unused; | |
3386 | wire spare0_nand2_8x_unused; | |
3387 | wire spare0_buf_16x_unused; | |
3388 | wire spare0_nor2_16x_unused; | |
3389 | wire spare0_inv_32x_unused; | |
3390 | wire si_1; | |
3391 | wire so_1; | |
3392 | wire spare1_flop_unused; | |
3393 | wire spare1_buf_32x_unused; | |
3394 | wire spare1_nand3_8x_unused; | |
3395 | wire spare1_inv_8x_unused; | |
3396 | wire spare1_aoi22_4x_unused; | |
3397 | wire spare1_buf_8x_unused; | |
3398 | wire spare1_oai22_4x_unused; | |
3399 | wire spare1_inv_16x_unused; | |
3400 | wire spare1_nand2_16x_unused; | |
3401 | wire spare1_nor3_4x_unused; | |
3402 | wire spare1_nand2_8x_unused; | |
3403 | wire spare1_buf_16x_unused; | |
3404 | wire spare1_nor2_16x_unused; | |
3405 | wire spare1_inv_32x_unused; | |
3406 | wire si_2; | |
3407 | wire so_2; | |
3408 | wire spare2_flop_unused; | |
3409 | wire spare2_buf_32x_unused; | |
3410 | wire spare2_nand3_8x_unused; | |
3411 | wire spare2_inv_8x_unused; | |
3412 | wire spare2_aoi22_4x_unused; | |
3413 | wire spare2_buf_8x_unused; | |
3414 | wire spare2_oai22_4x_unused; | |
3415 | wire spare2_inv_16x_unused; | |
3416 | wire spare2_nand2_16x_unused; | |
3417 | wire spare2_nor3_4x_unused; | |
3418 | wire spare2_nand2_8x_unused; | |
3419 | wire spare2_buf_16x_unused; | |
3420 | wire spare2_nor2_16x_unused; | |
3421 | wire spare2_inv_32x_unused; | |
3422 | wire si_3; | |
3423 | wire so_3; | |
3424 | wire spare3_flop_unused; | |
3425 | wire spare3_buf_32x_unused; | |
3426 | wire spare3_nand3_8x_unused; | |
3427 | wire spare3_inv_8x_unused; | |
3428 | wire spare3_aoi22_4x_unused; | |
3429 | wire spare3_buf_8x_unused; | |
3430 | wire spare3_oai22_4x_unused; | |
3431 | wire spare3_inv_16x_unused; | |
3432 | wire spare3_nand2_16x_unused; | |
3433 | wire spare3_nor3_4x_unused; | |
3434 | wire spare3_nand2_8x_unused; | |
3435 | wire spare3_buf_16x_unused; | |
3436 | wire spare3_nor2_16x_unused; | |
3437 | wire spare3_inv_32x_unused; | |
3438 | wire si_4; | |
3439 | wire so_4; | |
3440 | wire spare4_flop_unused; | |
3441 | wire spare4_buf_32x_unused; | |
3442 | wire spare4_nand3_8x_unused; | |
3443 | wire spare4_inv_8x_unused; | |
3444 | wire spare4_aoi22_4x_unused; | |
3445 | wire spare4_buf_8x_unused; | |
3446 | wire spare4_oai22_4x_unused; | |
3447 | wire spare4_inv_16x_unused; | |
3448 | wire spare4_nand2_16x_unused; | |
3449 | wire spare4_nor3_4x_unused; | |
3450 | wire spare4_nand2_8x_unused; | |
3451 | wire spare4_buf_16x_unused; | |
3452 | wire spare4_nor2_16x_unused; | |
3453 | wire spare4_inv_32x_unused; | |
3454 | wire si_5; | |
3455 | wire so_5; | |
3456 | wire spare5_flop_unused; | |
3457 | wire spare5_buf_32x_unused; | |
3458 | wire spare5_nand3_8x_unused; | |
3459 | wire spare5_inv_8x_unused; | |
3460 | wire spare5_aoi22_4x_unused; | |
3461 | wire spare5_buf_8x_unused; | |
3462 | wire spare5_oai22_4x_unused; | |
3463 | wire spare5_inv_16x_unused; | |
3464 | wire spare5_nand2_16x_unused; | |
3465 | wire spare5_nor3_4x_unused; | |
3466 | wire spare5_nand2_8x_unused; | |
3467 | wire spare5_buf_16x_unused; | |
3468 | wire spare5_nor2_16x_unused; | |
3469 | wire spare5_inv_32x_unused; | |
3470 | wire si_6; | |
3471 | wire so_6; | |
3472 | wire spare6_flop_unused; | |
3473 | wire spare6_buf_32x_unused; | |
3474 | wire spare6_nand3_8x_unused; | |
3475 | wire spare6_inv_8x_unused; | |
3476 | wire spare6_aoi22_4x_unused; | |
3477 | wire spare6_buf_8x_unused; | |
3478 | wire spare6_oai22_4x_unused; | |
3479 | wire spare6_inv_16x_unused; | |
3480 | wire spare6_nand2_16x_unused; | |
3481 | wire spare6_nor3_4x_unused; | |
3482 | wire spare6_nand2_8x_unused; | |
3483 | wire spare6_buf_16x_unused; | |
3484 | wire spare6_nor2_16x_unused; | |
3485 | wire spare6_inv_32x_unused; | |
3486 | wire si_7; | |
3487 | wire so_7; | |
3488 | wire spare7_flop_unused; | |
3489 | wire spare7_buf_32x_unused; | |
3490 | wire spare7_nand3_8x_unused; | |
3491 | wire spare7_inv_8x_unused; | |
3492 | wire spare7_aoi22_4x_unused; | |
3493 | wire spare7_buf_8x_unused; | |
3494 | wire spare7_oai22_4x_unused; | |
3495 | wire spare7_inv_16x_unused; | |
3496 | wire spare7_nand2_16x_unused; | |
3497 | wire spare7_nor3_4x_unused; | |
3498 | wire spare7_nand2_8x_unused; | |
3499 | wire spare7_buf_16x_unused; | |
3500 | wire spare7_nor2_16x_unused; | |
3501 | wire spare7_inv_32x_unused; | |
3502 | wire si_8; | |
3503 | wire so_8; | |
3504 | wire spare8_flop_unused; | |
3505 | wire spare8_buf_32x_unused; | |
3506 | wire spare8_nand3_8x_unused; | |
3507 | wire spare8_inv_8x_unused; | |
3508 | wire spare8_aoi22_4x_unused; | |
3509 | wire spare8_buf_8x_unused; | |
3510 | wire spare8_oai22_4x_unused; | |
3511 | wire spare8_inv_16x_unused; | |
3512 | wire spare8_nand2_16x_unused; | |
3513 | wire spare8_nor3_4x_unused; | |
3514 | wire spare8_nand2_8x_unused; | |
3515 | wire spare8_buf_16x_unused; | |
3516 | wire spare8_nor2_16x_unused; | |
3517 | wire spare8_inv_32x_unused; | |
3518 | wire si_9; | |
3519 | wire so_9; | |
3520 | wire spare9_flop_unused; | |
3521 | wire spare9_buf_32x_unused; | |
3522 | wire spare9_nand3_8x_unused; | |
3523 | wire spare9_inv_8x_unused; | |
3524 | wire spare9_aoi22_4x_unused; | |
3525 | wire spare9_buf_8x_unused; | |
3526 | wire spare9_oai22_4x_unused; | |
3527 | wire spare9_inv_16x_unused; | |
3528 | wire spare9_nand2_16x_unused; | |
3529 | wire spare9_nor3_4x_unused; | |
3530 | wire spare9_nand2_8x_unused; | |
3531 | wire spare9_buf_16x_unused; | |
3532 | wire spare9_nor2_16x_unused; | |
3533 | wire spare9_inv_32x_unused; | |
3534 | wire si_10; | |
3535 | wire so_10; | |
3536 | wire spare10_flop_unused; | |
3537 | wire spare10_buf_32x_unused; | |
3538 | wire spare10_nand3_8x_unused; | |
3539 | wire spare10_inv_8x_unused; | |
3540 | wire spare10_aoi22_4x_unused; | |
3541 | wire spare10_buf_8x_unused; | |
3542 | wire spare10_oai22_4x_unused; | |
3543 | wire spare10_inv_16x_unused; | |
3544 | wire spare10_nand2_16x_unused; | |
3545 | wire spare10_nor3_4x_unused; | |
3546 | wire spare10_nand2_8x_unused; | |
3547 | wire spare10_buf_16x_unused; | |
3548 | wire spare10_nor2_16x_unused; | |
3549 | wire spare10_inv_32x_unused; | |
3550 | wire si_11; | |
3551 | wire so_11; | |
3552 | wire spare11_flop_unused; | |
3553 | wire spare11_buf_32x_unused; | |
3554 | wire spare11_nand3_8x_unused; | |
3555 | wire spare11_inv_8x_unused; | |
3556 | wire spare11_aoi22_4x_unused; | |
3557 | wire spare11_buf_8x_unused; | |
3558 | wire spare11_oai22_4x_unused; | |
3559 | wire spare11_inv_16x_unused; | |
3560 | wire spare11_nand2_16x_unused; | |
3561 | wire spare11_nor3_4x_unused; | |
3562 | wire spare11_nand2_8x_unused; | |
3563 | wire spare11_buf_16x_unused; | |
3564 | wire spare11_nor2_16x_unused; | |
3565 | wire spare11_inv_32x_unused; | |
3566 | ||
3567 | ||
3568 | input l1clk; | |
3569 | input scan_in; | |
3570 | input siclk; | |
3571 | input soclk; | |
3572 | output scan_out; | |
3573 | ||
3574 | cl_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)); | |
3581 | assign si_0 = scan_in; | |
3582 | ||
3583 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
3584 | .out(spare0_buf_32x_unused)); | |
3585 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
3586 | .in1(1'b1), | |
3587 | .in2(1'b1), | |
3588 | .out(spare0_nand3_8x_unused)); | |
3589 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
3590 | .out(spare0_inv_8x_unused)); | |
3591 | cl_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)); | |
3596 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
3597 | .out(spare0_buf_8x_unused)); | |
3598 | cl_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)); | |
3603 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
3604 | .out(spare0_inv_16x_unused)); | |
3605 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
3606 | .in1(1'b1), | |
3607 | .out(spare0_nand2_16x_unused)); | |
3608 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
3609 | .in1(1'b0), | |
3610 | .in2(1'b0), | |
3611 | .out(spare0_nor3_4x_unused)); | |
3612 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
3613 | .in1(1'b1), | |
3614 | .out(spare0_nand2_8x_unused)); | |
3615 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
3616 | .out(spare0_buf_16x_unused)); | |
3617 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
3618 | .in1(1'b0), | |
3619 | .out(spare0_nor2_16x_unused)); | |
3620 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
3621 | .out(spare0_inv_32x_unused)); | |
3622 | ||
3623 | cl_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)); | |
3630 | assign si_1 = so_0; | |
3631 | ||
3632 | cl_u1_buf_32x spare1_buf_32x (.in(1'b1), | |
3633 | .out(spare1_buf_32x_unused)); | |
3634 | cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1), | |
3635 | .in1(1'b1), | |
3636 | .in2(1'b1), | |
3637 | .out(spare1_nand3_8x_unused)); | |
3638 | cl_u1_inv_8x spare1_inv_8x (.in(1'b1), | |
3639 | .out(spare1_inv_8x_unused)); | |
3640 | cl_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)); | |
3645 | cl_u1_buf_8x spare1_buf_8x (.in(1'b1), | |
3646 | .out(spare1_buf_8x_unused)); | |
3647 | cl_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)); | |
3652 | cl_u1_inv_16x spare1_inv_16x (.in(1'b1), | |
3653 | .out(spare1_inv_16x_unused)); | |
3654 | cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1), | |
3655 | .in1(1'b1), | |
3656 | .out(spare1_nand2_16x_unused)); | |
3657 | cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0), | |
3658 | .in1(1'b0), | |
3659 | .in2(1'b0), | |
3660 | .out(spare1_nor3_4x_unused)); | |
3661 | cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1), | |
3662 | .in1(1'b1), | |
3663 | .out(spare1_nand2_8x_unused)); | |
3664 | cl_u1_buf_16x spare1_buf_16x (.in(1'b1), | |
3665 | .out(spare1_buf_16x_unused)); | |
3666 | cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0), | |
3667 | .in1(1'b0), | |
3668 | .out(spare1_nor2_16x_unused)); | |
3669 | cl_u1_inv_32x spare1_inv_32x (.in(1'b1), | |
3670 | .out(spare1_inv_32x_unused)); | |
3671 | ||
3672 | cl_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)); | |
3679 | assign si_2 = so_1; | |
3680 | ||
3681 | cl_u1_buf_32x spare2_buf_32x (.in(1'b1), | |
3682 | .out(spare2_buf_32x_unused)); | |
3683 | cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1), | |
3684 | .in1(1'b1), | |
3685 | .in2(1'b1), | |
3686 | .out(spare2_nand3_8x_unused)); | |
3687 | cl_u1_inv_8x spare2_inv_8x (.in(1'b1), | |
3688 | .out(spare2_inv_8x_unused)); | |
3689 | cl_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)); | |
3694 | cl_u1_buf_8x spare2_buf_8x (.in(1'b1), | |
3695 | .out(spare2_buf_8x_unused)); | |
3696 | cl_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)); | |
3701 | cl_u1_inv_16x spare2_inv_16x (.in(1'b1), | |
3702 | .out(spare2_inv_16x_unused)); | |
3703 | cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1), | |
3704 | .in1(1'b1), | |
3705 | .out(spare2_nand2_16x_unused)); | |
3706 | cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0), | |
3707 | .in1(1'b0), | |
3708 | .in2(1'b0), | |
3709 | .out(spare2_nor3_4x_unused)); | |
3710 | cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1), | |
3711 | .in1(1'b1), | |
3712 | .out(spare2_nand2_8x_unused)); | |
3713 | cl_u1_buf_16x spare2_buf_16x (.in(1'b1), | |
3714 | .out(spare2_buf_16x_unused)); | |
3715 | cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0), | |
3716 | .in1(1'b0), | |
3717 | .out(spare2_nor2_16x_unused)); | |
3718 | cl_u1_inv_32x spare2_inv_32x (.in(1'b1), | |
3719 | .out(spare2_inv_32x_unused)); | |
3720 | ||
3721 | cl_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)); | |
3728 | assign si_3 = so_2; | |
3729 | ||
3730 | cl_u1_buf_32x spare3_buf_32x (.in(1'b1), | |
3731 | .out(spare3_buf_32x_unused)); | |
3732 | cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1), | |
3733 | .in1(1'b1), | |
3734 | .in2(1'b1), | |
3735 | .out(spare3_nand3_8x_unused)); | |
3736 | cl_u1_inv_8x spare3_inv_8x (.in(1'b1), | |
3737 | .out(spare3_inv_8x_unused)); | |
3738 | cl_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)); | |
3743 | cl_u1_buf_8x spare3_buf_8x (.in(1'b1), | |
3744 | .out(spare3_buf_8x_unused)); | |
3745 | cl_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)); | |
3750 | cl_u1_inv_16x spare3_inv_16x (.in(1'b1), | |
3751 | .out(spare3_inv_16x_unused)); | |
3752 | cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1), | |
3753 | .in1(1'b1), | |
3754 | .out(spare3_nand2_16x_unused)); | |
3755 | cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0), | |
3756 | .in1(1'b0), | |
3757 | .in2(1'b0), | |
3758 | .out(spare3_nor3_4x_unused)); | |
3759 | cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1), | |
3760 | .in1(1'b1), | |
3761 | .out(spare3_nand2_8x_unused)); | |
3762 | cl_u1_buf_16x spare3_buf_16x (.in(1'b1), | |
3763 | .out(spare3_buf_16x_unused)); | |
3764 | cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0), | |
3765 | .in1(1'b0), | |
3766 | .out(spare3_nor2_16x_unused)); | |
3767 | cl_u1_inv_32x spare3_inv_32x (.in(1'b1), | |
3768 | .out(spare3_inv_32x_unused)); | |
3769 | ||
3770 | cl_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)); | |
3777 | assign si_4 = so_3; | |
3778 | ||
3779 | cl_u1_buf_32x spare4_buf_32x (.in(1'b1), | |
3780 | .out(spare4_buf_32x_unused)); | |
3781 | cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1), | |
3782 | .in1(1'b1), | |
3783 | .in2(1'b1), | |
3784 | .out(spare4_nand3_8x_unused)); | |
3785 | cl_u1_inv_8x spare4_inv_8x (.in(1'b1), | |
3786 | .out(spare4_inv_8x_unused)); | |
3787 | cl_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)); | |
3792 | cl_u1_buf_8x spare4_buf_8x (.in(1'b1), | |
3793 | .out(spare4_buf_8x_unused)); | |
3794 | cl_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)); | |
3799 | cl_u1_inv_16x spare4_inv_16x (.in(1'b1), | |
3800 | .out(spare4_inv_16x_unused)); | |
3801 | cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1), | |
3802 | .in1(1'b1), | |
3803 | .out(spare4_nand2_16x_unused)); | |
3804 | cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0), | |
3805 | .in1(1'b0), | |
3806 | .in2(1'b0), | |
3807 | .out(spare4_nor3_4x_unused)); | |
3808 | cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1), | |
3809 | .in1(1'b1), | |
3810 | .out(spare4_nand2_8x_unused)); | |
3811 | cl_u1_buf_16x spare4_buf_16x (.in(1'b1), | |
3812 | .out(spare4_buf_16x_unused)); | |
3813 | cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0), | |
3814 | .in1(1'b0), | |
3815 | .out(spare4_nor2_16x_unused)); | |
3816 | cl_u1_inv_32x spare4_inv_32x (.in(1'b1), | |
3817 | .out(spare4_inv_32x_unused)); | |
3818 | ||
3819 | cl_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)); | |
3826 | assign si_5 = so_4; | |
3827 | ||
3828 | cl_u1_buf_32x spare5_buf_32x (.in(1'b1), | |
3829 | .out(spare5_buf_32x_unused)); | |
3830 | cl_u1_nand3_8x spare5_nand3_8x (.in0(1'b1), | |
3831 | .in1(1'b1), | |
3832 | .in2(1'b1), | |
3833 | .out(spare5_nand3_8x_unused)); | |
3834 | cl_u1_inv_8x spare5_inv_8x (.in(1'b1), | |
3835 | .out(spare5_inv_8x_unused)); | |
3836 | cl_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)); | |
3841 | cl_u1_buf_8x spare5_buf_8x (.in(1'b1), | |
3842 | .out(spare5_buf_8x_unused)); | |
3843 | cl_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)); | |
3848 | cl_u1_inv_16x spare5_inv_16x (.in(1'b1), | |
3849 | .out(spare5_inv_16x_unused)); | |
3850 | cl_u1_nand2_16x spare5_nand2_16x (.in0(1'b1), | |
3851 | .in1(1'b1), | |
3852 | .out(spare5_nand2_16x_unused)); | |
3853 | cl_u1_nor3_4x spare5_nor3_4x (.in0(1'b0), | |
3854 | .in1(1'b0), | |
3855 | .in2(1'b0), | |
3856 | .out(spare5_nor3_4x_unused)); | |
3857 | cl_u1_nand2_8x spare5_nand2_8x (.in0(1'b1), | |
3858 | .in1(1'b1), | |
3859 | .out(spare5_nand2_8x_unused)); | |
3860 | cl_u1_buf_16x spare5_buf_16x (.in(1'b1), | |
3861 | .out(spare5_buf_16x_unused)); | |
3862 | cl_u1_nor2_16x spare5_nor2_16x (.in0(1'b0), | |
3863 | .in1(1'b0), | |
3864 | .out(spare5_nor2_16x_unused)); | |
3865 | cl_u1_inv_32x spare5_inv_32x (.in(1'b1), | |
3866 | .out(spare5_inv_32x_unused)); | |
3867 | ||
3868 | cl_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)); | |
3875 | assign si_6 = so_5; | |
3876 | ||
3877 | cl_u1_buf_32x spare6_buf_32x (.in(1'b1), | |
3878 | .out(spare6_buf_32x_unused)); | |
3879 | cl_u1_nand3_8x spare6_nand3_8x (.in0(1'b1), | |
3880 | .in1(1'b1), | |
3881 | .in2(1'b1), | |
3882 | .out(spare6_nand3_8x_unused)); | |
3883 | cl_u1_inv_8x spare6_inv_8x (.in(1'b1), | |
3884 | .out(spare6_inv_8x_unused)); | |
3885 | cl_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)); | |
3890 | cl_u1_buf_8x spare6_buf_8x (.in(1'b1), | |
3891 | .out(spare6_buf_8x_unused)); | |
3892 | cl_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)); | |
3897 | cl_u1_inv_16x spare6_inv_16x (.in(1'b1), | |
3898 | .out(spare6_inv_16x_unused)); | |
3899 | cl_u1_nand2_16x spare6_nand2_16x (.in0(1'b1), | |
3900 | .in1(1'b1), | |
3901 | .out(spare6_nand2_16x_unused)); | |
3902 | cl_u1_nor3_4x spare6_nor3_4x (.in0(1'b0), | |
3903 | .in1(1'b0), | |
3904 | .in2(1'b0), | |
3905 | .out(spare6_nor3_4x_unused)); | |
3906 | cl_u1_nand2_8x spare6_nand2_8x (.in0(1'b1), | |
3907 | .in1(1'b1), | |
3908 | .out(spare6_nand2_8x_unused)); | |
3909 | cl_u1_buf_16x spare6_buf_16x (.in(1'b1), | |
3910 | .out(spare6_buf_16x_unused)); | |
3911 | cl_u1_nor2_16x spare6_nor2_16x (.in0(1'b0), | |
3912 | .in1(1'b0), | |
3913 | .out(spare6_nor2_16x_unused)); | |
3914 | cl_u1_inv_32x spare6_inv_32x (.in(1'b1), | |
3915 | .out(spare6_inv_32x_unused)); | |
3916 | ||
3917 | cl_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)); | |
3924 | assign si_7 = so_6; | |
3925 | ||
3926 | cl_u1_buf_32x spare7_buf_32x (.in(1'b1), | |
3927 | .out(spare7_buf_32x_unused)); | |
3928 | cl_u1_nand3_8x spare7_nand3_8x (.in0(1'b1), | |
3929 | .in1(1'b1), | |
3930 | .in2(1'b1), | |
3931 | .out(spare7_nand3_8x_unused)); | |
3932 | cl_u1_inv_8x spare7_inv_8x (.in(1'b1), | |
3933 | .out(spare7_inv_8x_unused)); | |
3934 | cl_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)); | |
3939 | cl_u1_buf_8x spare7_buf_8x (.in(1'b1), | |
3940 | .out(spare7_buf_8x_unused)); | |
3941 | cl_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)); | |
3946 | cl_u1_inv_16x spare7_inv_16x (.in(1'b1), | |
3947 | .out(spare7_inv_16x_unused)); | |
3948 | cl_u1_nand2_16x spare7_nand2_16x (.in0(1'b1), | |
3949 | .in1(1'b1), | |
3950 | .out(spare7_nand2_16x_unused)); | |
3951 | cl_u1_nor3_4x spare7_nor3_4x (.in0(1'b0), | |
3952 | .in1(1'b0), | |
3953 | .in2(1'b0), | |
3954 | .out(spare7_nor3_4x_unused)); | |
3955 | cl_u1_nand2_8x spare7_nand2_8x (.in0(1'b1), | |
3956 | .in1(1'b1), | |
3957 | .out(spare7_nand2_8x_unused)); | |
3958 | cl_u1_buf_16x spare7_buf_16x (.in(1'b1), | |
3959 | .out(spare7_buf_16x_unused)); | |
3960 | cl_u1_nor2_16x spare7_nor2_16x (.in0(1'b0), | |
3961 | .in1(1'b0), | |
3962 | .out(spare7_nor2_16x_unused)); | |
3963 | cl_u1_inv_32x spare7_inv_32x (.in(1'b1), | |
3964 | .out(spare7_inv_32x_unused)); | |
3965 | ||
3966 | cl_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)); | |
3973 | assign si_8 = so_7; | |
3974 | ||
3975 | cl_u1_buf_32x spare8_buf_32x (.in(1'b1), | |
3976 | .out(spare8_buf_32x_unused)); | |
3977 | cl_u1_nand3_8x spare8_nand3_8x (.in0(1'b1), | |
3978 | .in1(1'b1), | |
3979 | .in2(1'b1), | |
3980 | .out(spare8_nand3_8x_unused)); | |
3981 | cl_u1_inv_8x spare8_inv_8x (.in(1'b1), | |
3982 | .out(spare8_inv_8x_unused)); | |
3983 | cl_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)); | |
3988 | cl_u1_buf_8x spare8_buf_8x (.in(1'b1), | |
3989 | .out(spare8_buf_8x_unused)); | |
3990 | cl_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)); | |
3995 | cl_u1_inv_16x spare8_inv_16x (.in(1'b1), | |
3996 | .out(spare8_inv_16x_unused)); | |
3997 | cl_u1_nand2_16x spare8_nand2_16x (.in0(1'b1), | |
3998 | .in1(1'b1), | |
3999 | .out(spare8_nand2_16x_unused)); | |
4000 | cl_u1_nor3_4x spare8_nor3_4x (.in0(1'b0), | |
4001 | .in1(1'b0), | |
4002 | .in2(1'b0), | |
4003 | .out(spare8_nor3_4x_unused)); | |
4004 | cl_u1_nand2_8x spare8_nand2_8x (.in0(1'b1), | |
4005 | .in1(1'b1), | |
4006 | .out(spare8_nand2_8x_unused)); | |
4007 | cl_u1_buf_16x spare8_buf_16x (.in(1'b1), | |
4008 | .out(spare8_buf_16x_unused)); | |
4009 | cl_u1_nor2_16x spare8_nor2_16x (.in0(1'b0), | |
4010 | .in1(1'b0), | |
4011 | .out(spare8_nor2_16x_unused)); | |
4012 | cl_u1_inv_32x spare8_inv_32x (.in(1'b1), | |
4013 | .out(spare8_inv_32x_unused)); | |
4014 | ||
4015 | cl_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)); | |
4022 | assign si_9 = so_8; | |
4023 | ||
4024 | cl_u1_buf_32x spare9_buf_32x (.in(1'b1), | |
4025 | .out(spare9_buf_32x_unused)); | |
4026 | cl_u1_nand3_8x spare9_nand3_8x (.in0(1'b1), | |
4027 | .in1(1'b1), | |
4028 | .in2(1'b1), | |
4029 | .out(spare9_nand3_8x_unused)); | |
4030 | cl_u1_inv_8x spare9_inv_8x (.in(1'b1), | |
4031 | .out(spare9_inv_8x_unused)); | |
4032 | cl_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)); | |
4037 | cl_u1_buf_8x spare9_buf_8x (.in(1'b1), | |
4038 | .out(spare9_buf_8x_unused)); | |
4039 | cl_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)); | |
4044 | cl_u1_inv_16x spare9_inv_16x (.in(1'b1), | |
4045 | .out(spare9_inv_16x_unused)); | |
4046 | cl_u1_nand2_16x spare9_nand2_16x (.in0(1'b1), | |
4047 | .in1(1'b1), | |
4048 | .out(spare9_nand2_16x_unused)); | |
4049 | cl_u1_nor3_4x spare9_nor3_4x (.in0(1'b0), | |
4050 | .in1(1'b0), | |
4051 | .in2(1'b0), | |
4052 | .out(spare9_nor3_4x_unused)); | |
4053 | cl_u1_nand2_8x spare9_nand2_8x (.in0(1'b1), | |
4054 | .in1(1'b1), | |
4055 | .out(spare9_nand2_8x_unused)); | |
4056 | cl_u1_buf_16x spare9_buf_16x (.in(1'b1), | |
4057 | .out(spare9_buf_16x_unused)); | |
4058 | cl_u1_nor2_16x spare9_nor2_16x (.in0(1'b0), | |
4059 | .in1(1'b0), | |
4060 | .out(spare9_nor2_16x_unused)); | |
4061 | cl_u1_inv_32x spare9_inv_32x (.in(1'b1), | |
4062 | .out(spare9_inv_32x_unused)); | |
4063 | ||
4064 | cl_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)); | |
4071 | assign si_10 = so_9; | |
4072 | ||
4073 | cl_u1_buf_32x spare10_buf_32x (.in(1'b1), | |
4074 | .out(spare10_buf_32x_unused)); | |
4075 | cl_u1_nand3_8x spare10_nand3_8x (.in0(1'b1), | |
4076 | .in1(1'b1), | |
4077 | .in2(1'b1), | |
4078 | .out(spare10_nand3_8x_unused)); | |
4079 | cl_u1_inv_8x spare10_inv_8x (.in(1'b1), | |
4080 | .out(spare10_inv_8x_unused)); | |
4081 | cl_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)); | |
4086 | cl_u1_buf_8x spare10_buf_8x (.in(1'b1), | |
4087 | .out(spare10_buf_8x_unused)); | |
4088 | cl_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)); | |
4093 | cl_u1_inv_16x spare10_inv_16x (.in(1'b1), | |
4094 | .out(spare10_inv_16x_unused)); | |
4095 | cl_u1_nand2_16x spare10_nand2_16x (.in0(1'b1), | |
4096 | .in1(1'b1), | |
4097 | .out(spare10_nand2_16x_unused)); | |
4098 | cl_u1_nor3_4x spare10_nor3_4x (.in0(1'b0), | |
4099 | .in1(1'b0), | |
4100 | .in2(1'b0), | |
4101 | .out(spare10_nor3_4x_unused)); | |
4102 | cl_u1_nand2_8x spare10_nand2_8x (.in0(1'b1), | |
4103 | .in1(1'b1), | |
4104 | .out(spare10_nand2_8x_unused)); | |
4105 | cl_u1_buf_16x spare10_buf_16x (.in(1'b1), | |
4106 | .out(spare10_buf_16x_unused)); | |
4107 | cl_u1_nor2_16x spare10_nor2_16x (.in0(1'b0), | |
4108 | .in1(1'b0), | |
4109 | .out(spare10_nor2_16x_unused)); | |
4110 | cl_u1_inv_32x spare10_inv_32x (.in(1'b1), | |
4111 | .out(spare10_inv_32x_unused)); | |
4112 | ||
4113 | cl_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)); | |
4120 | assign si_11 = so_10; | |
4121 | ||
4122 | cl_u1_buf_32x spare11_buf_32x (.in(1'b1), | |
4123 | .out(spare11_buf_32x_unused)); | |
4124 | cl_u1_nand3_8x spare11_nand3_8x (.in0(1'b1), | |
4125 | .in1(1'b1), | |
4126 | .in2(1'b1), | |
4127 | .out(spare11_nand3_8x_unused)); | |
4128 | cl_u1_inv_8x spare11_inv_8x (.in(1'b1), | |
4129 | .out(spare11_inv_8x_unused)); | |
4130 | cl_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)); | |
4135 | cl_u1_buf_8x spare11_buf_8x (.in(1'b1), | |
4136 | .out(spare11_buf_8x_unused)); | |
4137 | cl_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)); | |
4142 | cl_u1_inv_16x spare11_inv_16x (.in(1'b1), | |
4143 | .out(spare11_inv_16x_unused)); | |
4144 | cl_u1_nand2_16x spare11_nand2_16x (.in0(1'b1), | |
4145 | .in1(1'b1), | |
4146 | .out(spare11_nand2_16x_unused)); | |
4147 | cl_u1_nor3_4x spare11_nor3_4x (.in0(1'b0), | |
4148 | .in1(1'b0), | |
4149 | .in2(1'b0), | |
4150 | .out(spare11_nor3_4x_unused)); | |
4151 | cl_u1_nand2_8x spare11_nand2_8x (.in0(1'b1), | |
4152 | .in1(1'b1), | |
4153 | .out(spare11_nand2_8x_unused)); | |
4154 | cl_u1_buf_16x spare11_buf_16x (.in(1'b1), | |
4155 | .out(spare11_buf_16x_unused)); | |
4156 | cl_u1_nor2_16x spare11_nor2_16x (.in0(1'b0), | |
4157 | .in1(1'b0), | |
4158 | .out(spare11_nor2_16x_unused)); | |
4159 | cl_u1_inv_32x spare11_inv_32x (.in(1'b1), | |
4160 | .out(spare11_inv_32x_unused)); | |
4161 | assign scan_out = so_11; | |
4162 | ||
4163 | ||
4164 | ||
4165 | endmodule | |
4166 |