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