Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: lsu_arc_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 lsu_arc_ctl ( | |
36 | l2clk, | |
37 | scan_in, | |
38 | tcu_pce_ov, | |
39 | tcu_scan_en, | |
40 | spc_aclk, | |
41 | spc_bclk, | |
42 | scan_out, | |
43 | ard_retl_ctl_1f, | |
44 | ard_retl_vld_1f, | |
45 | ard_retl_rd_1f, | |
46 | ard_retl_tid_1f, | |
47 | ard_retl_ack_1f, | |
48 | ard_retl_exc_1f, | |
49 | ard_retf_ctl_1f, | |
50 | ard_retf_vld_1f, | |
51 | ard_retf_rd_1f, | |
52 | ard_retf_tid_1f, | |
53 | ard_retf_ack_1f, | |
54 | ard_retf_exc_1f, | |
55 | lsu_asi_clken, | |
56 | tlu_rngf_cdbus_error, | |
57 | arc_retl_vld_2f, | |
58 | arc_retf_vld_2f, | |
59 | arc_sel_fast, | |
60 | arc_pid_ctl_2f, | |
61 | lsu_priv_action_g, | |
62 | lsu_tid_g); | |
63 | wire se; | |
64 | wire pce_ov; | |
65 | wire stop; | |
66 | wire siclk; | |
67 | wire soclk; | |
68 | wire l1clk_pm1; | |
69 | wire arcl_retl_vld_1; | |
70 | wire [1:0] arcl_retl_exc_1; | |
71 | wire rngl_stg2_reg_scanin; | |
72 | wire rngl_stg2_reg_scanout; | |
73 | wire [1:0] arcl_retl_exc_2f; | |
74 | wire arcl_retl_rd_2f; | |
75 | wire [2:0] arcl_retl_tid_2f; | |
76 | wire [6:0] arcl_pidl_ctl_2; | |
77 | wire clr_local; | |
78 | wire [6:0] arcl_pidl_ctl_3f; | |
79 | wire rngl_stg3_reg_scanin; | |
80 | wire rngl_stg3_reg_scanout; | |
81 | wire arcl_retf_vld_1; | |
82 | wire [1:0] arcl_retf_exc_1; | |
83 | wire rngf_stg2_reg_scanin; | |
84 | wire rngf_stg2_reg_scanout; | |
85 | wire [1:0] arcl_retf_exc_2f; | |
86 | wire arcl_retf_rd_2f; | |
87 | wire [2:0] arcl_retf_tid_2f; | |
88 | wire rngf_error_2f; | |
89 | wire [6:0] arcl_pidf_ctl_2; | |
90 | wire clr_fast; | |
91 | wire [6:0] arcl_pidf_ctl_3f; | |
92 | wire rngf_stg3_reg_scanin; | |
93 | wire rngf_stg3_reg_scanout; | |
94 | wire arc_sel_fast_2f; | |
95 | wire spares_scanin; | |
96 | wire spares_scanout; | |
97 | ||
98 | ||
99 | // globals | |
100 | input l2clk; | |
101 | input scan_in; | |
102 | input tcu_pce_ov; // scan signals | |
103 | input tcu_scan_en; | |
104 | input spc_aclk; | |
105 | input spc_bclk; | |
106 | output scan_out; | |
107 | ||
108 | input ard_retl_ctl_1f; // Control/Data bit from returning ring | |
109 | input ard_retl_vld_1f; // Valid/hold bit on returning ring | |
110 | input ard_retl_rd_1f; // rd/wrx bit on returning ring | |
111 | input [2:0] ard_retl_tid_1f; // Thread id on returning ring | |
112 | input ard_retl_ack_1f; // Ack bit returning on ring | |
113 | input [1:0] ard_retl_exc_1f; // Exception status returning on ring | |
114 | ||
115 | input ard_retf_ctl_1f; // Control/Data bit from returning ring | |
116 | input ard_retf_vld_1f; // Valid/hold bit on returning ring | |
117 | input ard_retf_rd_1f; // rd/wrx bit on returning ring | |
118 | input [2:0] ard_retf_tid_1f; // Thread id on returning ring | |
119 | input ard_retf_ack_1f; // Ack bit returning on ring | |
120 | input [1:0] ard_retf_exc_1f; // Exception status returning on ring | |
121 | ||
122 | input lsu_asi_clken; | |
123 | ||
124 | input tlu_rngf_cdbus_error; | |
125 | ||
126 | output arc_retl_vld_2f; // Valid data returned on the ring | |
127 | output arc_retf_vld_2f; // Valid data returned on the ring | |
128 | output arc_sel_fast; // select fast ring data | |
129 | ||
130 | output [6:0] arc_pid_ctl_2f; | |
131 | ||
132 | output lsu_priv_action_g; | |
133 | output [2:0] lsu_tid_g; | |
134 | ||
135 | // scan renames | |
136 | assign se = tcu_scan_en; | |
137 | assign pce_ov = tcu_pce_ov; | |
138 | assign stop = 1'b0; | |
139 | assign siclk = spc_aclk; | |
140 | assign soclk = spc_bclk; | |
141 | // end scan | |
142 | ||
143 | //////////////////////////////////////////////////////// | |
144 | lsu_arc_ctl_l1clkhdr_ctl_macro clkgen | |
145 | ( | |
146 | .l2clk(l2clk), | |
147 | .l1en (lsu_asi_clken ), | |
148 | .l1clk(l1clk_pm1), | |
149 | .pce_ov(pce_ov), | |
150 | .stop(stop), | |
151 | .se(se)); | |
152 | //////////////////////////////////////////////////////// | |
153 | ||
154 | ||
155 | ||
156 | //////////////////////////////////////////////////////////// | |
157 | // Return data coming from the ring. | |
158 | // This comes over two cycles. Combine | |
159 | // into a single packet before returning. | |
160 | ||
161 | // local ring | |
162 | ||
163 | assign arcl_retl_vld_1 = ard_retl_ctl_1f & ard_retl_vld_1f; | |
164 | ||
165 | // clear exceptions if no ack bit | |
166 | assign arcl_retl_exc_1[1:0] = {ard_retl_ack_1f & ard_retl_exc_1f[1], | |
167 | ard_retl_ack_1f & ard_retl_exc_1f[0]}; | |
168 | ||
169 | ||
170 | // Another staging register for the control bits. | |
171 | lsu_arc_ctl_msff_ctl_macro__width_7 rngl_stg2_reg | |
172 | ( | |
173 | .scan_in(rngl_stg2_reg_scanin), | |
174 | .scan_out(rngl_stg2_reg_scanout), | |
175 | .l1clk(l1clk_pm1), | |
176 | .din ({arcl_retl_vld_1,arcl_retl_exc_1[1:0],ard_retl_rd_1f,ard_retl_tid_1f[2:0]}), | |
177 | .dout ({arc_retl_vld_2f,arcl_retl_exc_2f[1:0],arcl_retl_rd_2f,arcl_retl_tid_2f[2:0]}), | |
178 | .siclk(siclk), | |
179 | .soclk(soclk) | |
180 | ); | |
181 | ||
182 | // stage the control bits for 1 more cycle to align it with output register | |
183 | // which holds data being returned to pid | |
184 | // This is the output register and is loaded only when valid | |
185 | // control is set in stage2. This can happen at the most every | |
186 | // other cycle. | |
187 | assign arcl_pidl_ctl_2[6:0] = ({7 { arc_retl_vld_2f}} & {arc_retl_vld_2f,arcl_retl_exc_2f[1:0],arcl_retl_rd_2f,arcl_retl_tid_2f[2:0]}) | | |
188 | ({7 {~arc_retl_vld_2f & ~clr_local}} & arcl_pidl_ctl_3f[6:0]); | |
189 | ||
190 | lsu_arc_ctl_msff_ctl_macro__width_7 rngl_stg3_reg | |
191 | ( | |
192 | .scan_in(rngl_stg3_reg_scanin), | |
193 | .scan_out(rngl_stg3_reg_scanout), | |
194 | .l1clk(l1clk_pm1), | |
195 | .din (arcl_pidl_ctl_2[6:0]), | |
196 | .dout(arcl_pidl_ctl_3f[6:0]), | |
197 | .siclk(siclk), | |
198 | .soclk(soclk) | |
199 | ); | |
200 | ||
201 | // Fast ring | |
202 | assign arcl_retf_vld_1 = ard_retf_ctl_1f & ard_retf_vld_1f; | |
203 | // clear exceptions if no ack bit | |
204 | assign arcl_retf_exc_1[1:0] = {ard_retf_ack_1f & ard_retf_exc_1f[1], | |
205 | ard_retf_ack_1f & ard_retf_exc_1f[0]}; | |
206 | ||
207 | ||
208 | // Another staging register for the control bits. | |
209 | lsu_arc_ctl_msff_ctl_macro__width_8 rngf_stg2_reg | |
210 | ( | |
211 | .scan_in(rngf_stg2_reg_scanin), | |
212 | .scan_out(rngf_stg2_reg_scanout), | |
213 | .l1clk(l1clk_pm1), | |
214 | .din ({arcl_retf_vld_1,arcl_retf_exc_1[1:0],ard_retf_rd_1f,ard_retf_tid_1f[2:0],tlu_rngf_cdbus_error}), | |
215 | .dout ({arc_retf_vld_2f,arcl_retf_exc_2f[1:0],arcl_retf_rd_2f,arcl_retf_tid_2f[2:0],rngf_error_2f}), | |
216 | .siclk(siclk), | |
217 | .soclk(soclk) | |
218 | ); | |
219 | ||
220 | // stage the control bits for 1 more cycle to align it with | |
221 | // data being returned to pid. | |
222 | // This is the output register and is loaded only when valid | |
223 | // control is set in stage2. This can happen at the most every | |
224 | // other cycle. | |
225 | // Set Fast bit (bit 4) | |
226 | ||
227 | assign arcl_pidf_ctl_2[6:0] = | |
228 | ({7 { arc_retf_vld_2f}} & {arc_retf_vld_2f,arcl_retf_exc_2f[1],(arcl_retf_exc_2f[0] | rngf_error_2f), | |
229 | arcl_retf_rd_2f,arcl_retf_tid_2f[2:0]}) | | |
230 | ({7 {~arc_retf_vld_2f & !clr_fast}} & arcl_pidf_ctl_3f[6:0]); | |
231 | ||
232 | lsu_arc_ctl_msff_ctl_macro__width_7 rngf_stg3_reg | |
233 | ( | |
234 | .scan_in(rngf_stg3_reg_scanin), | |
235 | .scan_out(rngf_stg3_reg_scanout), | |
236 | .l1clk(l1clk_pm1), | |
237 | .din (arcl_pidf_ctl_2[6:0]), | |
238 | .dout(arcl_pidf_ctl_3f[6:0]), | |
239 | .siclk(siclk), | |
240 | .soclk(soclk) | |
241 | ); | |
242 | ||
243 | // mux between the two output registers (fast and local). Give priority to the fast register. | |
244 | // Once valid pkt is sent to pid, clear the corresponding output register. | |
245 | // sel_fast if fast packet is valid (bit 7) | |
246 | ||
247 | assign arc_sel_fast_2f = arcl_pidf_ctl_2[6]; | |
248 | assign arc_pid_ctl_2f[6:0] = arc_sel_fast_2f ? arcl_pidf_ctl_2[6:0]: arcl_pidl_ctl_2[6:0]; | |
249 | ||
250 | assign arc_sel_fast = arcl_pidf_ctl_3f[6]; | |
251 | assign clr_fast = arc_sel_fast; | |
252 | assign clr_local = !arc_sel_fast & arcl_pidl_ctl_3f[6]; | |
253 | ||
254 | assign lsu_priv_action_g = arc_pid_ctl_2f[6] & arc_pid_ctl_2f[5] & ~arc_pid_ctl_2f[4]; | |
255 | assign lsu_tid_g[2:0] = arc_pid_ctl_2f[2:0]; | |
256 | ||
257 | lsu_arc_ctl_spare_ctl_macro spares ( | |
258 | .scan_in(spares_scanin), | |
259 | .scan_out(spares_scanout), | |
260 | .l1clk (l1clk_pm1), | |
261 | .siclk(siclk), | |
262 | .soclk(soclk) | |
263 | ); | |
264 | ||
265 | supply0 vss; | |
266 | supply1 vdd; | |
267 | // fixscan start: | |
268 | assign rngl_stg2_reg_scanin = scan_in ; | |
269 | assign rngl_stg3_reg_scanin = rngl_stg2_reg_scanout ; | |
270 | assign rngf_stg2_reg_scanin = rngl_stg3_reg_scanout ; | |
271 | assign rngf_stg3_reg_scanin = rngf_stg2_reg_scanout ; | |
272 | assign spares_scanin = rngf_stg3_reg_scanout ; | |
273 | assign scan_out = spares_scanout ; | |
274 | // fixscan end: | |
275 | endmodule | |
276 | ||
277 | ||
278 | ||
279 | ||
280 | ||
281 | ||
282 | ||
283 | // any PARAMS parms go into naming of macro | |
284 | ||
285 | module lsu_arc_ctl_l1clkhdr_ctl_macro ( | |
286 | l2clk, | |
287 | l1en, | |
288 | pce_ov, | |
289 | stop, | |
290 | se, | |
291 | l1clk); | |
292 | ||
293 | ||
294 | input l2clk; | |
295 | input l1en; | |
296 | input pce_ov; | |
297 | input stop; | |
298 | input se; | |
299 | output l1clk; | |
300 | ||
301 | ||
302 | ||
303 | ||
304 | ||
305 | cl_sc1_l1hdr_8x c_0 ( | |
306 | ||
307 | ||
308 | .l2clk(l2clk), | |
309 | .pce(l1en), | |
310 | .l1clk(l1clk), | |
311 | .se(se), | |
312 | .pce_ov(pce_ov), | |
313 | .stop(stop) | |
314 | ); | |
315 | ||
316 | ||
317 | ||
318 | endmodule | |
319 | ||
320 | ||
321 | ||
322 | ||
323 | ||
324 | ||
325 | ||
326 | ||
327 | ||
328 | ||
329 | ||
330 | ||
331 | ||
332 | // any PARAMS parms go into naming of macro | |
333 | ||
334 | module lsu_arc_ctl_msff_ctl_macro__width_7 ( | |
335 | din, | |
336 | l1clk, | |
337 | scan_in, | |
338 | siclk, | |
339 | soclk, | |
340 | dout, | |
341 | scan_out); | |
342 | wire [6:0] fdin; | |
343 | wire [5:0] so; | |
344 | ||
345 | input [6:0] din; | |
346 | input l1clk; | |
347 | input scan_in; | |
348 | ||
349 | ||
350 | input siclk; | |
351 | input soclk; | |
352 | ||
353 | output [6:0] dout; | |
354 | output scan_out; | |
355 | assign fdin[6:0] = din[6:0]; | |
356 | ||
357 | ||
358 | ||
359 | ||
360 | ||
361 | ||
362 | dff #(7) d0_0 ( | |
363 | .l1clk(l1clk), | |
364 | .siclk(siclk), | |
365 | .soclk(soclk), | |
366 | .d(fdin[6:0]), | |
367 | .si({scan_in,so[5:0]}), | |
368 | .so({so[5:0],scan_out}), | |
369 | .q(dout[6:0]) | |
370 | ); | |
371 | ||
372 | ||
373 | ||
374 | ||
375 | ||
376 | ||
377 | ||
378 | ||
379 | ||
380 | ||
381 | ||
382 | ||
383 | endmodule | |
384 | ||
385 | ||
386 | ||
387 | ||
388 | ||
389 | ||
390 | ||
391 | ||
392 | ||
393 | ||
394 | ||
395 | ||
396 | ||
397 | // any PARAMS parms go into naming of macro | |
398 | ||
399 | module lsu_arc_ctl_msff_ctl_macro__width_8 ( | |
400 | din, | |
401 | l1clk, | |
402 | scan_in, | |
403 | siclk, | |
404 | soclk, | |
405 | dout, | |
406 | scan_out); | |
407 | wire [7:0] fdin; | |
408 | wire [6:0] so; | |
409 | ||
410 | input [7:0] din; | |
411 | input l1clk; | |
412 | input scan_in; | |
413 | ||
414 | ||
415 | input siclk; | |
416 | input soclk; | |
417 | ||
418 | output [7:0] dout; | |
419 | output scan_out; | |
420 | assign fdin[7:0] = din[7:0]; | |
421 | ||
422 | ||
423 | ||
424 | ||
425 | ||
426 | ||
427 | dff #(8) d0_0 ( | |
428 | .l1clk(l1clk), | |
429 | .siclk(siclk), | |
430 | .soclk(soclk), | |
431 | .d(fdin[7:0]), | |
432 | .si({scan_in,so[6:0]}), | |
433 | .so({so[6:0],scan_out}), | |
434 | .q(dout[7:0]) | |
435 | ); | |
436 | ||
437 | ||
438 | ||
439 | ||
440 | ||
441 | ||
442 | ||
443 | ||
444 | ||
445 | ||
446 | ||
447 | ||
448 | endmodule | |
449 | ||
450 | ||
451 | ||
452 | ||
453 | ||
454 | ||
455 | ||
456 | ||
457 | ||
458 | // Description: Spare gate macro for control blocks | |
459 | // | |
460 | // Param num controls the number of times the macro is added | |
461 | // flops=0 can be used to use only combination spare logic | |
462 | ||
463 | ||
464 | module lsu_arc_ctl_spare_ctl_macro ( | |
465 | l1clk, | |
466 | scan_in, | |
467 | siclk, | |
468 | soclk, | |
469 | scan_out); | |
470 | wire si_0; | |
471 | wire so_0; | |
472 | wire spare0_flop_unused; | |
473 | wire spare0_buf_32x_unused; | |
474 | wire spare0_nand3_8x_unused; | |
475 | wire spare0_inv_8x_unused; | |
476 | wire spare0_aoi22_4x_unused; | |
477 | wire spare0_buf_8x_unused; | |
478 | wire spare0_oai22_4x_unused; | |
479 | wire spare0_inv_16x_unused; | |
480 | wire spare0_nand2_16x_unused; | |
481 | wire spare0_nor3_4x_unused; | |
482 | wire spare0_nand2_8x_unused; | |
483 | wire spare0_buf_16x_unused; | |
484 | wire spare0_nor2_16x_unused; | |
485 | wire spare0_inv_32x_unused; | |
486 | ||
487 | ||
488 | input l1clk; | |
489 | input scan_in; | |
490 | input siclk; | |
491 | input soclk; | |
492 | output scan_out; | |
493 | ||
494 | cl_sc1_msff_8x spare0_flop (.l1clk(l1clk), | |
495 | .siclk(siclk), | |
496 | .soclk(soclk), | |
497 | .si(si_0), | |
498 | .so(so_0), | |
499 | .d(1'b0), | |
500 | .q(spare0_flop_unused)); | |
501 | assign si_0 = scan_in; | |
502 | ||
503 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
504 | .out(spare0_buf_32x_unused)); | |
505 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
506 | .in1(1'b1), | |
507 | .in2(1'b1), | |
508 | .out(spare0_nand3_8x_unused)); | |
509 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
510 | .out(spare0_inv_8x_unused)); | |
511 | cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1), | |
512 | .in01(1'b1), | |
513 | .in10(1'b1), | |
514 | .in11(1'b1), | |
515 | .out(spare0_aoi22_4x_unused)); | |
516 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
517 | .out(spare0_buf_8x_unused)); | |
518 | cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1), | |
519 | .in01(1'b1), | |
520 | .in10(1'b1), | |
521 | .in11(1'b1), | |
522 | .out(spare0_oai22_4x_unused)); | |
523 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
524 | .out(spare0_inv_16x_unused)); | |
525 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
526 | .in1(1'b1), | |
527 | .out(spare0_nand2_16x_unused)); | |
528 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
529 | .in1(1'b0), | |
530 | .in2(1'b0), | |
531 | .out(spare0_nor3_4x_unused)); | |
532 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
533 | .in1(1'b1), | |
534 | .out(spare0_nand2_8x_unused)); | |
535 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
536 | .out(spare0_buf_16x_unused)); | |
537 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
538 | .in1(1'b0), | |
539 | .out(spare0_nor2_16x_unused)); | |
540 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
541 | .out(spare0_inv_32x_unused)); | |
542 | assign scan_out = so_0; | |
543 | ||
544 | ||
545 | ||
546 | endmodule | |
547 |