Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: ifu_ftu_cms_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 ifu_ftu_cms_ctl ( | |
36 | tcu_scan_en, | |
37 | l2clk, | |
38 | scan_in, | |
39 | tcu_pce_ov, | |
40 | spc_aclk, | |
41 | spc_bclk, | |
42 | lsu_ic_enable, | |
43 | lsu_ifu_direct_map, | |
44 | agd_direct_map_rep_way, | |
45 | ftp_curr_fetch_thr_f, | |
46 | ftu_agc_thr0_cmiss_c, | |
47 | ftu_agc_thr1_cmiss_c, | |
48 | ftu_agc_thr2_cmiss_c, | |
49 | ftu_agc_thr3_cmiss_c, | |
50 | ftu_agc_thr4_cmiss_c, | |
51 | ftu_agc_thr5_cmiss_c, | |
52 | ftu_agc_thr6_cmiss_c, | |
53 | ftu_agc_thr7_cmiss_c, | |
54 | cmu_ic_data_parity, | |
55 | ftu_paddr_unq, | |
56 | agc_any_invalidation_req_f, | |
57 | itb_tte_cp_c, | |
58 | itc_bypass_bf, | |
59 | cmu_l2_err, | |
60 | tlu_cerer_icl2u, | |
61 | tlu_cerer_icl2nd, | |
62 | ftu_thrx_un_cacheable, | |
63 | ftu_rep_way, | |
64 | cms_ic_modified_parity, | |
65 | ftu_paddr, | |
66 | scan_out) ; | |
67 | wire pce_ov; | |
68 | wire stop; | |
69 | wire siclk; | |
70 | wire soclk; | |
71 | wire l1clk; | |
72 | wire itb_tte_cp_c_q; | |
73 | wire itb_bypass_c; | |
74 | wire ic_disabled_c; | |
75 | wire any_invalidation_req_c_l; | |
76 | wire flip_parity_ff; | |
77 | wire any_miss; | |
78 | wire [2:0] rep_way_inc; | |
79 | wire sel_miss; | |
80 | wire ifu_direct_map_ff; | |
81 | wire sel_direct_map; | |
82 | wire sel_hold; | |
83 | wire [2:0] rep_way_in; | |
84 | wire flip_parity; | |
85 | wire cerer_icl2u_ff; | |
86 | wire cerer_icl2nd_ff; | |
87 | wire any_invalidation_req_f_l; | |
88 | wire rep_way_reg_scanin; | |
89 | wire rep_way_reg_scanout; | |
90 | wire itb_bypass_f; | |
91 | wire ic_enable_reg_scanin; | |
92 | wire ic_enable_reg_scanout; | |
93 | wire [7:0] cms_icache_enable; | |
94 | wire ic_disabled_f; | |
95 | wire ic_disabled_reg_scanin; | |
96 | wire ic_disabled_reg_scanout; | |
97 | wire se; | |
98 | wire spares_scanin; | |
99 | wire spares_scanout; | |
100 | ||
101 | ||
102 | ||
103 | input tcu_scan_en ; | |
104 | input l2clk; | |
105 | input scan_in; | |
106 | input tcu_pce_ov; // scan signals | |
107 | input spc_aclk; | |
108 | input spc_bclk; | |
109 | ||
110 | input [7:0] lsu_ic_enable ; | |
111 | input lsu_ifu_direct_map; | |
112 | input [2:0] agd_direct_map_rep_way; | |
113 | ||
114 | input [7:0] ftp_curr_fetch_thr_f ; | |
115 | // input [7:0] agd_itlb_valid_f ; | |
116 | ||
117 | // input agc_qualify_cmiss ; | |
118 | ||
119 | ||
120 | ||
121 | ||
122 | input ftu_agc_thr0_cmiss_c; | |
123 | input ftu_agc_thr1_cmiss_c; | |
124 | input ftu_agc_thr2_cmiss_c; | |
125 | input ftu_agc_thr3_cmiss_c; | |
126 | input ftu_agc_thr4_cmiss_c; | |
127 | input ftu_agc_thr5_cmiss_c; | |
128 | input ftu_agc_thr6_cmiss_c; | |
129 | input ftu_agc_thr7_cmiss_c; | |
130 | input [7:0] cmu_ic_data_parity; | |
131 | input [39:37] ftu_paddr_unq; | |
132 | input agc_any_invalidation_req_f; | |
133 | input itb_tte_cp_c ; | |
134 | input itc_bypass_bf ; | |
135 | input [1:0] cmu_l2_err ; | |
136 | input tlu_cerer_icl2u ; | |
137 | input tlu_cerer_icl2nd ; | |
138 | ||
139 | ||
140 | output ftu_thrx_un_cacheable; | |
141 | ||
142 | output [2:0] ftu_rep_way; | |
143 | output [7:0] cms_ic_modified_parity; | |
144 | output [39:37] ftu_paddr; | |
145 | ||
146 | ||
147 | output scan_out; | |
148 | ||
149 | // scan renames | |
150 | assign pce_ov = tcu_pce_ov; | |
151 | assign stop = 1'b0; | |
152 | assign siclk = spc_aclk; | |
153 | assign soclk = spc_bclk; | |
154 | // end scan | |
155 | ||
156 | ||
157 | ifu_ftu_cms_ctl_l1clkhdr_ctl_macro clkgen ( | |
158 | .l2clk(l2clk), | |
159 | .l1en (1'b1 ), | |
160 | .l1clk(l1clk), | |
161 | .pce_ov(pce_ov), | |
162 | .stop(stop), | |
163 | .se(se)); | |
164 | ||
165 | ||
166 | ||
167 | ||
168 | ||
169 | ||
170 | ||
171 | ||
172 | /////////////////////////////////////////////////////////// | |
173 | // Generate duplicate miss reset signal from WOB bits. // | |
174 | /////////////////////////////////////////////////////////// | |
175 | assign itb_tte_cp_c_q = itb_tte_cp_c | itb_bypass_c ; | |
176 | ||
177 | assign ftu_thrx_un_cacheable = (ftu_paddr[39] | ic_disabled_c | ~itb_tte_cp_c_q) & any_invalidation_req_c_l ; | |
178 | assign cms_ic_modified_parity[7:0] = (cmu_ic_data_parity[7:0] ^ {8{flip_parity_ff}}) ; | |
179 | ||
180 | ||
181 | ////////////////////////////////////////////////////////////////// | |
182 | // Replace_way generation. The replace way is just a shifter which | |
183 | // is shifted whenever a miss is sent to the cmu | |
184 | ////////////////////////////////////////////////////////////////// | |
185 | ||
186 | assign any_miss = ftu_agc_thr7_cmiss_c | ftu_agc_thr6_cmiss_c | ftu_agc_thr5_cmiss_c | | |
187 | ftu_agc_thr4_cmiss_c | ftu_agc_thr3_cmiss_c | ftu_agc_thr2_cmiss_c | | |
188 | ftu_agc_thr1_cmiss_c | ftu_agc_thr0_cmiss_c ; | |
189 | ||
190 | assign rep_way_inc[2] = (!ftu_rep_way[2] & ftu_rep_way[1] & ftu_rep_way[0]) | | |
191 | ( ftu_rep_way[2] & !ftu_rep_way[0]) | | |
192 | ( ftu_rep_way[2] & !ftu_rep_way[1]) ; | |
193 | assign rep_way_inc[1] = (ftu_rep_way[1] & !ftu_rep_way[0]) | | |
194 | (!ftu_rep_way[1] & ftu_rep_way[0]) ; | |
195 | assign rep_way_inc[0] = (!ftu_rep_way[0]); | |
196 | ||
197 | assign sel_miss = (any_miss & ~ifu_direct_map_ff); | |
198 | assign sel_direct_map = ifu_direct_map_ff; | |
199 | assign sel_hold = ~any_miss & ~ifu_direct_map_ff ; | |
200 | ||
201 | assign rep_way_in[2:0] = ({3{sel_miss}} & rep_way_inc[2:0] ) | | |
202 | ({3{sel_direct_map}} & agd_direct_map_rep_way[2:0] ) | | |
203 | ({3{sel_hold}} & ftu_rep_way[2:0] ) ; | |
204 | ||
205 | assign flip_parity = (cmu_l2_err[1] & ~cmu_l2_err[0] & cerer_icl2u_ff) | | |
206 | (cmu_l2_err[1] & cmu_l2_err[0] & cerer_icl2nd_ff) ; | |
207 | ||
208 | assign any_invalidation_req_f_l = ~agc_any_invalidation_req_f ; | |
209 | ifu_ftu_cms_ctl_msff_ctl_macro__width_10 rep_way_reg ( | |
210 | .scan_in(rep_way_reg_scanin), | |
211 | .scan_out(rep_way_reg_scanout), | |
212 | .l1clk( l1clk ), | |
213 | .din ({rep_way_in[2:0],flip_parity,lsu_ifu_direct_map,itc_bypass_bf,itb_bypass_f, | |
214 | any_invalidation_req_f_l,tlu_cerer_icl2u,tlu_cerer_icl2nd}), | |
215 | .dout ({ftu_rep_way[2:0],flip_parity_ff,ifu_direct_map_ff,itb_bypass_f,itb_bypass_c, | |
216 | any_invalidation_req_c_l,cerer_icl2u_ff,cerer_icl2nd_ff}), | |
217 | .siclk(siclk), | |
218 | .soclk(soclk)); | |
219 | ||
220 | assign ftu_paddr[39:37] = ftu_paddr_unq[39:37] & {3{any_invalidation_req_c_l}} ; | |
221 | ||
222 | ||
223 | ifu_ftu_cms_ctl_msff_ctl_macro__width_8 ic_enable_reg ( | |
224 | .scan_in(ic_enable_reg_scanin), | |
225 | .scan_out(ic_enable_reg_scanout), | |
226 | .l1clk( l1clk ), | |
227 | .din (lsu_ic_enable[7:0]), | |
228 | .dout (cms_icache_enable[7:0]), | |
229 | .siclk(siclk), | |
230 | .soclk(soclk)) ; | |
231 | ||
232 | ||
233 | assign ic_disabled_f = (ftp_curr_fetch_thr_f[0] & ~cms_icache_enable[0] ) | | |
234 | (ftp_curr_fetch_thr_f[1] & ~cms_icache_enable[1] ) | | |
235 | (ftp_curr_fetch_thr_f[2] & ~cms_icache_enable[2] ) | | |
236 | (ftp_curr_fetch_thr_f[3] & ~cms_icache_enable[3] ) | | |
237 | (ftp_curr_fetch_thr_f[4] & ~cms_icache_enable[4] ) | | |
238 | (ftp_curr_fetch_thr_f[5] & ~cms_icache_enable[5] ) | | |
239 | (ftp_curr_fetch_thr_f[6] & ~cms_icache_enable[6] ) | | |
240 | (ftp_curr_fetch_thr_f[7] & ~cms_icache_enable[7] ) ; | |
241 | ||
242 | ifu_ftu_cms_ctl_msff_ctl_macro__width_1 ic_disabled_reg ( | |
243 | .scan_in(ic_disabled_reg_scanin), | |
244 | .scan_out(ic_disabled_reg_scanout), | |
245 | .l1clk( l1clk ), | |
246 | .din (ic_disabled_f), | |
247 | .dout (ic_disabled_c), | |
248 | .siclk(siclk), | |
249 | .soclk(soclk)) ; | |
250 | ||
251 | ||
252 | ||
253 | ||
254 | ||
255 | ||
256 | ||
257 | assign se = tcu_scan_en ; | |
258 | /////////////////////////////////////////////////////////////////////// | |
259 | // Spare circuits // | |
260 | /////////////////////////////////////////////////////////////////////// | |
261 | ifu_ftu_cms_ctl_spare_ctl_macro__num_1 spares ( | |
262 | .scan_in(spares_scanin), | |
263 | .scan_out(spares_scanout), | |
264 | .l1clk (l1clk), | |
265 | .siclk(siclk), | |
266 | .soclk(soclk) | |
267 | ); | |
268 | ||
269 | ||
270 | ||
271 | // fixscan start: | |
272 | assign rep_way_reg_scanin = scan_in ; | |
273 | assign ic_enable_reg_scanin = rep_way_reg_scanout ; | |
274 | assign ic_disabled_reg_scanin = ic_enable_reg_scanout ; | |
275 | assign spares_scanin = ic_disabled_reg_scanout ; | |
276 | assign scan_out = spares_scanout ; | |
277 | // fixscan end: | |
278 | endmodule | |
279 | ||
280 | ||
281 | ||
282 | ||
283 | ||
284 | ||
285 | // any PARAMS parms go into naming of macro | |
286 | ||
287 | module ifu_ftu_cms_ctl_l1clkhdr_ctl_macro ( | |
288 | l2clk, | |
289 | l1en, | |
290 | pce_ov, | |
291 | stop, | |
292 | se, | |
293 | l1clk); | |
294 | ||
295 | ||
296 | input l2clk; | |
297 | input l1en; | |
298 | input pce_ov; | |
299 | input stop; | |
300 | input se; | |
301 | output l1clk; | |
302 | ||
303 | ||
304 | ||
305 | ||
306 | ||
307 | cl_sc1_l1hdr_8x c_0 ( | |
308 | ||
309 | ||
310 | .l2clk(l2clk), | |
311 | .pce(l1en), | |
312 | .l1clk(l1clk), | |
313 | .se(se), | |
314 | .pce_ov(pce_ov), | |
315 | .stop(stop) | |
316 | ); | |
317 | ||
318 | ||
319 | ||
320 | endmodule | |
321 | ||
322 | ||
323 | ||
324 | ||
325 | ||
326 | ||
327 | ||
328 | ||
329 | ||
330 | ||
331 | ||
332 | ||
333 | ||
334 | // any PARAMS parms go into naming of macro | |
335 | ||
336 | module ifu_ftu_cms_ctl_msff_ctl_macro__width_10 ( | |
337 | din, | |
338 | l1clk, | |
339 | scan_in, | |
340 | siclk, | |
341 | soclk, | |
342 | dout, | |
343 | scan_out); | |
344 | wire [9:0] fdin; | |
345 | wire [8:0] so; | |
346 | ||
347 | input [9:0] din; | |
348 | input l1clk; | |
349 | input scan_in; | |
350 | ||
351 | ||
352 | input siclk; | |
353 | input soclk; | |
354 | ||
355 | output [9:0] dout; | |
356 | output scan_out; | |
357 | assign fdin[9:0] = din[9:0]; | |
358 | ||
359 | ||
360 | ||
361 | ||
362 | ||
363 | ||
364 | dff #(10) d0_0 ( | |
365 | .l1clk(l1clk), | |
366 | .siclk(siclk), | |
367 | .soclk(soclk), | |
368 | .d(fdin[9:0]), | |
369 | .si({scan_in,so[8:0]}), | |
370 | .so({so[8:0],scan_out}), | |
371 | .q(dout[9:0]) | |
372 | ); | |
373 | ||
374 | ||
375 | ||
376 | ||
377 | ||
378 | ||
379 | ||
380 | ||
381 | ||
382 | ||
383 | ||
384 | ||
385 | endmodule | |
386 | ||
387 | ||
388 | ||
389 | ||
390 | ||
391 | ||
392 | ||
393 | ||
394 | ||
395 | ||
396 | ||
397 | ||
398 | ||
399 | // any PARAMS parms go into naming of macro | |
400 | ||
401 | module ifu_ftu_cms_ctl_msff_ctl_macro__width_8 ( | |
402 | din, | |
403 | l1clk, | |
404 | scan_in, | |
405 | siclk, | |
406 | soclk, | |
407 | dout, | |
408 | scan_out); | |
409 | wire [7:0] fdin; | |
410 | wire [6:0] so; | |
411 | ||
412 | input [7:0] din; | |
413 | input l1clk; | |
414 | input scan_in; | |
415 | ||
416 | ||
417 | input siclk; | |
418 | input soclk; | |
419 | ||
420 | output [7:0] dout; | |
421 | output scan_out; | |
422 | assign fdin[7:0] = din[7:0]; | |
423 | ||
424 | ||
425 | ||
426 | ||
427 | ||
428 | ||
429 | dff #(8) d0_0 ( | |
430 | .l1clk(l1clk), | |
431 | .siclk(siclk), | |
432 | .soclk(soclk), | |
433 | .d(fdin[7:0]), | |
434 | .si({scan_in,so[6:0]}), | |
435 | .so({so[6:0],scan_out}), | |
436 | .q(dout[7:0]) | |
437 | ); | |
438 | ||
439 | ||
440 | ||
441 | ||
442 | ||
443 | ||
444 | ||
445 | ||
446 | ||
447 | ||
448 | ||
449 | ||
450 | endmodule | |
451 | ||
452 | ||
453 | ||
454 | ||
455 | ||
456 | ||
457 | ||
458 | ||
459 | ||
460 | ||
461 | ||
462 | ||
463 | ||
464 | // any PARAMS parms go into naming of macro | |
465 | ||
466 | module ifu_ftu_cms_ctl_msff_ctl_macro__width_1 ( | |
467 | din, | |
468 | l1clk, | |
469 | scan_in, | |
470 | siclk, | |
471 | soclk, | |
472 | dout, | |
473 | scan_out); | |
474 | wire [0:0] fdin; | |
475 | ||
476 | input [0:0] din; | |
477 | input l1clk; | |
478 | input scan_in; | |
479 | ||
480 | ||
481 | input siclk; | |
482 | input soclk; | |
483 | ||
484 | output [0:0] dout; | |
485 | output scan_out; | |
486 | assign fdin[0:0] = din[0:0]; | |
487 | ||
488 | ||
489 | ||
490 | ||
491 | ||
492 | ||
493 | dff #(1) d0_0 ( | |
494 | .l1clk(l1clk), | |
495 | .siclk(siclk), | |
496 | .soclk(soclk), | |
497 | .d(fdin[0:0]), | |
498 | .si(scan_in), | |
499 | .so(scan_out), | |
500 | .q(dout[0:0]) | |
501 | ); | |
502 | ||
503 | ||
504 | ||
505 | ||
506 | ||
507 | ||
508 | ||
509 | ||
510 | ||
511 | ||
512 | ||
513 | ||
514 | endmodule | |
515 | ||
516 | ||
517 | ||
518 | ||
519 | ||
520 | ||
521 | ||
522 | ||
523 | ||
524 | // Description: Spare gate macro for control blocks | |
525 | // | |
526 | // Param num controls the number of times the macro is added | |
527 | // flops=0 can be used to use only combination spare logic | |
528 | ||
529 | ||
530 | module ifu_ftu_cms_ctl_spare_ctl_macro__num_1 ( | |
531 | l1clk, | |
532 | scan_in, | |
533 | siclk, | |
534 | soclk, | |
535 | scan_out); | |
536 | wire si_0; | |
537 | wire so_0; | |
538 | wire spare0_flop_unused; | |
539 | wire spare0_buf_32x_unused; | |
540 | wire spare0_nand3_8x_unused; | |
541 | wire spare0_inv_8x_unused; | |
542 | wire spare0_aoi22_4x_unused; | |
543 | wire spare0_buf_8x_unused; | |
544 | wire spare0_oai22_4x_unused; | |
545 | wire spare0_inv_16x_unused; | |
546 | wire spare0_nand2_16x_unused; | |
547 | wire spare0_nor3_4x_unused; | |
548 | wire spare0_nand2_8x_unused; | |
549 | wire spare0_buf_16x_unused; | |
550 | wire spare0_nor2_16x_unused; | |
551 | wire spare0_inv_32x_unused; | |
552 | ||
553 | ||
554 | input l1clk; | |
555 | input scan_in; | |
556 | input siclk; | |
557 | input soclk; | |
558 | output scan_out; | |
559 | ||
560 | cl_sc1_msff_8x spare0_flop (.l1clk(l1clk), | |
561 | .siclk(siclk), | |
562 | .soclk(soclk), | |
563 | .si(si_0), | |
564 | .so(so_0), | |
565 | .d(1'b0), | |
566 | .q(spare0_flop_unused)); | |
567 | assign si_0 = scan_in; | |
568 | ||
569 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
570 | .out(spare0_buf_32x_unused)); | |
571 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
572 | .in1(1'b1), | |
573 | .in2(1'b1), | |
574 | .out(spare0_nand3_8x_unused)); | |
575 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
576 | .out(spare0_inv_8x_unused)); | |
577 | cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1), | |
578 | .in01(1'b1), | |
579 | .in10(1'b1), | |
580 | .in11(1'b1), | |
581 | .out(spare0_aoi22_4x_unused)); | |
582 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
583 | .out(spare0_buf_8x_unused)); | |
584 | cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1), | |
585 | .in01(1'b1), | |
586 | .in10(1'b1), | |
587 | .in11(1'b1), | |
588 | .out(spare0_oai22_4x_unused)); | |
589 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
590 | .out(spare0_inv_16x_unused)); | |
591 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
592 | .in1(1'b1), | |
593 | .out(spare0_nand2_16x_unused)); | |
594 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
595 | .in1(1'b0), | |
596 | .in2(1'b0), | |
597 | .out(spare0_nor3_4x_unused)); | |
598 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
599 | .in1(1'b1), | |
600 | .out(spare0_nand2_8x_unused)); | |
601 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
602 | .out(spare0_buf_16x_unused)); | |
603 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
604 | .in1(1'b0), | |
605 | .out(spare0_nor2_16x_unused)); | |
606 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
607 | .out(spare0_inv_32x_unused)); | |
608 | assign scan_out = so_0; | |
609 | ||
610 | ||
611 | ||
612 | endmodule | |
613 |