Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / l2t / rtl / l2t_mbist_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: l2t_mbist_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 ============================================
35module l2t_mbist_ctl (
36 mbist_run,
37 mbist_l2tag_read,
38 mbist_l2tag_write,
39 mbist_l2tag_index,
40 mbist_l2tag_way,
41 mbist_l2tag_dec_way,
42 mbist_l2tag_lkup_tag,
43 mbist_l2tag_fail,
44 mbist_l2tag_hit_way,
45 mbist_l2data_write,
46 mbist_l2data_word,
47 mbist_l2data_way,
48 mbist_l2data_index,
49 mbist_l2data_fail,
50 mbist_l2vuad_read,
51 mbist_l2vuad_write,
52 mbist_l2vuad_index,
53 mbist_l2vuad_vd,
54 mbist_l2vuad_fail,
55 mbist_arb_l2t_write,
56 mbist_write_data,
57 mbist_write_data_decck,
58 mbist_done,
59 mbist_fail,
60 mbist0_done,
61 mbist2_done,
62 mbist0_fail,
63 mbist2_fail,
64 mbist_start_mb0,
65 mbist_start_mb2,
66 mbist_arb_l2d_en,
67 mbist_arb_l2d_write,
68 mbist_l2d_en,
69 l2clk,
70 tcu_pce_ov,
71 tcu_aclk,
72 tcu_bclk,
73 tcu_scan_en,
74 tcu_clk_stop,
75 scan_in,
76 scan_out,
77 mbist_start,
78 mbist_bisi_mode,
79 mbist_user_mode);
80wire pce_ov;
81wire stop;
82wire siclk;
83wire soclk;
84wire se;
85wire l1clk;
86wire clock_enable;
87wire start_in;
88wire l1clk_pm1;
89wire array_usr_reg_scanin;
90wire array_usr_reg_scanout;
91wire [3:0] user_array_sel_in;
92wire [3:0] user_array_sel;
93wire user_addr_mode_reg_scanin;
94wire user_addr_mode_reg_scanout;
95wire user_addr_mode_in;
96wire user_addr_mode;
97wire user_start_addr_reg_scanin;
98wire user_start_addr_reg_scanout;
99wire [17:0] user_start_addr_in;
100wire [17:0] user_start_addr;
101wire user_stop_addr_reg_scanin;
102wire user_stop_addr_reg_scanout;
103wire [17:0] user_stop_addr_in;
104wire [17:0] user_stop_addr;
105wire user_incr_addr_reg_scanin;
106wire user_incr_addr_reg_scanout;
107wire [17:0] user_incr_addr_in;
108wire [17:0] user_incr_addr;
109wire user_data_mode_reg_scanin;
110wire user_data_mode_reg_scanout;
111wire user_data_mode_in;
112wire user_data_mode;
113wire user_data_reg_scanin;
114wire user_data_reg_scanout;
115wire [7:0] user_data_in;
116wire [7:0] user_data;
117wire user_loop_mode_reg_scanin;
118wire user_loop_mode_reg_scanout;
119wire user_loop_mode_in;
120wire user_loop_mode;
121wire ten_n_mode_reg_scanin;
122wire ten_n_mode_reg_scanout;
123wire ten_n_mode_in;
124wire ten_n_mode;
125wire user_quad_sel_reg_scanin;
126wire user_quad_sel_reg_scanout;
127wire user_quad_sel_in;
128wire user_quad_sel;
129wire user_bisi_wr_mode_reg_scanin;
130wire user_bisi_wr_mode_reg_scanout;
131wire user_bisi_wr_mode_in;
132wire user_bisi_wr_mode;
133wire user_bisi_rd_mode_reg_scanin;
134wire user_bisi_rd_mode_reg_scanout;
135wire user_bisi_rd_mode_in;
136wire user_bisi_rd_mode;
137wire user_addr_mix_sel_reg_scanin;
138wire user_addr_mix_sel_reg_scanout;
139wire [1:0] user_addr_mix_sel_in;
140wire [1:0] user_addr_mix_sel;
141wire mb_user_data_mode;
142wire user_mode;
143wire mb_user_addr_mode;
144wire mb_user_quad_sel;
145wire mb_ten_n_mode;
146wire mb_user_loop_mode;
147wire mb_user_bisi_wr_mode;
148wire bisi_mode;
149wire mb_user_bisi_rd_mode;
150wire mb_user_bisi_rw_mode;
151wire mb_default_bisi;
152wire mbist_start_reg_scanin;
153wire mbist_start_reg_scanout;
154wire mbist_start_all;
155wire mbist_start_all_reg_scanin;
156wire mbist_start_all_reg_scanout;
157wire mbist_start_mb1;
158wire input_signals_reg_scanin;
159wire input_signals_reg_scanout;
160wire mb_enable_reg_scanin;
161wire mb_enable_reg_scanout;
162wire mb_enable;
163wire mb_enable_out;
164wire start;
165wire mb2_done;
166wire config_reg_scanin;
167wire config_reg_scanout;
168wire [1:0] config_in;
169wire [1:0] config_out;
170wire start_transition;
171wire end_transition;
172wire reset_engine;
173wire loop_again;
174wire run;
175wire loop_again_reg_scanin;
176wire loop_again_reg_scanout;
177wire stop_engine_l;
178wire stop_engine_l_q;
179wire [15:0] l2tag_dec_way;
180wire [3:0] l2tag_way;
181wire d_mbist_l2vuad_vd;
182wire array_1;
183wire arb_l2d_en;
184wire array_3;
185wire array_2;
186wire arb_l2d_write;
187wire l2d_en;
188wire mbist_output_reg_scanin;
189wire mbist_output_reg_scanout;
190wire cntl_l2rw;
191wire [27:0] mb_l2tag_lkup_tag;
192wire mb_array_2_wr;
193wire cntl_l2rw_out;
194wire input_cam_hit_reg_scanin;
195wire input_cam_hit_reg_scanout;
196wire [15:0] mb_l2tag_hit_way;
197wire cntl_reg_scanin;
198wire cntl_reg_scanout;
199wire [35:0] cntl_in;
200wire [35:0] cntl_out;
201wire run3;
202wire [13:0] cntl_algr;
203wire [13:0] next_algr;
204wire sel_nextaddr_reset;
205wire sel_nextaddr_restart;
206wire overflow;
207wire sel_nextaddr_incred;
208wire cout_rw;
209wire sel_nextaddr_same;
210wire [17:0] start_addr;
211wire [17:0] restart_addr;
212wire [17:0] incred_addr;
213wire [17:0] cntl_addr;
214wire [2:0] cntl_rw;
215wire [3:0] next_rw;
216wire cntl_msb;
217wire cntl_bisi;
218wire [3:0] cntl_array_sel;
219wire last_array;
220wire [1:0] cntl_data_sel;
221wire [1:0] cntl_addr_mix;
222wire addr_mix_pass;
223wire [3:0] cntl_march_element;
224wire sel_march_1_pass;
225wire [1:0] addr_mix_cntl_out;
226wire cntl_addr_mix_reg_scanin;
227wire cntl_addr_mix_reg_scanout;
228wire [1:0] addr_mix_sel;
229wire [1:0] addr_mix_sel_out;
230wire array_0;
231wire addr_mix_1;
232wire addr_mix_0;
233wire addr_mix_2;
234wire cout_addr;
235wire upaddr;
236wire march_0;
237wire march_1;
238wire march_2;
239wire march_6;
240wire march_7;
241wire [3:0] march_element_pre;
242wire march_pre_0;
243wire march_pre_1;
244wire march_pre_2;
245wire march_pre_6;
246wire march_pre_7;
247wire upaddr_pre;
248wire [17:0] incr_addr;
249wire [17:0] stop_addr;
250wire sel_rw_pass;
251wire [3:0] rw_incr;
252wire one_cycle_march;
253wire march_5;
254wire five_cycle_march;
255wire march_8;
256wire two_cycle_march;
257wire mem_wr_pbi;
258wire march_3;
259wire march_4;
260wire rw_1;
261wire rw_0;
262wire rw_4;
263wire mem_wr;
264wire bisi_wr_mode;
265wire bisi_rd_mode;
266wire mem_rd_pbi;
267wire mem_rd;
268wire [17:0] adj_addr;
269wire rw_3;
270wire [17:0] mem_addr1;
271wire true_data_l;
272wire rw_2;
273wire true_data;
274wire [7:0] data_pat_sel;
275wire [7:0] mem_data;
276wire l2tag_data_0_or_1;
277wire [27:0] l2tag_lkup_tag;
278wire l2tag_cam_pass;
279wire l2tag_cam_cmp_d4;
280wire l2tag_cam_fail;
281wire l2tag_strobe_valid;
282wire [17:0] mb_addr;
283wire l2tag_cam_cmp;
284wire mb_array_2_rd;
285wire cam_cmp_fail_delay_reg_scanin;
286wire cam_cmp_fail_delay_reg_scanout;
287wire l2tag_cam_cmp_d1;
288wire l2tag_cam_cmp_d2;
289wire l2tag_cam_cmp_d3;
290wire [17:0] mem_addr_mix0;
291wire [17:0] mem_addr_mix1;
292wire [17:0] mem_addr_mix2_pre;
293wire [3:0] mem_addr_mix2_dec;
294wire [17:0] mem_addr_mix2;
295wire [17:0] mem_addr;
296wire [3:0] array_sel;
297wire [3:0] march_element;
298wire [2:0] rw;
299wire [3:0] array_sel_cntl_out;
300wire array_sel_reg_scanin;
301wire array_sel_reg_scanout;
302wire [3:0] array_sel_out;
303wire [3:0] march_element_cntl_out;
304wire marche_element_reg_scanin;
305wire marche_element_reg_scanout;
306wire [3:0] march_element_out;
307wire [2:0] rw_cntl_out;
308wire march_element_reg_scanin;
309wire march_element_reg_scanout;
310wire [2:0] rw_out;
311wire sel_rw_1_pass;
312wire sel_rw_2_pass;
313wire sel_rw_5_pass;
314wire [7:0] mb_write_data;
315wire mb_array_0_rd;
316wire mb_array_1_rd;
317wire mb_array_3_rd;
318wire quad_cntl;
319wire mb_array_0_wr;
320wire mb_array_1_wr;
321wire mb_array_3_wr;
322wire mb_run;
323wire msb_latch_scanin;
324wire msb_latch_scanout;
325wire msb_in;
326wire msb_out;
327wire mb_done;
328wire [4:0] done_delay;
329wire run3_transition_reg_scanin;
330wire run3_transition_reg_scanout;
331wire run3_out;
332wire run3_transition;
333wire done_delay_reg_scanin;
334wire done_delay_reg_scanout;
335wire [4:0] done_delay_in;
336wire merged_fail_scanin;
337wire merged_fail_scanout;
338wire mb_fail_merged;
339wire mb0_fail;
340wire mb2_fail;
341wire merged_done_scanin;
342wire merged_done_scanout;
343wire mb_done_merged;
344wire mb0_done;
345wire mb1_fail;
346wire mb1_done;
347wire mb_l2tag_fail;
348wire mb_l2vuad_fail;
349wire mb_l2data_fail_pregate;
350wire l2data_rd_cmp_reg_scanin;
351wire l2data_rd_cmp_reg_scanout;
352wire array_3_rd_d1;
353wire array_3_rd_d2;
354wire array_3_rd_d3;
355wire array_3_rd_d4;
356wire array_3_rd_d5;
357wire array_3_rd_d6;
358wire mb_l2data_fail;
359wire l2tag_fail_d;
360wire l2tag_fail_sticky;
361wire l2vuad_fail_d;
362wire l2vuad_fail_sticky;
363wire l2data_fail_d;
364wire l2data_fail_sticky;
365wire l2tag_cam_fail_d;
366wire l2tag_cam_sticky;
367wire mbist_fail_input_reg_scanin;
368wire mbist_fail_input_reg_scanout;
369wire mbist_fail_sticky;
370wire mbist_fail_array;
371wire valid_fail;
372wire mb_fail;
373wire out_mb_tcu_done_reg_scanin;
374wire out_mb_tcu_done_reg_scanout;
375wire mb_done_out;
376wire out_mb_tcu_fail_reg_scanin;
377wire out_mb_tcu_fail_reg_scanout;
378wire mb_fail_out;
379wire out_run_mb_arrays_reg_scanin;
380wire out_run_mb_arrays_reg_scanout;
381wire mb_run_out;
382wire out_data_mb_arrays_reg_scanin;
383wire out_data_mb_arrays_reg_scanout;
384wire [7:0] mb_write_data_out;
385wire [7:0] mbist_write_data_decck_out;
386wire out_addr_mb_arrays_reg_scanin;
387wire out_addr_mb_arrays_reg_scanout;
388wire [17:0] mb_addr_out;
389wire out_wr_mb_arrays_reg_scanin;
390wire out_wr_mb_arrays_reg_scanout;
391wire mb_array_0_wr_out;
392wire mb_array_1_wr_out;
393wire mb_array_2_wr_out;
394wire mb_array_3_wr_out;
395wire out_rd_mb_arrays_reg_scanin;
396wire out_rd_mb_arrays_reg_scanout;
397wire mb_array_0_rd_out;
398wire mb_array_1_rd_out;
399wire mb_array_2_rd_out;
400wire [3:0] l2data_word;
401wire spares_scanin;
402wire spares_scanout;
403
404
405///////////////////////////////////////////////////////////////////////////////
406// Outputs
407///////////////////////////////////////////////////////////////////////////////
408
409output mbist_run; // run
410
411// l2tag
412output mbist_l2tag_read; // read enable for tag array
413output mbist_l2tag_write; // write enable for tag array
414output [8:0] mbist_l2tag_index; // Tag array index
415output [3:0] mbist_l2tag_way; // mux select to pick out a way for a read
416output [15:0] mbist_l2tag_dec_way; // The way select for the tag array
417output [27:0] mbist_l2tag_lkup_tag; //To test lookup operation.
418input mbist_l2tag_fail;
419
420input [15:0] mbist_l2tag_hit_way; //To see if a match happened.
421 //Added 2/28/05.
422
423// l2data
424
425output mbist_l2data_write; // 0=Write to the dataarray 1=read
426output [3:0] mbist_l2data_word; // encoded 1/16 words are picked to write
427 // out of 624 bits you can only write 78 bits at
428 // a time
429output [3:0] mbist_l2data_way; // encoded way for data array access
430output [8:0] mbist_l2data_index; // data access index encoded
431input mbist_l2data_fail;
432
433// l2vuad
434output mbist_l2vuad_read; // Read enable for vuad array
435output mbist_l2vuad_write; // VUAD array write enable
436output [8:0] mbist_l2vuad_index; // index to access vuad arrays
437output mbist_l2vuad_vd; // This is a select signal to pick vd or ua arrays
438input mbist_l2vuad_fail;
439
440// ???
441
442output mbist_arb_l2t_write; // Asserted as a request for writing tag array
443output [7:0] mbist_write_data; // write data
444output [7:0] mbist_write_data_decck; // write data
445
446output mbist_done;
447output mbist_fail;
448input mbist0_done;
449input mbist2_done;
450input mbist0_fail;
451input mbist2_fail;
452
453
454
455// mbist_start redistribution:
456
457 output mbist_start_mb0;
458 output mbist_start_mb2;
459
460
461
462// ???????????????????????????????????????????????????????????????????????????????????????
463
464
465output mbist_arb_l2d_en; // select to pick mbist index for data array access
466output mbist_arb_l2d_write; // select to pick mbist data for data array access
467output mbist_l2d_en; // select to pick mbist way for data array access
468
469
470///////////////////////////////////////////////////////////////////////////////
471// Inputs
472///////////////////////////////////////////////////////////////////////////////
473
474input l2clk;
475input tcu_pce_ov;
476input tcu_aclk;
477input tcu_bclk;
478input tcu_scan_en;
479input tcu_clk_stop;
480
481input scan_in;
482output scan_out;
483
484input mbist_start;
485input mbist_bisi_mode;
486input mbist_user_mode;
487
488
489///////////////////////////////////////////////////////////////////////////////
490// Wires
491///////////////////////////////////////////////////////////////////////////////
492
493
494
495// /////////////////////////////////////////////////////////////////////////////
496// Scan Renames
497// /////////////////////////////////////////////////////////////////////////////
498
499assign pce_ov = tcu_pce_ov;
500assign stop = tcu_clk_stop;
501assign siclk = tcu_aclk;
502assign soclk = tcu_bclk;
503assign se = tcu_scan_en;
504
505
506
507////////////////////////////////////////////////////////////////////////////////
508// Clock header
509
510
511l2t_l1clkhdr_ctl_macro clkgen_freeclk (
512 .l2clk (l2clk ),
513 .l1en (1'b1 ),
514 .l1clk (l1clk ),
515 .pce_ov(pce_ov),
516 .stop(stop),
517 .se(se));
518
519
520assign clock_enable = start_in | mbist_done | mbist_run | mbist_fail ;
521l2t_l1clkhdr_ctl_macro clkgen (
522 .l2clk (l2clk ),
523 .l1en (clock_enable ),
524 .l1clk (l1clk_pm1 ),
525 .pce_ov(pce_ov),
526 .stop(stop),
527 .se(se)
528);
529
530
531
532// /////////////////////////////////////////////////////////////////////////////
533//
534// user mode resgisters
535// MBIST PGM Control Register
536//
537// /////////////////////////////////////////////////////////////////////////////
538// /////////////////////////////////////////////////////////////////////////////
539
540
541////////////////////////////////////////////////////////////////////////////////
542// user control registers
543// size
544// - user_array_sel 4
545// - user_addr_mode 1
546// - user_start_addr 15
547// - user_stop_addr 15
548// - user_inc_addr 15
549// - user_data_mode 1
550// - user_data 8
551// - user_cmpsel_hold 1
552// - user_cmpsel 3
553// - user_loop_mode 1
554// - user_quad_sel 1 (selects upper and lower halves )
555
556
557 l2t_msff_ctl_macro__width_4 array_usr_reg (
558 .scan_in(array_usr_reg_scanin),
559 .scan_out(array_usr_reg_scanout),
560 .l1clk ( l1clk_pm1 ),
561 .din ( user_array_sel_in[3:0] ),
562 .dout ( user_array_sel[3:0] ),
563 .siclk(siclk),
564 .soclk(soclk));
565
566 assign user_array_sel_in[3:0]=user_array_sel[3:0];
567
568
569 // user address mode
570
571 l2t_msff_ctl_macro__width_1 user_addr_mode_reg (
572 .scan_in(user_addr_mode_reg_scanin),
573 .scan_out(user_addr_mode_reg_scanout),
574 .l1clk ( l1clk_pm1 ),
575 .din ( user_addr_mode_in ),
576 .dout ( user_addr_mode ),
577 .siclk(siclk),
578 .soclk(soclk));
579
580 assign user_addr_mode_in=user_addr_mode;
581
582
583 // user start address
584
585 l2t_msff_ctl_macro__width_18 user_start_addr_reg (
586 .scan_in(user_start_addr_reg_scanin),
587 .scan_out(user_start_addr_reg_scanout),
588 .l1clk ( l1clk_pm1 ),
589 .din ( user_start_addr_in[17:0] ),
590 .dout ( user_start_addr[17:0] ),
591 .siclk(siclk),
592 .soclk(soclk));
593
594
595 assign user_start_addr_in[17:0]=user_start_addr[17:0];
596
597 // user stop address
598
599 l2t_msff_ctl_macro__width_18 user_stop_addr_reg (
600 .scan_in(user_stop_addr_reg_scanin),
601 .scan_out(user_stop_addr_reg_scanout),
602 .l1clk ( l1clk_pm1 ),
603 .din ( user_stop_addr_in[17:0] ),
604 .dout ( user_stop_addr[17:0] ),
605 .siclk(siclk),
606 .soclk(soclk));
607
608
609 assign user_stop_addr_in[17:0]=user_stop_addr[17:0];
610
611
612 // user increment address
613
614 l2t_msff_ctl_macro__width_18 user_incr_addr_reg (
615 .scan_in(user_incr_addr_reg_scanin),
616 .scan_out(user_incr_addr_reg_scanout),
617 .l1clk ( l1clk_pm1 ),
618 .din ( user_incr_addr_in[17:0] ),
619 .dout ( user_incr_addr[17:0] ),
620 .siclk(siclk),
621 .soclk(soclk));
622
623
624 assign user_incr_addr_in[17:0]=user_incr_addr[17:0];
625
626 // user data mode
627
628 l2t_msff_ctl_macro__width_1 user_data_mode_reg (
629 .scan_in(user_data_mode_reg_scanin),
630 .scan_out(user_data_mode_reg_scanout),
631 .l1clk ( l1clk_pm1 ),
632 .din ( user_data_mode_in ),
633 .dout ( user_data_mode ),
634 .siclk(siclk),
635 .soclk(soclk));
636
637
638 assign user_data_mode_in=user_data_mode;
639
640 // user data select
641
642 l2t_msff_ctl_macro__width_8 user_data_reg (
643 .scan_in(user_data_reg_scanin),
644 .scan_out(user_data_reg_scanout),
645 .l1clk ( l1clk_pm1 ),
646 .din ( user_data_in[7:0] ),
647 .dout ( user_data[7:0] ),
648 .siclk(siclk),
649 .soclk(soclk));
650
651
652 assign user_data_in[7:0] = user_data[7:0];
653
654
655 // user loop mode
656
657 l2t_msff_ctl_macro__width_1 user_loop_mode_reg (
658 .scan_in(user_loop_mode_reg_scanin),
659 .scan_out(user_loop_mode_reg_scanout),
660 .l1clk ( l1clk_pm1 ),
661 .din ( user_loop_mode_in ),
662 .dout ( user_loop_mode ),
663 .siclk(siclk),
664 .soclk(soclk));
665
666
667 assign user_loop_mode_in=user_loop_mode;
668
669
670
671 // 10N Algorithm for bit mapping
672
673 l2t_msff_ctl_macro__width_1 ten_n_mode_reg (
674 .scan_in(ten_n_mode_reg_scanin),
675 .scan_out(ten_n_mode_reg_scanout),
676 .l1clk ( l1clk_pm1 ),
677 .din ( ten_n_mode_in ),
678 .dout ( ten_n_mode ),
679 .siclk(siclk),
680 .soclk(soclk));
681
682
683 assign ten_n_mode_in=ten_n_mode;
684
685
686
687 // user data mode
688
689 l2t_msff_ctl_macro__width_1 user_quad_sel_reg (
690 .scan_in(user_quad_sel_reg_scanin),
691 .scan_out(user_quad_sel_reg_scanout),
692 .l1clk ( l1clk_pm1 ),
693 .din ( user_quad_sel_in ),
694 .dout ( user_quad_sel ),
695 .siclk(siclk),
696 .soclk(soclk));
697
698
699 assign user_quad_sel_in=user_quad_sel;
700
701
702 l2t_msff_ctl_macro__width_1 user_bisi_wr_mode_reg (
703 .scan_in(user_bisi_wr_mode_reg_scanin),
704 .scan_out(user_bisi_wr_mode_reg_scanout),
705 .l1clk ( l1clk_pm1 ),
706 .din ( user_bisi_wr_mode_in ),
707 .dout ( user_bisi_wr_mode ),
708 .siclk(siclk),
709 .soclk(soclk));
710
711 assign user_bisi_wr_mode_in=user_bisi_wr_mode;
712
713 l2t_msff_ctl_macro__width_1 user_bisi_rd_mode_reg (
714 .scan_in(user_bisi_rd_mode_reg_scanin),
715 .scan_out(user_bisi_rd_mode_reg_scanout),
716 .l1clk ( l1clk_pm1 ),
717 .din ( user_bisi_rd_mode_in ),
718 .dout ( user_bisi_rd_mode ),
719 .siclk(siclk),
720 .soclk(soclk));
721
722 assign user_bisi_rd_mode_in=user_bisi_rd_mode;
723
724
725
726 l2t_msff_ctl_macro__width_2 user_addr_mix_sel_reg (
727 .scan_in(user_addr_mix_sel_reg_scanin),
728 .scan_out(user_addr_mix_sel_reg_scanout),
729 .l1clk ( l1clk_pm1 ),
730 .din ( user_addr_mix_sel_in[1:0] ),
731 .dout ( user_addr_mix_sel[1:0] ),
732 .siclk(siclk),
733 .soclk(soclk));
734
735
736 assign user_addr_mix_sel_in[1:0]=user_addr_mix_sel[1:0];
737
738
739
740
741
742 assign mb_user_data_mode = user_mode & user_data_mode;
743 assign mb_user_addr_mode = user_mode & user_addr_mode;
744 assign mb_user_quad_sel = user_mode & user_quad_sel;
745 assign mb_ten_n_mode = user_mode & ten_n_mode;
746 assign mb_user_loop_mode = user_mode & user_loop_mode;
747
748
749
750 assign mb_user_bisi_wr_mode = user_mode & user_bisi_wr_mode & bisi_mode;
751 assign mb_user_bisi_rd_mode = user_mode & user_bisi_rd_mode & bisi_mode;
752
753 assign mb_user_bisi_rw_mode = ((~user_bisi_wr_mode & ~user_bisi_rd_mode) | (user_bisi_wr_mode & user_bisi_rd_mode)) & bisi_mode;
754
755 assign mb_default_bisi = bisi_mode & ~user_mode;
756
757
758// /////////////////////////////////////////////////////////////////////////////
759//
760// MBIST Config Register
761//
762// /////////////////////////////////////////////////////////////////////////////
763//
764// A low to high transition on mbist_start will reset and start the engine.
765// mbist_start must remain active high for the duration of MBIST.
766// If mbist_start deasserts the engine will stop but not reset.
767// Once MBIST has completed mb0_done will assert and the fail status
768// signals will be valid.
769// To run MBIST again the mbist_start signal must transition low then high.
770//
771// Loop on Address will disable the address mix function.
772//
773// /////////////////////////////////////////////////////////////////////////////
774
775
776 // flop incoming signals:
777
778
779 // flop incoming signals:
780
781 // --> mbist_start -> flop -> flop-> mbist_mb2
782 // -> mbist_start_all -> mbist_start_mb1
783 // -> mbist_start_all -> mbist_start_mb0
784
785 l2t_msff_ctl_macro__width_1 mbist_start_reg (
786 .scan_in(mbist_start_reg_scanin),
787 .scan_out(mbist_start_reg_scanout),
788 .l1clk ( l1clk ),
789 .din ( mbist_start ),
790 .dout ( mbist_start_all ),
791 .siclk(siclk),
792 .soclk(soclk));
793
794 l2t_msff_ctl_macro__width_3 mbist_start_all_reg (
795 .scan_in(mbist_start_all_reg_scanin),
796 .scan_out(mbist_start_all_reg_scanout),
797 .l1clk ( l1clk ),
798 .din ( {mbist_start_all,mbist_start_all, mbist_start_all} ),
799 .dout ( {mbist_start_mb1,mbist_start_mb0, mbist_start_mb2} ),
800 .siclk(siclk),
801 .soclk(soclk));
802
803
804 l2t_msff_ctl_macro__width_3 input_signals_reg (
805 .scan_in(input_signals_reg_scanin),
806 .scan_out(input_signals_reg_scanout),
807 .l1clk ( l1clk ),
808 .din ( {mbist_start_mb1,mbist_bisi_mode,mbist_user_mode} ),
809 .dout ( {start_in,bisi_mode,user_mode} ),
810 .siclk(siclk),
811 .soclk(soclk));
812
813
814 // default : mb_enable=0
815 // bisi : mb_enable=0
816 // user_mode : mb_enable=depend on programmed value
817
818 l2t_msff_ctl_macro__width_1 mb_enable_reg (
819 .scan_in(mb_enable_reg_scanin),
820 .scan_out(mb_enable_reg_scanout),
821 .l1clk ( l1clk_pm1 ),
822 .din ( mb_enable ),
823 .dout ( mb_enable_out ),
824 .siclk(siclk),
825 .soclk(soclk));
826
827
828 assign mb_enable = user_mode ? mb_enable_out : 1'b0;
829
830
831 assign start = user_mode ? (mb_enable_out & start_in) :
832 (start_in & mb2_done);
833
834// assign start = start_in ;
835
836
837
838 l2t_msff_ctl_macro__width_2 config_reg (
839 .scan_in(config_reg_scanin),
840 .scan_out(config_reg_scanout),
841 .l1clk ( l1clk_pm1 ),
842 .din ( config_in[1:0] ),
843 .dout ( config_out[1:0] ),
844 .siclk(siclk),
845 .soclk(soclk));
846
847
848 assign config_in[0] = start;
849 assign config_in[1] = config_out[0];
850 assign start_transition = config_out[0] & ~config_out[1];
851 assign end_transition = ~config_out[0] & config_out[1];
852 assign reset_engine = start_transition | loop_again | end_transition;
853 assign run = config_out[1] ;
854
855
856
857 l2t_msff_ctl_macro__width_1 loop_again_reg (
858 .scan_in(loop_again_reg_scanin),
859 .scan_out(loop_again_reg_scanout),
860 .l1clk ( l1clk_pm1 ),
861 .din ( stop_engine_l ),
862 .dout ( stop_engine_l_q ),
863 .siclk(siclk),
864 .soclk(soclk));
865
866
867assign loop_again=mb_user_loop_mode ? stop_engine_l & ~stop_engine_l_q: 1'b0;
868
869
870
871
872
873 assign l2tag_dec_way[0] = (l2tag_way[3:0]==4'h0);
874 assign l2tag_dec_way[1] = (l2tag_way[3:0]==4'h1);
875 assign l2tag_dec_way[2] = (l2tag_way[3:0]==4'h2);
876 assign l2tag_dec_way[3] = (l2tag_way[3:0]==4'h3);
877
878
879 assign l2tag_dec_way[4] = (l2tag_way[3:0]==4'h4);
880 assign l2tag_dec_way[5] = (l2tag_way[3:0]==4'h5);
881 assign l2tag_dec_way[6] = (l2tag_way[3:0]==4'h6);
882 assign l2tag_dec_way[7] = (l2tag_way[3:0]==4'h7);
883
884
885 assign l2tag_dec_way[8] = (l2tag_way[3:0]==4'h8);
886 assign l2tag_dec_way[9] = (l2tag_way[3:0]==4'h9);
887 assign l2tag_dec_way[10] = (l2tag_way[3:0]==4'hA);
888 assign l2tag_dec_way[11] = (l2tag_way[3:0]==4'hB);
889
890
891 assign l2tag_dec_way[12] = (l2tag_way[3:0]==4'hC);
892 assign l2tag_dec_way[13] = (l2tag_way[3:0]==4'hD);
893 assign l2tag_dec_way[14] = (l2tag_way[3:0]==4'hE);
894 assign l2tag_dec_way[15] = (l2tag_way[3:0]==4'hF);
895
896
897
898
899
900
901assign d_mbist_l2vuad_vd=array_1; // selects vuad dirty
902
903assign arb_l2d_en =user_mode ? run : array_3 | array_2; // provide early static signal
904assign arb_l2d_write=user_mode ? run : array_3 | array_2; // provide early static signal
905assign l2d_en =user_mode ? run : array_3 | array_2; // provide early static signal
906
907
908l2t_msff_ctl_macro__width_50 mbist_output_reg (
909 .scan_in(mbist_output_reg_scanin),
910 .scan_out(mbist_output_reg_scanout),
911 .l1clk ( l1clk_pm1 ),
912 .din ({ cntl_l2rw,
913 l2tag_dec_way[15:0],
914 mb_l2tag_lkup_tag[27:0],
915 d_mbist_l2vuad_vd,
916 mb_array_2_wr,
917 arb_l2d_en,
918 arb_l2d_write,
919 l2d_en}),
920 .dout ({ cntl_l2rw_out,
921 mbist_l2tag_dec_way[15:0],
922 mbist_l2tag_lkup_tag[27:0],
923 mbist_l2vuad_vd,
924 mbist_arb_l2t_write,
925 mbist_arb_l2d_en,
926 mbist_arb_l2d_write,
927 mbist_l2d_en}),
928 .siclk(siclk),
929 .soclk(soclk));
930
931
932
933
934 l2t_msff_ctl_macro__width_16 input_cam_hit_reg (
935 .scan_in(input_cam_hit_reg_scanin),
936 .scan_out(input_cam_hit_reg_scanout),
937 .l1clk ( l1clk_pm1 ),
938 .din ( mbist_l2tag_hit_way[15:0] ),
939 .dout ( mb_l2tag_hit_way[15:0] ),
940 .siclk(siclk),
941 .soclk(soclk));
942
943
944
945
946// work
947//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
948//////////////////////////////////// ////////////////////////////////////
949// CONTROL REG:
950//////////////////////////////////// ////////////////////////////////////
951
952
953 l2t_msff_ctl_macro__width_36 cntl_reg (
954 .scan_in(cntl_reg_scanin),
955 .scan_out(cntl_reg_scanout),
956 .l1clk ( l1clk_pm1 ),
957 .din ( cntl_in[35:0] ),
958 .dout ( cntl_out[35:0] ),
959 .siclk(siclk),
960 .soclk(soclk));
961
962
963 assign cntl_in[35:22] = reset_engine ? {14'b00000000000000}:
964 (~run3) ? cntl_algr[13:0]:
965 next_algr[13:0];
966
967
968// assign cntl_in[12:3] = reset_engine ? start_addr[7:0]:
969// ~run3 ? cntl_addr[7:0]:
970// next_addr[7:0];
971
972 // reset_engine run3 overflow cout_rw output
973 // ---------------------------------------------------------
974 // 1 x x x start_addr
975 // 0 0 x x cntl_addr
976 // 0 1 1 x restart_addr
977 // 0 1 0 1 incred_addr
978 // 0 1 0 0 cntl_addr
979
980
981 assign sel_nextaddr_reset = reset_engine;
982 assign sel_nextaddr_restart = ~reset_engine & run3 & overflow;
983 assign sel_nextaddr_incred = ~reset_engine & run3 & ~overflow & cout_rw;
984 assign sel_nextaddr_same = ~(sel_nextaddr_reset | sel_nextaddr_restart | sel_nextaddr_incred);
985
986 assign cntl_in[21:4] = ({18{sel_nextaddr_reset}} & start_addr[17:0]) |
987 ({18{sel_nextaddr_restart}} & restart_addr[17:0]) |
988 ({18{sel_nextaddr_incred}} & incred_addr[17:0]) |
989 ({18{sel_nextaddr_same}} & cntl_addr[17:0]);
990
991
992 assign cntl_in[3:1] = reset_engine ? 3'b000 :
993 (~run3 ) ? cntl_rw[2:0]:
994 next_rw[3:1];
995
996
997 assign cntl_in[0] = next_rw[0];
998
999
1000//////////////////////////////////// ////////////////////////////////////
1001// NEXT ALGR
1002//////////////////////////////////// ////////////////////////////////////
1003
1004 // msb
1005 assign cntl_msb = start_in & cntl_out[ 35]; // done selection
1006
1007 assign cntl_bisi = mb_default_bisi | mb_user_bisi_rw_mode ? cntl_out[34] :
1008 1'b1;
1009
1010 // array
1011 assign cntl_array_sel[3:0] = (user_mode | last_array) ? 4'b1111:
1012 cntl_out[33:30]; // array selection
1013
1014 // data
1015 assign cntl_data_sel[1:0] = (bisi_mode | mb_user_data_mode) ? 2'b11 : cntl_out[29:28]; // data selection
1016
1017
1018
1019 // address mix
1020 assign cntl_addr_mix[1:0] = addr_mix_pass ? 2'b11 :
1021
1022 cntl_out[27:26]; // address mix
1023
1024
1025 assign cntl_march_element[3:0] = sel_march_1_pass ? 4'b1111:
1026 cntl_out[25:22]; // march element
1027
1028// assign addr_mix[1:0] = (bisi_mode | mb_user_addr_mode ) ? 2'b00 :
1029// cntl_addr_mix[1:0];
1030
1031
1032
1033
1034 // cmp logic
1035
1036 assign addr_mix_cntl_out[1:0] = cntl_out[27:26];
1037
1038 l2t_msff_ctl_macro__width_2 cntl_addr_mix_reg (
1039 .scan_in(cntl_addr_mix_reg_scanin),
1040 .scan_out(cntl_addr_mix_reg_scanout),
1041 .l1clk ( l1clk_pm1 ),
1042 .din ( addr_mix_sel[1:0] ),
1043 .dout ( addr_mix_sel_out[1:0] ),
1044 .siclk(siclk),
1045 .soclk(soclk));
1046
1047// assign cmp_sel[3:0]= (&cmp_sel_cntl_out[3:0] & ~(array_5)) ? cmp_sel_out[3:0] :
1048 assign addr_mix_sel[1:0]= (&addr_mix_cntl_out[1:0] ) ? addr_mix_sel_out[1:0] :
1049 mb_user_addr_mode ? user_addr_mix_sel[1:0] :
1050 addr_mix_cntl_out[1:0];
1051
1052 assign addr_mix_pass = (mb_user_addr_mode | bisi_mode ) |
1053 array_0 & addr_mix_1 |
1054 array_1 & addr_mix_1 |
1055 array_2 & addr_mix_1 |
1056 array_3 & addr_mix_1 ;
1057
1058 assign addr_mix_0 = addr_mix_sel==2'b00 & run3;
1059 assign addr_mix_1 = addr_mix_sel==2'b01 & run3;
1060 assign addr_mix_2 = addr_mix_sel==2'b10 & run3;
1061
1062 assign cntl_algr[13:0] = {cntl_msb,
1063 cntl_bisi,
1064 cntl_array_sel[3:0],
1065 cntl_data_sel[1:0],
1066 cntl_addr_mix[1:0],
1067 cntl_march_element[3:0]};
1068
1069 assign next_algr[13:0] = cout_addr ? cntl_algr[13:0] + 14'h1 : cntl_algr[13:0]; // mbist control
1070
1071
1072
1073
1074//////////////////////////////////// ////////////////////////////////////
1075// NEXT ADDR
1076//////////////////////////////////// ////////////////////////////////////
1077
1078
1079 /////////////////////////
1080 // address engine
1081 /////////////////////////
1082
1083
1084 assign upaddr = march_0 | march_1 | march_2 | march_6 | march_7 | bisi_mode ;
1085
1086
1087 assign march_element_pre[3:0]=next_algr[3:0];
1088
1089 assign march_pre_0 = march_element_pre[3:0]==4'h0;
1090 assign march_pre_1 = march_element_pre[3:0]==4'h1;
1091 assign march_pre_2 = march_element_pre[3:0]==4'h2;
1092 assign march_pre_6 = march_element_pre[3:0]==4'h6;
1093 assign march_pre_7 = march_element_pre[3:0]==4'h7;
1094
1095 assign upaddr_pre = march_pre_0 | march_pre_1 | march_pre_2 | march_pre_6 | march_pre_7;
1096
1097
1098 assign incr_addr[17:0] = mb_user_addr_mode ? user_incr_addr[17:0] : 18'b000000000000000001;
1099
1100 assign start_addr[17:0] = mb_user_addr_mode ? user_start_addr[17:0] : 18'b000000000000000000;
1101
1102
1103// assign next_addr_out[8:0] = cout_rw ? cntl_addr[8:0] + incr_addr[8:0] : cntl_addr[8:0]; // next address
1104
1105
1106 assign incred_addr[17:0] = cntl_addr[17:0] + incr_addr[17:0];
1107
1108
1109 assign overflow = upaddr ? ( cntl_addr[17:0] == stop_addr[17:0]) & (cntl_rw[2:0]==3'b111 & cntl_l2rw):
1110 (~cntl_addr[17:0] == start_addr[17:0]) & (cntl_rw[2:0]==3'b111 & cntl_l2rw);
1111
1112
1113// assign next_addr[17:0]= overflow ? restart_addr[17:0] : next_addr_out[17:0];
1114
1115 assign restart_addr[17:0] = upaddr_pre ? start_addr[17:0] : ~stop_addr[17:0];
1116
1117 assign cout_addr = overflow;
1118
1119
1120
1121
1122//////////////////////////////////// ////////////////////////////////////
1123// NEXT RW
1124//////////////////////////////////// ////////////////////////////////////
1125
1126
1127 assign cntl_rw[2:0] = sel_rw_pass ? 3'b111:
1128 cntl_out[ 3: 1]; // read write control
1129
1130 assign cntl_l2rw = (run3 & (array_3 & cntl_out[0]) | ~(array_3)) ;
1131
1132 assign rw_incr[3:0] = {cntl_rw[2:0],cntl_l2rw};
1133
1134 assign next_rw[3:0] = rw_incr[3:0]+4'b0001 ;
1135
1136
1137 assign cout_rw = &{cntl_rw[2:0],cntl_l2rw}; // carry over for rw
1138
1139
1140
1141
1142
1143
1144
1145
1146//////////////////////////////////// ////////////////////////////////////
1147// MBIST CONTROL SIGNAL
1148// - mem_wr
1149//////////////////////////////////// ////////////////////////////////////
1150
1151
1152 assign one_cycle_march = march_0 | march_5 | march_7;
1153 assign five_cycle_march = march_6 | march_8;
1154 assign two_cycle_march = ~(one_cycle_march | five_cycle_march);
1155
1156
1157 /////////////////////////
1158 // membist write enable
1159 /////////////////////////
1160
1161
1162 assign mem_wr_pbi = run3 & (
1163 march_0 |
1164 ((march_1 | march_2 | march_3 | march_4 ) & rw_1) |
1165 (march_6 & (rw_0 | rw_1 | rw_4)) |
1166 march_7 |
1167 (march_8 & (rw_0 | rw_1 | rw_4))
1168 );
1169
1170
1171 assign mem_wr = bisi_wr_mode ? 1'b1 :
1172 bisi_rd_mode ? 1'b0 :
1173 mem_wr_pbi;
1174
1175
1176 /////////////////////////
1177 // membist read enable
1178 /////////////////////////
1179
1180
1181
1182 assign mem_rd_pbi = run3 & ~mem_wr;
1183
1184
1185
1186 assign mem_rd= bisi_rd_mode ? 1'b1 : mem_rd_pbi;
1187
1188
1189 /////////////////////
1190 // membist address:
1191 ////////////////////
1192
1193 assign cntl_addr[17:0] = cntl_out[21:4];
1194
1195// Original Code:
1196// assign adj_addr[17:0] = (five_cycle_march & (rw_1 | rw_3)) ? {cntl_addr[17:6],~cntl_addr[5],cntl_addr[4:0]}:
1197// cntl_addr[17:0] ;
1198
1199// Proposed Code:
1200 assign adj_addr[17:0] = (five_cycle_march & (rw_1 | rw_3)) ? {cntl_addr[17:4],~cntl_addr[3],cntl_addr[2:0]}:
1201 cntl_addr[17:0] ;
1202
1203// If l2d: default cntl_addr[7:0] works
1204// addr_mix cntl_addr[10:3] works
1205// Note: Based on my conversation w/ Judy, for l2d, if a row needs to be replaced with a
1206// redundant row, the redundant row is in the other 16KB block. In that case,
1207// for that row and its corresponding row for weak-bit test, weak-bit address
1208// would not be on the bitline.
1209
1210// If l2t: default cntl_addr[8:2] works
1211// addr_mix cntl_addr[6:0] works
1212
1213// If vuad: default cntl_addr[5:2] works
1214// addr_mix cntl_addr[3:0] works
1215
1216
1217 assign mem_addr1[17:0] = upaddr ? adj_addr[17:0]: ~adj_addr[17:0];
1218
1219
1220
1221 /////////////////////
1222 // true data
1223 ////////////////////
1224
1225 assign true_data_l = bisi_mode |
1226 march_0 |
1227 (march_1 & rw_0) |
1228 (march_2 & rw_1) |
1229 (march_3 & rw_0) |
1230 (march_4 & rw_1) |
1231 (march_5) |
1232 (march_6 & (rw_1 | rw_3 | rw_4)) |
1233 (march_8 & (rw_0 | rw_2));
1234
1235 assign true_data=~true_data_l;
1236
1237 /////////////////////
1238 // membist data:
1239 ////////////////////
1240
1241 assign data_pat_sel[7:0] = (mb_user_data_mode & bisi_mode) ? ~user_data[7:0]:
1242 (mb_user_data_mode) ? user_data[7:0]:
1243 bisi_mode ? 8'hFF:
1244 (cntl_data_sel[1:0] == 2'h0) ? 8'hAA:
1245 (cntl_data_sel[1:0] == 2'h1) ? 8'h99:
1246 (cntl_data_sel[1:0] == 2'h2) ? 8'hCC:
1247 8'h00;
1248 assign mem_data[7:0] = true_data ? data_pat_sel[7:0] : ~data_pat_sel[7:0];
1249
1250
1251 // l2tag cam
1252
1253
1254 assign l2tag_data_0_or_1 = mem_data[7:0] == 8'h00 | mem_data[7:0]==8'hFF;
1255
1256 assign l2tag_lkup_tag[27:0] = {mem_data[3:0],mem_data[7:0],mem_data[7:0],mem_data[7:0]};
1257
1258 assign mb_l2tag_lkup_tag[27:0] = (march_1 | march_2) ? l2tag_lkup_tag[27:0] : ~l2tag_lkup_tag[27:0];
1259
1260 assign l2tag_cam_pass = l2tag_cam_cmp_d4 ? &mb_l2tag_hit_way[15:0] : ~|mb_l2tag_hit_way[15:0];
1261 assign l2tag_cam_fail = (l2tag_strobe_valid) ? ~l2tag_cam_pass : 1'b0;
1262
1263 assign l2tag_strobe_valid = mb_addr[8] & array_2 & (~bisi_mode | ~mb_user_addr_mode) & l2tag_way[3:0]==4'h0 & (march_1 | march_2) ;
1264 assign l2tag_cam_cmp = mb_array_2_rd & (march_1 | march_2) & l2tag_data_0_or_1;
1265
1266
1267l2t_msff_ctl_macro__width_4 cam_cmp_fail_delay_reg (
1268 .scan_in(cam_cmp_fail_delay_reg_scanin),
1269 .scan_out(cam_cmp_fail_delay_reg_scanout),
1270 .l1clk ( l1clk_pm1 ),
1271 .din ( {
1272 l2tag_cam_cmp,
1273 l2tag_cam_cmp_d1,
1274 l2tag_cam_cmp_d2,
1275 l2tag_cam_cmp_d3
1276 } ),
1277 .dout ({
1278 l2tag_cam_cmp_d1,
1279 l2tag_cam_cmp_d2,
1280 l2tag_cam_cmp_d3,
1281 l2tag_cam_cmp_d4
1282 } ),
1283 .siclk(siclk),
1284 .soclk(soclk));
1285
1286
1287
1288//////////////////////////////////// ////////////////////////////////////
1289// STOP ADDR
1290//////////////////////////////////// ////////////////////////////////////
1291// cycle count for bisi:
1292// arrays cycles operation
1293// ---------------------------
1294// vuad0: 512 write
1295// vuad1: 512 write
1296// l2tag: 8192 write
1297// l2data: 131072 write
1298// vuad0: 512 read
1299// vuad1: 512 read
1300// l2tag: 8192 read <-- abort after 1st read
1301// l2data: 131072 read
1302//-----------------------------
1303// total 280576
1304
1305
1306 assign stop_addr[17:0] = mb_user_addr_mode ? user_stop_addr[17:0] :
1307 array_0 ? 18'b00_00000001_11111111: // l2vuad (valid)
1308 array_1 ? 18'b00_00000001_11111111: // l2vuad (dirty)
1309 array_2 ? 18'b00_00011111_11111111: // l2tag
1310 array_3 ? 18'b00_11111111_11111111: // l2data
1311 18'b01_11111111_11111111;
1312
1313
1314//////////////////////////////////// ////////////////////////////////////
1315// ADDR MIX
1316//////////////////////////////////// ////////////////////////////////////
1317
1318// L2tag
1319// ------
1320// Each L2t bank is 8Kx28. Each bank is composed of 8 arrays
1321// and each array represent 2 ways.
1322
1323// Each array is 128 rows x (28x8) columns. There is a 4:1 column muxing
1324// and since 2 ways, the 8 consecutive columns represent 2 ways, where
1325// every 4 goes to one sense amp.
1326
1327// Therefore, index[8:0] chooses one of 512 entires, where:
1328
1329// index[8:2] are row addresses, and
1330// index[1:0] are column addresses.
1331
1332
1333// VUAD memories
1334// --------------
1335// Each VUAD instance is 32 words x 160 bits and structured as
1336// 32 rows x 160 columns. It is a straight forward memory.
1337// The rows are divided in between for read. i.e. 16 rows on top
1338// and 16 rows in the bottom.
1339
1340// Therefore, for addressing, consider this:
1341
1342// address_mix = 0 : mem_address[4:0]
1343// = 1 : mem_address[3:0],mem_address[4] // to jump between
1344 // top & bottom.
1345// For adjacent row, consider inverting one of mem_address[3:0] so that
1346// both fall amongst the top or bottom rows.
1347//
1348// Furthermore, there are 4 arrays of 32x160 for VD and 4 for UA.
1349// There are index[8:0] is used to address the bits of each set of 4 arrays.
1350// For VD bits, since there 2 bits for each entry and for each way, then
1351// # of bits per entry for 16 ways are 16x2=32 which requires 7 bits of ecc,
1352// therefore 39 bits per entry is needed. Therefore, for 512 entries, we need:
1353// 512 x 39 which is stored as (4 arrays) of (32rows) x (39x4).
1354// So, index[8:0] is used in the following way:
1355
1356// index[1:0]: decodes which entry on each row,
1357// index[6:2]: decodes which row within an array,
1358// index[8:7]: decodes which of four 32x160 array instances.
1359
1360// L2data
1361// ------
1362// Each bank of L2data is composed of a top and bottom half. Top half for
1363// col_offset 1 and 3 and the bottom one for col_offset 0 and 2.
1364// Each half is composed of 2 quadrants and each quadrant is made up of four
1365// 32KB blocks.
1366// The top two 32KB in each quadrant is controlled with way_sel[7:0] and the
1367// bottom two is controlled with way_sel[15:8].
1368// Each 32KB block is built of two 16KB blocks.
1369// Each 16KB block is the configured as 256 rows x 624 columns.
1370// These 624 columns are muxed 8:1 into 78 i/o's.
1371// way_sel[7:0] and way_sel[15:8] decode the 8 columns within an i/o.
1372// set[7:0] decodes 256 rows within a 16K B and set[8] chooses between top and
1373// bottom 16KB.
1374//
1375
1376 // l2tag
1377
1378 assign mem_addr_mix0[17:0] = mem_addr1[17:0];
1379
1380
1381
1382 assign mem_addr_mix1[17:0] = (array_2) ? { mem_addr1[17:13],
1383 mem_addr1[12],
1384 mem_addr1[9],
1385 mem_addr1[11],
1386 mem_addr1[10],
1387 mem_addr1[6:0],
1388 mem_addr1[8:7] } : // l2tag fast row
1389
1390 (array_0) ? { mem_addr1[17:7],mem_addr1[4:0],mem_addr1[6:5] } : // vuad
1391 (array_1) ? { mem_addr1[17:7],mem_addr1[4:0],mem_addr1[6:5] } :
1392 (array_3) ? { mem_addr1[17:16],mem_addr1[5:3],mem_addr1[6],mem_addr1[2:0],mem_addr1[15:7] } :
1393 mem_addr1[17:0]; // Default l2d: fast row, then 16K block, then column
1394 // Default l2t: fast col, then row, then way
1395 // Default vuad: fast word_en, then row
1396
1397 // index[7:0], waysel, index[8], word
1398 assign mem_addr_mix2_pre[17:0] = { mem_addr1[17:16],mem_addr1[2:0],mem_addr1[7:4],mem_addr1[3],mem_addr1[15:8] } ;
1399
1400
1401 assign mem_addr_mix2_dec[3:0] = mem_addr_mix2_pre[12:9]==4'd0 ? 4'd0 :
1402 mem_addr_mix2_pre[12:9]==4'd1 ? 4'd8 :
1403 mem_addr_mix2_pre[12:9]==4'd2 ? 4'd1 :
1404 mem_addr_mix2_pre[12:9]==4'd3 ? 4'd9 :
1405 mem_addr_mix2_pre[12:9]==4'd4 ? 4'd2 :
1406 mem_addr_mix2_pre[12:9]==4'd5 ? 4'd10 :
1407 mem_addr_mix2_pre[12:9]==4'd6 ? 4'd3 :
1408 mem_addr_mix2_pre[12:9]==4'd7 ? 4'd11 :
1409 mem_addr_mix2_pre[12:9]==4'd8 ? 4'd4 :
1410 mem_addr_mix2_pre[12:9]==4'd9 ? 4'd12 :
1411 mem_addr_mix2_pre[12:9]==4'd10 ? 4'd5 :
1412 mem_addr_mix2_pre[12:9]==4'd11 ? 4'd13 :
1413 mem_addr_mix2_pre[12:9]==4'd12 ? 4'd6 :
1414 mem_addr_mix2_pre[12:9]==4'd13 ? 4'd14 :
1415 mem_addr_mix2_pre[12:9]==4'd14 ? 4'd7 :
1416 mem_addr_mix2_pre[12:9]==4'd15 ? 4'd15 :
1417 4'h0 ;
1418
1419
1420 assign mem_addr_mix2[17:0]={mem_addr_mix2_pre[17:13],mem_addr_mix2_dec[3:0],mem_addr_mix2_pre[8:0]};
1421
1422 assign mem_addr[17:0] = addr_mix_0 ? mem_addr_mix0[17:0] :
1423 addr_mix_1 ? mem_addr_mix1[17:0] :
1424 addr_mix_2 ? mem_addr_mix2[17:0] :
1425 mem_addr1[17:0];
1426
1427
1428
1429//////////////////////////////////// ////////////////////////////////////
1430// SEQ selection
1431//////////////////////////////////// ////////////////////////////////////
1432
1433 // array
1434
1435 assign array_0 = array_sel[3:0]==4'h0 & run3;
1436 assign array_1 = array_sel[3:0]==4'h1 & run3;
1437 assign array_2 = array_sel[3:0]==4'h2 & run3;
1438 assign array_3 = array_sel[3:0]==4'h3 & run3;
1439// assign array_4 = array_sel[3:0]==4'h4;
1440// assign array_5 = array_sel[3:0]==4'h5;
1441
1442 assign last_array = array_3;
1443 // cmp
1444// assign cmp_0 = cmp_sel[3:0]==4'b0000;
1445// assign cmp_1 = cmp_sel[3:0]==4'b0001;
1446// assign cmp_2 = cmp_sel[3:0]==4'b0010;
1447// assign cmp_3 = cmp_sel[3:0]==4'b0011;
1448// assign cmp_4 = cmp_sel[3:0]==4'b0100;
1449// assign cmp_5 = cmp_sel[3:0]==4'b0101;
1450// assign cmp_6 = cmp_sel[3:0]==4'b0110;
1451// assign cmp_7 = cmp_sel[3:0]==4'b0111;
1452// assign cmp_15 = cmp_sel[3:0]==4'b1111;
1453
1454 // march
1455
1456 assign march_0 = (march_element[3:0]==4'h0);
1457 assign march_1 = (march_element[3:0]==4'h1);
1458 assign march_2 = (march_element[3:0]==4'h2);
1459 assign march_3 = (march_element[3:0]==4'h3);
1460 assign march_4 = (march_element[3:0]==4'h4);
1461 assign march_5 = (march_element[3:0]==4'h5);
1462 assign march_6 = (march_element[3:0]==4'h6);
1463 assign march_7 = (march_element[3:0]==4'h7);
1464 assign march_8 = (march_element[3:0]==4'h8);
1465
1466 // rw
1467
1468 assign rw_0 = (rw[2:0]==3'b000);
1469 assign rw_1 = (rw[2:0]==3'b001);
1470 assign rw_2 = (rw[2:0]==3'b010);
1471 assign rw_3 = (rw[2:0]==3'b011);
1472 assign rw_4 = (rw[2:0]==3'b100);
1473// assign rw_5 = (rw[2:0]==3'b101);
1474// assign rw_6 = (rw[2:0]==3'b110);
1475// assign rw_7 = (rw[2:0]==3'b111);
1476
1477
1478
1479
1480
1481//////////////////////////////////// ////////////////////////////////////
1482// SEQ logic
1483//////////////////////////////////// ////////////////////////////////////
1484
1485 // array logic
1486
1487 assign array_sel_cntl_out[3:0]=cntl_out[33:30];
1488
1489
1490 l2t_msff_ctl_macro__width_4 array_sel_reg (
1491 .scan_in(array_sel_reg_scanin),
1492 .scan_out(array_sel_reg_scanout),
1493 .l1clk ( l1clk_pm1 ),
1494 .din ( array_sel[3:0] ),
1495 .dout ( array_sel_out[3:0] ),
1496 .siclk(siclk),
1497 .soclk(soclk));
1498
1499 assign array_sel[3:0]=(&array_sel_cntl_out[3:0]) ? array_sel_out[3:0] :
1500 user_mode ? user_array_sel[3:0] :
1501 array_sel_cntl_out[3:0];
1502
1503
1504
1505 // cmp logic
1506
1507// assign cmp_sel_cntl_out[3:0] = cntl_out[29:26];
1508
1509// msff_ctl_macro cmp_sel_reg (width=4) (
1510// .scan_in(cmp_sel_reg_scanin),
1511// .scan_out(cmp_sel_reg_scanout),
1512// .din ( cmp_sel[3:0] ),
1513// .dout ( cmp_sel_out[3:0] ));
1514//
1515// assign cmp_sel[3:0]= (&cmp_sel_cntl_out[3:0] & ~(array_4 | array_5)) ? cmp_sel_out[3:0] :
1516// cmp_sel_cntl_out[3:0];
1517
1518
1519 // march logic
1520
1521 assign march_element_cntl_out[3:0]=cntl_out[25:22];
1522
1523
1524 l2t_msff_ctl_macro__width_4 marche_element_reg (
1525 .scan_in(marche_element_reg_scanin),
1526 .scan_out(marche_element_reg_scanout),
1527 .l1clk ( l1clk_pm1 ),
1528 .din ( march_element[3:0] ),
1529 .dout ( march_element_out ),
1530 .siclk(siclk),
1531 .soclk(soclk));
1532
1533 assign march_element[3:0]=(&march_element_cntl_out[3:0]) ? march_element_out[3:0] :
1534 march_element_cntl_out[3:0];
1535
1536
1537 // rw
1538
1539 assign rw_cntl_out[2:0]=cntl_out[3:1];
1540
1541
1542 l2t_msff_ctl_macro__width_3 march_element_reg (
1543 .scan_in(march_element_reg_scanin),
1544 .scan_out(march_element_reg_scanout),
1545 .l1clk ( l1clk_pm1 ),
1546 .din ( rw[2:0] ),
1547 .dout ( rw_out[2:0] ),
1548 .siclk(siclk),
1549 .soclk(soclk));
1550
1551 assign rw[2:0]=(&rw_cntl_out[2:0]) ? rw_out[2:0] :
1552 rw_cntl_out[2:0];
1553
1554
1555
1556//////////////////////////////////////////////////////////////////
1557// SEL_PASS LOGIC
1558//////////////////////////////////////////////////////////////////
1559
1560
1561 // pass logic:
1562
1563 // march
1564 assign sel_march_1_pass = bisi_mode | (mb_ten_n_mode & march_5) | march_8;
1565
1566
1567 assign bisi_wr_mode = mb_default_bisi | mb_user_bisi_rw_mode ? ~cntl_bisi & run3 :
1568 mb_user_bisi_wr_mode & run3;
1569
1570 assign bisi_rd_mode =mb_default_bisi | mb_user_bisi_rw_mode ? cntl_bisi & run3 :
1571 mb_user_bisi_rd_mode & run3;
1572
1573
1574
1575
1576 // rw
1577 assign sel_rw_1_pass = bisi_mode | one_cycle_march ;
1578
1579 assign sel_rw_2_pass = two_cycle_march;
1580 assign sel_rw_5_pass = five_cycle_march;
1581
1582 assign sel_rw_pass = (run3 & sel_rw_1_pass & rw_0) |
1583 (run3 & sel_rw_2_pass & rw_1) |
1584 (run3 & sel_rw_5_pass & rw_4) ;
1585
1586
1587
1588
1589
1590//////////////////////////////////// ////////////////////////////////////
1591// membist control assignment
1592//////////////////////////////////// ////////////////////////////////////
1593
1594
1595
1596 assign mb_addr[17:0]= mem_addr[17:0];
1597 assign l2tag_way[3:0]=mb_addr[12:9];
1598
1599 assign mb_write_data[7:0]=mem_data[7:0];
1600
1601
1602
1603
1604 // only one array read signal should be active
1605
1606 assign mb_array_0_rd = array_0 & mem_rd; // l2tag
1607 assign mb_array_1_rd = array_1 & mem_rd; // l2vuad (valid)
1608 assign mb_array_2_rd = array_2 & mem_rd; // l2vuad (dirty)
1609// assign mb_array_3_rd = array_3 & mem_rd & (mb_user_addr_mode ; // l2data
1610 assign mb_array_3_rd = mb_user_addr_mode ? array_3 & mem_rd & ~quad_cntl:
1611 array_3 & mem_rd ;
1612
1613
1614
1615 assign mb_array_0_wr = array_0 & mem_wr;
1616 assign mb_array_1_wr = array_1 & mem_wr;
1617 assign mb_array_2_wr = array_2 & mem_wr;
1618 assign mb_array_3_wr = mb_user_addr_mode ? array_3 & mem_wr & quad_cntl :
1619 array_3 & mem_wr ;
1620
1621//((~user_mode) | (user_mode & quad_cntl)) & array_3;
1622 assign quad_cntl = mb_user_quad_sel ? cntl_l2rw_out : ~cntl_l2rw_out;
1623
1624 assign mb_run = run;
1625
1626
1627//////////////////////////////////// ////////////////////////////////////
1628// DONE LOGIC
1629//////////////////////////////////// ////////////////////////////////////
1630
1631
1632
1633
1634
1635
1636
1637
1638 l2t_msff_ctl_macro__width_1 msb_latch (
1639 .scan_in(msb_latch_scanin),
1640 .scan_out(msb_latch_scanout),
1641 .l1clk ( l1clk_pm1 ),
1642 .din ( msb_in ),
1643 .dout ( msb_out ),
1644 .siclk(siclk),
1645 .soclk(soclk));
1646
1647 assign msb_in= (~start_in ) | (mb_user_loop_mode & mb_done) ? 1'b0 :
1648 (cntl_msb) ? 1'b1 :
1649 msb_out;
1650
1651
1652 assign stop_engine_l = start_in & cntl_msb;
1653
1654
1655 assign mb_done=msb_out & (done_delay[4:0]==5'b11110);
1656
1657 assign run3 = &done_delay[4:1] & ~stop_engine_l & start_in;
1658
1659
1660 l2t_msff_ctl_macro__width_1 run3_transition_reg (
1661 .scan_in(run3_transition_reg_scanin),
1662 .scan_out(run3_transition_reg_scanout),
1663 .l1clk ( l1clk_pm1 ),
1664 .din ( run3 ),
1665 .dout ( run3_out ),
1666 .siclk(siclk),
1667 .soclk(soclk));
1668
1669 assign run3_transition = run3 & ~run3_out;
1670
1671 l2t_msff_ctl_macro__width_5 done_delay_reg (
1672 .scan_in(done_delay_reg_scanin),
1673 .scan_out(done_delay_reg_scanout),
1674 .l1clk ( l1clk_pm1 ),
1675 .din ( done_delay_in[4:0] ),
1676 .dout ( done_delay[4:0] ),
1677 .siclk(siclk),
1678 .soclk(soclk));
1679
1680
1681
1682 assign done_delay_in[4:0] = run3 ? 5'b11111 :
1683 mb_done ? 5'b11110 :
1684 (run & ~run3) ? done_delay[4:0] + 5'b00001 :
1685 5'b00000;
1686
1687
1688
1689 // merge start, done, fail signals:
1690 // ordering of test operation of engines
1691 // - mb0 parallel with mb2 - mb1
1692 // default mode:
1693 // done - default: mb_all_done = mb0_done & mb1_done;
1694 // - user : mb_all_done = mb0_done | mb1_done | mb2_done;
1695 // fail - default: mb_all_fail = mb0_fail | mb1_fail | mb2_fail;
1696 // - user : mb_all_fail = mb0_fail | mb1_fail | mb2_fail;
1697
1698
1699// merge fail and done signals:
1700
1701 l2t_msff_ctl_macro__width_3 merged_fail (
1702 .scan_in(merged_fail_scanin),
1703 .scan_out(merged_fail_scanout),
1704 .l1clk ( l1clk_pm1 ),
1705 .din ( {mbist0_fail,mbist2_fail,mb_fail_merged} ),
1706 .dout ( {mb0_fail, mb2_fail, mbist_fail} ),
1707 .siclk(siclk),
1708 .soclk(soclk));
1709
1710 l2t_msff_ctl_macro__width_3 merged_done (
1711 .scan_in(merged_done_scanin),
1712 .scan_out(merged_done_scanout),
1713 .l1clk ( l1clk_pm1 ),
1714 .din ( {mbist0_done,mbist2_done,mb_done_merged} ),
1715 .dout ( {mb0_done, mb2_done, mbist_done} ),
1716 .siclk(siclk),
1717 .soclk(soclk));
1718
1719
1720
1721
1722
1723 assign mb_fail_merged=mb1_fail | mb2_fail | mb0_fail;
1724
1725
1726 assign mb_done_merged= user_mode ? (mb0_done | mb2_done | mb1_done) : (mb0_done & mb1_done);
1727
1728
1729
1730//////////////////////////////////// ////////////////////////////////////
1731// FAIL LOGIC
1732//////////////////////////////////// ////////////////////////////////////
1733
1734// mb_*_fail signals are all inverted
1735// 0 - pass, 1 - fail
1736
1737assign mb_l2tag_fail = ~mbist_l2tag_fail;
1738assign mb_l2vuad_fail = ~mbist_l2vuad_fail;
1739assign mb_l2data_fail_pregate = ~mbist_l2data_fail;
1740
1741
1742l2t_msff_ctl_macro__width_6 l2data_rd_cmp_reg (
1743 .scan_in(l2data_rd_cmp_reg_scanin),
1744 .scan_out(l2data_rd_cmp_reg_scanout),
1745 .l1clk ( l1clk_pm1 ),
1746 .din ( {mb_array_3_rd,array_3_rd_d1,array_3_rd_d2,array_3_rd_d3,array_3_rd_d4,array_3_rd_d5} ),
1747 .dout ( {array_3_rd_d1 ,array_3_rd_d2,array_3_rd_d3,array_3_rd_d4,array_3_rd_d5,array_3_rd_d6} ),
1748 .siclk(siclk),
1749 .soclk(soclk));
1750
1751
1752assign mb_l2data_fail = array_3_rd_d6 ? mb_l2data_fail_pregate : 1'b0;
1753
1754//assign mb_l2data_fail= (~mb_array_3_wr & mb_l2data_fail_pregate);
1755
1756assign l2tag_fail_d = run3_transition ? 1'b0 : mb_l2tag_fail | l2tag_fail_sticky;
1757assign l2vuad_fail_d = run3_transition ? 1'b0 : mb_l2vuad_fail | l2vuad_fail_sticky;
1758assign l2data_fail_d = run3_transition ? 1'b0 : mb_l2data_fail | l2data_fail_sticky;
1759assign l2tag_cam_fail_d = run3_transition ? 1'b0 : l2tag_cam_fail | l2tag_cam_sticky;
1760
1761
1762l2t_msff_ctl_macro__width_4 mbist_fail_input_reg (
1763 .scan_in(mbist_fail_input_reg_scanin),
1764 .scan_out(mbist_fail_input_reg_scanout),
1765 .l1clk ( l1clk_pm1 ),
1766 .din ({l2tag_fail_d,
1767 l2vuad_fail_d,
1768 l2data_fail_d,
1769 l2tag_cam_fail_d
1770 }),
1771 .dout ({l2tag_fail_sticky,
1772 l2vuad_fail_sticky,
1773 l2data_fail_sticky,
1774 l2tag_cam_sticky
1775 }),
1776 .siclk(siclk),
1777 .soclk(soclk));
1778
1779
1780
1781assign mbist_fail_sticky = l2tag_fail_sticky |
1782 l2vuad_fail_sticky |
1783 l2data_fail_sticky |
1784 l2tag_cam_sticky ;
1785
1786
1787assign mbist_fail_array = mb_l2tag_fail |
1788 mb_l2vuad_fail |
1789 mb_l2data_fail |
1790 l2tag_cam_fail ;
1791
1792
1793assign valid_fail=run3 | (stop_engine_l & ~mb_done);
1794
1795
1796assign mb_fail = mb_done ? mbist_fail_sticky : mbist_fail_array & valid_fail;
1797
1798
1799//////////////////////////////////////////////////////////////////
1800// OUTPUT FLOP:
1801//////////////////////////////////////////////////////////////////
1802
1803// mb_done
1804
1805
1806l2t_msff_ctl_macro__width_1 out_mb_tcu_done_reg (
1807 .scan_in(out_mb_tcu_done_reg_scanin),
1808 .scan_out(out_mb_tcu_done_reg_scanout),
1809 .l1clk ( l1clk_pm1 ),
1810 .din ( mb_done ),
1811 .dout ( mb_done_out ),
1812 .siclk(siclk),
1813 .soclk(soclk));
1814
1815
1816// mb_fail
1817
1818
1819l2t_msff_ctl_macro__width_1 out_mb_tcu_fail_reg (
1820 .scan_in(out_mb_tcu_fail_reg_scanin),
1821 .scan_out(out_mb_tcu_fail_reg_scanout),
1822 .l1clk ( l1clk_pm1 ),
1823 .din ( mb_fail ),
1824 .dout ( mb_fail_out ),
1825 .siclk(siclk),
1826 .soclk(soclk));
1827
1828
1829
1830
1831
1832
1833// thes are all the output flops to arrays
1834// for the following signals:
1835//
1836// - run
1837// - data
1838// - address
1839
1840
1841l2t_msff_ctl_macro__width_1 out_run_mb_arrays_reg (
1842 .scan_in(out_run_mb_arrays_reg_scanin),
1843 .scan_out(out_run_mb_arrays_reg_scanout),
1844 .l1clk ( l1clk_pm1 ),
1845 .din ( mb_run),
1846 .dout ( mb_run_out),
1847 .siclk(siclk),
1848 .soclk(soclk));
1849
1850// data 8 bits
1851
1852l2t_msff_ctl_macro__width_16 out_data_mb_arrays_reg (
1853 .scan_in(out_data_mb_arrays_reg_scanin),
1854 .scan_out(out_data_mb_arrays_reg_scanout),
1855 .l1clk ( l1clk_pm1 ),
1856 .din ( {mb_write_data[7:0],mb_write_data[7:0]}),
1857 .dout ( {mb_write_data_out[7:0],mbist_write_data_decck_out[7:0]}),
1858 .siclk(siclk),
1859 .soclk(soclk));
1860
1861
1862// address 16 bits
1863
1864
1865l2t_msff_ctl_macro__width_18 out_addr_mb_arrays_reg (
1866 .scan_in(out_addr_mb_arrays_reg_scanin),
1867 .scan_out(out_addr_mb_arrays_reg_scanout),
1868 .l1clk ( l1clk_pm1 ),
1869 .din ( mb_addr[17:0]),
1870 .dout ( mb_addr_out[17:0]),
1871 .siclk(siclk),
1872 .soclk(soclk));
1873
1874
1875
1876//
1877// write enable
1878
1879l2t_msff_ctl_macro__width_4 out_wr_mb_arrays_reg (
1880 .scan_in(out_wr_mb_arrays_reg_scanin),
1881 .scan_out(out_wr_mb_arrays_reg_scanout),
1882 .l1clk ( l1clk_pm1 ),
1883 .din ( {
1884 mb_array_0_wr,
1885 mb_array_1_wr,
1886 mb_array_2_wr,
1887 mb_array_3_wr
1888 } ),
1889 .dout ({
1890 mb_array_0_wr_out,
1891 mb_array_1_wr_out,
1892 mb_array_2_wr_out,
1893 mb_array_3_wr_out
1894 } ),
1895 .siclk(siclk),
1896 .soclk(soclk));
1897
1898
1899
1900// read enable
1901
1902l2t_msff_ctl_macro__width_3 out_rd_mb_arrays_reg (
1903 .scan_in(out_rd_mb_arrays_reg_scanin),
1904 .scan_out(out_rd_mb_arrays_reg_scanout),
1905 .l1clk ( l1clk_pm1 ),
1906 .din ( {
1907 mb_array_0_rd,
1908 mb_array_1_rd,
1909 mb_array_2_rd
1910 } ),
1911 .dout ({
1912 mb_array_0_rd_out,
1913 mb_array_1_rd_out,
1914 mb_array_2_rd_out
1915 } ),
1916 .siclk(siclk),
1917 .soclk(soclk));
1918
1919
1920
1921// port name re-assignment
1922
1923
1924 assign mbist_run =mb_run_out;
1925 assign mbist_write_data[7:0] =mb_write_data_out[7:0];
1926 assign mbist_write_data_decck[7:0] =mbist_write_data_decck_out[7:0]; // duplicated the bus for routing reasons
1927 assign mbist_l2tag_index[8:0] =mb_addr_out[8:0];
1928 assign mbist_l2data_index[8:0] =mb_addr_out[8:0];
1929 assign mbist_l2vuad_index[8:0] =mb_addr_out[8:0];
1930
1931
1932 assign mbist_l2tag_way[3:0] =mb_addr_out[12:9];
1933 assign mbist_l2data_way[3:0] =mb_addr_out[12:9];
1934
1935 // top half 0,1,2,3 ,8 ,9, 10,11
1936 // bot hald 4,5,6,7 12,13,14,15
1937 // current:
1938 // 0 1 2 3 11 10 9 8
1939 // 15 14 13 12 4 5 6 7
1940 // designer's request:
1941 // 0 2 8 10 1 3 9 11 top half
1942 // 15 13 7 5 4 6 12 14 bot half
1943
1944 // mb_addr_out[16:13]
1945 // 000
1946 // 001
1947 // 010
1948 // 011
1949 // 100
1950 // 101
1951 // 110
1952 // 111
1953
1954
1955
1956 assign l2data_word[3:0] = mb_addr_out[16:15]==2'b01 ? ~mb_addr_out[16:13] : mb_addr_out[16:13];
1957
1958 assign mbist_l2data_word[3:0] =cntl_l2rw_out ? ~l2data_word[3:0] : l2data_word[3:0];
1959
1960
1961
1962// assign l2data_word_frow[3:0] = l2data_word_raw[3:0]==4'd0 ? 4'd0 :
1963// l2data_word_raw[3:0]==4'd1 ? 4'd2 :
1964// l2data_word_raw[3:0]==4'd2 ? 4'd8 :
1965// l2data_word_raw[3:0]==4'd3 ? 4'd10 :
1966// l2data_word_raw[3:0]==4'd11 ? 4'd1 :
1967// l2data_word_raw[3:0]==4'd10 ? 4'd3 :
1968// l2data_word_raw[3:0]==4'd9 ? 4'd9 :
1969// l2data_word_raw[3:0]==4'd8 ? 4'd11 :
1970// l2data_word_raw[3:0]==4'd15 ? 4'd15 :
1971// l2data_word_raw[3:0]==4'd14 ? 4'd13 :
1972// l2data_word_raw[3:0]==4'd13 ? 4'd7 :
1973// l2data_word_raw[3:0]==4'd12 ? 4'd5 :
1974// l2data_word_raw[3:0]==4'd4 ? 4'd4 :
1975// l2data_word_raw[3:0]==4'd5 ? 4'd6 :
1976// l2data_word_raw[3:0]==4'd6 ? 4'd12 :
1977// l2data_word_raw[3:0]==4'd7 ? 4'd14 :
1978// 4'd0;
1979//
1980
1981 assign mb1_fail =mb_fail_out;
1982 assign mb1_done =mb_done_out;
1983 assign mbist_l2vuad_write =mb_array_0_wr_out | mb_array_1_wr_out;
1984 assign mbist_l2tag_write =mb_array_2_wr_out;
1985 assign mbist_l2data_write =mb_array_3_wr_out;
1986
1987
1988 assign mbist_l2tag_read =mb_array_2_rd_out;
1989 assign mbist_l2vuad_read =mb_array_0_rd_out | mb_array_1_rd_out;
1990
1991
1992// spare gates:
1993
1994
1995
1996l2t_spare_ctl_macro__num_2 spares (
1997 .scan_in(spares_scanin),
1998 .scan_out(spares_scanout),
1999 .l1clk (l1clk_pm1),
2000 .siclk(siclk),
2001 .soclk(soclk)
2002);
2003
2004
2005supply0 vss; // <- port for ground
2006supply1 vdd; // <- port for power
2007// /////////////////////////////////////////////////////////////////////////////
2008
2009// fixscan start:
2010assign array_usr_reg_scanin = scan_in ;
2011assign user_addr_mode_reg_scanin = array_usr_reg_scanout ;
2012assign user_start_addr_reg_scanin = user_addr_mode_reg_scanout;
2013assign user_stop_addr_reg_scanin = user_start_addr_reg_scanout;
2014assign user_incr_addr_reg_scanin = user_stop_addr_reg_scanout;
2015assign user_data_mode_reg_scanin = user_incr_addr_reg_scanout;
2016assign user_data_reg_scanin = user_data_mode_reg_scanout;
2017assign user_loop_mode_reg_scanin = user_data_reg_scanout ;
2018assign ten_n_mode_reg_scanin = user_loop_mode_reg_scanout;
2019assign user_quad_sel_reg_scanin = ten_n_mode_reg_scanout ;
2020assign user_bisi_wr_mode_reg_scanin = user_quad_sel_reg_scanout;
2021assign user_bisi_rd_mode_reg_scanin = user_bisi_wr_mode_reg_scanout;
2022assign user_addr_mix_sel_reg_scanin = user_bisi_rd_mode_reg_scanout;
2023assign mbist_start_reg_scanin = user_addr_mix_sel_reg_scanout;
2024assign mbist_start_all_reg_scanin = mbist_start_reg_scanout ;
2025assign input_signals_reg_scanin = mbist_start_all_reg_scanout;
2026assign mb_enable_reg_scanin = input_signals_reg_scanout;
2027assign config_reg_scanin = mb_enable_reg_scanout ;
2028assign loop_again_reg_scanin = config_reg_scanout ;
2029assign mbist_output_reg_scanin = loop_again_reg_scanout ;
2030assign input_cam_hit_reg_scanin = mbist_output_reg_scanout ;
2031assign cntl_reg_scanin = input_cam_hit_reg_scanout;
2032assign cntl_addr_mix_reg_scanin = cntl_reg_scanout ;
2033assign cam_cmp_fail_delay_reg_scanin = cntl_addr_mix_reg_scanout;
2034assign array_sel_reg_scanin = cam_cmp_fail_delay_reg_scanout;
2035assign marche_element_reg_scanin = array_sel_reg_scanout ;
2036assign march_element_reg_scanin = marche_element_reg_scanout;
2037assign msb_latch_scanin = march_element_reg_scanout;
2038assign run3_transition_reg_scanin = msb_latch_scanout ;
2039assign done_delay_reg_scanin = run3_transition_reg_scanout;
2040assign merged_fail_scanin = done_delay_reg_scanout ;
2041assign merged_done_scanin = merged_fail_scanout ;
2042assign l2data_rd_cmp_reg_scanin = merged_done_scanout ;
2043assign mbist_fail_input_reg_scanin = l2data_rd_cmp_reg_scanout;
2044assign out_mb_tcu_done_reg_scanin = mbist_fail_input_reg_scanout;
2045assign out_mb_tcu_fail_reg_scanin = out_mb_tcu_done_reg_scanout;
2046assign out_run_mb_arrays_reg_scanin = out_mb_tcu_fail_reg_scanout;
2047assign out_data_mb_arrays_reg_scanin = out_run_mb_arrays_reg_scanout;
2048assign out_addr_mb_arrays_reg_scanin = out_data_mb_arrays_reg_scanout;
2049assign out_wr_mb_arrays_reg_scanin = out_addr_mb_arrays_reg_scanout;
2050assign out_rd_mb_arrays_reg_scanin = out_wr_mb_arrays_reg_scanout;
2051assign spares_scanin = out_rd_mb_arrays_reg_scanout;
2052assign scan_out = spares_scanout ;
2053// fixscan end:
2054endmodule
2055
2056
2057
2058
2059// any PARAMS parms go into naming of macro
2060
2061module l2t_msff_ctl_macro__width_18 (
2062 din,
2063 l1clk,
2064 scan_in,
2065 siclk,
2066 soclk,
2067 dout,
2068 scan_out);
2069wire [17:0] fdin;
2070wire [16:0] so;
2071
2072 input [17:0] din;
2073 input l1clk;
2074 input scan_in;
2075
2076
2077 input siclk;
2078 input soclk;
2079
2080 output [17:0] dout;
2081 output scan_out;
2082assign fdin[17:0] = din[17:0];
2083
2084
2085
2086
2087
2088
2089dff #(18) d0_0 (
2090.l1clk(l1clk),
2091.siclk(siclk),
2092.soclk(soclk),
2093.d(fdin[17:0]),
2094.si({scan_in,so[16:0]}),
2095.so({so[16:0],scan_out}),
2096.q(dout[17:0])
2097);
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110endmodule
2111
2112