Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: spc_mb2_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 spc_mb2_ctl ( | |
36 | scan_out, | |
37 | mb2_done, | |
38 | mb2_run, | |
39 | mb2_addr, | |
40 | mb2_frf_read_en, | |
41 | mb2_frf_write_en, | |
42 | mb2_arf_read_en, | |
43 | mb2_arf_write_en, | |
44 | mb2_irf_read_en, | |
45 | mb2_irf_write_en, | |
46 | mb2_irf_save_en, | |
47 | mb2_irf_restore_en, | |
48 | mb2_mam_read_en, | |
49 | mb2_mam_write_en, | |
50 | mb2_rrf_read_en, | |
51 | mb2_rrf_write_en, | |
52 | mb2_write_data, | |
53 | mb2_write_data_p1, | |
54 | mb2_write_data_p2, | |
55 | mb2_misc_pmen, | |
56 | mb2_mbist_fail, | |
57 | l2clk, | |
58 | scan_in, | |
59 | tcu_pce_ov, | |
60 | tcu_clk_stop, | |
61 | tcu_aclk, | |
62 | tcu_bclk, | |
63 | tcu_scan_en, | |
64 | lsu_misc_pmen, | |
65 | mbist_start, | |
66 | mbist_user_mode, | |
67 | mbist_bisi_mode, | |
68 | spu_mbi_mam_fail_, | |
69 | spu_mbi_mam_fail2_, | |
70 | spu_mbi_arf_fail_, | |
71 | spu_mbi_rrf_fail_, | |
72 | exu0_mbi_irf_fail_, | |
73 | exu1_mbi_irf_fail_, | |
74 | fgu_mbi_frf_fail); | |
75 | wire pce_ov; | |
76 | wire stop; | |
77 | wire siclk; | |
78 | wire soclk; | |
79 | wire se; | |
80 | wire l1clk; | |
81 | wire pmen_scanin; | |
82 | wire pmen_scanout; | |
83 | wire start_in; | |
84 | wire misc_pmen_; | |
85 | wire pmem_unused; | |
86 | wire clock_enable; | |
87 | wire l1clk_pm1; | |
88 | wire input_signals_reg_scanin; | |
89 | wire input_signals_reg_scanout; | |
90 | wire bisi_mode; | |
91 | wire user_mode; | |
92 | wire mb_enable_reg_scanin; | |
93 | wire mb_enable_reg_scanout; | |
94 | wire mb_enable; | |
95 | wire mb_enable_out; | |
96 | wire start; | |
97 | wire config_reg_scanin; | |
98 | wire config_reg_scanout; | |
99 | wire [1:0] config_in; | |
100 | wire [1:0] config_out; | |
101 | wire start_transition; | |
102 | wire end_transition; | |
103 | wire reset_engine; | |
104 | wire loop_again; | |
105 | wire run; | |
106 | wire loop_again_reg_scanin; | |
107 | wire loop_again_reg_scanout; | |
108 | wire stop_engine_l; | |
109 | wire stop_engine_l_q; | |
110 | wire mb_user_loop_mode; | |
111 | wire array_usr_reg_scanin; | |
112 | wire array_usr_reg_scanout; | |
113 | wire [3:0] user_array_in; | |
114 | wire [3:0] user_array; | |
115 | wire user_addr_mode_reg_scanin; | |
116 | wire user_addr_mode_reg_scanout; | |
117 | wire user_addr_mode_in; | |
118 | wire user_addr_mode; | |
119 | wire user_start_addr_reg_scanin; | |
120 | wire user_start_addr_reg_scanout; | |
121 | wire [9:0] user_start_addr_in; | |
122 | wire [9:0] user_start_addr; | |
123 | wire user_stop_addr_reg_scanin; | |
124 | wire user_stop_addr_reg_scanout; | |
125 | wire [9:0] user_stop_addr_in; | |
126 | wire [9:0] user_stop_addr; | |
127 | wire user_incr_addr_reg_scanin; | |
128 | wire user_incr_addr_reg_scanout; | |
129 | wire [9:0] user_incr_addr_in; | |
130 | wire [9:0] user_incr_addr; | |
131 | wire user_data_mode_reg_scanin; | |
132 | wire user_data_mode_reg_scanout; | |
133 | wire user_data_mode_in; | |
134 | wire user_data_mode; | |
135 | wire user_data_reg_scanin; | |
136 | wire user_data_reg_scanout; | |
137 | wire [7:0] user_data_in; | |
138 | wire [7:0] user_data; | |
139 | wire user_cmpselinc_hold_reg_scanin; | |
140 | wire user_cmpselinc_hold_reg_scanout; | |
141 | wire user_cmpselinc_hold_in; | |
142 | wire user_cmpselinc_hold; | |
143 | wire user_cmpsel_reg_scanin; | |
144 | wire user_cmpsel_reg_scanout; | |
145 | wire [2:0] user_cmpsel_in; | |
146 | wire [2:0] user_cmpsel; | |
147 | wire user_loop_mode_reg_scanin; | |
148 | wire user_loop_mode_reg_scanout; | |
149 | wire user_loop_mode_in; | |
150 | wire user_loop_mode; | |
151 | wire ten_n_mode_reg_scanin; | |
152 | wire ten_n_mode_reg_scanout; | |
153 | wire ten_n_mode_in; | |
154 | wire ten_n_mode; | |
155 | wire user_bisi_wr_mode_reg_scanin; | |
156 | wire user_bisi_wr_mode_reg_scanout; | |
157 | wire user_bisi_wr_mode_in; | |
158 | wire user_bisi_wr_mode; | |
159 | wire user_bisi_rd_mode_reg_scanin; | |
160 | wire user_bisi_rd_mode_reg_scanout; | |
161 | wire user_bisi_rd_mode_in; | |
162 | wire user_bisi_rd_mode; | |
163 | wire mb_user_data_mode; | |
164 | wire mb_user_addr_mode; | |
165 | wire mb_ten_n_mode; | |
166 | wire mb_user_cmpselinc_hold; | |
167 | wire mb_user_bisi_wr_mode; | |
168 | wire mb_user_bisi_rd_mode; | |
169 | wire mb_user_bisi_rw_mode; | |
170 | wire mb_default_bisi; | |
171 | wire [9:0] stop_addr; | |
172 | wire array_0; | |
173 | wire array_1; | |
174 | wire array_2; | |
175 | wire array_3; | |
176 | wire array_4; | |
177 | wire array_5; | |
178 | wire rw_0; | |
179 | wire [2:0] rw; | |
180 | wire rw_1; | |
181 | wire rw_2; | |
182 | wire rw_3; | |
183 | wire rw_4; | |
184 | wire rw_5; | |
185 | wire rw_6; | |
186 | wire march_0; | |
187 | wire [3:0] march_element; | |
188 | wire march_1; | |
189 | wire march_2; | |
190 | wire march_3; | |
191 | wire march_4; | |
192 | wire march_5; | |
193 | wire march_6; | |
194 | wire march_7; | |
195 | wire march_8; | |
196 | wire [9:0] mem_addr; | |
197 | wire addr_mix; | |
198 | wire [9:0] up_addr; | |
199 | wire cntl_msb; | |
200 | wire [34:0] cntl_out; | |
201 | wire cntl_bisi; | |
202 | wire [3:0] cntl_array_sel; | |
203 | wire last_array; | |
204 | wire [2:0] cntl_cmp_sel; | |
205 | wire sel_cmp_pass; | |
206 | wire cmp_0; | |
207 | wire cmp_7; | |
208 | wire [2:0] cmp_sel_cntl_out; | |
209 | wire cmp_sel_reg_scanin; | |
210 | wire cmp_sel_reg_scanout; | |
211 | wire [2:0] cmp_sel; | |
212 | wire [2:0] cmp_sel_out; | |
213 | wire [1:0] cntl_data_sel; | |
214 | wire cntl_addr_mix; | |
215 | wire [3:0] cntl_march_element; | |
216 | wire sel_march_1_pass; | |
217 | wire [15:0] cntl_algr; | |
218 | wire [15:0] next_algr; | |
219 | wire cout_addr; | |
220 | wire [34:0] cntl_in; | |
221 | wire run3; | |
222 | wire sel_nextaddr_reset; | |
223 | wire sel_nextaddr_restart; | |
224 | wire overflow; | |
225 | wire sel_nextaddr_incred; | |
226 | wire cout_rw; | |
227 | wire sel_nextaddr_same; | |
228 | wire [9:0] start_addr; | |
229 | wire [9:0] restart_addr; | |
230 | wire [9:0] incred_addr; | |
231 | wire [9:0] cntl_addr; | |
232 | wire [9:0] incr_addr; | |
233 | wire upaddr; | |
234 | wire [2:0] cntl_rw; | |
235 | wire upaddr_pre; | |
236 | wire [3:0] march_element_pre; | |
237 | wire march_pre_0; | |
238 | wire march_pre_1; | |
239 | wire march_pre_2; | |
240 | wire march_pre_6; | |
241 | wire march_pre_7; | |
242 | wire sel_rw_pass; | |
243 | wire [2:0] next_rw; | |
244 | wire [3:0] array_sel; | |
245 | wire cntl_reg_scanin; | |
246 | wire cntl_reg_scanout; | |
247 | wire one_cycle_march; | |
248 | wire five_cycle_march; | |
249 | wire two_cycle_march; | |
250 | wire bisi_wr_mode; | |
251 | wire bisi_rd_mode; | |
252 | wire sel_rw_1_pass; | |
253 | wire sel_rw_2_pass; | |
254 | wire sel_rw_5_pass; | |
255 | wire true_data_l; | |
256 | wire true_data; | |
257 | wire [7:0] data_pat_sel; | |
258 | wire [7:0] mem_data1; | |
259 | wire [7:0] mem_data; | |
260 | wire [9:0] adj_addr; | |
261 | wire mem_wr_pbi; | |
262 | wire mem_wr; | |
263 | wire mem_save; | |
264 | wire mem_restore; | |
265 | wire mem_rd_pbi; | |
266 | wire mem_rd; | |
267 | wire [3:0] array_sel_cntl_out; | |
268 | wire array_sel_reg_scanin; | |
269 | wire array_sel_reg_scanout; | |
270 | wire [3:0] array_sel_out; | |
271 | wire [3:0] march_element_cntl_out; | |
272 | wire marche_element_reg_scanin; | |
273 | wire marche_element_reg_scanout; | |
274 | wire [3:0] march_element_out; | |
275 | wire mb_run; | |
276 | wire [15:0] mb_addr; | |
277 | wire [7:0] mb_write_data; | |
278 | wire mb_array_0_rd; | |
279 | wire mb_array_1_rd; | |
280 | wire mb_array_2_rd; | |
281 | wire mb_array_3_rd; | |
282 | wire mb_array_save; | |
283 | wire mb_array_5_rd; | |
284 | wire mb_array_0_wr; | |
285 | wire mb_array_1_wr; | |
286 | wire mb_array_2_wr; | |
287 | wire mb_array_3_wr; | |
288 | wire mb_array_restore; | |
289 | wire mb_array_5_wr; | |
290 | wire spu_arf_fail; | |
291 | wire mb2_arf_read_en_p2; | |
292 | wire spu_rrf_fail; | |
293 | wire mb2_rrf_read_en_p2; | |
294 | wire spu_mam_fail; | |
295 | wire mb2_mam_read_en_p2; | |
296 | wire exu0_irf_fail; | |
297 | wire mb2_irf_read_en_p4; | |
298 | wire exu1_irf_fail; | |
299 | wire arf_fail; | |
300 | wire run3_transition; | |
301 | wire spu_arf_fail_sticky; | |
302 | wire rrf_fail; | |
303 | wire spu_rrf_fail_sticky; | |
304 | wire mam_fail; | |
305 | wire spu_mam_fail_sticky; | |
306 | wire irf0_fail; | |
307 | wire exu0_irf_fail_sticky; | |
308 | wire irf1_fail; | |
309 | wire exu1_irf_fail_sticky; | |
310 | wire frf_fail; | |
311 | wire fgu_frf_fail_sticky; | |
312 | wire fail_reg_scanin; | |
313 | wire fail_reg_scanout; | |
314 | wire mbist_fail_sticky; | |
315 | wire mbist_fail_array; | |
316 | wire valid_fail; | |
317 | wire mb_done; | |
318 | wire mb_fail; | |
319 | wire msb_latch_scanin; | |
320 | wire msb_latch_scanout; | |
321 | wire msb_in; | |
322 | wire msb_out; | |
323 | wire [4:0] done_delay; | |
324 | wire run3_transition_reg_scanin; | |
325 | wire run3_transition_reg_scanout; | |
326 | wire run3_out; | |
327 | wire done_delay_reg_scanin; | |
328 | wire done_delay_reg_scanout; | |
329 | wire [4:0] done_delay_in; | |
330 | wire out_run_mb_arrays_reg_scanin; | |
331 | wire out_run_mb_arrays_reg_scanout; | |
332 | wire mb_run_out; | |
333 | wire out_data_mb_arrays_reg_scanin; | |
334 | wire out_data_mb_arrays_reg_scanout; | |
335 | wire [7:0] mb_write_data_out; | |
336 | wire out_addr_mb_arrays_reg_scanin; | |
337 | wire out_addr_mb_arrays_reg_scanout; | |
338 | wire [15:0] mb_addr_out; | |
339 | wire out_wr_mb_arrays_reg_scanin; | |
340 | wire out_wr_mb_arrays_reg_scanout; | |
341 | wire mb_array_0_wr_out; | |
342 | wire mb_array_1_wr_out; | |
343 | wire mb_array_2_wr_out; | |
344 | wire mb_array_3_wr_out; | |
345 | wire mb_array_5_wr_out; | |
346 | wire out_rd_mb_arrays_reg_scanin; | |
347 | wire out_rd_mb_arrays_reg_scanout; | |
348 | wire mb_array_0_rd_out; | |
349 | wire mb_array_1_rd_out; | |
350 | wire mb_array_2_rd_out; | |
351 | wire mb_array_3_rd_out; | |
352 | wire mb_array_5_rd_out; | |
353 | wire out_mb_tcu_done_reg_scanin; | |
354 | wire out_mb_tcu_done_reg_scanout; | |
355 | wire mb_done_out; | |
356 | wire out_mb_tcu_fail_reg_scanin; | |
357 | wire out_mb_tcu_fail_reg_scanout; | |
358 | wire mb_fail_out; | |
359 | wire spares_scanin; | |
360 | wire spares_scanout; | |
361 | wire i_delay_4th_scanin; | |
362 | wire i_delay_4th_scanout; | |
363 | wire mb2_irf_read_en_p1; | |
364 | wire mb2_irf_read_en_p2; | |
365 | wire mb2_irf_read_en_p3; | |
366 | wire delayed_cmp_rd_data_reg_scanin; | |
367 | wire delayed_cmp_rd_data_reg_scanout; | |
368 | wire mb2_arf_read_en_p1; | |
369 | wire mb2_mam_read_en_p1; | |
370 | wire mb2_rrf_read_en_p1; | |
371 | wire out_save_restore_mb_arrays_reg_scanin; | |
372 | wire out_save_restore_mb_arrays_reg_scanout; | |
373 | ||
374 | ||
375 | ||
376 | ||
377 | // ///////////////////////////////////////////////////////////////////////////// | |
378 | // Outputs | |
379 | // ///////////////////////////////////////////////////////////////////////////// | |
380 | ||
381 | output scan_out; | |
382 | ||
383 | output mb2_done; | |
384 | ||
385 | output mb2_run; | |
386 | output [15:0] mb2_addr; | |
387 | output mb2_frf_read_en; | |
388 | output mb2_frf_write_en; | |
389 | output mb2_arf_read_en; | |
390 | output mb2_arf_write_en; | |
391 | output mb2_irf_read_en; | |
392 | output mb2_irf_write_en; | |
393 | output mb2_irf_save_en; | |
394 | output mb2_irf_restore_en; | |
395 | output mb2_mam_read_en; | |
396 | output mb2_mam_write_en; | |
397 | output mb2_rrf_read_en; | |
398 | output mb2_rrf_write_en; | |
399 | output [7:0] mb2_write_data; | |
400 | output [7:0] mb2_write_data_p1; | |
401 | output [7:0] mb2_write_data_p2; | |
402 | ||
403 | output mb2_misc_pmen; | |
404 | output mb2_mbist_fail; | |
405 | ||
406 | // ///////////////////////////////////////////////////////////////////////////// | |
407 | // Inputs | |
408 | // ///////////////////////////////////////////////////////////////////////////// | |
409 | ||
410 | input l2clk; | |
411 | input scan_in; | |
412 | input tcu_pce_ov; // scan signals | |
413 | input tcu_clk_stop; | |
414 | input tcu_aclk; | |
415 | input tcu_bclk; | |
416 | input tcu_scan_en; | |
417 | input lsu_misc_pmen; // Power management enable | |
418 | ||
419 | input mbist_start; | |
420 | input mbist_user_mode; | |
421 | input mbist_bisi_mode; | |
422 | ||
423 | ||
424 | input spu_mbi_mam_fail_; // MBIST comparator output bits 63:0 | |
425 | input spu_mbi_mam_fail2_; // MBIST comparator output bits 71:64 | |
426 | input spu_mbi_arf_fail_; // MBIST comparator | |
427 | input spu_mbi_rrf_fail_; // MBIST comparator | |
428 | ||
429 | input [1:0] exu0_mbi_irf_fail_; // MBIST [0] == data[63:0]; [1] == data[71:64] | |
430 | input [1:0] exu1_mbi_irf_fail_; // MBIST [0] == data[63:0]; [1] == data[71:64] | |
431 | input fgu_mbi_frf_fail; | |
432 | ||
433 | ||
434 | supply0 vss; // <- port for ground | |
435 | supply1 vdd; // <- port for power | |
436 | ||
437 | ||
438 | ||
439 | // ///////////////////////////////////////////////////////////////////////////// | |
440 | // Scan Renames | |
441 | // ///////////////////////////////////////////////////////////////////////////// | |
442 | ||
443 | assign pce_ov = tcu_pce_ov; | |
444 | assign stop = tcu_clk_stop; | |
445 | assign siclk = tcu_aclk; | |
446 | assign soclk = tcu_bclk; | |
447 | assign se = tcu_scan_en; | |
448 | ||
449 | ||
450 | ||
451 | ||
452 | //////////////////////////////////////////////////////////////////////////////// | |
453 | // Clock header | |
454 | //////////////////////////////////////////////////////////////////////////////// | |
455 | ||
456 | spc_mb2_ctll1clkhdr_ctl_macro clkgen ( | |
457 | .l2clk (l2clk ), | |
458 | .l1en (1'b1 ), | |
459 | .l1clk (l1clk ), | |
460 | .pce_ov(pce_ov), | |
461 | .stop(stop), | |
462 | .se(se)); | |
463 | ||
464 | spc_mb2_ctlmsff_ctl_macro__width_3 pmen ( | |
465 | .scan_in(pmen_scanin), | |
466 | .scan_out(pmen_scanout), | |
467 | .l1clk ( l1clk ), // Must be connected to a free running clock | |
468 | .din ({mbist_start, ~lsu_misc_pmen , 1'b0} ), | |
469 | .dout ({start_in , misc_pmen_ , pmem_unused} ), | |
470 | .siclk(siclk), | |
471 | .soclk(soclk)); | |
472 | ||
473 | assign mb2_misc_pmen = ~misc_pmen_; // Sent to MB1 for timing reasons | |
474 | ||
475 | assign clock_enable = start_in | mb2_done | mb2_run | mb2_mbist_fail | misc_pmen_; | |
476 | ||
477 | spc_mb2_ctll1clkhdr_ctl_macro clkgen_pm1 ( | |
478 | .l2clk (l2clk ), | |
479 | .l1en (clock_enable ), | |
480 | .l1clk (l1clk_pm1 ), | |
481 | .pce_ov(pce_ov), | |
482 | .stop(stop), | |
483 | .se(se)); | |
484 | ||
485 | ||
486 | // ///////////////////////////////////////////////////////////////////////////// | |
487 | // | |
488 | // MBIST Config Register | |
489 | // | |
490 | // ///////////////////////////////////////////////////////////////////////////// | |
491 | // | |
492 | // A low to high transition on mbist_start will reset and start the engine. | |
493 | // mbist_start must remain active high for the duration of MBIST. | |
494 | // If mbist_start deasserts the engine will stop but not reset. | |
495 | // Once MBIST has completed mb0_done will assert and the fail status | |
496 | // signals will be valid. | |
497 | // To run MBIST again the mbist_start signal must transition low then high. | |
498 | // | |
499 | // Loop on Address will disable the address mix function. | |
500 | // | |
501 | // ///////////////////////////////////////////////////////////////////////////// | |
502 | ||
503 | // flop incoming signals: | |
504 | ||
505 | spc_mb2_ctlmsff_ctl_macro__width_2 input_signals_reg ( | |
506 | .scan_in(input_signals_reg_scanin), | |
507 | .scan_out(input_signals_reg_scanout), | |
508 | .l1clk ( l1clk ), | |
509 | .din ( {mbist_bisi_mode,mbist_user_mode} ), | |
510 | .dout ( {bisi_mode ,user_mode} ), | |
511 | .siclk(siclk), | |
512 | .soclk(soclk)); | |
513 | ||
514 | ||
515 | // default : mb_enable=0 | |
516 | // bisi : mb_enable=0 | |
517 | // user_mode : mb_enable=depend on programmed value | |
518 | ||
519 | spc_mb2_ctlmsff_ctl_macro__width_1 mb_enable_reg ( | |
520 | .scan_in(mb_enable_reg_scanin), | |
521 | .scan_out(mb_enable_reg_scanout), | |
522 | .l1clk ( l1clk_pm1 ), | |
523 | .din ( mb_enable ), | |
524 | .dout ( mb_enable_out ), | |
525 | .siclk(siclk), | |
526 | .soclk(soclk)); | |
527 | ||
528 | ||
529 | //assign mb_enable = user_mode ? mb_enable_out : 1'b0; | |
530 | assign mb_enable = mb_enable_out; | |
531 | ||
532 | ||
533 | assign start = user_mode ? (mb_enable_out & start_in) : | |
534 | start_in; | |
535 | ||
536 | ||
537 | ||
538 | spc_mb2_ctlmsff_ctl_macro__width_2 config_reg ( | |
539 | .scan_in(config_reg_scanin), | |
540 | .scan_out(config_reg_scanout), | |
541 | .l1clk ( l1clk_pm1 ), | |
542 | .din ( config_in[1:0] ), | |
543 | .dout ( config_out[1:0] ), | |
544 | .siclk(siclk), | |
545 | .soclk(soclk)); | |
546 | ||
547 | ||
548 | assign config_in[0] = start; | |
549 | assign config_in[1] = config_out[0]; | |
550 | assign start_transition = config_out[0] & ~config_out[1]; | |
551 | assign end_transition = ~config_out[0] & config_out[1]; | |
552 | assign reset_engine = start_transition | loop_again | end_transition; | |
553 | assign run = config_out[1]; | |
554 | ||
555 | ||
556 | spc_mb2_ctlmsff_ctl_macro__width_1 loop_again_reg ( | |
557 | .scan_in(loop_again_reg_scanin), | |
558 | .scan_out(loop_again_reg_scanout), | |
559 | .l1clk ( l1clk_pm1 ), | |
560 | .din ( stop_engine_l ), | |
561 | .dout ( stop_engine_l_q ), | |
562 | .siclk(siclk), | |
563 | .soclk(soclk)); | |
564 | ||
565 | assign loop_again=mb_user_loop_mode ? stop_engine_l & ~stop_engine_l_q: 1'b0; | |
566 | ||
567 | ||
568 | ||
569 | ||
570 | ||
571 | ||
572 | ||
573 | ||
574 | //////////////////////////////////////////////////////////////////////////////// | |
575 | // user control registers | |
576 | // size | |
577 | // - user_array 4 | |
578 | // - user_addr_mode 1 | |
579 | // - user_start_addr 10 | |
580 | // - user_stop_addr 10 | |
581 | // - user_inc_addr 10 | |
582 | // - user_data_mode 1 | |
583 | // - user_data 8 | |
584 | // - user_cmpselinc_mode 1 | |
585 | // - user_cmpselinc 3 | |
586 | // - user_loop_mode 1 | |
587 | // - user_cam_select 2 | |
588 | // - user_cam_test_sel 4 | |
589 | //////////////////////////////////////////////////////////////////////////////// | |
590 | ||
591 | ||
592 | spc_mb2_ctlmsff_ctl_macro__width_4 array_usr_reg ( | |
593 | .scan_in(array_usr_reg_scanin), | |
594 | .scan_out(array_usr_reg_scanout), | |
595 | .l1clk ( l1clk_pm1 ), | |
596 | .din ( user_array_in[3:0] ), | |
597 | .dout ( user_array[3:0] ), | |
598 | .siclk(siclk), | |
599 | .soclk(soclk)); | |
600 | ||
601 | assign user_array_in[3:0]=user_array[3:0]; | |
602 | ||
603 | ||
604 | // user address mode | |
605 | ||
606 | spc_mb2_ctlmsff_ctl_macro__width_1 user_addr_mode_reg ( | |
607 | .scan_in(user_addr_mode_reg_scanin), | |
608 | .scan_out(user_addr_mode_reg_scanout), | |
609 | .l1clk ( l1clk_pm1 ), | |
610 | .din ( user_addr_mode_in ), | |
611 | .dout ( user_addr_mode ), | |
612 | .siclk(siclk), | |
613 | .soclk(soclk)); | |
614 | ||
615 | assign user_addr_mode_in=user_addr_mode; | |
616 | ||
617 | ||
618 | // user start address | |
619 | ||
620 | spc_mb2_ctlmsff_ctl_macro__width_10 user_start_addr_reg ( | |
621 | .scan_in(user_start_addr_reg_scanin), | |
622 | .scan_out(user_start_addr_reg_scanout), | |
623 | .l1clk ( l1clk_pm1 ), | |
624 | .din ( user_start_addr_in[9:0] ), | |
625 | .dout ( user_start_addr[9:0] ), | |
626 | .siclk(siclk), | |
627 | .soclk(soclk)); | |
628 | ||
629 | ||
630 | assign user_start_addr_in[9:0]=user_start_addr[9:0]; | |
631 | ||
632 | // user stop address | |
633 | ||
634 | spc_mb2_ctlmsff_ctl_macro__width_10 user_stop_addr_reg ( | |
635 | .scan_in(user_stop_addr_reg_scanin), | |
636 | .scan_out(user_stop_addr_reg_scanout), | |
637 | .l1clk ( l1clk_pm1 ), | |
638 | .din ( user_stop_addr_in[9:0] ), | |
639 | .dout ( user_stop_addr[9:0] ), | |
640 | .siclk(siclk), | |
641 | .soclk(soclk)); | |
642 | ||
643 | ||
644 | assign user_stop_addr_in[9:0]=user_stop_addr[9:0]; | |
645 | ||
646 | ||
647 | // user increment address | |
648 | ||
649 | spc_mb2_ctlmsff_ctl_macro__width_10 user_incr_addr_reg ( | |
650 | .scan_in(user_incr_addr_reg_scanin), | |
651 | .scan_out(user_incr_addr_reg_scanout), | |
652 | .l1clk ( l1clk_pm1 ), | |
653 | .din ( user_incr_addr_in[9:0] ), | |
654 | .dout ( user_incr_addr[9:0] ), | |
655 | .siclk(siclk), | |
656 | .soclk(soclk)); | |
657 | ||
658 | ||
659 | assign user_incr_addr_in[9:0]=user_incr_addr[9:0]; | |
660 | ||
661 | // user data mode | |
662 | ||
663 | spc_mb2_ctlmsff_ctl_macro__width_1 user_data_mode_reg ( | |
664 | .scan_in(user_data_mode_reg_scanin), | |
665 | .scan_out(user_data_mode_reg_scanout), | |
666 | .l1clk ( l1clk_pm1 ), | |
667 | .din ( user_data_mode_in ), | |
668 | .dout ( user_data_mode ), | |
669 | .siclk(siclk), | |
670 | .soclk(soclk)); | |
671 | ||
672 | ||
673 | assign user_data_mode_in=user_data_mode; | |
674 | ||
675 | // user data select | |
676 | ||
677 | spc_mb2_ctlmsff_ctl_macro__width_8 user_data_reg ( | |
678 | .scan_in(user_data_reg_scanin), | |
679 | .scan_out(user_data_reg_scanout), | |
680 | .l1clk ( l1clk_pm1 ), | |
681 | .din ( user_data_in[7:0] ), | |
682 | .dout ( user_data[7:0] ), | |
683 | .siclk(siclk), | |
684 | .soclk(soclk)); | |
685 | ||
686 | ||
687 | assign user_data_in[7:0] = user_data[7:0]; | |
688 | ||
689 | ||
690 | // user cmp sel inc | |
691 | // if its one, user need to program the cmpselinc register | |
692 | // otherwise it will loop all cmpsel | |
693 | ||
694 | spc_mb2_ctlmsff_ctl_macro__width_1 user_cmpselinc_hold_reg ( | |
695 | .scan_in(user_cmpselinc_hold_reg_scanin), | |
696 | .scan_out(user_cmpselinc_hold_reg_scanout), | |
697 | .l1clk ( l1clk_pm1 ), | |
698 | .din ( user_cmpselinc_hold_in ), | |
699 | .dout ( user_cmpselinc_hold ), | |
700 | .siclk(siclk), | |
701 | .soclk(soclk)); | |
702 | ||
703 | ||
704 | assign user_cmpselinc_hold_in=user_cmpselinc_hold; | |
705 | ||
706 | ||
707 | ||
708 | // user cmp sel reg | |
709 | ||
710 | spc_mb2_ctlmsff_ctl_macro__width_3 user_cmpsel_reg ( | |
711 | .scan_in(user_cmpsel_reg_scanin), | |
712 | .scan_out(user_cmpsel_reg_scanout), | |
713 | .l1clk ( l1clk_pm1 ), | |
714 | .din ( user_cmpsel_in[2:0] ), | |
715 | .dout ( user_cmpsel[2:0] ), | |
716 | .siclk(siclk), | |
717 | .soclk(soclk)); | |
718 | ||
719 | assign user_cmpsel_in[2:0]=user_cmpsel[2:0]; | |
720 | ||
721 | // user loop mode | |
722 | ||
723 | spc_mb2_ctlmsff_ctl_macro__width_1 user_loop_mode_reg ( | |
724 | .scan_in(user_loop_mode_reg_scanin), | |
725 | .scan_out(user_loop_mode_reg_scanout), | |
726 | .l1clk ( l1clk_pm1 ), | |
727 | .din ( user_loop_mode_in ), | |
728 | .dout ( user_loop_mode ), | |
729 | .siclk(siclk), | |
730 | .soclk(soclk)); | |
731 | ||
732 | ||
733 | assign user_loop_mode_in=user_loop_mode; | |
734 | ||
735 | ||
736 | // 10N Algorithm for bit mapping | |
737 | ||
738 | spc_mb2_ctlmsff_ctl_macro__width_1 ten_n_mode_reg ( | |
739 | .scan_in(ten_n_mode_reg_scanin), | |
740 | .scan_out(ten_n_mode_reg_scanout), | |
741 | .l1clk ( l1clk_pm1 ), | |
742 | .din ( ten_n_mode_in ), | |
743 | .dout ( ten_n_mode ), | |
744 | .siclk(siclk), | |
745 | .soclk(soclk)); | |
746 | ||
747 | ||
748 | assign ten_n_mode_in=ten_n_mode; | |
749 | ||
750 | ||
751 | ||
752 | spc_mb2_ctlmsff_ctl_macro__width_1 user_bisi_wr_mode_reg ( | |
753 | .scan_in(user_bisi_wr_mode_reg_scanin), | |
754 | .scan_out(user_bisi_wr_mode_reg_scanout), | |
755 | .l1clk ( l1clk_pm1 ), | |
756 | .din ( user_bisi_wr_mode_in ), | |
757 | .dout ( user_bisi_wr_mode ), | |
758 | .siclk(siclk), | |
759 | .soclk(soclk)); | |
760 | ||
761 | assign user_bisi_wr_mode_in=user_bisi_wr_mode; | |
762 | ||
763 | spc_mb2_ctlmsff_ctl_macro__width_1 user_bisi_rd_mode_reg ( | |
764 | .scan_in(user_bisi_rd_mode_reg_scanin), | |
765 | .scan_out(user_bisi_rd_mode_reg_scanout), | |
766 | .l1clk ( l1clk_pm1 ), | |
767 | .din ( user_bisi_rd_mode_in ), | |
768 | .dout ( user_bisi_rd_mode ), | |
769 | .siclk(siclk), | |
770 | .soclk(soclk)); | |
771 | ||
772 | assign user_bisi_rd_mode_in=user_bisi_rd_mode; | |
773 | ||
774 | ||
775 | assign mb_user_data_mode = user_mode & user_data_mode; | |
776 | assign mb_user_addr_mode = user_mode & user_addr_mode; | |
777 | assign mb_ten_n_mode = user_mode & ten_n_mode; | |
778 | assign mb_user_loop_mode = user_mode & user_loop_mode; | |
779 | assign mb_user_cmpselinc_hold = user_mode & user_cmpselinc_hold; | |
780 | ||
781 | ||
782 | ||
783 | assign mb_user_bisi_wr_mode = user_mode & user_bisi_wr_mode & bisi_mode; | |
784 | assign mb_user_bisi_rd_mode = user_mode & user_bisi_rd_mode & bisi_mode; | |
785 | ||
786 | assign mb_user_bisi_rw_mode = ((~user_bisi_wr_mode & ~user_bisi_rd_mode) | (user_bisi_wr_mode & user_bisi_rd_mode)) & bisi_mode; | |
787 | ||
788 | assign mb_default_bisi = bisi_mode & ~user_mode; | |
789 | ||
790 | ||
791 | ||
792 | assign stop_addr[9:0] = ({10{ mb_user_addr_mode }} & user_stop_addr[9:0]) | | |
793 | ({10{~mb_user_addr_mode & array_0}} & 10'b00_0001_1111 ) | // arf | |
794 | ({10{~mb_user_addr_mode & array_1}} & 10'b00_0011_1111 ) | // rrf | |
795 | ({10{~mb_user_addr_mode & array_2}} & 10'b00_1001_1111 ) | // mam | |
796 | ({10{~mb_user_addr_mode & array_3}} & 10'b00_0111_1111 ) | // irf active | |
797 | ({10{~mb_user_addr_mode & array_4}} & 10'b00_0111_1111 ) | // irf shadow | |
798 | ({10{~mb_user_addr_mode & array_5}} & 10'b00_1111_1111 ); // frf | |
799 | ||
800 | ||
801 | ||
802 | assign rw_0 = (rw[2:0]==3'b000); | |
803 | assign rw_1 = (rw[2:0]==3'b001); | |
804 | assign rw_2 = (rw[2:0]==3'b010); | |
805 | assign rw_3 = (rw[2:0]==3'b011); | |
806 | assign rw_4 = (rw[2:0]==3'b100); | |
807 | assign rw_5 = (rw[2:0]==3'b101); | |
808 | assign rw_6 = (rw[2:0]==3'b110); | |
809 | // assign rw_7 = (rw[2:0]==3'b111); | |
810 | ||
811 | ||
812 | ||
813 | ||
814 | ||
815 | ||
816 | ||
817 | ||
818 | assign march_0 = (march_element[3:0]==4'h0); | |
819 | assign march_1 = (march_element[3:0]==4'h1); | |
820 | assign march_2 = (march_element[3:0]==4'h2); | |
821 | assign march_3 = (march_element[3:0]==4'h3); | |
822 | assign march_4 = (march_element[3:0]==4'h4); | |
823 | assign march_5 = (march_element[3:0]==4'h5); | |
824 | assign march_6 = (march_element[3:0]==4'h6); | |
825 | assign march_7 = (march_element[3:0]==4'h7); | |
826 | assign march_8 = (march_element[3:0]==4'h8); | |
827 | ||
828 | ||
829 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
830 | /// address mix : fast_row and fast_column | |
831 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
832 | ||
833 | // arf: no column decorder or multiple bansk | |
834 | // maps one to one - logical to physical | |
835 | ||
836 | // rrf: no column decoder or banks addr[5:0] | |
837 | // maps one to one | |
838 | ||
839 | ||
840 | ||
841 | // mam: | |
842 | // - address 7:5 is for block select (0-5) blocks | |
843 | // - 4:1 row select | |
844 | // - 0 column select | |
845 | ||
846 | // irf: | |
847 | // - addr[0] is for column select | |
848 | // - addr[6:0] | |
849 | // | |
850 | ||
851 | ||
852 | ||
853 | assign mem_addr[9:0] = (addr_mix & array_0) ? { up_addr[9:5],up_addr[3:0],up_addr[4] } : // arf fixed w/circuit | |
854 | (addr_mix & array_1) ? { up_addr[9:6],up_addr[2:0],up_addr[5:3] } : // rrf fixed w/circuit | |
855 | (addr_mix & array_2) ? { up_addr[9:5],up_addr[3:0],up_addr[4] } : // mam fixed w/circuit | |
856 | (addr_mix & array_3) ? { up_addr[9:7],up_addr[5:0],up_addr[6] } : // irf active w/circuit | |
857 | (addr_mix & array_4) ? { up_addr[9:0] } : // no addr mix for irf shadow | |
858 | (addr_mix & array_5) ? { up_addr[9:8],up_addr[6:0],up_addr[7]} : // frf w/circuit | |
859 | up_addr[9:0]; | |
860 | ||
861 | ||
862 | ||
863 | ||
864 | ||
865 | ||
866 | assign cntl_msb = start_in & cntl_out[34]; // done selection | |
867 | ||
868 | ||
869 | assign cntl_bisi = mb_default_bisi | mb_user_bisi_rw_mode ? cntl_out[33] : | |
870 | 1'b1; | |
871 | ||
872 | ||
873 | assign cntl_array_sel[3:0] = (last_array | user_mode) ? 4'b1111: | |
874 | cntl_out[32:29]; // array selection | |
875 | ||
876 | assign cntl_cmp_sel[2:0] = sel_cmp_pass ? {3'b111} : | |
877 | cntl_out[28:26]; | |
878 | ||
879 | // cmp | |
880 | ||
881 | assign sel_cmp_pass= mb_user_cmpselinc_hold | | |
882 | (array_0 & cmp_0) | // arf | |
883 | (array_1 & cmp_0) | // rrf | |
884 | (array_2 & cmp_0) | // mam | |
885 | (array_3 & cmp_0) | // irf active | |
886 | (array_4 & cmp_7) | // irf shadow | |
887 | (array_5 & cmp_0) ; // frf | |
888 | ||
889 | ||
890 | // cmp logic | |
891 | ||
892 | assign cmp_sel_cntl_out[2:0] = cntl_out[28:26]; | |
893 | ||
894 | spc_mb2_ctlmsff_ctl_macro__width_3 cmp_sel_reg ( | |
895 | .scan_in(cmp_sel_reg_scanin), | |
896 | .scan_out(cmp_sel_reg_scanout), | |
897 | .l1clk ( l1clk_pm1 ), | |
898 | .din ( cmp_sel[2:0] ), | |
899 | .dout ( cmp_sel_out[2:0] ), | |
900 | .siclk(siclk), | |
901 | .soclk(soclk)); | |
902 | ||
903 | assign cmp_sel[2:0]=(&cmp_sel_cntl_out[2:0] & ~array_4) ? cmp_sel_out[2:0] : | |
904 | mb_user_cmpselinc_hold ? user_cmpsel[2:0] : | |
905 | cmp_sel_cntl_out[2:0]; | |
906 | ||
907 | ||
908 | assign cmp_0 = cmp_sel[2:0]==3'b000; | |
909 | assign cmp_7 = cmp_sel[2:0]==3'b111; | |
910 | ||
911 | ||
912 | assign cntl_data_sel[1:0] = bisi_mode | | |
913 | mb_user_data_mode ? 2'b11 : cntl_out[25:24]; // data selection | |
914 | ||
915 | assign cntl_addr_mix = (bisi_mode | mb_user_addr_mode) ? 1'b1 : cntl_out[23]; // address mix | |
916 | assign addr_mix = (bisi_mode | mb_user_addr_mode) ? 1'b0 : cntl_out[23]; | |
917 | ||
918 | ||
919 | assign cntl_march_element[3:0] = sel_march_1_pass ? 4'b1111: | |
920 | cntl_out[22:19]; // march element | |
921 | ||
922 | ||
923 | assign cntl_algr[15:0] = {cntl_msb, | |
924 | cntl_bisi, | |
925 | cntl_array_sel[3:0], | |
926 | cntl_cmp_sel[2:0], | |
927 | cntl_data_sel[1:0], | |
928 | cntl_addr_mix, | |
929 | cntl_march_element[3:0]}; | |
930 | ||
931 | ||
932 | assign next_algr[15:0] = cout_addr ? cntl_algr[15:0] + 16'h1 : cntl_algr[15:0]; // mbist control | |
933 | ||
934 | // next algr | |
935 | assign cntl_in[34:19] = reset_engine ? {16'b000000_0000000000}: | |
936 | ~run3 ? cntl_algr[15:0]: | |
937 | next_algr[15:0]; | |
938 | ||
939 | ||
940 | ||
941 | // reset_engine run3 overflow cout_rw output | |
942 | // --------------------------------------------------------- | |
943 | // 1 x x x start_addr | |
944 | // 0 0 x x cntl_addr | |
945 | // 0 1 1 x restart_addr | |
946 | // 0 1 0 1 incred_addr | |
947 | // 0 1 0 0 cntl_addr | |
948 | ||
949 | ||
950 | assign sel_nextaddr_reset = reset_engine; | |
951 | assign sel_nextaddr_restart = ~reset_engine & run3 & overflow; | |
952 | assign sel_nextaddr_incred = ~reset_engine & run3 & ~overflow & cout_rw; | |
953 | assign sel_nextaddr_same = ~(sel_nextaddr_reset | sel_nextaddr_restart | sel_nextaddr_incred); | |
954 | ||
955 | assign cntl_in[12:3] = ({10{sel_nextaddr_reset}} & start_addr[9:0]) | | |
956 | ({10{sel_nextaddr_restart}} & restart_addr[9:0]) | | |
957 | ({10{sel_nextaddr_incred}} & incred_addr[9:0]) | | |
958 | ({10{sel_nextaddr_same}} & cntl_addr[9:0]); | |
959 | ||
960 | ||
961 | ||
962 | ||
963 | ||
964 | assign incr_addr[9:0] = mb_user_addr_mode ? user_incr_addr[9:0] : 10'b00_00000001; | |
965 | ||
966 | ||
967 | assign start_addr[9:0] = mb_user_addr_mode ? user_start_addr[9:0] : 10'b00_00000000; | |
968 | ||
969 | ||
970 | // assign next_addr_out[9:0] = cout_rw ? cntl_addr[9:0] + incr_addr[9:0] : cntl_addr[9:0]; // next address | |
971 | ||
972 | assign incred_addr[9:0] = cntl_addr[9:0] + incr_addr[9:0]; | |
973 | ||
974 | ||
975 | assign overflow = upaddr ? ( cntl_addr[9:0] == stop_addr[9:0]) & (cntl_rw[2:0]==3'b111): | |
976 | (~cntl_addr[9:0] == start_addr[9:0]) & (cntl_rw[2:0]==3'b111); | |
977 | ||
978 | ||
979 | // assign next_addr[9:0]= overflow ? restart_addr[9:0] : next_addr_out[9:0]; | |
980 | ||
981 | assign restart_addr[9:0] = upaddr_pre ? start_addr[9:0] : ~stop_addr[9:0]; | |
982 | ||
983 | assign cout_addr = overflow; | |
984 | ||
985 | ||
986 | assign march_element_pre[3:0]=next_algr[3:0]; | |
987 | ||
988 | assign march_pre_0 = ~(march_element_pre[3] | march_element_pre[2] | march_element_pre[1] | march_element_pre[0]); | |
989 | assign march_pre_1 = ~(march_element_pre[3] | march_element_pre[2] | march_element_pre[1] | ~march_element_pre[0]); | |
990 | assign march_pre_2 = ~(march_element_pre[3] | march_element_pre[2] | ~march_element_pre[1] | march_element_pre[0]); | |
991 | assign march_pre_6 = ~(march_element_pre[3] |~march_element_pre[2] | ~march_element_pre[1] | march_element_pre[0]); | |
992 | assign march_pre_7 = ~(march_element_pre[3] | march_element_pre[3] | ~march_element_pre[2] | ~march_element_pre[1] | ~march_element_pre[0]); | |
993 | ||
994 | ||
995 | assign upaddr_pre = march_pre_0 | march_pre_1 | march_pre_2 | march_pre_6 | march_pre_7; | |
996 | ||
997 | ||
998 | ||
999 | ///////////////////////// | |
1000 | // rw engine | |
1001 | ///////////////////////// | |
1002 | ||
1003 | assign cntl_rw[2:0] = sel_rw_pass ? 3'b111: | |
1004 | cntl_out[ 2: 0]; // read write control | |
1005 | ||
1006 | assign next_rw[2:0] = cntl_rw[2:0]+3'b001 ; | |
1007 | ||
1008 | ||
1009 | assign cout_rw = &cntl_rw[2:0]; // carry over for rw | |
1010 | ||
1011 | ||
1012 | // next rw | |
1013 | assign cntl_in[2:0] = reset_engine ? 3'b000 : | |
1014 | ~run3 ? cntl_rw[2:0]: | |
1015 | next_rw[2:0]; | |
1016 | ||
1017 | ||
1018 | ||
1019 | //////////////////////////////////////////////////////////////////////////////// | |
1020 | // array selection | |
1021 | //////////////////////////////////////////////////////////////////////////////// | |
1022 | ||
1023 | ||
1024 | ||
1025 | ||
1026 | assign array_0 = array_sel[3:0]==4'h0; | |
1027 | assign array_1 = array_sel[3:0]==4'h1; | |
1028 | assign array_2 = array_sel[3:0]==4'h2; | |
1029 | assign array_3 = array_sel[3:0]==4'h3; | |
1030 | assign array_4 = array_sel[3:0]==4'h4; | |
1031 | assign array_5 = array_sel[3:0]==4'h5; | |
1032 | // assign array_end = array_sel[3:0]==4'h5; | |
1033 | ||
1034 | ||
1035 | assign last_array = array_5; | |
1036 | ||
1037 | ||
1038 | ||
1039 | ||
1040 | // ///////////////////////////////////////////////////////////////////////////// | |
1041 | // | |
1042 | // MBIST Control Register | |
1043 | // | |
1044 | // ///////////////////////////////////////////////////////////////////////////// | |
1045 | // standard membist | |
1046 | // ///////////////////////////////////////////////////////////////////////////// | |
1047 | // 0 1 2 3 4 5 6 7 8 | |
1048 | // ^(W0);^(R0W1);^(R1W0);v(R0W1);v(R1W0);v(R0);^(W1W0*R1R0W0);v(W1);^(W0W1*R0R1W1); | |
1049 | // | |
1050 | // - there are 9 march elements in the engine | |
1051 | // march_0 - march_8 indicate which march element it's in | |
1052 | // | |
1053 | // - for each march element, there are write and read sequences and for some | |
1054 | // just write or just read | |
1055 | // | |
1056 | // - for each march element, it can move upaddr (0-max) or downaddr (max-0) | |
1057 | // | |
1058 | // march rw upaddr truedata | |
1059 | // -------------------------------------------------------------------------------- | |
1060 | // - march_0 w 1 one_cycle_march rw_0 ^(W0) | |
1061 | // - march_1 rw 1 two_cycle_march rw_0 ^(R0W1) | |
1062 | // - march_2 rw 1 two_cycle_march rw_1 ^(R1W0) | |
1063 | // - march_3 rw 0 two_cycle_march rw_0 v(R0W1) | |
1064 | // - march_4 rw 0 two_cycle_march rw_1 v(R1W0) | |
1065 | // - march_5 r 0 one_cycle_march rw_0 v(R0) | |
1066 | // - march_6 wwrrw 1 five_cycle_march rw_1,3,4 ^(W1W0*R1R0W0) | |
1067 | // - march_7 w 0 one_cycle_march -- v(W1) | |
1068 | // - march_8 wwrrw 1 five_cycle_march rw_0,2 ^(W0W1*R0R1W1) | |
1069 | // mbist address: | |
1070 | // one_cycle_march : march_0 | march_5 | march_7 | |
1071 | // five_cycle_march : march_6 | march_8 | |
1072 | // two_cycle_march : ~(one_cycle_march | five_cycle_march) | |
1073 | ||
1074 | //////////////////////////////////////////////////////////////////////////////// | |
1075 | ////// user mode signals | |
1076 | ||
1077 | // the different between cntl_march and march is that march is before mux and | |
1078 | // and cntl_march is after mux | |
1079 | ||
1080 | // IRF-shadow | |
1081 | // write: W1,S1,X,W0,restore | |
1082 | // rw : R1,W1,S1,X,W0,restore | |
1083 | ||
1084 | spc_mb2_ctlmsff_ctl_macro__width_29 cntl_reg ( | |
1085 | .scan_in(cntl_reg_scanin), | |
1086 | .scan_out(cntl_reg_scanout), | |
1087 | .l1clk ( l1clk_pm1 ), | |
1088 | .din ({cntl_in[34:19] ,cntl_in[12:0]} ), | |
1089 | .dout ({cntl_out[34:19],cntl_out[12:0]} ), | |
1090 | .siclk(siclk), | |
1091 | .soclk(soclk)); | |
1092 | ||
1093 | ||
1094 | assign one_cycle_march = march_0 | march_5 | march_7; | |
1095 | assign five_cycle_march = march_6 | march_8; | |
1096 | assign two_cycle_march = ~(one_cycle_march | five_cycle_march); | |
1097 | ||
1098 | ||
1099 | // this will indicate last march turn | |
1100 | assign sel_march_1_pass = bisi_mode | ((mb_ten_n_mode | array_4) & march_5) | march_8; | |
1101 | ||
1102 | ||
1103 | assign bisi_wr_mode = mb_default_bisi | mb_user_bisi_rw_mode ? ~cntl_bisi & run3 : | |
1104 | mb_user_bisi_wr_mode & run3; | |
1105 | ||
1106 | assign bisi_rd_mode =mb_default_bisi | mb_user_bisi_rw_mode ? cntl_bisi & run3 : | |
1107 | mb_user_bisi_rd_mode & run3; | |
1108 | ||
1109 | ||
1110 | // control for rw | |
1111 | assign sel_rw_1_pass = bisi_mode | one_cycle_march ; | |
1112 | ||
1113 | assign sel_rw_2_pass = two_cycle_march; | |
1114 | assign sel_rw_5_pass = five_cycle_march; | |
1115 | ||
1116 | assign sel_rw_pass = (run3 & sel_rw_1_pass & rw_0 & ~array_4) | | |
1117 | (run3 & sel_rw_2_pass & rw_1 & ~array_4) | | |
1118 | (run3 & sel_rw_5_pass & rw_4 & ~array_4) | | |
1119 | (run3 & array_4 & march_5 & rw_0) | | |
1120 | (run3 & array_4 & march_0 & rw_5) | | |
1121 | (run3 & array_4 & ~(march_5 | march_0) & rw_6) ; | |
1122 | ||
1123 | ///////////////////// | |
1124 | // true data | |
1125 | //////////////////// | |
1126 | ||
1127 | ||
1128 | assign true_data_l = bisi_mode | | |
1129 | (~array_4 & march_0) | | |
1130 | (array_4 & march_0 & ~rw_3) | | |
1131 | (~array_4 & march_1 & rw_0) | | |
1132 | (array_4 & march_1 & (rw_0 | rw_4)) | | |
1133 | (~array_4 & march_2 & rw_1) | | |
1134 | (array_4 & march_2 & (rw_1 | rw_4)) | | |
1135 | (~array_4 & march_3 & rw_0) | | |
1136 | (array_4 & march_3 & (rw_0 | rw_4)) | | |
1137 | (~array_4 & march_4 & rw_1) | | |
1138 | (array_4 & march_4 & (rw_1 | rw_4)) | | |
1139 | (march_5) | | |
1140 | (march_6 & (rw_1 | rw_3 | rw_4)) | | |
1141 | (march_8 & (rw_0 | rw_2)); | |
1142 | ||
1143 | assign true_data=~true_data_l; | |
1144 | ||
1145 | ||
1146 | ///////////////////// | |
1147 | // membist data: | |
1148 | //////////////////// | |
1149 | ||
1150 | assign data_pat_sel[7:0] = mb_user_data_mode ? user_data[7:0]: | |
1151 | bisi_mode ? 8'hFF: | |
1152 | (cntl_data_sel[1:0] == 2'h0) ? 8'hAA: | |
1153 | (cntl_data_sel[1:0] == 2'h1) ? 8'h99: | |
1154 | (cntl_data_sel[1:0] == 2'h2) ? 8'hCC: | |
1155 | 8'h00; | |
1156 | ||
1157 | assign mem_data1[7:0] = (true_data) ? data_pat_sel[7:0] : ~data_pat_sel[7:0]; | |
1158 | assign mem_data[7:0] = ~array_4 ? mem_data1[7:0] : | |
1159 | array_4 & bisi_mode ? 8'h00 : | |
1160 | ~mem_data1[7:0]; | |
1161 | ||
1162 | ///////////////////// | |
1163 | // membist address: | |
1164 | //////////////////// | |
1165 | ||
1166 | assign cntl_addr[9:0] = cntl_out[12:3]; | |
1167 | ||
1168 | assign adj_addr = (five_cycle_march & (rw_1 | rw_3)) ? {cntl_addr[9:3],~cntl_addr[2],cntl_addr[1:0]}: | |
1169 | cntl_addr[9:0] ; | |
1170 | ||
1171 | ||
1172 | ||
1173 | assign up_addr[9:0] = upaddr ? adj_addr[9:0]: ~adj_addr[9:0]; | |
1174 | ||
1175 | ||
1176 | ||
1177 | ||
1178 | ///////////////////////// | |
1179 | // membist write enable | |
1180 | ///////////////////////// | |
1181 | ||
1182 | ||
1183 | assign mem_wr_pbi = (run3 & ~array_4 & ( | |
1184 | march_0 | | |
1185 | ((march_1 | march_2 | march_3 | march_4 ) & rw_1) | | |
1186 | (march_6 & (rw_0 | rw_1 | rw_4)) | | |
1187 | march_7 | | |
1188 | (march_8 & (rw_0 | rw_1 | rw_4)) | |
1189 | )) | | |
1190 | (run3 & array_4 & ( | |
1191 | (march_0 & (rw_0 | rw_3)) | | |
1192 | ((march_1 | march_2 | march_3 | march_4 ) & (rw_1 | rw_4)) | |
1193 | )) ; | |
1194 | ||
1195 | ||
1196 | assign mem_wr = bisi_wr_mode ? mem_wr_pbi : | |
1197 | bisi_rd_mode ? 1'b0 : | |
1198 | mem_wr_pbi; | |
1199 | ||
1200 | assign mem_save = (run3 & array_4 & ((march_0 & rw_1) | (~march_0 & rw_2))); | |
1201 | assign mem_restore = (run3 & array_4 & ((march_0 & rw_4) | (~march_0 & rw_5))); | |
1202 | ///////////////////////// | |
1203 | // membist read enable | |
1204 | ///////////////////////// | |
1205 | ||
1206 | ||
1207 | assign mem_rd_pbi = (~array_4 & run3 & ~mem_wr) | | |
1208 | ( array_4 & run3 & ~march_0 & rw_0); | |
1209 | ||
1210 | assign mem_rd= bisi_rd_mode ? 1'b1 : mem_rd_pbi; | |
1211 | // loop detection | |
1212 | ||
1213 | ||
1214 | assign upaddr = march_0 | march_1 | march_2 | march_6 | march_7 | bisi_mode ; | |
1215 | ||
1216 | ||
1217 | // next_rw[1:0] | |
1218 | ||
1219 | ||
1220 | ||
1221 | ||
1222 | assign array_sel_cntl_out[3:0]=cntl_out[32:29]; | |
1223 | ||
1224 | ||
1225 | spc_mb2_ctlmsff_ctl_macro__width_4 array_sel_reg ( | |
1226 | .scan_in(array_sel_reg_scanin), | |
1227 | .scan_out(array_sel_reg_scanout), | |
1228 | .l1clk ( l1clk_pm1 ), | |
1229 | .din ( array_sel[3:0] ), | |
1230 | .dout ( array_sel_out[3:0] ), | |
1231 | .siclk(siclk), | |
1232 | .soclk(soclk)); | |
1233 | ||
1234 | assign array_sel[3:0]=(&array_sel_cntl_out[3:0]) ? array_sel_out[3:0] : | |
1235 | user_mode ? user_array[3:0] : | |
1236 | array_sel_cntl_out[3:0]; | |
1237 | ||
1238 | ||
1239 | ||
1240 | assign march_element_cntl_out[3:0]=cntl_out[22:19]; | |
1241 | ||
1242 | ||
1243 | spc_mb2_ctlmsff_ctl_macro__width_4 marche_element_reg ( | |
1244 | .scan_in(marche_element_reg_scanin), | |
1245 | .scan_out(marche_element_reg_scanout), | |
1246 | .l1clk ( l1clk_pm1 ), | |
1247 | .din ( march_element[3:0] ), | |
1248 | .dout ( march_element_out ), | |
1249 | .siclk(siclk), | |
1250 | .soclk(soclk)); | |
1251 | ||
1252 | assign march_element[3:0]=(&march_element_cntl_out[3:0]) ? march_element_out[3:0] : | |
1253 | march_element_cntl_out[3:0]; | |
1254 | ||
1255 | ||
1256 | ||
1257 | assign rw[2:0]=cntl_out[2:0]; | |
1258 | ||
1259 | ||
1260 | ||
1261 | ||
1262 | ||
1263 | ||
1264 | ||
1265 | //////////////////////////////////// //////////////////////////////////// | |
1266 | // mbist signals | |
1267 | //////////////////////////////////// //////////////////////////////////// | |
1268 | ||
1269 | assign mb_run=run; | |
1270 | // assign mbist_cmp_sel[2:0]=~cntl_cmp_sel[2:0]; | |
1271 | assign mb_addr[15:0]=array_4 ? {6'b000000,cmp_sel[2:0],mem_addr[6:0]} : {6'b000000,mem_addr[9:0]}; | |
1272 | assign mb_write_data[7:0]=mem_data[7:0]; | |
1273 | ||
1274 | ||
1275 | // only one array read signal should be active | |
1276 | ||
1277 | ||
1278 | assign mb_array_0_rd= array_0 & mem_rd; | |
1279 | assign mb_array_1_rd= array_1 & mem_rd; | |
1280 | assign mb_array_2_rd= array_2 & mem_rd; | |
1281 | assign mb_array_3_rd= (array_3 & mem_rd & ((|mem_addr[4:0]) | ~(|mem_data[7:0])) & ~bisi_mode) | | |
1282 | (array_4 & mem_rd & ((|mem_addr[4:0]) | ~(|mem_data[7:0])) & ~bisi_mode); | |
1283 | assign mb_array_save= mem_save; | |
1284 | assign mb_array_5_rd= array_5 & mem_rd; | |
1285 | ||
1286 | // only one array write signal should be active | |
1287 | ||
1288 | ||
1289 | assign mb_array_0_wr= array_0 & mem_wr; | |
1290 | assign mb_array_1_wr= array_1 & mem_wr; | |
1291 | assign mb_array_2_wr= array_2 & mem_wr; | |
1292 | assign mb_array_3_wr= (array_3 & mem_wr) | (array_4 & mem_wr); | |
1293 | assign mb_array_restore = mem_restore; | |
1294 | assign mb_array_5_wr= array_5 & mem_wr; | |
1295 | ||
1296 | ||
1297 | ||
1298 | ||
1299 | // fail sigals from arrays | |
1300 | ||
1301 | ||
1302 | assign spu_arf_fail = mb2_arf_read_en_p2 & ~spu_mbi_arf_fail_; | |
1303 | assign spu_rrf_fail = mb2_rrf_read_en_p2 & ~spu_mbi_rrf_fail_; | |
1304 | assign spu_mam_fail = (mb2_mam_read_en_p2 & ~spu_mbi_mam_fail_ ) | | |
1305 | (mb2_mam_read_en_p2 & ~spu_mbi_mam_fail2_); | |
1306 | ||
1307 | assign exu0_irf_fail = (mb2_irf_read_en_p4 & ~exu0_mbi_irf_fail_[0] ) | | |
1308 | (mb2_irf_read_en_p4 & ~exu0_mbi_irf_fail_[1]); | |
1309 | assign exu1_irf_fail = (mb2_irf_read_en_p4 & ~exu1_mbi_irf_fail_[0] ) | | |
1310 | (mb2_irf_read_en_p4 & ~exu1_mbi_irf_fail_[1]); | |
1311 | ||
1312 | ||
1313 | ||
1314 | ||
1315 | assign arf_fail = run3_transition ? 1'b0 : (spu_arf_fail | spu_arf_fail_sticky); | |
1316 | assign rrf_fail = run3_transition ? 1'b0 : (spu_rrf_fail | spu_rrf_fail_sticky); | |
1317 | assign mam_fail = run3_transition ? 1'b0 : (spu_mam_fail | spu_mam_fail_sticky); | |
1318 | assign irf0_fail = run3_transition ? 1'b0 : (exu0_irf_fail | exu0_irf_fail_sticky); | |
1319 | assign irf1_fail = run3_transition ? 1'b0 : (exu1_irf_fail | exu1_irf_fail_sticky); | |
1320 | assign frf_fail = run3_transition ? 1'b0 : (fgu_mbi_frf_fail | fgu_frf_fail_sticky); | |
1321 | ||
1322 | ||
1323 | ||
1324 | ||
1325 | spc_mb2_ctlmsff_ctl_macro__width_6 fail_reg ( | |
1326 | .scan_in(fail_reg_scanin), | |
1327 | .scan_out(fail_reg_scanout), | |
1328 | .l1clk( l1clk_pm1 ), | |
1329 | .din ({arf_fail , | |
1330 | rrf_fail , | |
1331 | mam_fail , | |
1332 | irf0_fail , | |
1333 | irf1_fail , | |
1334 | frf_fail} ), | |
1335 | .dout ({spu_arf_fail_sticky , | |
1336 | spu_rrf_fail_sticky , | |
1337 | spu_mam_fail_sticky , | |
1338 | exu0_irf_fail_sticky , | |
1339 | exu1_irf_fail_sticky , | |
1340 | fgu_frf_fail_sticky} ), | |
1341 | .siclk(siclk), | |
1342 | .soclk(soclk)); | |
1343 | ||
1344 | ||
1345 | ||
1346 | assign mbist_fail_sticky = spu_arf_fail_sticky | | |
1347 | spu_rrf_fail_sticky | | |
1348 | spu_mam_fail_sticky | | |
1349 | exu0_irf_fail_sticky | | |
1350 | exu1_irf_fail_sticky | | |
1351 | fgu_frf_fail_sticky ; | |
1352 | ||
1353 | ||
1354 | ||
1355 | assign mbist_fail_array = spu_arf_fail | | |
1356 | spu_rrf_fail | | |
1357 | spu_mam_fail | | |
1358 | exu0_irf_fail | | |
1359 | exu1_irf_fail | | |
1360 | fgu_mbi_frf_fail; | |
1361 | ||
1362 | assign valid_fail=run3 | (stop_engine_l & ~mb_done); | |
1363 | ||
1364 | assign mb_fail = mb_done ? mbist_fail_sticky : mbist_fail_array & valid_fail; | |
1365 | ||
1366 | ||
1367 | ||
1368 | ||
1369 | //////////////////////////////////// //////////////////////////////////// | |
1370 | // DONE LOGIC | |
1371 | //////////////////////////////////// //////////////////////////////////// | |
1372 | ||
1373 | ||
1374 | ||
1375 | ||
1376 | spc_mb2_ctlmsff_ctl_macro__width_1 msb_latch ( | |
1377 | .scan_in(msb_latch_scanin), | |
1378 | .scan_out(msb_latch_scanout), | |
1379 | .l1clk ( l1clk_pm1 ), | |
1380 | .din ( msb_in ), | |
1381 | .dout ( msb_out ), | |
1382 | .siclk(siclk), | |
1383 | .soclk(soclk)); | |
1384 | ||
1385 | assign msb_in= (~start_in ) | (mb_user_loop_mode & mb_done) ? 1'b0 : | |
1386 | (cntl_msb) ? 1'b1 : | |
1387 | msb_out; | |
1388 | ||
1389 | ||
1390 | assign stop_engine_l = start_in & cntl_msb; | |
1391 | ||
1392 | ||
1393 | assign mb_done=msb_out & (done_delay[4:0]==5'b11110); | |
1394 | ||
1395 | assign run3 = &done_delay[4:1] & ~stop_engine_l & start_in; | |
1396 | ||
1397 | ||
1398 | spc_mb2_ctlmsff_ctl_macro__width_1 run3_transition_reg ( | |
1399 | .scan_in(run3_transition_reg_scanin), | |
1400 | .scan_out(run3_transition_reg_scanout), | |
1401 | .l1clk ( l1clk_pm1 ), | |
1402 | .din ( run3 ), | |
1403 | .dout ( run3_out ), | |
1404 | .siclk(siclk), | |
1405 | .soclk(soclk)); | |
1406 | ||
1407 | assign run3_transition = run3 & ~run3_out; | |
1408 | ||
1409 | spc_mb2_ctlmsff_ctl_macro__width_5 done_delay_reg ( | |
1410 | .scan_in(done_delay_reg_scanin), | |
1411 | .scan_out(done_delay_reg_scanout), | |
1412 | .l1clk ( l1clk_pm1 ), | |
1413 | .din ( done_delay_in[4:0] ), | |
1414 | .dout ( done_delay[4:0] ), | |
1415 | .siclk(siclk), | |
1416 | .soclk(soclk)); | |
1417 | ||
1418 | ||
1419 | ||
1420 | assign done_delay_in[4:0] = run3 ? 5'b11111 : | |
1421 | mb_done ? 5'b11110 : | |
1422 | (run & ~run3) ? done_delay[4:0] + 5'b00001 : | |
1423 | 5'b00000; | |
1424 | ||
1425 | ||
1426 | ||
1427 | //////////////////////////////////// //////////////////////////////////// | |
1428 | // FAIL LOGIC | |
1429 | //////////////////////////////////// //////////////////////////////////// | |
1430 | ||
1431 | ||
1432 | ||
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | spc_mb2_ctlmsff_ctl_macro__width_1 out_run_mb_arrays_reg ( | |
1438 | .scan_in(out_run_mb_arrays_reg_scanin), | |
1439 | .scan_out(out_run_mb_arrays_reg_scanout), | |
1440 | .l1clk( l1clk_pm1 ), | |
1441 | .din ( mb_run ), | |
1442 | .dout ( mb_run_out ), | |
1443 | .siclk(siclk), | |
1444 | .soclk(soclk)); | |
1445 | ||
1446 | ||
1447 | ||
1448 | spc_mb2_ctlmsff_ctl_macro__width_8 out_data_mb_arrays_reg ( | |
1449 | .scan_in(out_data_mb_arrays_reg_scanin), | |
1450 | .scan_out(out_data_mb_arrays_reg_scanout), | |
1451 | .l1clk( l1clk_pm1 ), | |
1452 | .din ( mb_write_data[7:0] ), | |
1453 | .dout ( mb_write_data_out[7:0] ), | |
1454 | .siclk(siclk), | |
1455 | .soclk(soclk)); | |
1456 | ||
1457 | ||
1458 | ||
1459 | spc_mb2_ctlmsff_ctl_macro__width_16 out_addr_mb_arrays_reg ( | |
1460 | .scan_in(out_addr_mb_arrays_reg_scanin), | |
1461 | .scan_out(out_addr_mb_arrays_reg_scanout), | |
1462 | .l1clk( l1clk_pm1 ), | |
1463 | .din ( mb_addr[15:0] ), | |
1464 | .dout ( mb_addr_out[15:0] ), | |
1465 | .siclk(siclk), | |
1466 | .soclk(soclk)); | |
1467 | ||
1468 | ||
1469 | ||
1470 | ||
1471 | spc_mb2_ctlmsff_ctl_macro__width_5 out_wr_mb_arrays_reg ( | |
1472 | .scan_in(out_wr_mb_arrays_reg_scanin), | |
1473 | .scan_out(out_wr_mb_arrays_reg_scanout), | |
1474 | .l1clk( l1clk_pm1 ), | |
1475 | .din ( { | |
1476 | mb_array_0_wr , | |
1477 | mb_array_1_wr , | |
1478 | mb_array_2_wr, | |
1479 | mb_array_3_wr, | |
1480 | mb_array_5_wr | |
1481 | } ), | |
1482 | .dout ({ | |
1483 | mb_array_0_wr_out , | |
1484 | mb_array_1_wr_out , | |
1485 | mb_array_2_wr_out, | |
1486 | mb_array_3_wr_out, | |
1487 | mb_array_5_wr_out | |
1488 | } ), | |
1489 | .siclk(siclk), | |
1490 | .soclk(soclk)); | |
1491 | ||
1492 | ||
1493 | spc_mb2_ctlmsff_ctl_macro__width_5 out_rd_mb_arrays_reg ( | |
1494 | .scan_in(out_rd_mb_arrays_reg_scanin), | |
1495 | .scan_out(out_rd_mb_arrays_reg_scanout), | |
1496 | .l1clk( l1clk_pm1 ), | |
1497 | .din ( { | |
1498 | mb_array_0_rd, | |
1499 | mb_array_1_rd, | |
1500 | mb_array_2_rd, | |
1501 | mb_array_3_rd, | |
1502 | mb_array_5_rd | |
1503 | } ), | |
1504 | .dout ({ | |
1505 | mb_array_0_rd_out, | |
1506 | mb_array_1_rd_out, | |
1507 | mb_array_2_rd_out, | |
1508 | mb_array_3_rd_out, | |
1509 | mb_array_5_rd_out | |
1510 | } ), | |
1511 | .siclk(siclk), | |
1512 | .soclk(soclk)); | |
1513 | ||
1514 | ||
1515 | assign mb2_run=mb_run_out; | |
1516 | assign mb2_write_data[7:0]=mb_write_data_out[7:0]; | |
1517 | assign mb2_addr[15:0]=mb_addr_out[15:0]; | |
1518 | ||
1519 | ||
1520 | assign mb2_arf_write_en=mb_array_0_wr_out; | |
1521 | assign mb2_rrf_write_en=mb_array_1_wr_out; | |
1522 | assign mb2_mam_write_en=mb_array_2_wr_out; | |
1523 | assign mb2_irf_write_en=mb_array_3_wr_out; | |
1524 | assign mb2_frf_write_en=mb_array_5_wr_out; | |
1525 | ||
1526 | assign mb2_arf_read_en=mb_array_0_rd_out; | |
1527 | assign mb2_rrf_read_en=mb_array_1_rd_out; | |
1528 | assign mb2_mam_read_en=mb_array_2_rd_out; | |
1529 | assign mb2_irf_read_en=mb_array_3_rd_out; | |
1530 | assign mb2_frf_read_en=mb_array_5_rd_out; | |
1531 | ||
1532 | ||
1533 | ||
1534 | ||
1535 | ||
1536 | spc_mb2_ctlmsff_ctl_macro__width_1 out_mb_tcu_done_reg ( | |
1537 | .scan_in(out_mb_tcu_done_reg_scanin), | |
1538 | .scan_out(out_mb_tcu_done_reg_scanout), | |
1539 | .l1clk ( l1clk_pm1 ), | |
1540 | .din ( mb_done ), | |
1541 | .dout ( mb_done_out ), | |
1542 | .siclk(siclk), | |
1543 | .soclk(soclk)); | |
1544 | ||
1545 | ||
1546 | ||
1547 | ||
1548 | spc_mb2_ctlmsff_ctl_macro__width_1 out_mb_tcu_fail_reg ( | |
1549 | .scan_in(out_mb_tcu_fail_reg_scanin), | |
1550 | .scan_out(out_mb_tcu_fail_reg_scanout), | |
1551 | .l1clk ( l1clk_pm1 ), | |
1552 | .din ( mb_fail ), | |
1553 | .dout ( mb_fail_out ), | |
1554 | .siclk(siclk), | |
1555 | .soclk(soclk)); | |
1556 | ||
1557 | ||
1558 | assign mb2_done=mb_done_out; | |
1559 | assign mb2_mbist_fail=mb_fail_out; | |
1560 | ||
1561 | // spare gates: | |
1562 | ||
1563 | ||
1564 | spc_mb2_ctlspare_ctl_macro__num_3 spares ( | |
1565 | .scan_in(spares_scanin), | |
1566 | .scan_out(spares_scanout), | |
1567 | .l1clk (l1clk_pm1), | |
1568 | .siclk(siclk), | |
1569 | .soclk(soclk) | |
1570 | ); | |
1571 | ||
1572 | ||
1573 | ||
1574 | //////////////////////////////////////////////////////////////////////////////// | |
1575 | // UNIQUE TO ENGINE | |
1576 | //////////////////////////////////////////////////////////////////////////////// | |
1577 | ||
1578 | // assign first_six_march =~(march_6 | march_7 | march_8); | |
1579 | ||
1580 | ||
1581 | ||
1582 | // END UNIQUE | |
1583 | ||
1584 | ||
1585 | ||
1586 | ||
1587 | spc_mb2_ctlmsff_ctl_macro__width_4 i_delay_4th ( | |
1588 | .scan_in(i_delay_4th_scanin), | |
1589 | .scan_out(i_delay_4th_scanout), | |
1590 | .l1clk( l1clk_pm1 ), | |
1591 | .din ({mb2_irf_read_en , | |
1592 | mb2_irf_read_en_p1 , | |
1593 | mb2_irf_read_en_p2 , | |
1594 | mb2_irf_read_en_p3} ), | |
1595 | .dout ({mb2_irf_read_en_p1 , | |
1596 | mb2_irf_read_en_p2 , | |
1597 | mb2_irf_read_en_p3 , | |
1598 | mb2_irf_read_en_p4} ), | |
1599 | .siclk(siclk), | |
1600 | .soclk(soclk)); | |
1601 | ||
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | // delayed compare read and data signals | |
1607 | ||
1608 | spc_mb2_ctlmsff_ctl_macro__width_22 delayed_cmp_rd_data_reg ( | |
1609 | .scan_in(delayed_cmp_rd_data_reg_scanin), | |
1610 | .scan_out(delayed_cmp_rd_data_reg_scanout), | |
1611 | .l1clk( l1clk_pm1 ), | |
1612 | .din ({mb2_arf_read_en , | |
1613 | mb2_mam_read_en , | |
1614 | mb2_rrf_read_en , | |
1615 | mb2_write_data[7:0] , | |
1616 | mb2_arf_read_en_p1 , | |
1617 | mb2_mam_read_en_p1 , | |
1618 | mb2_rrf_read_en_p1 , | |
1619 | mb2_write_data_p1[7:0]} ), | |
1620 | .dout ({mb2_arf_read_en_p1 , | |
1621 | mb2_mam_read_en_p1 , | |
1622 | mb2_rrf_read_en_p1 , | |
1623 | mb2_write_data_p1[7:0] , | |
1624 | mb2_arf_read_en_p2 , | |
1625 | mb2_mam_read_en_p2 , | |
1626 | mb2_rrf_read_en_p2 , | |
1627 | mb2_write_data_p2[7:0]} ), | |
1628 | .siclk(siclk), | |
1629 | .soclk(soclk)); | |
1630 | ||
1631 | ||
1632 | // save and restore signals to arrays | |
1633 | ||
1634 | ||
1635 | spc_mb2_ctlmsff_ctl_macro__width_2 out_save_restore_mb_arrays_reg ( | |
1636 | .scan_in(out_save_restore_mb_arrays_reg_scanin), | |
1637 | .scan_out(out_save_restore_mb_arrays_reg_scanout), | |
1638 | .l1clk( l1clk_pm1 ), | |
1639 | .din ({mb_array_save , | |
1640 | mb_array_restore} ), | |
1641 | .dout ({mb2_irf_save_en , | |
1642 | mb2_irf_restore_en} ), | |
1643 | .siclk(siclk), | |
1644 | .soclk(soclk)); | |
1645 | ||
1646 | ||
1647 | ||
1648 | ||
1649 | ||
1650 | // fixscan start: | |
1651 | assign pmen_scanin = scan_in ; | |
1652 | assign input_signals_reg_scanin = pmen_scanout ; | |
1653 | assign mb_enable_reg_scanin = input_signals_reg_scanout; | |
1654 | assign config_reg_scanin = mb_enable_reg_scanout ; | |
1655 | assign loop_again_reg_scanin = config_reg_scanout ; | |
1656 | assign array_usr_reg_scanin = loop_again_reg_scanout ; | |
1657 | assign user_addr_mode_reg_scanin = array_usr_reg_scanout ; | |
1658 | assign user_start_addr_reg_scanin = user_addr_mode_reg_scanout; | |
1659 | assign user_stop_addr_reg_scanin = user_start_addr_reg_scanout; | |
1660 | assign user_incr_addr_reg_scanin = user_stop_addr_reg_scanout; | |
1661 | assign user_data_mode_reg_scanin = user_incr_addr_reg_scanout; | |
1662 | assign user_data_reg_scanin = user_data_mode_reg_scanout; | |
1663 | assign user_cmpselinc_hold_reg_scanin = user_data_reg_scanout ; | |
1664 | assign user_cmpsel_reg_scanin = user_cmpselinc_hold_reg_scanout; | |
1665 | assign user_loop_mode_reg_scanin = user_cmpsel_reg_scanout ; | |
1666 | assign ten_n_mode_reg_scanin = user_loop_mode_reg_scanout; | |
1667 | assign user_bisi_wr_mode_reg_scanin = ten_n_mode_reg_scanout ; | |
1668 | assign user_bisi_rd_mode_reg_scanin = user_bisi_wr_mode_reg_scanout; | |
1669 | assign cmp_sel_reg_scanin = user_bisi_rd_mode_reg_scanout; | |
1670 | assign cntl_reg_scanin = cmp_sel_reg_scanout ; | |
1671 | assign array_sel_reg_scanin = cntl_reg_scanout ; | |
1672 | assign marche_element_reg_scanin = array_sel_reg_scanout ; | |
1673 | assign fail_reg_scanin = marche_element_reg_scanout; | |
1674 | assign msb_latch_scanin = fail_reg_scanout ; | |
1675 | assign run3_transition_reg_scanin = msb_latch_scanout ; | |
1676 | assign done_delay_reg_scanin = run3_transition_reg_scanout; | |
1677 | assign out_run_mb_arrays_reg_scanin = done_delay_reg_scanout ; | |
1678 | assign out_data_mb_arrays_reg_scanin = out_run_mb_arrays_reg_scanout; | |
1679 | assign out_addr_mb_arrays_reg_scanin = out_data_mb_arrays_reg_scanout; | |
1680 | assign out_wr_mb_arrays_reg_scanin = out_addr_mb_arrays_reg_scanout; | |
1681 | assign out_rd_mb_arrays_reg_scanin = out_wr_mb_arrays_reg_scanout; | |
1682 | assign out_mb_tcu_done_reg_scanin = out_rd_mb_arrays_reg_scanout; | |
1683 | assign out_mb_tcu_fail_reg_scanin = out_mb_tcu_done_reg_scanout; | |
1684 | assign spares_scanin = out_mb_tcu_fail_reg_scanout; | |
1685 | assign i_delay_4th_scanin = spares_scanout ; | |
1686 | assign delayed_cmp_rd_data_reg_scanin = i_delay_4th_scanout ; | |
1687 | assign out_save_restore_mb_arrays_reg_scanin = delayed_cmp_rd_data_reg_scanout; | |
1688 | assign scan_out = out_save_restore_mb_arrays_reg_scanout; | |
1689 | // fixscan end: | |
1690 | endmodule | |
1691 | ||
1692 | ||
1693 | ||
1694 | ||
1695 | ||
1696 | ||
1697 | // any PARAMS parms go into naming of macro | |
1698 | ||
1699 | module spc_mb2_ctll1clkhdr_ctl_macro ( | |
1700 | l2clk, | |
1701 | l1en, | |
1702 | pce_ov, | |
1703 | stop, | |
1704 | se, | |
1705 | l1clk); | |
1706 | ||
1707 | ||
1708 | input l2clk; | |
1709 | input l1en; | |
1710 | input pce_ov; | |
1711 | input stop; | |
1712 | input se; | |
1713 | output l1clk; | |
1714 | ||
1715 | ||
1716 | ||
1717 | ||
1718 | ||
1719 | cl_sc1_l1hdr_8x c_0 ( | |
1720 | ||
1721 | ||
1722 | .l2clk(l2clk), | |
1723 | .pce(l1en), | |
1724 | .l1clk(l1clk), | |
1725 | .se(se), | |
1726 | .pce_ov(pce_ov), | |
1727 | .stop(stop) | |
1728 | ); | |
1729 | ||
1730 | ||
1731 | ||
1732 | endmodule | |
1733 | ||
1734 | ||
1735 | ||
1736 | ||
1737 | ||
1738 | ||
1739 | ||
1740 | ||
1741 | ||
1742 | ||
1743 | ||
1744 | ||
1745 | ||
1746 | // any PARAMS parms go into naming of macro | |
1747 | ||
1748 | module spc_mb2_ctlmsff_ctl_macro__width_3 ( | |
1749 | din, | |
1750 | l1clk, | |
1751 | scan_in, | |
1752 | siclk, | |
1753 | soclk, | |
1754 | dout, | |
1755 | scan_out); | |
1756 | wire [2:0] fdin; | |
1757 | wire [1:0] so; | |
1758 | ||
1759 | input [2:0] din; | |
1760 | input l1clk; | |
1761 | input scan_in; | |
1762 | ||
1763 | ||
1764 | input siclk; | |
1765 | input soclk; | |
1766 | ||
1767 | output [2:0] dout; | |
1768 | output scan_out; | |
1769 | assign fdin[2:0] = din[2:0]; | |
1770 | ||
1771 | ||
1772 | ||
1773 | ||
1774 | ||
1775 | ||
1776 | dff #(3) d0_0 ( | |
1777 | .l1clk(l1clk), | |
1778 | .siclk(siclk), | |
1779 | .soclk(soclk), | |
1780 | .d(fdin[2:0]), | |
1781 | .si({scan_in,so[1:0]}), | |
1782 | .so({so[1:0],scan_out}), | |
1783 | .q(dout[2:0]) | |
1784 | ); | |
1785 | ||
1786 | ||
1787 | ||
1788 | ||
1789 | ||
1790 | ||
1791 | ||
1792 | ||
1793 | ||
1794 | ||
1795 | ||
1796 | ||
1797 | endmodule | |
1798 | ||
1799 | ||
1800 | ||
1801 | ||
1802 | ||
1803 | ||
1804 | ||
1805 | ||
1806 | ||
1807 | ||
1808 | ||
1809 | ||
1810 | ||
1811 | // any PARAMS parms go into naming of macro | |
1812 | ||
1813 | module spc_mb2_ctlmsff_ctl_macro__width_2 ( | |
1814 | din, | |
1815 | l1clk, | |
1816 | scan_in, | |
1817 | siclk, | |
1818 | soclk, | |
1819 | dout, | |
1820 | scan_out); | |
1821 | wire [1:0] fdin; | |
1822 | wire [0:0] so; | |
1823 | ||
1824 | input [1:0] din; | |
1825 | input l1clk; | |
1826 | input scan_in; | |
1827 | ||
1828 | ||
1829 | input siclk; | |
1830 | input soclk; | |
1831 | ||
1832 | output [1:0] dout; | |
1833 | output scan_out; | |
1834 | assign fdin[1:0] = din[1:0]; | |
1835 | ||
1836 | ||
1837 | ||
1838 | ||
1839 | ||
1840 | ||
1841 | dff #(2) d0_0 ( | |
1842 | .l1clk(l1clk), | |
1843 | .siclk(siclk), | |
1844 | .soclk(soclk), | |
1845 | .d(fdin[1:0]), | |
1846 | .si({scan_in,so[0:0]}), | |
1847 | .so({so[0:0],scan_out}), | |
1848 | .q(dout[1:0]) | |
1849 | ); | |
1850 | ||
1851 | ||
1852 | ||
1853 | ||
1854 | ||
1855 | ||
1856 | ||
1857 | ||
1858 | ||
1859 | ||
1860 | ||
1861 | ||
1862 | endmodule | |
1863 | ||
1864 | ||
1865 | ||
1866 | ||
1867 | ||
1868 | ||
1869 | ||
1870 | ||
1871 | ||
1872 | ||
1873 | ||
1874 | ||
1875 | ||
1876 | // any PARAMS parms go into naming of macro | |
1877 | ||
1878 | module spc_mb2_ctlmsff_ctl_macro__width_1 ( | |
1879 | din, | |
1880 | l1clk, | |
1881 | scan_in, | |
1882 | siclk, | |
1883 | soclk, | |
1884 | dout, | |
1885 | scan_out); | |
1886 | wire [0:0] fdin; | |
1887 | ||
1888 | input [0:0] din; | |
1889 | input l1clk; | |
1890 | input scan_in; | |
1891 | ||
1892 | ||
1893 | input siclk; | |
1894 | input soclk; | |
1895 | ||
1896 | output [0:0] dout; | |
1897 | output scan_out; | |
1898 | assign fdin[0:0] = din[0:0]; | |
1899 | ||
1900 | ||
1901 | ||
1902 | ||
1903 | ||
1904 | ||
1905 | dff #(1) d0_0 ( | |
1906 | .l1clk(l1clk), | |
1907 | .siclk(siclk), | |
1908 | .soclk(soclk), | |
1909 | .d(fdin[0:0]), | |
1910 | .si(scan_in), | |
1911 | .so(scan_out), | |
1912 | .q(dout[0:0]) | |
1913 | ); | |
1914 | ||
1915 | ||
1916 | ||
1917 | ||
1918 | ||
1919 | ||
1920 | ||
1921 | ||
1922 | ||
1923 | ||
1924 | ||
1925 | ||
1926 | endmodule | |
1927 | ||
1928 | ||
1929 | ||
1930 | ||
1931 | ||
1932 | ||
1933 | ||
1934 | ||
1935 | ||
1936 | ||
1937 | ||
1938 | ||
1939 | ||
1940 | // any PARAMS parms go into naming of macro | |
1941 | ||
1942 | module spc_mb2_ctlmsff_ctl_macro__width_4 ( | |
1943 | din, | |
1944 | l1clk, | |
1945 | scan_in, | |
1946 | siclk, | |
1947 | soclk, | |
1948 | dout, | |
1949 | scan_out); | |
1950 | wire [3:0] fdin; | |
1951 | wire [2:0] so; | |
1952 | ||
1953 | input [3:0] din; | |
1954 | input l1clk; | |
1955 | input scan_in; | |
1956 | ||
1957 | ||
1958 | input siclk; | |
1959 | input soclk; | |
1960 | ||
1961 | output [3:0] dout; | |
1962 | output scan_out; | |
1963 | assign fdin[3:0] = din[3:0]; | |
1964 | ||
1965 | ||
1966 | ||
1967 | ||
1968 | ||
1969 | ||
1970 | dff #(4) d0_0 ( | |
1971 | .l1clk(l1clk), | |
1972 | .siclk(siclk), | |
1973 | .soclk(soclk), | |
1974 | .d(fdin[3:0]), | |
1975 | .si({scan_in,so[2:0]}), | |
1976 | .so({so[2:0],scan_out}), | |
1977 | .q(dout[3:0]) | |
1978 | ); | |
1979 | ||
1980 | ||
1981 | ||
1982 | ||
1983 | ||
1984 | ||
1985 | ||
1986 | ||
1987 | ||
1988 | ||
1989 | ||
1990 | ||
1991 | endmodule | |
1992 | ||
1993 | ||
1994 | ||
1995 | ||
1996 | ||
1997 | ||
1998 | ||
1999 | ||
2000 | ||
2001 | ||
2002 | ||
2003 | ||
2004 | ||
2005 | // any PARAMS parms go into naming of macro | |
2006 | ||
2007 | module spc_mb2_ctlmsff_ctl_macro__width_10 ( | |
2008 | din, | |
2009 | l1clk, | |
2010 | scan_in, | |
2011 | siclk, | |
2012 | soclk, | |
2013 | dout, | |
2014 | scan_out); | |
2015 | wire [9:0] fdin; | |
2016 | wire [8:0] so; | |
2017 | ||
2018 | input [9:0] din; | |
2019 | input l1clk; | |
2020 | input scan_in; | |
2021 | ||
2022 | ||
2023 | input siclk; | |
2024 | input soclk; | |
2025 | ||
2026 | output [9:0] dout; | |
2027 | output scan_out; | |
2028 | assign fdin[9:0] = din[9:0]; | |
2029 | ||
2030 | ||
2031 | ||
2032 | ||
2033 | ||
2034 | ||
2035 | dff #(10) d0_0 ( | |
2036 | .l1clk(l1clk), | |
2037 | .siclk(siclk), | |
2038 | .soclk(soclk), | |
2039 | .d(fdin[9:0]), | |
2040 | .si({scan_in,so[8:0]}), | |
2041 | .so({so[8:0],scan_out}), | |
2042 | .q(dout[9:0]) | |
2043 | ); | |
2044 | ||
2045 | ||
2046 | ||
2047 | ||
2048 | ||
2049 | ||
2050 | ||
2051 | ||
2052 | ||
2053 | ||
2054 | ||
2055 | ||
2056 | endmodule | |
2057 | ||
2058 | ||
2059 | ||
2060 | ||
2061 | ||
2062 | ||
2063 | ||
2064 | ||
2065 | ||
2066 | ||
2067 | ||
2068 | ||
2069 | ||
2070 | // any PARAMS parms go into naming of macro | |
2071 | ||
2072 | module spc_mb2_ctlmsff_ctl_macro__width_8 ( | |
2073 | din, | |
2074 | l1clk, | |
2075 | scan_in, | |
2076 | siclk, | |
2077 | soclk, | |
2078 | dout, | |
2079 | scan_out); | |
2080 | wire [7:0] fdin; | |
2081 | wire [6:0] so; | |
2082 | ||
2083 | input [7:0] din; | |
2084 | input l1clk; | |
2085 | input scan_in; | |
2086 | ||
2087 | ||
2088 | input siclk; | |
2089 | input soclk; | |
2090 | ||
2091 | output [7:0] dout; | |
2092 | output scan_out; | |
2093 | assign fdin[7:0] = din[7:0]; | |
2094 | ||
2095 | ||
2096 | ||
2097 | ||
2098 | ||
2099 | ||
2100 | dff #(8) d0_0 ( | |
2101 | .l1clk(l1clk), | |
2102 | .siclk(siclk), | |
2103 | .soclk(soclk), | |
2104 | .d(fdin[7:0]), | |
2105 | .si({scan_in,so[6:0]}), | |
2106 | .so({so[6:0],scan_out}), | |
2107 | .q(dout[7:0]) | |
2108 | ); | |
2109 | ||
2110 | ||
2111 | ||
2112 | ||
2113 | ||
2114 | ||
2115 | ||
2116 | ||
2117 | ||
2118 | ||
2119 | ||
2120 | ||
2121 | endmodule | |
2122 | ||
2123 | ||
2124 | ||
2125 | ||
2126 | ||
2127 | ||
2128 | ||
2129 | ||
2130 | ||
2131 | ||
2132 | ||
2133 | ||
2134 | ||
2135 | // any PARAMS parms go into naming of macro | |
2136 | ||
2137 | module spc_mb2_ctlmsff_ctl_macro__width_29 ( | |
2138 | din, | |
2139 | l1clk, | |
2140 | scan_in, | |
2141 | siclk, | |
2142 | soclk, | |
2143 | dout, | |
2144 | scan_out); | |
2145 | wire [28:0] fdin; | |
2146 | wire [27:0] so; | |
2147 | ||
2148 | input [28:0] din; | |
2149 | input l1clk; | |
2150 | input scan_in; | |
2151 | ||
2152 | ||
2153 | input siclk; | |
2154 | input soclk; | |
2155 | ||
2156 | output [28:0] dout; | |
2157 | output scan_out; | |
2158 | assign fdin[28:0] = din[28:0]; | |
2159 | ||
2160 | ||
2161 | ||
2162 | ||
2163 | ||
2164 | ||
2165 | dff #(29) d0_0 ( | |
2166 | .l1clk(l1clk), | |
2167 | .siclk(siclk), | |
2168 | .soclk(soclk), | |
2169 | .d(fdin[28:0]), | |
2170 | .si({scan_in,so[27:0]}), | |
2171 | .so({so[27:0],scan_out}), | |
2172 | .q(dout[28:0]) | |
2173 | ); | |
2174 | ||
2175 | ||
2176 | ||
2177 | ||
2178 | ||
2179 | ||
2180 | ||
2181 | ||
2182 | ||
2183 | ||
2184 | ||
2185 | ||
2186 | endmodule | |
2187 | ||
2188 | ||
2189 | ||
2190 | ||
2191 | ||
2192 | ||
2193 | ||
2194 | ||
2195 | ||
2196 | ||
2197 | ||
2198 | ||
2199 | ||
2200 | // any PARAMS parms go into naming of macro | |
2201 | ||
2202 | module spc_mb2_ctlmsff_ctl_macro__width_6 ( | |
2203 | din, | |
2204 | l1clk, | |
2205 | scan_in, | |
2206 | siclk, | |
2207 | soclk, | |
2208 | dout, | |
2209 | scan_out); | |
2210 | wire [5:0] fdin; | |
2211 | wire [4:0] so; | |
2212 | ||
2213 | input [5:0] din; | |
2214 | input l1clk; | |
2215 | input scan_in; | |
2216 | ||
2217 | ||
2218 | input siclk; | |
2219 | input soclk; | |
2220 | ||
2221 | output [5:0] dout; | |
2222 | output scan_out; | |
2223 | assign fdin[5:0] = din[5:0]; | |
2224 | ||
2225 | ||
2226 | ||
2227 | ||
2228 | ||
2229 | ||
2230 | dff #(6) d0_0 ( | |
2231 | .l1clk(l1clk), | |
2232 | .siclk(siclk), | |
2233 | .soclk(soclk), | |
2234 | .d(fdin[5:0]), | |
2235 | .si({scan_in,so[4:0]}), | |
2236 | .so({so[4:0],scan_out}), | |
2237 | .q(dout[5:0]) | |
2238 | ); | |
2239 | ||
2240 | ||
2241 | ||
2242 | ||
2243 | ||
2244 | ||
2245 | ||
2246 | ||
2247 | ||
2248 | ||
2249 | ||
2250 | ||
2251 | endmodule | |
2252 | ||
2253 | ||
2254 | ||
2255 | ||
2256 | ||
2257 | ||
2258 | ||
2259 | ||
2260 | ||
2261 | ||
2262 | ||
2263 | ||
2264 | ||
2265 | // any PARAMS parms go into naming of macro | |
2266 | ||
2267 | module spc_mb2_ctlmsff_ctl_macro__width_5 ( | |
2268 | din, | |
2269 | l1clk, | |
2270 | scan_in, | |
2271 | siclk, | |
2272 | soclk, | |
2273 | dout, | |
2274 | scan_out); | |
2275 | wire [4:0] fdin; | |
2276 | wire [3:0] so; | |
2277 | ||
2278 | input [4:0] din; | |
2279 | input l1clk; | |
2280 | input scan_in; | |
2281 | ||
2282 | ||
2283 | input siclk; | |
2284 | input soclk; | |
2285 | ||
2286 | output [4:0] dout; | |
2287 | output scan_out; | |
2288 | assign fdin[4:0] = din[4:0]; | |
2289 | ||
2290 | ||
2291 | ||
2292 | ||
2293 | ||
2294 | ||
2295 | dff #(5) d0_0 ( | |
2296 | .l1clk(l1clk), | |
2297 | .siclk(siclk), | |
2298 | .soclk(soclk), | |
2299 | .d(fdin[4:0]), | |
2300 | .si({scan_in,so[3:0]}), | |
2301 | .so({so[3:0],scan_out}), | |
2302 | .q(dout[4:0]) | |
2303 | ); | |
2304 | ||
2305 | ||
2306 | ||
2307 | ||
2308 | ||
2309 | ||
2310 | ||
2311 | ||
2312 | ||
2313 | ||
2314 | ||
2315 | ||
2316 | endmodule | |
2317 | ||
2318 | ||
2319 | ||
2320 | ||
2321 | ||
2322 | ||
2323 | ||
2324 | ||
2325 | ||
2326 | ||
2327 | ||
2328 | ||
2329 | ||
2330 | // any PARAMS parms go into naming of macro | |
2331 | ||
2332 | module spc_mb2_ctlmsff_ctl_macro__width_16 ( | |
2333 | din, | |
2334 | l1clk, | |
2335 | scan_in, | |
2336 | siclk, | |
2337 | soclk, | |
2338 | dout, | |
2339 | scan_out); | |
2340 | wire [15:0] fdin; | |
2341 | wire [14:0] so; | |
2342 | ||
2343 | input [15:0] din; | |
2344 | input l1clk; | |
2345 | input scan_in; | |
2346 | ||
2347 | ||
2348 | input siclk; | |
2349 | input soclk; | |
2350 | ||
2351 | output [15:0] dout; | |
2352 | output scan_out; | |
2353 | assign fdin[15:0] = din[15:0]; | |
2354 | ||
2355 | ||
2356 | ||
2357 | ||
2358 | ||
2359 | ||
2360 | dff #(16) d0_0 ( | |
2361 | .l1clk(l1clk), | |
2362 | .siclk(siclk), | |
2363 | .soclk(soclk), | |
2364 | .d(fdin[15:0]), | |
2365 | .si({scan_in,so[14:0]}), | |
2366 | .so({so[14:0],scan_out}), | |
2367 | .q(dout[15:0]) | |
2368 | ); | |
2369 | ||
2370 | ||
2371 | ||
2372 | ||
2373 | ||
2374 | ||
2375 | ||
2376 | ||
2377 | ||
2378 | ||
2379 | ||
2380 | ||
2381 | endmodule | |
2382 | ||
2383 | ||
2384 | ||
2385 | ||
2386 | ||
2387 | ||
2388 | ||
2389 | ||
2390 | ||
2391 | // Description: Spare gate macro for control blocks | |
2392 | // | |
2393 | // Param num controls the number of times the macro is added | |
2394 | // flops=0 can be used to use only combination spare logic | |
2395 | ||
2396 | ||
2397 | module spc_mb2_ctlspare_ctl_macro__num_3 ( | |
2398 | l1clk, | |
2399 | scan_in, | |
2400 | siclk, | |
2401 | soclk, | |
2402 | scan_out); | |
2403 | wire si_0; | |
2404 | wire so_0; | |
2405 | wire spare0_flop_unused; | |
2406 | wire spare0_buf_32x_unused; | |
2407 | wire spare0_nand3_8x_unused; | |
2408 | wire spare0_inv_8x_unused; | |
2409 | wire spare0_aoi22_4x_unused; | |
2410 | wire spare0_buf_8x_unused; | |
2411 | wire spare0_oai22_4x_unused; | |
2412 | wire spare0_inv_16x_unused; | |
2413 | wire spare0_nand2_16x_unused; | |
2414 | wire spare0_nor3_4x_unused; | |
2415 | wire spare0_nand2_8x_unused; | |
2416 | wire spare0_buf_16x_unused; | |
2417 | wire spare0_nor2_16x_unused; | |
2418 | wire spare0_inv_32x_unused; | |
2419 | wire si_1; | |
2420 | wire so_1; | |
2421 | wire spare1_flop_unused; | |
2422 | wire spare1_buf_32x_unused; | |
2423 | wire spare1_nand3_8x_unused; | |
2424 | wire spare1_inv_8x_unused; | |
2425 | wire spare1_aoi22_4x_unused; | |
2426 | wire spare1_buf_8x_unused; | |
2427 | wire spare1_oai22_4x_unused; | |
2428 | wire spare1_inv_16x_unused; | |
2429 | wire spare1_nand2_16x_unused; | |
2430 | wire spare1_nor3_4x_unused; | |
2431 | wire spare1_nand2_8x_unused; | |
2432 | wire spare1_buf_16x_unused; | |
2433 | wire spare1_nor2_16x_unused; | |
2434 | wire spare1_inv_32x_unused; | |
2435 | wire si_2; | |
2436 | wire so_2; | |
2437 | wire spare2_flop_unused; | |
2438 | wire spare2_buf_32x_unused; | |
2439 | wire spare2_nand3_8x_unused; | |
2440 | wire spare2_inv_8x_unused; | |
2441 | wire spare2_aoi22_4x_unused; | |
2442 | wire spare2_buf_8x_unused; | |
2443 | wire spare2_oai22_4x_unused; | |
2444 | wire spare2_inv_16x_unused; | |
2445 | wire spare2_nand2_16x_unused; | |
2446 | wire spare2_nor3_4x_unused; | |
2447 | wire spare2_nand2_8x_unused; | |
2448 | wire spare2_buf_16x_unused; | |
2449 | wire spare2_nor2_16x_unused; | |
2450 | wire spare2_inv_32x_unused; | |
2451 | ||
2452 | ||
2453 | input l1clk; | |
2454 | input scan_in; | |
2455 | input siclk; | |
2456 | input soclk; | |
2457 | output scan_out; | |
2458 | ||
2459 | cl_sc1_msff_8x spare0_flop (.l1clk(l1clk), | |
2460 | .siclk(siclk), | |
2461 | .soclk(soclk), | |
2462 | .si(si_0), | |
2463 | .so(so_0), | |
2464 | .d(1'b0), | |
2465 | .q(spare0_flop_unused)); | |
2466 | assign si_0 = scan_in; | |
2467 | ||
2468 | cl_u1_buf_32x spare0_buf_32x (.in(1'b1), | |
2469 | .out(spare0_buf_32x_unused)); | |
2470 | cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1), | |
2471 | .in1(1'b1), | |
2472 | .in2(1'b1), | |
2473 | .out(spare0_nand3_8x_unused)); | |
2474 | cl_u1_inv_8x spare0_inv_8x (.in(1'b1), | |
2475 | .out(spare0_inv_8x_unused)); | |
2476 | cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1), | |
2477 | .in01(1'b1), | |
2478 | .in10(1'b1), | |
2479 | .in11(1'b1), | |
2480 | .out(spare0_aoi22_4x_unused)); | |
2481 | cl_u1_buf_8x spare0_buf_8x (.in(1'b1), | |
2482 | .out(spare0_buf_8x_unused)); | |
2483 | cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1), | |
2484 | .in01(1'b1), | |
2485 | .in10(1'b1), | |
2486 | .in11(1'b1), | |
2487 | .out(spare0_oai22_4x_unused)); | |
2488 | cl_u1_inv_16x spare0_inv_16x (.in(1'b1), | |
2489 | .out(spare0_inv_16x_unused)); | |
2490 | cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1), | |
2491 | .in1(1'b1), | |
2492 | .out(spare0_nand2_16x_unused)); | |
2493 | cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0), | |
2494 | .in1(1'b0), | |
2495 | .in2(1'b0), | |
2496 | .out(spare0_nor3_4x_unused)); | |
2497 | cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1), | |
2498 | .in1(1'b1), | |
2499 | .out(spare0_nand2_8x_unused)); | |
2500 | cl_u1_buf_16x spare0_buf_16x (.in(1'b1), | |
2501 | .out(spare0_buf_16x_unused)); | |
2502 | cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0), | |
2503 | .in1(1'b0), | |
2504 | .out(spare0_nor2_16x_unused)); | |
2505 | cl_u1_inv_32x spare0_inv_32x (.in(1'b1), | |
2506 | .out(spare0_inv_32x_unused)); | |
2507 | ||
2508 | cl_sc1_msff_8x spare1_flop (.l1clk(l1clk), | |
2509 | .siclk(siclk), | |
2510 | .soclk(soclk), | |
2511 | .si(si_1), | |
2512 | .so(so_1), | |
2513 | .d(1'b0), | |
2514 | .q(spare1_flop_unused)); | |
2515 | assign si_1 = so_0; | |
2516 | ||
2517 | cl_u1_buf_32x spare1_buf_32x (.in(1'b1), | |
2518 | .out(spare1_buf_32x_unused)); | |
2519 | cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1), | |
2520 | .in1(1'b1), | |
2521 | .in2(1'b1), | |
2522 | .out(spare1_nand3_8x_unused)); | |
2523 | cl_u1_inv_8x spare1_inv_8x (.in(1'b1), | |
2524 | .out(spare1_inv_8x_unused)); | |
2525 | cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1), | |
2526 | .in01(1'b1), | |
2527 | .in10(1'b1), | |
2528 | .in11(1'b1), | |
2529 | .out(spare1_aoi22_4x_unused)); | |
2530 | cl_u1_buf_8x spare1_buf_8x (.in(1'b1), | |
2531 | .out(spare1_buf_8x_unused)); | |
2532 | cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1), | |
2533 | .in01(1'b1), | |
2534 | .in10(1'b1), | |
2535 | .in11(1'b1), | |
2536 | .out(spare1_oai22_4x_unused)); | |
2537 | cl_u1_inv_16x spare1_inv_16x (.in(1'b1), | |
2538 | .out(spare1_inv_16x_unused)); | |
2539 | cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1), | |
2540 | .in1(1'b1), | |
2541 | .out(spare1_nand2_16x_unused)); | |
2542 | cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0), | |
2543 | .in1(1'b0), | |
2544 | .in2(1'b0), | |
2545 | .out(spare1_nor3_4x_unused)); | |
2546 | cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1), | |
2547 | .in1(1'b1), | |
2548 | .out(spare1_nand2_8x_unused)); | |
2549 | cl_u1_buf_16x spare1_buf_16x (.in(1'b1), | |
2550 | .out(spare1_buf_16x_unused)); | |
2551 | cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0), | |
2552 | .in1(1'b0), | |
2553 | .out(spare1_nor2_16x_unused)); | |
2554 | cl_u1_inv_32x spare1_inv_32x (.in(1'b1), | |
2555 | .out(spare1_inv_32x_unused)); | |
2556 | ||
2557 | cl_sc1_msff_8x spare2_flop (.l1clk(l1clk), | |
2558 | .siclk(siclk), | |
2559 | .soclk(soclk), | |
2560 | .si(si_2), | |
2561 | .so(so_2), | |
2562 | .d(1'b0), | |
2563 | .q(spare2_flop_unused)); | |
2564 | assign si_2 = so_1; | |
2565 | ||
2566 | cl_u1_buf_32x spare2_buf_32x (.in(1'b1), | |
2567 | .out(spare2_buf_32x_unused)); | |
2568 | cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1), | |
2569 | .in1(1'b1), | |
2570 | .in2(1'b1), | |
2571 | .out(spare2_nand3_8x_unused)); | |
2572 | cl_u1_inv_8x spare2_inv_8x (.in(1'b1), | |
2573 | .out(spare2_inv_8x_unused)); | |
2574 | cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1), | |
2575 | .in01(1'b1), | |
2576 | .in10(1'b1), | |
2577 | .in11(1'b1), | |
2578 | .out(spare2_aoi22_4x_unused)); | |
2579 | cl_u1_buf_8x spare2_buf_8x (.in(1'b1), | |
2580 | .out(spare2_buf_8x_unused)); | |
2581 | cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1), | |
2582 | .in01(1'b1), | |
2583 | .in10(1'b1), | |
2584 | .in11(1'b1), | |
2585 | .out(spare2_oai22_4x_unused)); | |
2586 | cl_u1_inv_16x spare2_inv_16x (.in(1'b1), | |
2587 | .out(spare2_inv_16x_unused)); | |
2588 | cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1), | |
2589 | .in1(1'b1), | |
2590 | .out(spare2_nand2_16x_unused)); | |
2591 | cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0), | |
2592 | .in1(1'b0), | |
2593 | .in2(1'b0), | |
2594 | .out(spare2_nor3_4x_unused)); | |
2595 | cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1), | |
2596 | .in1(1'b1), | |
2597 | .out(spare2_nand2_8x_unused)); | |
2598 | cl_u1_buf_16x spare2_buf_16x (.in(1'b1), | |
2599 | .out(spare2_buf_16x_unused)); | |
2600 | cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0), | |
2601 | .in1(1'b0), | |
2602 | .out(spare2_nor2_16x_unused)); | |
2603 | cl_u1_inv_32x spare2_inv_32x (.in(1'b1), | |
2604 | .out(spare2_inv_32x_unused)); | |
2605 | assign scan_out = so_2; | |
2606 | ||
2607 | ||
2608 | ||
2609 | endmodule | |
2610 | ||
2611 | ||
2612 | ||
2613 | ||
2614 | ||
2615 | ||
2616 | // any PARAMS parms go into naming of macro | |
2617 | ||
2618 | module spc_mb2_ctlmsff_ctl_macro__width_22 ( | |
2619 | din, | |
2620 | l1clk, | |
2621 | scan_in, | |
2622 | siclk, | |
2623 | soclk, | |
2624 | dout, | |
2625 | scan_out); | |
2626 | wire [21:0] fdin; | |
2627 | wire [20:0] so; | |
2628 | ||
2629 | input [21:0] din; | |
2630 | input l1clk; | |
2631 | input scan_in; | |
2632 | ||
2633 | ||
2634 | input siclk; | |
2635 | input soclk; | |
2636 | ||
2637 | output [21:0] dout; | |
2638 | output scan_out; | |
2639 | assign fdin[21:0] = din[21:0]; | |
2640 | ||
2641 | ||
2642 | ||
2643 | ||
2644 | ||
2645 | ||
2646 | dff #(22) d0_0 ( | |
2647 | .l1clk(l1clk), | |
2648 | .siclk(siclk), | |
2649 | .soclk(soclk), | |
2650 | .d(fdin[21:0]), | |
2651 | .si({scan_in,so[20:0]}), | |
2652 | .so({so[20:0],scan_out}), | |
2653 | .q(dout[21:0]) | |
2654 | ); | |
2655 | ||
2656 | ||
2657 | ||
2658 | ||
2659 | ||
2660 | ||
2661 | ||
2662 | ||
2663 | ||
2664 | ||
2665 | ||
2666 | ||
2667 | endmodule | |
2668 | ||
2669 | ||
2670 | ||
2671 | ||
2672 | ||
2673 | ||
2674 | ||
2675 |