Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: mcu_errq_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 mcu_errq_ctl ( | |
36 | errq_dout, | |
37 | errq_full, | |
38 | errq_empty, | |
39 | errq_enq, | |
40 | errq_deq, | |
41 | errq_din, | |
42 | l1clk, | |
43 | scan_in, | |
44 | scan_out, | |
45 | tcu_aclk, | |
46 | tcu_bclk, | |
47 | tcu_scan_en); | |
48 | wire siclk; | |
49 | wire soclk; | |
50 | wire se; | |
51 | wire [5:0] wptr_in; | |
52 | wire [5:0] wptr; | |
53 | wire ff_wptr_scanin; | |
54 | wire ff_wptr_scanout; | |
55 | wire [5:0] rptr_in; | |
56 | wire [5:0] rptr; | |
57 | wire ff_rptr_scanin; | |
58 | wire ff_rptr_scanout; | |
59 | wire ent0_en; | |
60 | wire ff_ent0_scanin; | |
61 | wire ff_ent0_scanout; | |
62 | wire [14:0] ent0; | |
63 | wire ent1_en; | |
64 | wire ff_ent1_scanin; | |
65 | wire ff_ent1_scanout; | |
66 | wire [14:0] ent1; | |
67 | wire ent2_en; | |
68 | wire ff_ent2_scanin; | |
69 | wire ff_ent2_scanout; | |
70 | wire [14:0] ent2; | |
71 | wire ent3_en; | |
72 | wire ff_ent3_scanin; | |
73 | wire ff_ent3_scanout; | |
74 | wire [14:0] ent3; | |
75 | wire ent4_en; | |
76 | wire ff_ent4_scanin; | |
77 | wire ff_ent4_scanout; | |
78 | wire [14:0] ent4; | |
79 | wire ent5_en; | |
80 | wire ff_ent5_scanin; | |
81 | wire ff_ent5_scanout; | |
82 | wire [14:0] ent5; | |
83 | wire ent6_en; | |
84 | wire ff_ent6_scanin; | |
85 | wire ff_ent6_scanout; | |
86 | wire [14:0] ent6; | |
87 | wire ent7_en; | |
88 | wire ff_ent7_scanin; | |
89 | wire ff_ent7_scanout; | |
90 | wire [14:0] ent7; | |
91 | wire ent8_en; | |
92 | wire ff_ent8_scanin; | |
93 | wire ff_ent8_scanout; | |
94 | wire [14:0] ent8; | |
95 | wire ent9_en; | |
96 | wire ff_ent9_scanin; | |
97 | wire ff_ent9_scanout; | |
98 | wire [14:0] ent9; | |
99 | wire ent10_en; | |
100 | wire ff_ent10_scanin; | |
101 | wire ff_ent10_scanout; | |
102 | wire [14:0] ent10; | |
103 | wire ent11_en; | |
104 | wire ff_ent11_scanin; | |
105 | wire ff_ent11_scanout; | |
106 | wire [14:0] ent11; | |
107 | wire ent12_en; | |
108 | wire ff_ent12_scanin; | |
109 | wire ff_ent12_scanout; | |
110 | wire [14:0] ent12; | |
111 | wire ent13_en; | |
112 | wire ff_ent13_scanin; | |
113 | wire ff_ent13_scanout; | |
114 | wire [14:0] ent13; | |
115 | wire ent14_en; | |
116 | wire ff_ent14_scanin; | |
117 | wire ff_ent14_scanout; | |
118 | wire [14:0] ent14; | |
119 | wire ent15_en; | |
120 | wire ff_ent15_scanin; | |
121 | wire ff_ent15_scanout; | |
122 | wire [14:0] ent15; | |
123 | wire ent16_en; | |
124 | wire ff_ent16_scanin; | |
125 | wire ff_ent16_scanout; | |
126 | wire [14:0] ent16; | |
127 | ||
128 | ||
129 | output [14:0] errq_dout; | |
130 | output errq_full; | |
131 | output errq_empty; | |
132 | ||
133 | input errq_enq; | |
134 | input errq_deq; | |
135 | input [14:0] errq_din; | |
136 | ||
137 | input l1clk; | |
138 | input scan_in; | |
139 | output scan_out; | |
140 | input tcu_aclk; | |
141 | input tcu_bclk; | |
142 | input tcu_scan_en; | |
143 | ||
144 | // Code | |
145 | assign siclk = tcu_aclk; | |
146 | assign soclk = tcu_bclk; | |
147 | assign se = tcu_scan_en; | |
148 | ||
149 | // 0in fifo -enq errq_enq -deq errq_deq -depth 17 -enq_data errq_din[14:0] -deq_data errq_dout[14:0] | |
150 | // 0in custom -fire (wptr[4:0] > 5'h10) | |
151 | // 0in custom -fire (rptr[4:0] > 5'h10) | |
152 | ||
153 | assign wptr_in[5:0] = (wptr[4:0] == 5'h10) ? {~wptr[5], 5'h0} : {wptr[5], wptr[4:0] + 5'h1}; | |
154 | mcu_errq_ctl_msff_ctl_macro__en_1__width_6 ff_wptr ( | |
155 | .scan_in(ff_wptr_scanin), | |
156 | .scan_out(ff_wptr_scanout), | |
157 | .din(wptr_in[5:0]), | |
158 | .dout(wptr[5:0]), | |
159 | .en(errq_enq), | |
160 | .l1clk(l1clk), | |
161 | .siclk(siclk), | |
162 | .soclk(soclk)); | |
163 | ||
164 | assign rptr_in[5:0] = (rptr[4:0] == 5'h10) ? {~rptr[5], 5'h0} : {rptr[5], rptr[4:0] + 5'h1}; | |
165 | mcu_errq_ctl_msff_ctl_macro__en_1__width_6 ff_rptr ( | |
166 | .scan_in(ff_rptr_scanin), | |
167 | .scan_out(ff_rptr_scanout), | |
168 | .din(rptr_in[5:0]), | |
169 | .dout(rptr[5:0]), | |
170 | .en(errq_deq), | |
171 | .l1clk(l1clk), | |
172 | .siclk(siclk), | |
173 | .soclk(soclk)); | |
174 | ||
175 | assign errq_full = rptr[5:0] == {~wptr[5],wptr[4:0]}; | |
176 | assign errq_empty = rptr[5:0] == wptr[5:0]; | |
177 | ||
178 | assign ent0_en = (wptr[4:0] == 5'd0) & errq_enq; | |
179 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent0 ( | |
180 | .scan_in(ff_ent0_scanin), | |
181 | .scan_out(ff_ent0_scanout), | |
182 | .din(errq_din[14:0]), | |
183 | .dout(ent0[14:0]), | |
184 | .en(ent0_en), | |
185 | .l1clk(l1clk), | |
186 | .siclk(siclk), | |
187 | .soclk(soclk)); | |
188 | ||
189 | assign ent1_en = (wptr[4:0] == 5'd1) & errq_enq; | |
190 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent1 ( | |
191 | .scan_in(ff_ent1_scanin), | |
192 | .scan_out(ff_ent1_scanout), | |
193 | .din(errq_din[14:0]), | |
194 | .dout(ent1[14:0]), | |
195 | .en(ent1_en), | |
196 | .l1clk(l1clk), | |
197 | .siclk(siclk), | |
198 | .soclk(soclk)); | |
199 | ||
200 | assign ent2_en = (wptr[4:0] == 5'd2) & errq_enq; | |
201 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent2 ( | |
202 | .scan_in(ff_ent2_scanin), | |
203 | .scan_out(ff_ent2_scanout), | |
204 | .din(errq_din[14:0]), | |
205 | .dout(ent2[14:0]), | |
206 | .en(ent2_en), | |
207 | .l1clk(l1clk), | |
208 | .siclk(siclk), | |
209 | .soclk(soclk)); | |
210 | ||
211 | assign ent3_en = (wptr[4:0] == 5'd3) & errq_enq; | |
212 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent3 ( | |
213 | .scan_in(ff_ent3_scanin), | |
214 | .scan_out(ff_ent3_scanout), | |
215 | .din(errq_din[14:0]), | |
216 | .dout(ent3[14:0]), | |
217 | .en(ent3_en), | |
218 | .l1clk(l1clk), | |
219 | .siclk(siclk), | |
220 | .soclk(soclk)); | |
221 | ||
222 | assign ent4_en = (wptr[4:0] == 5'd4) & errq_enq; | |
223 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent4 ( | |
224 | .scan_in(ff_ent4_scanin), | |
225 | .scan_out(ff_ent4_scanout), | |
226 | .din(errq_din[14:0]), | |
227 | .dout(ent4[14:0]), | |
228 | .en(ent4_en), | |
229 | .l1clk(l1clk), | |
230 | .siclk(siclk), | |
231 | .soclk(soclk)); | |
232 | ||
233 | assign ent5_en = (wptr[4:0] == 5'd5) & errq_enq; | |
234 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent5 ( | |
235 | .scan_in(ff_ent5_scanin), | |
236 | .scan_out(ff_ent5_scanout), | |
237 | .din(errq_din[14:0]), | |
238 | .dout(ent5[14:0]), | |
239 | .en(ent5_en), | |
240 | .l1clk(l1clk), | |
241 | .siclk(siclk), | |
242 | .soclk(soclk)); | |
243 | ||
244 | assign ent6_en = (wptr[4:0] == 5'd6) & errq_enq; | |
245 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent6 ( | |
246 | .scan_in(ff_ent6_scanin), | |
247 | .scan_out(ff_ent6_scanout), | |
248 | .din(errq_din[14:0]), | |
249 | .dout(ent6[14:0]), | |
250 | .en(ent6_en), | |
251 | .l1clk(l1clk), | |
252 | .siclk(siclk), | |
253 | .soclk(soclk)); | |
254 | ||
255 | assign ent7_en = (wptr[4:0] == 5'd7) & errq_enq; | |
256 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent7 ( | |
257 | .scan_in(ff_ent7_scanin), | |
258 | .scan_out(ff_ent7_scanout), | |
259 | .din(errq_din[14:0]), | |
260 | .dout(ent7[14:0]), | |
261 | .en(ent7_en), | |
262 | .l1clk(l1clk), | |
263 | .siclk(siclk), | |
264 | .soclk(soclk)); | |
265 | ||
266 | assign ent8_en = (wptr[4:0] == 5'd8) & errq_enq; | |
267 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent8 ( | |
268 | .scan_in(ff_ent8_scanin), | |
269 | .scan_out(ff_ent8_scanout), | |
270 | .din(errq_din[14:0]), | |
271 | .dout(ent8[14:0]), | |
272 | .en(ent8_en), | |
273 | .l1clk(l1clk), | |
274 | .siclk(siclk), | |
275 | .soclk(soclk)); | |
276 | ||
277 | assign ent9_en = (wptr[4:0] == 5'd9) & errq_enq; | |
278 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent9 ( | |
279 | .scan_in(ff_ent9_scanin), | |
280 | .scan_out(ff_ent9_scanout), | |
281 | .din(errq_din[14:0]), | |
282 | .dout(ent9[14:0]), | |
283 | .en(ent9_en), | |
284 | .l1clk(l1clk), | |
285 | .siclk(siclk), | |
286 | .soclk(soclk)); | |
287 | ||
288 | assign ent10_en = (wptr[4:0] == 5'd10) & errq_enq; | |
289 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent10 ( | |
290 | .scan_in(ff_ent10_scanin), | |
291 | .scan_out(ff_ent10_scanout), | |
292 | .din(errq_din[14:0]), | |
293 | .dout(ent10[14:0]), | |
294 | .en(ent10_en), | |
295 | .l1clk(l1clk), | |
296 | .siclk(siclk), | |
297 | .soclk(soclk)); | |
298 | ||
299 | assign ent11_en = (wptr[4:0] == 5'd11) & errq_enq; | |
300 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent11 ( | |
301 | .scan_in(ff_ent11_scanin), | |
302 | .scan_out(ff_ent11_scanout), | |
303 | .din(errq_din[14:0]), | |
304 | .dout(ent11[14:0]), | |
305 | .en(ent11_en), | |
306 | .l1clk(l1clk), | |
307 | .siclk(siclk), | |
308 | .soclk(soclk)); | |
309 | ||
310 | assign ent12_en = (wptr[4:0] == 5'd12) & errq_enq; | |
311 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent12 ( | |
312 | .scan_in(ff_ent12_scanin), | |
313 | .scan_out(ff_ent12_scanout), | |
314 | .din(errq_din[14:0]), | |
315 | .dout(ent12[14:0]), | |
316 | .en(ent12_en), | |
317 | .l1clk(l1clk), | |
318 | .siclk(siclk), | |
319 | .soclk(soclk)); | |
320 | ||
321 | assign ent13_en = (wptr[4:0] == 5'd13) & errq_enq; | |
322 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent13 ( | |
323 | .scan_in(ff_ent13_scanin), | |
324 | .scan_out(ff_ent13_scanout), | |
325 | .din(errq_din[14:0]), | |
326 | .dout(ent13[14:0]), | |
327 | .en(ent13_en), | |
328 | .l1clk(l1clk), | |
329 | .siclk(siclk), | |
330 | .soclk(soclk)); | |
331 | ||
332 | assign ent14_en = (wptr[4:0] == 5'd14) & errq_enq; | |
333 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent14 ( | |
334 | .scan_in(ff_ent14_scanin), | |
335 | .scan_out(ff_ent14_scanout), | |
336 | .din(errq_din[14:0]), | |
337 | .dout(ent14[14:0]), | |
338 | .en(ent14_en), | |
339 | .l1clk(l1clk), | |
340 | .siclk(siclk), | |
341 | .soclk(soclk)); | |
342 | ||
343 | assign ent15_en = (wptr[4:0] == 5'd15) & errq_enq; | |
344 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent15 ( | |
345 | .scan_in(ff_ent15_scanin), | |
346 | .scan_out(ff_ent15_scanout), | |
347 | .din(errq_din[14:0]), | |
348 | .dout(ent15[14:0]), | |
349 | .en(ent15_en), | |
350 | .l1clk(l1clk), | |
351 | .siclk(siclk), | |
352 | .soclk(soclk)); | |
353 | ||
354 | assign ent16_en = (wptr[4:0] == 5'd16) & errq_enq; | |
355 | mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ff_ent16 ( | |
356 | .scan_in(ff_ent16_scanin), | |
357 | .scan_out(ff_ent16_scanout), | |
358 | .din(errq_din[14:0]), | |
359 | .dout(ent16[14:0]), | |
360 | .en(ent16_en), | |
361 | .l1clk(l1clk), | |
362 | .siclk(siclk), | |
363 | .soclk(soclk)); | |
364 | ||
365 | // FIFO output selection | |
366 | assign errq_dout[14:0] = | |
367 | {15{rptr[4:0] == 5'd0}} & ent0[14:0] | | |
368 | {15{rptr[4:0] == 5'd1}} & ent1[14:0] | | |
369 | {15{rptr[4:0] == 5'd2}} & ent2[14:0] | | |
370 | {15{rptr[4:0] == 5'd3}} & ent3[14:0] | | |
371 | {15{rptr[4:0] == 5'd4}} & ent4[14:0] | | |
372 | {15{rptr[4:0] == 5'd5}} & ent5[14:0] | | |
373 | {15{rptr[4:0] == 5'd6}} & ent6[14:0] | | |
374 | {15{rptr[4:0] == 5'd7}} & ent7[14:0] | | |
375 | {15{rptr[4:0] == 5'd8}} & ent8[14:0] | | |
376 | {15{rptr[4:0] == 5'd9}} & ent9[14:0] | | |
377 | {15{rptr[4:0] == 5'd10}} & ent10[14:0] | | |
378 | {15{rptr[4:0] == 5'd11}} & ent11[14:0] | | |
379 | {15{rptr[4:0] == 5'd12}} & ent12[14:0] | | |
380 | {15{rptr[4:0] == 5'd13}} & ent13[14:0] | | |
381 | {15{rptr[4:0] == 5'd14}} & ent14[14:0] | | |
382 | {15{rptr[4:0] == 5'd15}} & ent15[14:0] | | |
383 | {15{rptr[4:0] == 5'd16}} & ent16[14:0]; | |
384 | ||
385 | // fixscan start: | |
386 | assign ff_wptr_scanin = scan_in ; | |
387 | assign ff_rptr_scanin = ff_wptr_scanout ; | |
388 | assign ff_ent0_scanin = ff_rptr_scanout ; | |
389 | assign ff_ent1_scanin = ff_ent0_scanout ; | |
390 | assign ff_ent2_scanin = ff_ent1_scanout ; | |
391 | assign ff_ent3_scanin = ff_ent2_scanout ; | |
392 | assign ff_ent4_scanin = ff_ent3_scanout ; | |
393 | assign ff_ent5_scanin = ff_ent4_scanout ; | |
394 | assign ff_ent6_scanin = ff_ent5_scanout ; | |
395 | assign ff_ent7_scanin = ff_ent6_scanout ; | |
396 | assign ff_ent8_scanin = ff_ent7_scanout ; | |
397 | assign ff_ent9_scanin = ff_ent8_scanout ; | |
398 | assign ff_ent10_scanin = ff_ent9_scanout ; | |
399 | assign ff_ent11_scanin = ff_ent10_scanout ; | |
400 | assign ff_ent12_scanin = ff_ent11_scanout ; | |
401 | assign ff_ent13_scanin = ff_ent12_scanout ; | |
402 | assign ff_ent14_scanin = ff_ent13_scanout ; | |
403 | assign ff_ent15_scanin = ff_ent14_scanout ; | |
404 | assign ff_ent16_scanin = ff_ent15_scanout ; | |
405 | assign scan_out = ff_ent16_scanout ; | |
406 | // fixscan end: | |
407 | endmodule | |
408 | ||
409 | ||
410 | ||
411 | ||
412 | ||
413 | ||
414 | // any PARAMS parms go into naming of macro | |
415 | ||
416 | module mcu_errq_ctl_msff_ctl_macro__en_1__width_6 ( | |
417 | din, | |
418 | en, | |
419 | l1clk, | |
420 | scan_in, | |
421 | siclk, | |
422 | soclk, | |
423 | dout, | |
424 | scan_out); | |
425 | wire [5:0] fdin; | |
426 | wire [4:0] so; | |
427 | ||
428 | input [5:0] din; | |
429 | input en; | |
430 | input l1clk; | |
431 | input scan_in; | |
432 | ||
433 | ||
434 | input siclk; | |
435 | input soclk; | |
436 | ||
437 | output [5:0] dout; | |
438 | output scan_out; | |
439 | assign fdin[5:0] = (din[5:0] & {6{en}}) | (dout[5:0] & ~{6{en}}); | |
440 | ||
441 | ||
442 | ||
443 | ||
444 | ||
445 | ||
446 | dff #(6) d0_0 ( | |
447 | .l1clk(l1clk), | |
448 | .siclk(siclk), | |
449 | .soclk(soclk), | |
450 | .d(fdin[5:0]), | |
451 | .si({scan_in,so[4:0]}), | |
452 | .so({so[4:0],scan_out}), | |
453 | .q(dout[5:0]) | |
454 | ); | |
455 | ||
456 | ||
457 | ||
458 | ||
459 | ||
460 | ||
461 | ||
462 | ||
463 | ||
464 | ||
465 | ||
466 | ||
467 | endmodule | |
468 | ||
469 | ||
470 | ||
471 | ||
472 | ||
473 | ||
474 | ||
475 | ||
476 | ||
477 | ||
478 | ||
479 | ||
480 | ||
481 | // any PARAMS parms go into naming of macro | |
482 | ||
483 | module mcu_errq_ctl_msff_ctl_macro__en_1__width_15 ( | |
484 | din, | |
485 | en, | |
486 | l1clk, | |
487 | scan_in, | |
488 | siclk, | |
489 | soclk, | |
490 | dout, | |
491 | scan_out); | |
492 | wire [14:0] fdin; | |
493 | wire [13:0] so; | |
494 | ||
495 | input [14:0] din; | |
496 | input en; | |
497 | input l1clk; | |
498 | input scan_in; | |
499 | ||
500 | ||
501 | input siclk; | |
502 | input soclk; | |
503 | ||
504 | output [14:0] dout; | |
505 | output scan_out; | |
506 | assign fdin[14:0] = (din[14:0] & {15{en}}) | (dout[14:0] & ~{15{en}}); | |
507 | ||
508 | ||
509 | ||
510 | ||
511 | ||
512 | ||
513 | dff #(15) d0_0 ( | |
514 | .l1clk(l1clk), | |
515 | .siclk(siclk), | |
516 | .soclk(soclk), | |
517 | .d(fdin[14:0]), | |
518 | .si({scan_in,so[13:0]}), | |
519 | .so({so[13:0],scan_out}), | |
520 | .q(dout[14:0]) | |
521 | ); | |
522 | ||
523 | ||
524 | ||
525 | ||
526 | ||
527 | ||
528 | ||
529 | ||
530 | ||
531 | ||
532 | ||
533 | ||
534 | endmodule | |
535 | ||
536 | ||
537 | ||
538 | ||
539 | ||
540 | ||
541 | ||
542 |