// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: tcu_mbist_ctl.v
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// ========== Copyright Header End ============================================
`define WATCH_POINT 2'b00
`define START_COUNT 2'b11
//debug event status bit location
// UCB defines, copied from Niagara iop/include/sys.h or iop.h
`define UCB_BUF_HI 11 // (2) buffer ID
`define UCB_THR_HI 9 // (6) cpu/thread ID
`define UCB_DATA_HI 127 // (64) data
`define UCB_PKT_HI 3 // (4) packet type
`define UCB_READ_ACK 4'b0001
`define UCB_READ_REQ 4'b0100 // req types
`define UCB_WRITE_ACK 4'b0010
`define UCB_WRITE_REQ 4'b0101
`define UCB_SIZE_HI 14 // (3) request size
`define UCB_BID_TAP 2'b01
`define UCB_ADDR_HI 54 // (40) bit address
`define PCX_SZ_8B 3'b011 // encoding for 8B access
`define NUM_TOTAL_MBIST_M1 47
`define NUM_TOTAL_MBIST 48
`define NUM_TOTAL_LBIST 8
`define NUM_TOTAL_LBIST_M1 7
`define POR_CLR_START 4'd3
`define POR_END_WAIT 4'd4
`define WMR_CLR_START 4'd8
`define WMR_END_WAIT 4'd9
`define BISX_CLR_DF 4'd10
`define BISX_CLR_START 4'd12
tcu_mio_jtag_membist_mode,
ncu_spc0_core_enable_status,
ncu_spc1_core_enable_status,
ncu_spc2_core_enable_status,
ncu_spc3_core_enable_status,
ncu_spc4_core_enable_status,
ncu_spc5_core_enable_status,
ncu_spc6_core_enable_status,
ncu_spc7_core_enable_status,
debug_reg_hard_stop_domain_1st,
debug_cycle_counter_stop_to_mbc,
debug_cycle_counter_stop,
wire jtag_csr_wr_sync_reg_scanin;
wire jtag_csr_wr_sync_reg_scanout;
wire mb_tcu_done_36_sync_reg_scanin;
wire mb_tcu_done_36_sync_reg_scanout;
wire mb_tcu_done_36_sync;
wire mb_tcu_fail_36_sync_reg_scanin;
wire mb_tcu_fail_36_sync_reg_scanout;
wire mb_tcu_fail_36_sync;
wire tcu_mbist_sync_en_reg_scanin;
wire tcu_mbist_sync_en_reg_scanout;
wire io_cmp_sync_en_local;
wire cmp_io_sync_en_local;
wire cmp_io2x_sync_en_local;
wire tcu_test_protect_cmp_reg_scanin;
wire tcu_test_protect_cmp_reg_scanout;
wire tcu_test_protect_sync;
wire ucb_csr_wr_sync_reg_scanin;
wire ucb_csr_wr_sync_reg_scanout;
wire ucb_csr_addr_sync_reg_scanin;
wire ucb_csr_addr_sync_reg_scanout;
wire [5:0] ucb_csr_addr_sync;
wire ucb_sel_mbist_bypass;
wire ucb_sel_mbist_start;
wire ucb_sel_mbist_abort;
wire ucb_sel_mbist_result;
wire ucb_sel_mbist_get_done;
wire ucb_sel_mbist_get_fail;
wire ucb_sel_mbist_start_wmr;
wire ucb_sel_lbist_bypass;
wire ucb_sel_lbist_start;
wire ucb_sel_lbist_get_done;
wire ucb_sel_cycle_count;
wire ucb_sel_clkstp_delay;
wire ucb_sel_peu_entestcfg;
wire ucb_wr_mbist_bypass;
wire ucb_wr_mbist_start_wmr;
wire ucb_wr_lbist_bypass;
wire ucb_wr_peu_entestcfg;
wire jtag_sel_mbist_mode;
wire jtag_sel_mbist_bypass;
wire jtag_sel_mbist_start;
wire jtag_sel_mbist_abort;
wire jtag_sel_mbist_start_wmr;
wire jtag_sel_lbist_mode;
wire jtag_sel_lbist_bypass;
wire jtag_sel_lbist_start;
wire jtag_sel_lbist_abort;
wire jtag_wr_mbist_bypass;
wire jtag_wr_mbist_start;
wire jtag_wr_mbist_abort;
wire jtag_wr_mbist_start_wmr;
wire jtag_wr_lbist_bypass;
wire jtag_wr_lbist_start;
wire jtag_wr_lbist_abort;
wire [3:0] csr_mbist_mode_din;
wire [3:0] csr_mbist_mode;
wire csr_mbist_mode_reg_scanin;
wire csr_mbist_mode_reg_scanout;
wire tcu_mbist_loop_mode;
wire [47:0] csr_mbist_bypass_din;
wire [47:0] csr_mbist_bypass;
wire csr_mbist_bypass_reg_scanin;
wire csr_mbist_bypass_reg_scanout;
wire csr_mbist_start_reg_scanin;
wire csr_mbist_start_reg_scanout;
wire csr_mbist_abort_din;
wire csr_mbist_abort_reg_scanin;
wire csr_mbist_abort_reg_scanout;
wire csr_mbist_abort_d_reg_scanin;
wire csr_mbist_abort_d_reg_scanout;
wire csr_mbist_start_wmr_din;
wire clr_mbist_start_wmr;
wire csr_mbist_start_wmr;
wire csr_mbist_start_wmr_reg_scanin;
wire csr_mbist_start_wmr_reg_scanout;
wire [47:0] mbist_done_din;
wire mbist_start_io_sync;
wire [47:0] mb_tcu_done_d;
wire mbist_done_reg_scanin;
wire mbist_done_reg_scanout;
wire [47:0] mbist_fail_din;
wire [47:0] mb_tcu_fail_d;
wire mbist_fail_reg_scanin;
wire mbist_fail_reg_scanout;
wire [1:0] mbist_done_fail_din;
wire [47:0] mbist_skip_or_done;
wire mbist_done_fail_reg_scanin;
wire mbist_done_fail_reg_scanout;
wire mbist_all_done_real_time;
wire mbist_one_fail_real_time;
wire [1:0] csr_lbist_mode_din;
wire [1:0] csr_lbist_mode;
wire csr_lbist_mode_reg_scanin;
wire csr_lbist_mode_reg_scanout;
wire [7:0] csr_lbist_bypass_din;
wire [7:0] csr_lbist_bypass;
wire csr_lbist_bypass_reg_scanin;
wire csr_lbist_bypass_reg_scanout;
wire csr_lbist_start_din;
wire csr_lbist_start_reg_scanin;
wire csr_lbist_start_reg_scanout;
wire csr_lbist_start_d_reg_scanin;
wire csr_lbist_start_d_reg_scanout;
wire [7:0] csr_lbist_done_din;
wire [7:0] csr_lbist_done;
wire csr_lbist_done_reg_scanin;
wire csr_lbist_done_reg_scanout;
wire csr_peu_entestcfg_din;
wire csr_peu_entestcfg_reg_scanin;
wire csr_peu_entestcfg_reg_scanout;
wire [63:0] csr_ucb_data_din;
wire csr_ucb_data_reg_scanin;
wire csr_ucb_data_reg_scanout;
wire start_bisx_por_d_reg_scanin;
wire start_bisx_por_d_reg_scanout;
wire tcu_mbist_state_reg_scanin;
wire tcu_mbist_state_reg_scanout;
wire mbist_start_io_sync_reg_scanin;
wire mbist_start_io_sync_reg_scanout;
wire hold_start_reg_scanin;
wire hold_start_reg_scanout;
wire clr_mbist_start_wmr_reg_scanin;
wire clr_mbist_start_wmr_reg_scanout;
wire tcu_mbist_user_mode_reg_scanin;
wire tcu_mbist_user_mode_reg_scanout;
wire [17:0] mb_tcu_done_stg_din;
wire mb_tcu_done_stg_reg_scanin;
wire mb_tcu_done_stg_reg_scanout;
wire [17:0] mb_tcu_done_stg;
wire [31:0] mb_tcu_done_d_cmp_din;
wire mb_tcu_done_d_cmp_reg_scanin;
wire mb_tcu_done_d_cmp_reg_scanout;
wire [31:0] mb_tcu_done_d_cmp;
wire [15:0] mb_tcu_done_d_io_din;
wire mb_tcu_done_d_io_reg_scanin;
wire mb_tcu_done_d_io_reg_scanout;
wire [15:0] mb_tcu_done_d_io;
wire [17:0] mb_tcu_fail_stg_din;
wire mb_tcu_fail_stg_reg_scanin;
wire mb_tcu_fail_stg_reg_scanout;
wire [17:0] mb_tcu_fail_stg;
wire [31:0] mb_tcu_fail_d_cmp_din;
wire mb_tcu_fail_d_cmp_reg_scanin;
wire mb_tcu_fail_d_cmp_reg_scanout;
wire [31:0] mb_tcu_fail_d_cmp;
wire [15:0] mb_tcu_fail_d_io_din;
wire mb_tcu_fail_d_io_reg_scanin;
wire mb_tcu_fail_d_io_reg_scanout;
wire [15:0] mb_tcu_fail_d_io;
wire [7:0] tcu_core_avail;
wire [7:0] core_avail_din;
wire core_avail_reg_scanin;
wire core_avail_reg_scanout;
wire [7:0] bank_avail_din;
wire bank_avail_reg_scanin;
wire bank_avail_reg_scanout;
wire [7:0] ncu_core_enable_status;
wire [7:0] core_enable_status_din;
wire [7:0] core_enable_status;
wire core_enable_status_reg_scanin;
wire core_enable_status_reg_scanout;
wire [4:0] ncu_bank_enable_status;
wire [4:0] bank_enable_status_din;
wire [4:0] bank_enable_status;
wire bank_enable_status_reg_scanin;
wire bank_enable_status_reg_scanout;
wire [7:0] bank_enable_status_8;
wire [47:0] not_core_avail_48;
wire [47:0] not_core_enable_48;
wire [47:0] not_bank_avail_48;
wire [47:0] not_bank_enable_48;
wire prev_skip_done_reg_scanin;
wire prev_skip_done_reg_scanout;
wire [47:0] tcu_mb_start_din;
wire [31:0] tcu_mb_start_d_cmp_din;
wire tcu_mb_start_d_cmp_reg_scanin;
wire tcu_mb_start_d_cmp_reg_scanout;
wire [31:0] tcu_mb_start_d_cmp;
wire [17:0] tcu_mb_start_d2_cmp_din;
wire tcu_mb_start_d2_cmp_reg_scanin;
wire tcu_mb_start_d2_cmp_reg_scanout;
wire [17:0] tcu_mb_start_d2_cmp;
wire [15:0] tcu_mb_start_d_io_din;
wire tcu_mb_start_d_io_reg_scanin;
wire tcu_mb_start_d_io_reg_scanout;
wire [15:0] tcu_mb_start_d_io;
wire tcu_bisx_done_reg_scanin;
wire tcu_bisx_done_reg_scanout;
wire bisx_counter_en_reg_scanin;
wire bisx_counter_en_reg_scanout;
wire [31:0] bisx_counter_din;
wire [31:0] bisx_counter;
wire bisx_counter_reg_scanin;
wire bisx_counter_reg_scanout;
wire tcu_lb_tcu_done_reg_scanin;
wire tcu_lb_tcu_done_reg_scanout;
wire [7:0] lb_prev_clear;
wire [7:0] lbist_skip_or_done;
wire lbist_all_done_reg_scanin;
wire lbist_all_done_reg_scanout;
wire tcu_lbist_start_reg_scanin;
wire tcu_lbist_start_reg_scanout;
wire tcu_mb_clkstop_reg_scanin;
wire tcu_mb_clkstop_reg_scanout;
wire tcu_dmo_ctl_scanout;
wire spare_flops_scanout;
wire [11:0] spare_flops_d;
wire [11:0] spare_flops_q;
wire [11:1] spare_flops_unused;
// Interface with sigmux_ctl
input tcu_rst_flush_init_ack;
output mbist_clk_stop_req;
output [47:0] mbist_done;
output [47:0] mbist_fail;
output [1:0] mbist_done_fail;
output [7:0] lb_tcu_done_d;
input [47:0] mb_tcu_done;
input [47:0] mb_tcu_fail;
output [47:0] tcu_mb_start;
output tcu_mbist_bisi_en;
output tcu_mbist_user_mode;
output [7:0] tcu_spc_lbist_start;
// DMO Memory BIST Direct-Output Observe: For SPCs
output [5:0] dmo_coresel; // to SPC {4,5,1,6,7,3}
output dmo_dcmuxctl; // to all SPCs
output dmo_icmuxctl; // to all SPCs
input [35:0] spc4_dmo_dout; // Mux'ed data from spc4
input [35:0] spc6_dmo_dout; // Mux'ed data from spc6
// DMO MBIST Direct Observe: For L2 Tags
input [38:0] l2t4_dmo_dout; // Mux'ed data from l2t4
input [38:0] l2t6_dmo_dout; // Mux'ed data from l2t6
output [5:0] dmo_l2tsel; // to l2t {1,5,4 & 3,7,6}
output dmo_tagmuxctl; // to all l2ts
// DMO MBIST Direct Observe: For NIU (RTX, RDP, TDS)
input [39:0] rtx_tcu_dmo_data_out;
input [39:0] tds_tcu_dmo_dout;
input [39:0] rdp_tcu_dmo_dout;
output [2:0] tcu_rtx_dmo_ctl; // Mux Control
// DMO Output to MIO (Chip Pins)
output [39:0] tcu_mio_dmo_data; // final data to pins
output tcu_mio_mbist_done;
output tcu_mio_mbist_fail;
output tcu_mio_jtag_membist_mode;
input jtag_dmo_enable; // enables DMO port
input jtag_dmo_control_upd;
input [47:0] jtag_dmo_control;
input ncu_spc0_core_available;
input ncu_spc1_core_available;
input ncu_spc2_core_available;
input ncu_spc3_core_available;
input ncu_spc4_core_available;
input ncu_spc5_core_available;
input ncu_spc6_core_available;
input ncu_spc7_core_available;
input ncu_spc0_core_enable_status;
input ncu_spc1_core_enable_status;
input ncu_spc2_core_enable_status;
input ncu_spc3_core_enable_status;
input ncu_spc4_core_enable_status;
input ncu_spc5_core_enable_status;
input ncu_spc6_core_enable_status;
input ncu_spc7_core_enable_status;
input [7:0] ncu_tcu_bank_avail;
output tcu_test_protect_cmp;
input [5:0] jtag_csr_addr;
input [47:0] jtag_csr_data;
input [5:0] ucb_csr_addr;
input [63:0] ucb_data_out;
output [63:0] csr_ucb_data;
input [6:0] csdel_data; // From sigmux_ctl
input [63:0] cycle_count; // From dbg_ctl
input [3:0] tcu_dcr; // From dbg_ctl
input [31:0] de_count; // From dbg_ctl
input [23:0] debug_reg_hard_stop_domain_1st; // From regs_ctl
output tcu_peu_entestcfg;
// For ECO C to use spare flops to flop these signals for timing
input debug_cycle_counter_stop_to_mbc; // ECO C
input mbist_clk_stop_to_mbc; // ECO C
output debug_cycle_counter_stop; // ECO C
output mbist_clk_stop; // ECO C
// For ECO D to use spare flops to flop these signals for timing
input cycle_stretch_to_mbc; // ECO D
output cycle_stretch; // ECO D
reg clr_mbist_start_wmr_din;
wire [47:1] prev_skip_done;
wire [47:1] prev_skip_done_din;
assign l1en = tcu_int_ce;
assign pce_ov = tcu_pce_ov;
assign siclk = tcu_int_aclk;
assign soclk = tcu_int_bclk;
tcu_mbist_ctl_l1clkhdr_ctl_macro ucb_clkgen (
//================================================================================
//================================================================================
cl_sc1_clksyncff_4x jtag_csr_wr_sync_reg (
.si ( jtag_csr_wr_sync_reg_scanin ),
.so ( jtag_csr_wr_sync_reg_scanout ),
//================================================================================
//================================================================================
cl_sc1_clksyncff_4x mb_tcu_done_36_sync_reg (
.si ( mb_tcu_done_36_sync_reg_scanin ),
.so ( mb_tcu_done_36_sync_reg_scanout ),
.q ( mb_tcu_done_36_sync ),
cl_sc1_clksyncff_4x mb_tcu_fail_36_sync_reg (
.si ( mb_tcu_fail_36_sync_reg_scanin ),
.so ( mb_tcu_fail_36_sync_reg_scanout ),
.q ( mb_tcu_fail_36_sync ),
//================================================================================
// Flop the Sync Enable Output from clkgen_tcu_cmp
//================================================================================
tcu_mbist_ctl_msff_ctl_macro__width_3 tcu_mbist_sync_en_reg (
.scan_in ( tcu_mbist_sync_en_reg_scanin ),
.scan_out ( tcu_mbist_sync_en_reg_scanout ),
.din ( {io_cmp_sync_en, cmp_io_sync_en, cmp_io2x_sync_en} ),
.dout ( {io_cmp_sync_en_local, cmp_io_sync_en_local, cmp_io2x_sync_en_local} ),
//================================================================================
// Synchronize tcu_test_protect
//================================================================================
tcu_mbist_ctl_msff_ctl_macro__en_1__width_1 tcu_test_protect_cmp_reg (
.scan_in ( tcu_test_protect_cmp_reg_scanin ),
.scan_out ( tcu_test_protect_cmp_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( tcu_test_protect ),
.dout ( tcu_test_protect_sync ),
assign tcu_test_protect_cmp = ac_test_mode | tcu_test_protect_sync;
//==================================================
//==================================================
//================================================================================
// Synchronize ucb_csr_wr
//================================================================================
tcu_mbist_ctl_msff_ctl_macro__en_1__width_1 ucb_csr_wr_sync_reg (
.scan_in ( ucb_csr_wr_sync_reg_scanin ),
.scan_out ( ucb_csr_wr_sync_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.dout ( ucb_csr_wr_sync ),
tcu_mbist_ctl_msff_ctl_macro__en_1__width_6 ucb_csr_addr_sync_reg (
.scan_in ( ucb_csr_addr_sync_reg_scanin ),
.scan_out ( ucb_csr_addr_sync_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( ucb_csr_addr[5:0] ),
.dout ( ucb_csr_addr_sync[5:0] ),
assign ucb_sel_mbist_mode = (ucb_csr_addr_sync == 6'h0);
assign ucb_sel_mbist_bypass = (ucb_csr_addr_sync == 6'h1);
assign ucb_sel_mbist_start = (ucb_csr_addr_sync == 6'h2);
assign ucb_sel_mbist_abort = (ucb_csr_addr_sync == 6'h3);
assign ucb_sel_mbist_result = (ucb_csr_addr_sync == 6'h4);
assign ucb_sel_mbist_get_done = (ucb_csr_addr_sync == 6'h5);
assign ucb_sel_mbist_get_fail = (ucb_csr_addr_sync == 6'h6);
assign ucb_sel_mbist_start_wmr = (ucb_csr_addr_sync == 6'h7);
assign ucb_sel_lbist_mode = (ucb_csr_addr_sync == 6'h8);
assign ucb_sel_lbist_bypass = (ucb_csr_addr_sync == 6'h9);
assign ucb_sel_lbist_start = (ucb_csr_addr_sync == 6'hA);
assign ucb_sel_lbist_get_done = (ucb_csr_addr_sync == 6'hC);
assign ucb_sel_cycle_count = (ucb_csr_addr_sync == 6'h20);
assign ucb_sel_dcr = (ucb_csr_addr_sync == 6'h21);
assign ucb_sel_dec = (ucb_csr_addr_sync == 6'h23);
assign ucb_sel_clkstp_delay = (ucb_csr_addr_sync == 6'h24);
assign ucb_sel_clk_domain = (ucb_csr_addr_sync == 6'h25);
assign ucb_sel_peu_entestcfg = (ucb_csr_addr_sync == 6'h30);
assign ucb_wr_mbist_mode = ucb_csr_wr_sync && ucb_sel_mbist_mode;
assign ucb_wr_mbist_bypass = ucb_csr_wr_sync && ucb_sel_mbist_bypass;
assign ucb_wr_mbist_start = ucb_csr_wr_sync && ucb_sel_mbist_start && ucb_data_out[0];
assign ucb_wr_mbist_abort = ucb_csr_wr_sync && ucb_sel_mbist_abort && ucb_data_out[0];
assign ucb_wr_mbist_start_wmr = ucb_csr_wr_sync && ucb_sel_mbist_start_wmr && ucb_data_out[0];
assign ucb_wr_lbist_mode = ucb_csr_wr_sync && ucb_sel_lbist_mode;
assign ucb_wr_lbist_bypass = ucb_csr_wr_sync && ucb_sel_lbist_bypass;
assign ucb_wr_lbist_start = ucb_csr_wr_sync && ucb_sel_lbist_start;
assign ucb_wr_peu_entestcfg = ucb_csr_wr_sync && ucb_sel_peu_entestcfg;
assign jtag_sel_mbist_mode = (jtag_csr_addr == 6'h0);
assign jtag_sel_mbist_bypass = (jtag_csr_addr == 6'h1);
assign jtag_sel_mbist_start = (jtag_csr_addr == 6'h2);
assign jtag_sel_mbist_abort = (jtag_csr_addr == 6'h3);
assign jtag_sel_mbist_start_wmr = (jtag_csr_addr == 6'h7);
assign jtag_sel_lbist_mode = (jtag_csr_addr == 6'h8);
assign jtag_sel_lbist_bypass = (jtag_csr_addr == 6'h9);
assign jtag_sel_lbist_start = (jtag_csr_addr == 6'hA);
assign jtag_sel_lbist_abort = (jtag_csr_addr == 6'hB);
assign jtag_wr_mbist_mode = jtag_csr_wr_sync && jtag_sel_mbist_mode;
assign jtag_wr_mbist_bypass = jtag_csr_wr_sync && jtag_sel_mbist_bypass;
assign jtag_wr_mbist_start = jtag_csr_wr_sync && jtag_sel_mbist_start;
assign jtag_wr_mbist_abort = jtag_csr_wr_sync && jtag_sel_mbist_abort;
assign jtag_wr_mbist_start_wmr = jtag_csr_wr_sync && jtag_sel_mbist_start_wmr;
assign jtag_wr_lbist_mode = jtag_csr_wr_sync && jtag_sel_lbist_mode;
assign jtag_wr_lbist_bypass = jtag_csr_wr_sync && jtag_sel_lbist_bypass;
assign jtag_wr_lbist_start = jtag_csr_wr_sync && jtag_sel_lbist_start;
assign jtag_wr_lbist_abort = jtag_csr_wr_sync && jtag_sel_lbist_abort;
//==================================================
//==================================================
assign {csr_mbist_mode_din[3:2], csr_mbist_mode_din[0]} =
jtag_wr_mbist_mode ? {jtag_csr_data[3:2], jtag_csr_data[0]} :
ucb_wr_mbist_mode ? {ucb_data_out[3:2], ucb_data_out[0]} :
{csr_mbist_mode[3:2], csr_mbist_mode[0]};
assign csr_mbist_mode_din[1] = jtag_wr_mbist_mode ? jtag_csr_data[1] :
ucb_wr_mbist_mode ? ucb_data_out[1] :
tcu_mbist_ctl_msff_ctl_macro__width_4 csr_mbist_mode_reg (
.scan_in ( csr_mbist_mode_reg_scanin ),
.scan_out ( csr_mbist_mode_reg_scanout ),
.din ( csr_mbist_mode_din[3:0] ),
.dout ( csr_mbist_mode[3:0] ),
assign tcu_mbist_loop_mode = csr_mbist_mode[3];
assign tcu_mbist_bisi_en = csr_mbist_mode[1];
assign parallel = csr_mbist_mode[0] || hold_start;
//==================================================
//==================================================
assign csr_mbist_bypass_din[47:0] = jtag_wr_mbist_bypass ? jtag_csr_data[47:0] :
ucb_wr_mbist_bypass ? ucb_data_out[47:0] :
tcu_mbist_ctl_msff_ctl_macro__width_48 csr_mbist_bypass_reg (
.scan_in ( csr_mbist_bypass_reg_scanin ),
.scan_out ( csr_mbist_bypass_reg_scanout ),
.din ( csr_mbist_bypass_din[47:0] ),
.dout ( csr_mbist_bypass[47:0] ),
//==================================================
//==================================================
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_mbist_start_reg (
.scan_in ( csr_mbist_start_reg_scanin ),
.scan_out ( csr_mbist_start_reg_scanout ),
.din ( csr_mbist_start_din ),
.dout ( csr_mbist_start ),
//==================================================
//==================================================
assign csr_mbist_abort_din = jtag_wr_mbist_abort ? 1'b1 :
ucb_wr_mbist_abort ? ucb_data_out[0] : 1'b0;
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_mbist_abort_reg (
.scan_in ( csr_mbist_abort_reg_scanin ),
.scan_out ( csr_mbist_abort_reg_scanout ),
.din ( csr_mbist_abort_din ),
.dout ( csr_mbist_abort ),
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_mbist_abort_d_reg (
.scan_in ( csr_mbist_abort_d_reg_scanin ),
.scan_out ( csr_mbist_abort_d_reg_scanout ),
.din ( csr_mbist_abort ),
.dout ( csr_mbist_abort_d ),
assign csr_mbist_abort_up = csr_mbist_abort && !csr_mbist_abort_d;
//==================================================
//==================================================
assign csr_mbist_start_wmr_din = jtag_wr_mbist_start_wmr ? jtag_csr_data[0] :
ucb_wr_mbist_start_wmr ? ucb_data_out[0] :
clr_mbist_start_wmr ? 1'b0 :
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_mbist_start_wmr_reg (
.scan_in ( csr_mbist_start_wmr_reg_scanin ),
.scan_out ( csr_mbist_start_wmr_reg_scanout ),
.din ( csr_mbist_start_wmr_din ),
.dout ( csr_mbist_start_wmr ),
//==================================================
//==================================================
assign mbist_done_din[47:0] =
mbist_start_io_sync ? ((~mbist_skip & mb_tcu_done_d) | mbist_done):
tcu_mbist_ctl_msff_ctl_macro__width_48 mbist_done_reg (
.scan_in ( mbist_done_reg_scanin ),
.scan_out ( mbist_done_reg_scanout ),
.din ( mbist_done_din[47:0] ),
.dout ( mbist_done[47:0] ),
//================================================================================
// Reset to 0 before starting a new MBIST operation
// When DONE comes back capture FAIL signals
//================================================================================
mbist_start_io_sync ? ((~mbist_skip & mb_tcu_fail_d) | mbist_fail) :
tcu_mbist_ctl_msff_ctl_macro__width_48 mbist_fail_reg (
.scan_in ( mbist_fail_reg_scanin ),
.scan_out ( mbist_fail_reg_scanout ),
.din ( mbist_fail_din[47:0] ),
.dout ( mbist_fail[47:0] ),
//==================================================
//==================================================
assign mbist_done_fail_din[1:0] = clr_done_fail ? 2'b0 :
{(&mbist_skip_or_done && !(&mbist_skip)), |mbist_fail};
tcu_mbist_ctl_msff_ctl_macro__width_2 mbist_done_fail_reg (
.scan_in ( mbist_done_fail_reg_scanin ),
.scan_out ( mbist_done_fail_reg_scanout ),
.din ( mbist_done_fail_din[1:0] ),
.dout ( mbist_done_fail[1:0] ),
assign mbist_all_done = mbist_done_fail[1];
assign mbist_all_done_real_time = mbist_done_fail_din[1];
assign mbist_one_fail_real_time = mbist_done_fail_din[0];
//==================================================
//==================================================
assign csr_lbist_mode_din[1:0] = jtag_wr_lbist_abort ? 2'b0 :
jtag_wr_lbist_mode ? jtag_csr_data[1:0] :
ucb_wr_lbist_mode ? ucb_data_out[1:0] :
tcu_mbist_ctl_msff_ctl_macro__width_2 csr_lbist_mode_reg (
.scan_in ( csr_lbist_mode_reg_scanin ),
.scan_out ( csr_lbist_mode_reg_scanout ),
.din ( csr_lbist_mode_din[1:0] ),
.dout ( csr_lbist_mode[1:0] ),
//==================================================
//==================================================
assign csr_lbist_bypass_din[7:0] = jtag_wr_lbist_abort ? 8'h0 :
jtag_wr_lbist_bypass ? jtag_csr_data[7:0] :
ucb_wr_lbist_bypass ? ucb_data_out[7:0] :
tcu_mbist_ctl_msff_ctl_macro__width_8 csr_lbist_bypass_reg (
.scan_in ( csr_lbist_bypass_reg_scanin ),
.scan_out ( csr_lbist_bypass_reg_scanout ),
.din ( csr_lbist_bypass_din[7:0] ),
.dout ( csr_lbist_bypass[7:0] ),
//==================================================
//==================================================
assign csr_lbist_start_din = jtag_wr_lbist_abort ? 1'b0 :
jtag_wr_lbist_start ? 1'b1 :
ucb_wr_lbist_start ? ucb_data_out[0] :
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_lbist_start_reg (
.scan_in ( csr_lbist_start_reg_scanin ),
.scan_out ( csr_lbist_start_reg_scanout ),
.din ( csr_lbist_start_din ),
.dout ( csr_lbist_start ),
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_lbist_start_d_reg (
.scan_in ( csr_lbist_start_d_reg_scanin ),
.scan_out ( csr_lbist_start_d_reg_scanout ),
.din ( csr_lbist_start ),
.dout ( csr_lbist_start_d ),
assign csr_lbist_start_up = csr_lbist_start && !csr_lbist_start_d;
//==================================================
//==================================================
assign csr_lbist_done_din[7:0] = csr_lbist_start_up ?
(csr_lbist_done | lb_tcu_done_d);
tcu_mbist_ctl_msff_ctl_macro__width_8 csr_lbist_done_reg (
.scan_in ( csr_lbist_done_reg_scanin ),
.scan_out ( csr_lbist_done_reg_scanout ),
.din ( csr_lbist_done_din[7:0] ),
.dout ( csr_lbist_done[7:0] ),
//==================================================
// PEU Test Config Enable
// CSR Only. No JTAG Access
//==================================================
assign csr_peu_entestcfg_din = ucb_wr_peu_entestcfg ?
tcu_mbist_ctl_msff_ctl_macro__width_1 csr_peu_entestcfg_reg (
.scan_in ( csr_peu_entestcfg_reg_scanin ),
.scan_out ( csr_peu_entestcfg_reg_scanout ),
.din ( csr_peu_entestcfg_din ),
.dout ( csr_peu_entestcfg ),
assign tcu_peu_entestcfg = csr_peu_entestcfg;
//==================================================
// Send CSR Read Back to UCB
//==================================================
assign csr_ucb_data_din =
ucb_sel_mbist_mode ? {60'h0, csr_mbist_mode[3:0]} :
ucb_sel_mbist_bypass ? {16'h0, csr_mbist_bypass[47:0]} :
ucb_sel_mbist_start ? {63'h0, csr_mbist_start} :
ucb_sel_mbist_abort ? {63'h0, csr_mbist_abort} :
ucb_sel_mbist_result ? {62'h0, mbist_done_fail[1:0]} :
ucb_sel_mbist_get_done ? {16'h0, mbist_done} :
ucb_sel_mbist_get_fail ? {16'h0, mbist_fail} :
ucb_sel_mbist_start_wmr ? {63'h0, csr_mbist_start_wmr} :
ucb_sel_lbist_mode ? {62'h0, csr_lbist_mode[1:0]} :
ucb_sel_lbist_bypass ? {56'h0, csr_lbist_bypass[7:0]} :
ucb_sel_lbist_start ? {63'h0, csr_lbist_start} :
ucb_sel_lbist_get_done ? {56'h0, csr_lbist_done[7:0]} :
ucb_sel_cycle_count ? cycle_count :
ucb_sel_dcr ? {60'h0, tcu_dcr} :
ucb_sel_dec ? {32'h0, de_count} :
ucb_sel_clkstp_delay ? {57'h0, csdel_data} :
ucb_sel_peu_entestcfg ? {63'h0, csr_peu_entestcfg} :
ucb_sel_clk_domain ? {40'h0, debug_reg_hard_stop_domain_1st} :
tcu_mbist_ctl_msff_ctl_macro__en_1__width_64 csr_ucb_data_reg (
.scan_in ( csr_ucb_data_reg_scanin ),
.scan_out ( csr_ucb_data_reg_scanout ),
.en ( cmp_io_sync_en_local ),
.din ( csr_ucb_data_din[63:0] ),
.dout ( csr_ucb_data[63:0] ),
tcu_mbist_ctl_msff_ctl_macro__width_1 start_bisx_por_d_reg (
.scan_in ( start_bisx_por_d_reg_scanin ),
.scan_out ( start_bisx_por_d_reg_scanout ),
.dout ( start_bisx_por_d ),
assign start_bisx_por_up = start_bisx_por && !start_bisx_por_d;
//==================================================
// MBIST Control State Machine
//==================================================
always @(state or clr_mbist_start_wmr or csr_mbist_start or hold_start or
tcu_bisx_done or bisx_counter_en or start_bisx_por_up or
start_bisx_wmr or csr_mbist_start_wmr or jtag_wr_mbist_start or
ucb_wr_mbist_start or csr_mbist_abort_up or tcu_rst_flush_init_ack or
mbist_all_done or tcu_mbist_loop_mode or
bisx_time_out or csr_mbist_mode[1])
clr_mbist_start_wmr_din = clr_mbist_start_wmr;
csr_mbist_start_din = csr_mbist_start;
hold_start_din = hold_start;
tcu_bisx_done_din = tcu_bisx_done;
bisx_counter_en_din = bisx_counter_en;
next_state = `MBIST_IDLE;
clr_mbist_start_wmr_din = 1'b0;
next_state = `POR_CLR_DF;
next_state = `WMR_CLR_DF;
else if (jtag_wr_mbist_start || ucb_wr_mbist_start)
next_state = `BISX_CLR_DF;
next_state = `MBIST_IDLE;
bisx_counter_en_din = 1'b0;
if (csr_mbist_abort_up) begin
next_state = `MBIST_IDLE;
bisx_counter_en_din = 1'b1;
csr_mbist_start_din = 1'b1;
next_state = `POR_CLR_START;
else if (mbist_all_done || bisx_time_out)
next_state = `POR_CLR_START;
`POR_CLR_START: begin // 3
next_state = `POR_END_WAIT;
bisx_counter_en_din = 1'b0;
tcu_bisx_done_din = 1'b1;
`POR_END_WAIT: begin // 4
if (csr_mbist_abort_up || tcu_rst_flush_init_ack) begin
next_state = `MBIST_IDLE;
tcu_bisx_done_din = 1'b0;
csr_mbist_start_din = 1'b0;
next_state = `POR_END_WAIT;
`WMR_DUMMY: begin // 6 - For asserting tcu_bisx_done when no WMR BISX is programmed
if (csr_mbist_abort_up || tcu_rst_flush_init_ack) begin
tcu_bisx_done_din = 1'b0;
next_state = `MBIST_IDLE;
tcu_bisx_done_din = 1'b1;
bisx_counter_en_din = 1'b0;
if (csr_mbist_abort_up) begin
next_state = `MBIST_IDLE;
bisx_counter_en_din = 1'b1;
if (csr_mbist_abort_up) begin
next_state = `MBIST_IDLE;
csr_mbist_start_din = 1'b0;
else if (mbist_all_done || bisx_time_out) begin
next_state = `WMR_CLR_START;
csr_mbist_start_din = 1'b1;
csr_mbist_start_din = 1'b1;
`WMR_CLR_START: begin // 9
next_state = `WMR_END_WAIT;
clr_mbist_start_wmr_din = 1'b1;
bisx_counter_en_din = 1'b0;
tcu_bisx_done_din = 1'b1;
`WMR_END_WAIT: begin // 10
if (csr_mbist_abort_up || tcu_rst_flush_init_ack) begin
next_state = `MBIST_IDLE;
tcu_bisx_done_din = 1'b0;
csr_mbist_start_din = 1'b0;
next_state = `WMR_END_WAIT;
`BISX_CLR_DF: begin // 11
bisx_counter_en_din = 1'b0;
if (csr_mbist_abort_up) begin
next_state = `MBIST_IDLE;
next_state = `BISX_START;
if (csr_mbist_mode[1]) begin
bisx_counter_en_din = 1'b1;
bisx_counter_en_din = 1'b0;
if (csr_mbist_abort_up) begin
next_state = `MBIST_IDLE;
csr_mbist_start_din = 1'b0;
else if (mbist_all_done && !tcu_mbist_loop_mode) begin
next_state = `BISX_CLR_START;
csr_mbist_start_din = 1'b1;
next_state = `BISX_START;
csr_mbist_start_din = 1'b1;
`BISX_CLR_START: begin // 13
next_state = `MBIST_IDLE;
csr_mbist_start_din = 1'b0;
bisx_counter_en_din = 1'b0;
clr_mbist_start_wmr_din = clr_mbist_start_wmr;
csr_mbist_start_din = csr_mbist_start;
hold_start_din = hold_start;
tcu_bisx_done_din = tcu_bisx_done;
bisx_counter_en_din = bisx_counter_en;
next_state = `MBIST_IDLE;
tcu_mbist_ctl_msff_ctl_macro__width_4 tcu_mbist_state_reg (
.scan_in ( tcu_mbist_state_reg_scanin ),
.scan_out ( tcu_mbist_state_reg_scanout ),
.din ( next_state[3:0] ),
tcu_mbist_ctl_msff_ctl_macro__en_1__width_1 mbist_start_io_sync_reg (
.scan_in ( mbist_start_io_sync_reg_scanin ),
.scan_out ( mbist_start_io_sync_reg_scanout ),
.en ( cmp_io_sync_en_local ),
.din ( csr_mbist_start ),
.dout ( mbist_start_io_sync ),
tcu_mbist_ctl_msff_ctl_macro__width_1 hold_start_reg (
.scan_in ( hold_start_reg_scanin ),
.scan_out ( hold_start_reg_scanout ),
tcu_mbist_ctl_msff_ctl_macro__width_1 clr_mbist_start_wmr_reg (
.scan_in ( clr_mbist_start_wmr_reg_scanin ),
.scan_out ( clr_mbist_start_wmr_reg_scanout ),
.din ( clr_mbist_start_wmr_din ),
.dout ( clr_mbist_start_wmr ),
tcu_mbist_ctl_msff_ctl_macro__en_1__width_1 tcu_mbist_user_mode_reg (
.scan_in ( tcu_mbist_user_mode_reg_scanin ),
.scan_out ( tcu_mbist_user_mode_reg_scanout ),
.en ( cmp_io_sync_en_local ),
.din ( csr_mbist_mode[2] ),
.dout ( tcu_mbist_user_mode ),
//================================================================================
// Latch mb_tcu_done to filter DONE signals that are less than 2-cycle wide
// During loop mode, MBIST engines generate DONE pulse (1-cycle) per compare
// TCU should not turn off START signals when it sees such DONE pulses
// Since TCU doesn't know if the engines are running in loop or non-loop mode
// We need to exame the width of the DONE signals to determine if we should turn
// off START signals when DONE signals are back
// For engines running in CMP latch their DONE signals once so that we can filter
// out those DONE pulses during loop mode
// For engines running in IO clock or PEU we need at least 6 CMP to be safe
//================================================================================
//================================================================================
// First latch the DONE signal because they are coming from other clusters
// For L2T1, L2T3-7, L2B4-7, SPC1, SPC3-7, MCU2, and MCU3
// We need to latch twice because there are corresponding staging flops in some
// other blocks for every other MBIST signals
//================================================================================
assign mb_tcu_done_stg_din[17:0] = {mb_tcu_done[33:29], // L2T7-3
mb_tcu_done[25:22], // L2B7-4
mb_tcu_done[17:16], // MCU3-2
mb_tcu_done[7:3], // SPC7-3
tcu_mbist_ctl_msff_ctl_macro__width_18 mb_tcu_done_stg_reg (
.scan_in ( mb_tcu_done_stg_reg_scanin ),
.scan_out ( mb_tcu_done_stg_reg_scanout ),
.din ( mb_tcu_done_stg_din[17:0] ),
.dout ( mb_tcu_done_stg[17:0] ),
assign mb_tcu_done_d_cmp_din[31:0] = {mb_tcu_done_stg[17:13], // L2T7-3
mb_tcu_done_stg[12], // L2T1
mb_tcu_done_stg[11:8], // L2B7-4
mb_tcu_done[21:18], // L2B3-0
mb_tcu_done_stg[7:6], // MCU3-2
mb_tcu_done[15:14], // MCU1-0
mb_tcu_done_stg[5:1], // SPC7-3
mb_tcu_done_stg[0], // SPC1
tcu_mbist_ctl_msff_ctl_macro__width_32 mb_tcu_done_d_cmp_reg (
.scan_in ( mb_tcu_done_d_cmp_reg_scanin ),
.scan_out ( mb_tcu_done_d_cmp_reg_scanout ),
.din ( mb_tcu_done_d_cmp_din[31:0] ),
.dout ( mb_tcu_done_d_cmp[31:0] ),
assign mb_tcu_done_d_io_din[15:0] = {mb_tcu_done[47:37], // 15:5 (NIU)
mb_tcu_done_36_sync, // 4 (PEU)
mb_tcu_done[35:34], // 3:2 (DMU)
mb_tcu_done[13], // 1 (NCU 1)
mb_tcu_done[11]}; // 0 (SIO 1)
tcu_mbist_ctl_msff_ctl_macro__en_1__width_16 mb_tcu_done_d_io_reg (
.scan_in ( mb_tcu_done_d_io_reg_scanin ),
.scan_out ( mb_tcu_done_d_io_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( mb_tcu_done_d_io_din[15:0] ),
.dout ( mb_tcu_done_d_io[15:0] ),
assign mb_tcu_done_d[47:0] = {mb_tcu_done_d_io[15:2], // (NIU, PEU, DMU)
mb_tcu_done_d_cmp[31:12], // (L2T, L2B, MCU3-0)
mb_tcu_done_d_io[1], // (NCU 1)
mb_tcu_done_d_cmp[11], // (NCU 0)
mb_tcu_done_d_io[0], // (SIO 1)
mb_tcu_done_d_cmp[10:0]}; // (SIO 0, SII, SPC)
//================================================================================
// Staging Flops for FAIL signals
//================================================================================
assign mb_tcu_fail_stg_din[17:0] = {mb_tcu_fail[33:29], // [17:13] L2T7-3
mb_tcu_fail[27], // [12] L2T1
mb_tcu_fail[25:22], // [11:8] L2B7-4
mb_tcu_fail[17:16], // [7:6] MCU3-2
mb_tcu_fail[7:3], // [5:1] SPC7-3
mb_tcu_fail[1]}; // [0] SPC1
tcu_mbist_ctl_msff_ctl_macro__width_18 mb_tcu_fail_stg_reg (
.scan_in ( mb_tcu_fail_stg_reg_scanin ),
.scan_out ( mb_tcu_fail_stg_reg_scanout ),
.din ( mb_tcu_fail_stg_din[17:0] ),
.dout ( mb_tcu_fail_stg[17:0] ),
assign mb_tcu_fail_d_cmp_din[31:0] = {mb_tcu_fail_stg[17:13], // L2T7-3
mb_tcu_fail_stg[12], // L2T1
mb_tcu_fail_stg[11:8], // L2B7-4
mb_tcu_fail[21:18], // L2B3-0
mb_tcu_fail_stg[7:6], // MCU3-2
mb_tcu_fail[15:14], // MCU1-0
mb_tcu_fail_stg[5:1], // SPC7-3
mb_tcu_fail_stg[0], // SPC1
tcu_mbist_ctl_msff_ctl_macro__width_32 mb_tcu_fail_d_cmp_reg (
.scan_in ( mb_tcu_fail_d_cmp_reg_scanin ),
.scan_out ( mb_tcu_fail_d_cmp_reg_scanout ),
.din ( mb_tcu_fail_d_cmp_din[31:0] ),
.dout ( mb_tcu_fail_d_cmp[31:0] ),
assign mb_tcu_fail_d_io_din[15:0] = {mb_tcu_fail[47:37], // 15:5 (NIU)
mb_tcu_fail_36_sync, // 4 (PEU)
mb_tcu_fail[35:34], // 3:2 (DMU)
mb_tcu_fail[13], // 1 (NCU 1)
mb_tcu_fail[11]}; // 0 (SIO 1)
tcu_mbist_ctl_msff_ctl_macro__en_1__width_16 mb_tcu_fail_d_io_reg (
.scan_in ( mb_tcu_fail_d_io_reg_scanin ),
.scan_out ( mb_tcu_fail_d_io_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( mb_tcu_fail_d_io_din[15:0] ),
.dout ( mb_tcu_fail_d_io[15:0] ),
assign mb_tcu_fail_d[47:0] = {mb_tcu_fail_d_io[15:2], // (NIU, PEU, DMU)
mb_tcu_fail_d_cmp[31:12], // (L2T, L2B, MCU3-0)
mb_tcu_fail_d_io[1], // (NCU 1)
mb_tcu_fail_d_cmp[11], // (NCU 0)
mb_tcu_fail_d_io[0], // (SIO 1)
mb_tcu_fail_d_cmp[10:0]}; // (SIO 0, SII, SPC)
assign tcu_core_avail[0] = ncu_spc0_core_available;
assign tcu_core_avail[1] = ncu_spc1_core_available;
assign tcu_core_avail[2] = ncu_spc2_core_available;
assign tcu_core_avail[3] = ncu_spc3_core_available;
assign tcu_core_avail[4] = ncu_spc4_core_available;
assign tcu_core_avail[5] = ncu_spc5_core_available;
assign tcu_core_avail[6] = ncu_spc6_core_available;
assign tcu_core_avail[7] = ncu_spc7_core_available;
assign core_avail_din[7:0] = tcu_test_protect_cmp ?
tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 core_avail_reg (
.scan_in ( core_avail_reg_scanin ),
.scan_out ( core_avail_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( core_avail_din[7:0] ),
.dout ( core_avail[7:0] ),
// Incoming bank_available signals from NCU
// One Bank = one each of L2D, L2T and L2B
assign bank_avail_din[7:0] = tcu_test_protect_cmp ?
tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 bank_avail_reg (
.scan_in ( bank_avail_reg_scanin ),
.scan_out ( bank_avail_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( bank_avail_din[7:0] ),
.dout ( bank_avail[7:0] ),
assign ncu_core_enable_status[7:0] =
{ncu_spc7_core_enable_status, ncu_spc6_core_enable_status,
ncu_spc5_core_enable_status, ncu_spc4_core_enable_status,
ncu_spc3_core_enable_status, ncu_spc2_core_enable_status,
ncu_spc1_core_enable_status, ncu_spc0_core_enable_status};
assign core_enable_status_din[7:0] = tcu_test_protect_cmp ?
core_enable_status[7:0] :
ncu_core_enable_status[7:0];
tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 core_enable_status_reg (
.scan_in ( core_enable_status_reg_scanin ),
.scan_out ( core_enable_status_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( core_enable_status_din[7:0] ),
.dout ( core_enable_status[7:0] ),
assign ncu_bank_enable_status[4:0] = {ncu_spc_pm,
ncu_spc_ba67, ncu_spc_ba45,
ncu_spc_ba23, ncu_spc_ba01};
assign bank_enable_status_din[4:0] = tcu_test_protect_cmp ?
bank_enable_status[4:0] :
ncu_bank_enable_status[4:0];
tcu_mbist_ctl_msff_ctl_macro__en_1__width_5 bank_enable_status_reg (
.scan_in ( bank_enable_status_reg_scanin ),
.scan_out ( bank_enable_status_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( bank_enable_status_din[4:0] ),
.dout ( bank_enable_status[4:0] ),
assign bank_enable_status_8[7:0] =
{8{!bank_enable_status[4]}} | {{2{bank_enable_status[3]}},
{2{bank_enable_status[2]}},
{2{bank_enable_status[1]}},
{2{bank_enable_status[0]}}};
assign bank_avail_4[3:0] = {|bank_avail[7:6], |bank_avail[5:4],
|bank_avail[3:2], |bank_avail[1:0]};
assign not_core_avail_48[47:0] = {40'h0, ~core_avail[7:0]};
assign not_core_enable_48[47:0] = {40'h0, ~core_enable_status[7:0]};
assign not_bank_avail_48[47:0] = {14'h0, {2{~bank_avail[7:0]}}, ~bank_avail_4[3:0], 14'h0};
assign not_bank_enable_48[47:0] = {14'h0, // NIU, PEU, DMU
{2{~bank_enable_status_8[7:0]}}, // L2T, L2B
~bank_enable_status_8[6], // MCU3
~bank_enable_status_8[4], // MCU2
~bank_enable_status_8[2], // MCU1
~bank_enable_status_8[0], // MCU0
assign mbist_skip[47:0] = csr_mbist_bypass |
not_core_avail_48 | not_core_enable_48 |
not_bank_avail_48 | not_bank_enable_48;
assign mbist_skip_or_done[47:0] = mbist_skip | mbist_done;
//================================================================================
// Previous is Skipped or Done
// Go through one engine in one cycle
// Move on to the next engine when the previous one is
// 1. Skipped (Bypassed or Core not available)
//================================================================================
assign prev_skip_done_din[47:1] = {prev_skip_done[46:1], mbist_start_io_sync} & mbist_skip_or_done[46:0];
tcu_mbist_ctl_msff_ctl_macro__width_47 prev_skip_done_reg (
.scan_in ( prev_skip_done_reg_scanin ),
.scan_out ( prev_skip_done_reg_scanout ),
.din ( prev_skip_done_din[47:1] ),
.dout ( prev_skip_done[47:1] ),
assign tcu_mb_start_din = ~mbist_skip[47:0] & (~mbist_done | {48{hold_start}} | {48{tcu_mbist_loop_mode}}) &
(parallel ? {48{mbist_start_io_sync}}:
{prev_skip_done_din, mbist_start_io_sync});
assign tcu_mb_start_d_cmp_din[31:0] = {tcu_mb_start_din[33:14], // [31:12] L2T, L2B, MCU
tcu_mb_start_din[12], // [11] NCU 0
tcu_mb_start_din[10], // [10] SIO 0
tcu_mb_start_din[9:0]}; // [9:0] SII, SPC
tcu_mbist_ctl_msff_ctl_macro__width_32 tcu_mb_start_d_cmp_reg (
.scan_in ( tcu_mb_start_d_cmp_reg_scanin ),
.scan_out ( tcu_mb_start_d_cmp_reg_scanout ),
.din ( tcu_mb_start_d_cmp_din[31:0] ),
.dout ( tcu_mb_start_d_cmp[31:0] ),
// Latch again for staging flops
assign tcu_mb_start_d2_cmp_din[17:0] = {tcu_mb_start_d_cmp[31:27], // [17:13] L2T7-3
tcu_mb_start_d_cmp[25], // [12] L2T1
tcu_mb_start_d_cmp[23:20], // [11:8] L2B7-3
tcu_mb_start_d_cmp[15:14], // [7:6] MCU3-2
tcu_mb_start_d_cmp[7:3], // [5:1] SPC7-3
tcu_mb_start_d_cmp[1]}; // [0] SPC1
tcu_mbist_ctl_msff_ctl_macro__width_18 tcu_mb_start_d2_cmp_reg (
.scan_in ( tcu_mb_start_d2_cmp_reg_scanin ),
.scan_out ( tcu_mb_start_d2_cmp_reg_scanout ),
.din ( tcu_mb_start_d2_cmp_din[17:0] ),
.dout ( tcu_mb_start_d2_cmp[17:0] ),
assign tcu_mb_start_d_io_din = {tcu_mb_start_din[47:34], // [15:2] NIU, PEU DMU
tcu_mb_start_din[13], // [1] NCU1
tcu_mb_start_din[11]}; // [0] SIO1
tcu_mbist_ctl_msff_ctl_macro__en_1__width_16 tcu_mb_start_d_io_reg (
.scan_in ( tcu_mb_start_d_io_reg_scanin ),
.scan_out ( tcu_mb_start_d_io_reg_scanout ),
.en ( cmp_io_sync_en_local ),
.din ( tcu_mb_start_d_io_din[15:0] ),
.dout ( tcu_mb_start_d_io[15:0] ),
assign tcu_mb_start = {tcu_mb_start_d_io[15:2], // NIU, PEU, DMU
tcu_mb_start_d2_cmp[17:13], // L2T7-3
tcu_mb_start_d_cmp[26], // L2T2
tcu_mb_start_d2_cmp[12], // L2T1
tcu_mb_start_d_cmp[24], // L2T0
tcu_mb_start_d2_cmp[11:8], // L2B7-4
tcu_mb_start_d_cmp[19:16], // L2B3-0
tcu_mb_start_d2_cmp[7:6], // MCU3-2
tcu_mb_start_d_cmp[13:12], // MCU1-0
tcu_mb_start_d_io[1], // NCU1
tcu_mb_start_d_cmp[11], // NCU0
tcu_mb_start_d_io[0], // SIO1
tcu_mb_start_d_cmp[10:8], // SIO0, SII
tcu_mb_start_d2_cmp[5:1], // SPC7-3
tcu_mb_start_d_cmp[2], // SPC2
tcu_mb_start_d2_cmp[0], // SPC1
tcu_mb_start_d_cmp[0]}; // SPC0
tcu_mbist_ctl_msff_ctl_macro__width_1 tcu_bisx_done_reg (
.scan_in ( tcu_bisx_done_reg_scanin ),
.scan_out ( tcu_bisx_done_reg_scanout ),
.din ( tcu_bisx_done_din ),
tcu_mbist_ctl_msff_ctl_macro__width_1 bisx_counter_en_reg (
.scan_in ( bisx_counter_en_reg_scanin ),
.scan_out ( bisx_counter_en_reg_scanout ),
.din ( bisx_counter_en_din ),
.dout ( bisx_counter_en ),
//================================================================================
//================================================================================
assign bisx_counter_din = bisx_counter_en ? bisx_counter + 32'b1 :
tcu_mbist_ctl_msff_ctl_macro__width_32 bisx_counter_reg (
.scan_in ( bisx_counter_reg_scanin ),
.scan_out ( bisx_counter_reg_scanout ),
.din ( bisx_counter_din[31:0] ),
.dout ( bisx_counter[31:0] ),
assign bisx_time_out = &bisx_counter;
//==============================================================================
//==============================================================================
//==============================================================================
// Flop Incoming Signals from Another Block
//==============================================================================
tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 tcu_lb_tcu_done_reg (
.scan_in ( tcu_lb_tcu_done_reg_scanin ),
.scan_out ( tcu_lb_tcu_done_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.din ( lb_tcu_done[7:0] ),
.dout ( lb_tcu_done_d[7:0] ),
assign lb_prev_clear[7:1] =
lb_prev_clear[6:0] & lbist_skip_or_done[6:0];
assign lb_prev_clear[0] = csr_lbist_start;
assign lbist_skip_or_done[7:0] = lb_tcu_done_d | csr_lbist_bypass | not_core_avail_48[7:0];
assign lbist_all_done_din = &lbist_skip_or_done[7:0];
tcu_mbist_ctl_msff_ctl_macro__width_1 lbist_all_done_reg (
.scan_in ( lbist_all_done_reg_scanin ),
.scan_out ( lbist_all_done_reg_scanout ),
.din ( lbist_all_done_din ),
.dout ( lbist_all_done ),
assign lb_start[7:0] = ~lbist_skip_or_done &
(csr_lbist_mode[0] ? {8{csr_lbist_start}} : lb_prev_clear);
tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 tcu_lbist_start_reg (
.scan_in ( tcu_lbist_start_reg_scanin ),
.scan_out ( tcu_lbist_start_reg_scanout ),
.en ( io_cmp_sync_en_local ),
.dout ( tcu_spc_lbist_start[7:0] ),
//================================================================================
// Send mbist start to debug ctl to request a clock stop when cycle counter
//================================================================================
tcu_mbist_ctl_msff_ctl_macro__width_1 tcu_mb_clkstop_reg (
.scan_in ( tcu_mb_clkstop_reg_scanin ),
.scan_out ( tcu_mb_clkstop_reg_scanout ),
.dout ( mbist_clk_stop_req ),
assign mb_clkstop_req = (mbist_clk_stop_req | mbist_start_io_sync) & mbist_clkstpen;
//********************************************************************
// Instantiate DMO Control Sub-Block
//********************************************************************
.mbist_all_done ( mbist_all_done_real_time ),
.mbist_one_fail ( mbist_one_fail_real_time ),
.scan_in ( tcu_dmo_ctl_scanin ),
.scan_out ( tcu_dmo_ctl_scanout ),
.tcu_int_aclk(tcu_int_aclk),
.tcu_int_bclk(tcu_int_bclk),
.io_cmp_sync_en_local(io_cmp_sync_en_local),
.cmp_io2x_sync_en_local(cmp_io2x_sync_en_local),
.mbist_start_io_sync(mbist_start_io_sync),
.tcu_mio_dmo_data(tcu_mio_dmo_data[39:0]),
.tcu_mio_dmo_sync(tcu_mio_dmo_sync),
.tcu_mio_mbist_done(tcu_mio_mbist_done),
.tcu_mio_mbist_fail(tcu_mio_mbist_fail),
.tcu_mio_jtag_membist_mode(tcu_mio_jtag_membist_mode),
.spc4_dmo_dout(spc4_dmo_dout[35:0]),
.spc6_dmo_dout(spc6_dmo_dout[35:0]),
.dmo_coresel(dmo_coresel[5:0]),
.dmo_dcmuxctl(dmo_dcmuxctl),
.dmo_icmuxctl(dmo_icmuxctl),
.l2t4_dmo_dout(l2t4_dmo_dout[38:0]),
.l2t6_dmo_dout(l2t6_dmo_dout[38:0]),
.dmo_l2tsel(dmo_l2tsel[5:0]),
.dmo_tagmuxctl(dmo_tagmuxctl),
.rtx_tcu_dmo_data_out(rtx_tcu_dmo_data_out[39:0]),
.tds_tcu_dmo_dout(tds_tcu_dmo_dout[39:0]),
.rdp_tcu_dmo_dout(rdp_tcu_dmo_dout[39:0]),
.tcu_rtx_dmo_ctl(tcu_rtx_dmo_ctl[2:0]),
.jtag_dmo_enable(jtag_dmo_enable),
.jtag_dmo_control_upd(jtag_dmo_control_upd),
.jtag_dmo_control(jtag_dmo_control[47:0]),
.dmo_cfg(dmo_cfg[47:0]));
//==================================================
//==================================================
// ----------------------------------------------------------------------
// Removed for ECO to make flops visible in SunV
//spare_ctl_macro spare (num=12) (
// .scan_in ( spare_scanin ),
// .scan_out ( spare_scanout ));
// Added for ECO to make flops visible
// - this is an expansion of spare_ctl_macro with just the gates
tcu_mbist_ctl_spare_ctl_macro__flops_0__num_12 spare_gates (
tcu_mbist_ctl_msff_ctl_macro__scanreverse_1__width_12 spare_flops (
.scan_in(spare_flops_scanin),
.scan_out(spare_flops_scanout),
.din (spare_flops_d[11:0]),
.dout (spare_flops_q[11:0]),
assign spare_flops_d[11] = 1'b0;
assign spare_flops_d[10] = 1'b0;
assign spare_flops_d[9] = spare9_flop_d; // ECO C
assign spare_flops_d[8] = 1'b0;
assign spare_flops_d[7] = 1'b0;
assign spare_flops_d[6] = 1'b0;
assign spare_flops_d[5] = 1'b0;
assign spare_flops_d[4] = 1'b0;
assign spare_flops_d[3] = spare3_flop_d; // ECO C
assign spare_flops_d[2] = 1'b0;
assign spare_flops_d[1] = 1'b0;
assign spare_flops_d[0] = spare0_flop_d; // ECO D
assign spare_flops_unused[11] = spare_flops_q[11];
assign spare_flops_unused[10] = spare_flops_q[10];
assign spare9_flop_q = spare_flops_q[9]; // ECO C
assign spare_flops_unused[8] = spare_flops_q[8];
assign spare_flops_unused[7] = spare_flops_q[7];
assign spare_flops_unused[6] = spare_flops_q[6];
assign spare_flops_unused[5] = spare_flops_q[5];
assign spare_flops_unused[4] = spare_flops_q[4];
assign spare3_flop_q = spare_flops_q[3]; // ECO C
assign spare_flops_unused[2] = spare_flops_q[2];
assign spare_flops_unused[1] = spare_flops_q[1];
assign spare0_flop_q = spare_flops_q[0]; // ECO D
assign spare0_flop_d = cycle_stretch_to_mbc; // ECO D
assign cycle_stretch = spare0_flop_q; // ECO D
assign spare3_flop_d = debug_cycle_counter_stop_to_mbc; // ECO C
assign debug_cycle_counter_stop = spare3_flop_q; // ECO C
assign spare9_flop_d = mbist_clk_stop_to_mbc; // ECO C
assign mbist_clk_stop = spare9_flop_q; // ECO C
// ----------------------------------------------------------------------
assign jtag_csr_wr_sync_reg_scanin = scan_in;
assign mb_tcu_done_36_sync_reg_scanin = jtag_csr_wr_sync_reg_scanout;
assign mb_tcu_fail_36_sync_reg_scanin = mb_tcu_done_36_sync_reg_scanout;
assign tcu_mbist_sync_en_reg_scanin = mb_tcu_fail_36_sync_reg_scanout;
assign tcu_test_protect_cmp_reg_scanin = tcu_mbist_sync_en_reg_scanout;
assign ucb_csr_wr_sync_reg_scanin = tcu_test_protect_cmp_reg_scanout;
assign ucb_csr_addr_sync_reg_scanin = ucb_csr_wr_sync_reg_scanout;
assign csr_mbist_mode_reg_scanin = ucb_csr_addr_sync_reg_scanout;
assign csr_mbist_bypass_reg_scanin = csr_mbist_mode_reg_scanout;
assign csr_mbist_start_reg_scanin = csr_mbist_bypass_reg_scanout;
assign csr_mbist_abort_reg_scanin = csr_mbist_start_reg_scanout;
assign csr_mbist_abort_d_reg_scanin = csr_mbist_abort_reg_scanout;
assign csr_mbist_start_wmr_reg_scanin = csr_mbist_abort_d_reg_scanout;
assign mbist_done_reg_scanin = csr_mbist_start_wmr_reg_scanout;
assign mbist_fail_reg_scanin = mbist_done_reg_scanout;
assign mbist_done_fail_reg_scanin = mbist_fail_reg_scanout;
assign csr_lbist_mode_reg_scanin = mbist_done_fail_reg_scanout;
assign csr_lbist_bypass_reg_scanin = csr_lbist_mode_reg_scanout;
assign csr_lbist_start_reg_scanin = csr_lbist_bypass_reg_scanout;
assign csr_lbist_start_d_reg_scanin = csr_lbist_start_reg_scanout;
assign csr_lbist_done_reg_scanin = csr_lbist_start_d_reg_scanout;
assign csr_peu_entestcfg_reg_scanin = csr_lbist_done_reg_scanout;
assign csr_ucb_data_reg_scanin = csr_peu_entestcfg_reg_scanout;
assign start_bisx_por_d_reg_scanin = csr_ucb_data_reg_scanout;
assign tcu_mbist_state_reg_scanin = start_bisx_por_d_reg_scanout;
assign mbist_start_io_sync_reg_scanin = tcu_mbist_state_reg_scanout;
assign hold_start_reg_scanin = mbist_start_io_sync_reg_scanout;
assign clr_mbist_start_wmr_reg_scanin = hold_start_reg_scanout;
assign tcu_mbist_user_mode_reg_scanin = clr_mbist_start_wmr_reg_scanout;
assign mb_tcu_done_stg_reg_scanin = tcu_mbist_user_mode_reg_scanout;
assign mb_tcu_done_d_cmp_reg_scanin = mb_tcu_done_stg_reg_scanout;
assign mb_tcu_done_d_io_reg_scanin = mb_tcu_done_d_cmp_reg_scanout;
assign mb_tcu_fail_stg_reg_scanin = mb_tcu_done_d_io_reg_scanout;
assign mb_tcu_fail_d_cmp_reg_scanin = mb_tcu_fail_stg_reg_scanout;
assign mb_tcu_fail_d_io_reg_scanin = mb_tcu_fail_d_cmp_reg_scanout;
assign core_avail_reg_scanin = mb_tcu_fail_d_io_reg_scanout;
assign bank_avail_reg_scanin = core_avail_reg_scanout;
assign core_enable_status_reg_scanin = bank_avail_reg_scanout;
assign bank_enable_status_reg_scanin = core_enable_status_reg_scanout;
assign prev_skip_done_reg_scanin = bank_enable_status_reg_scanout;
assign tcu_mb_start_d_cmp_reg_scanin = prev_skip_done_reg_scanout;
assign tcu_mb_start_d2_cmp_reg_scanin = tcu_mb_start_d_cmp_reg_scanout;
assign tcu_mb_start_d_io_reg_scanin = tcu_mb_start_d2_cmp_reg_scanout;
assign tcu_bisx_done_reg_scanin = tcu_mb_start_d_io_reg_scanout;
assign bisx_counter_en_reg_scanin = tcu_bisx_done_reg_scanout;
assign bisx_counter_reg_scanin = bisx_counter_en_reg_scanout;
assign tcu_lb_tcu_done_reg_scanin = bisx_counter_reg_scanout;
assign lbist_all_done_reg_scanin = tcu_lb_tcu_done_reg_scanout;
assign tcu_lbist_start_reg_scanin = lbist_all_done_reg_scanout;
assign tcu_mb_clkstop_reg_scanin = tcu_lbist_start_reg_scanout;
assign tcu_dmo_ctl_scanin = tcu_mb_clkstop_reg_scanout;
assign spare_flops_scanin = tcu_dmo_ctl_scanout;
assign scan_out = spare_flops_scanout;
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_l1clkhdr_ctl_macro (
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_3 (
assign fdin[2:0] = din[2:0];
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_1 (
assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}});
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_6 (
assign fdin[5:0] = (din[5:0] & {6{en}}) | (dout[5:0] & ~{6{en}});
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_4 (
assign fdin[3:0] = din[3:0];
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_48 (
assign fdin[47:0] = din[47:0];
.so({so[46:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_1 (
assign fdin[0:0] = din[0:0];
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_2 (
assign fdin[1:0] = din[1:0];
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_8 (
assign fdin[7:0] = din[7:0];
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_64 (
assign fdin[63:0] = (din[63:0] & {64{en}}) | (dout[63:0] & ~{64{en}});
.so({so[62:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_18 (
assign fdin[17:0] = din[17:0];
.so({so[16:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_32 (
assign fdin[31:0] = din[31:0];
.so({so[30:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_16 (
assign fdin[15:0] = (din[15:0] & {16{en}}) | (dout[15:0] & ~{16{en}});
.so({so[14:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_8 (
assign fdin[7:0] = (din[7:0] & {8{en}}) | (dout[7:0] & ~{8{en}});
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_5 (
assign fdin[4:0] = (din[4:0] & {5{en}}) | (dout[4:0] & ~{5{en}});
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_47 (
assign fdin[46:0] = din[46:0];
.so({so[45:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_36 (
assign fdin[35:0] = din[35:0];
.so({so[34:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__width_39 (
assign fdin[38:0] = din[38:0];
.so({so[37:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_40 (
assign fdin[39:0] = (din[39:0] & {40{en}}) | (dout[39:0] & ~{40{en}});
.so({so[38:0],scan_out}),
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__clr__1__width_1 (
assign fdin[0:0] = din[0:0] & ~{1{(~clr_)}};
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__en_1__width_3 (
assign fdin[2:0] = (din[2:0] & {3{en}}) | (dout[2:0] & ~{3{en}});
// Description: Spare gate macro for control blocks
// Param num controls the number of times the macro is added
// flops=0 can be used to use only combination spare logic
module tcu_mbist_ctl_spare_ctl_macro__flops_0__num_12;
wire spare0_buf_32x_unused;
wire spare0_nand3_8x_unused;
wire spare0_inv_8x_unused;
wire spare0_aoi22_4x_unused;
wire spare0_buf_8x_unused;
wire spare0_oai22_4x_unused;
wire spare0_inv_16x_unused;
wire spare0_nand2_16x_unused;
wire spare0_nor3_4x_unused;
wire spare0_nand2_8x_unused;
wire spare0_buf_16x_unused;
wire spare0_nor2_16x_unused;
wire spare0_inv_32x_unused;
wire spare1_buf_32x_unused;
wire spare1_nand3_8x_unused;
wire spare1_inv_8x_unused;
wire spare1_aoi22_4x_unused;
wire spare1_buf_8x_unused;
wire spare1_oai22_4x_unused;
wire spare1_inv_16x_unused;
wire spare1_nand2_16x_unused;
wire spare1_nor3_4x_unused;
wire spare1_nand2_8x_unused;
wire spare1_buf_16x_unused;
wire spare1_nor2_16x_unused;
wire spare1_inv_32x_unused;
wire spare2_buf_32x_unused;
wire spare2_nand3_8x_unused;
wire spare2_inv_8x_unused;
wire spare2_aoi22_4x_unused;
wire spare2_buf_8x_unused;
wire spare2_oai22_4x_unused;
wire spare2_inv_16x_unused;
wire spare2_nand2_16x_unused;
wire spare2_nor3_4x_unused;
wire spare2_nand2_8x_unused;
wire spare2_buf_16x_unused;
wire spare2_nor2_16x_unused;
wire spare2_inv_32x_unused;
wire spare3_buf_32x_unused;
wire spare3_nand3_8x_unused;
wire spare3_inv_8x_unused;
wire spare3_aoi22_4x_unused;
wire spare3_buf_8x_unused;
wire spare3_oai22_4x_unused;
wire spare3_inv_16x_unused;
wire spare3_nand2_16x_unused;
wire spare3_nor3_4x_unused;
wire spare3_nand2_8x_unused;
wire spare3_buf_16x_unused;
wire spare3_nor2_16x_unused;
wire spare3_inv_32x_unused;
wire spare4_buf_32x_unused;
wire spare4_nand3_8x_unused;
wire spare4_inv_8x_unused;
wire spare4_aoi22_4x_unused;
wire spare4_buf_8x_unused;
wire spare4_oai22_4x_unused;
wire spare4_inv_16x_unused;
wire spare4_nand2_16x_unused;
wire spare4_nor3_4x_unused;
wire spare4_nand2_8x_unused;
wire spare4_buf_16x_unused;
wire spare4_nor2_16x_unused;
wire spare4_inv_32x_unused;
wire spare5_buf_32x_unused;
wire spare5_nand3_8x_unused;
wire spare5_inv_8x_unused;
wire spare5_aoi22_4x_unused;
wire spare5_buf_8x_unused;
wire spare5_oai22_4x_unused;
wire spare5_inv_16x_unused;
wire spare5_nand2_16x_unused;
wire spare5_nor3_4x_unused;
wire spare5_nand2_8x_unused;
wire spare5_buf_16x_unused;
wire spare5_nor2_16x_unused;
wire spare5_inv_32x_unused;
wire spare6_buf_32x_unused;
wire spare6_nand3_8x_unused;
wire spare6_inv_8x_unused;
wire spare6_aoi22_4x_unused;
wire spare6_buf_8x_unused;
wire spare6_oai22_4x_unused;
wire spare6_inv_16x_unused;
wire spare6_nand2_16x_unused;
wire spare6_nor3_4x_unused;
wire spare6_nand2_8x_unused;
wire spare6_buf_16x_unused;
wire spare6_nor2_16x_unused;
wire spare6_inv_32x_unused;
wire spare7_buf_32x_unused;
wire spare7_nand3_8x_unused;
wire spare7_inv_8x_unused;
wire spare7_aoi22_4x_unused;
wire spare7_buf_8x_unused;
wire spare7_oai22_4x_unused;
wire spare7_inv_16x_unused;
wire spare7_nand2_16x_unused;
wire spare7_nor3_4x_unused;
wire spare7_nand2_8x_unused;
wire spare7_buf_16x_unused;
wire spare7_nor2_16x_unused;
wire spare7_inv_32x_unused;
wire spare8_buf_32x_unused;
wire spare8_nand3_8x_unused;
wire spare8_inv_8x_unused;
wire spare8_aoi22_4x_unused;
wire spare8_buf_8x_unused;
wire spare8_oai22_4x_unused;
wire spare8_inv_16x_unused;
wire spare8_nand2_16x_unused;
wire spare8_nor3_4x_unused;
wire spare8_nand2_8x_unused;
wire spare8_buf_16x_unused;
wire spare8_nor2_16x_unused;
wire spare8_inv_32x_unused;
wire spare9_buf_32x_unused;
wire spare9_nand3_8x_unused;
wire spare9_inv_8x_unused;
wire spare9_aoi22_4x_unused;
wire spare9_buf_8x_unused;
wire spare9_oai22_4x_unused;
wire spare9_inv_16x_unused;
wire spare9_nand2_16x_unused;
wire spare9_nor3_4x_unused;
wire spare9_nand2_8x_unused;
wire spare9_buf_16x_unused;
wire spare9_nor2_16x_unused;
wire spare9_inv_32x_unused;
wire spare10_buf_32x_unused;
wire spare10_nand3_8x_unused;
wire spare10_inv_8x_unused;
wire spare10_aoi22_4x_unused;
wire spare10_buf_8x_unused;
wire spare10_oai22_4x_unused;
wire spare10_inv_16x_unused;
wire spare10_nand2_16x_unused;
wire spare10_nor3_4x_unused;
wire spare10_nand2_8x_unused;
wire spare10_buf_16x_unused;
wire spare10_nor2_16x_unused;
wire spare10_inv_32x_unused;
wire spare11_buf_32x_unused;
wire spare11_nand3_8x_unused;
wire spare11_inv_8x_unused;
wire spare11_aoi22_4x_unused;
wire spare11_buf_8x_unused;
wire spare11_oai22_4x_unused;
wire spare11_inv_16x_unused;
wire spare11_nand2_16x_unused;
wire spare11_nor3_4x_unused;
wire spare11_nand2_8x_unused;
wire spare11_buf_16x_unused;
wire spare11_nor2_16x_unused;
wire spare11_inv_32x_unused;
cl_u1_buf_32x spare0_buf_32x (.in(1'b1),
.out(spare0_buf_32x_unused));
cl_u1_nand3_8x spare0_nand3_8x (.in0(1'b1),
.out(spare0_nand3_8x_unused));
cl_u1_inv_8x spare0_inv_8x (.in(1'b1),
.out(spare0_inv_8x_unused));
cl_u1_aoi22_4x spare0_aoi22_4x (.in00(1'b1),
.out(spare0_aoi22_4x_unused));
cl_u1_buf_8x spare0_buf_8x (.in(1'b1),
.out(spare0_buf_8x_unused));
cl_u1_oai22_4x spare0_oai22_4x (.in00(1'b1),
.out(spare0_oai22_4x_unused));
cl_u1_inv_16x spare0_inv_16x (.in(1'b1),
.out(spare0_inv_16x_unused));
cl_u1_nand2_16x spare0_nand2_16x (.in0(1'b1),
.out(spare0_nand2_16x_unused));
cl_u1_nor3_4x spare0_nor3_4x (.in0(1'b0),
.out(spare0_nor3_4x_unused));
cl_u1_nand2_8x spare0_nand2_8x (.in0(1'b1),
.out(spare0_nand2_8x_unused));
cl_u1_buf_16x spare0_buf_16x (.in(1'b1),
.out(spare0_buf_16x_unused));
cl_u1_nor2_16x spare0_nor2_16x (.in0(1'b0),
.out(spare0_nor2_16x_unused));
cl_u1_inv_32x spare0_inv_32x (.in(1'b1),
.out(spare0_inv_32x_unused));
cl_u1_buf_32x spare1_buf_32x (.in(1'b1),
.out(spare1_buf_32x_unused));
cl_u1_nand3_8x spare1_nand3_8x (.in0(1'b1),
.out(spare1_nand3_8x_unused));
cl_u1_inv_8x spare1_inv_8x (.in(1'b1),
.out(spare1_inv_8x_unused));
cl_u1_aoi22_4x spare1_aoi22_4x (.in00(1'b1),
.out(spare1_aoi22_4x_unused));
cl_u1_buf_8x spare1_buf_8x (.in(1'b1),
.out(spare1_buf_8x_unused));
cl_u1_oai22_4x spare1_oai22_4x (.in00(1'b1),
.out(spare1_oai22_4x_unused));
cl_u1_inv_16x spare1_inv_16x (.in(1'b1),
.out(spare1_inv_16x_unused));
cl_u1_nand2_16x spare1_nand2_16x (.in0(1'b1),
.out(spare1_nand2_16x_unused));
cl_u1_nor3_4x spare1_nor3_4x (.in0(1'b0),
.out(spare1_nor3_4x_unused));
cl_u1_nand2_8x spare1_nand2_8x (.in0(1'b1),
.out(spare1_nand2_8x_unused));
cl_u1_buf_16x spare1_buf_16x (.in(1'b1),
.out(spare1_buf_16x_unused));
cl_u1_nor2_16x spare1_nor2_16x (.in0(1'b0),
.out(spare1_nor2_16x_unused));
cl_u1_inv_32x spare1_inv_32x (.in(1'b1),
.out(spare1_inv_32x_unused));
cl_u1_buf_32x spare2_buf_32x (.in(1'b1),
.out(spare2_buf_32x_unused));
cl_u1_nand3_8x spare2_nand3_8x (.in0(1'b1),
.out(spare2_nand3_8x_unused));
cl_u1_inv_8x spare2_inv_8x (.in(1'b1),
.out(spare2_inv_8x_unused));
cl_u1_aoi22_4x spare2_aoi22_4x (.in00(1'b1),
.out(spare2_aoi22_4x_unused));
cl_u1_buf_8x spare2_buf_8x (.in(1'b1),
.out(spare2_buf_8x_unused));
cl_u1_oai22_4x spare2_oai22_4x (.in00(1'b1),
.out(spare2_oai22_4x_unused));
cl_u1_inv_16x spare2_inv_16x (.in(1'b1),
.out(spare2_inv_16x_unused));
cl_u1_nand2_16x spare2_nand2_16x (.in0(1'b1),
.out(spare2_nand2_16x_unused));
cl_u1_nor3_4x spare2_nor3_4x (.in0(1'b0),
.out(spare2_nor3_4x_unused));
cl_u1_nand2_8x spare2_nand2_8x (.in0(1'b1),
.out(spare2_nand2_8x_unused));
cl_u1_buf_16x spare2_buf_16x (.in(1'b1),
.out(spare2_buf_16x_unused));
cl_u1_nor2_16x spare2_nor2_16x (.in0(1'b0),
.out(spare2_nor2_16x_unused));
cl_u1_inv_32x spare2_inv_32x (.in(1'b1),
.out(spare2_inv_32x_unused));
cl_u1_buf_32x spare3_buf_32x (.in(1'b1),
.out(spare3_buf_32x_unused));
cl_u1_nand3_8x spare3_nand3_8x (.in0(1'b1),
.out(spare3_nand3_8x_unused));
cl_u1_inv_8x spare3_inv_8x (.in(1'b1),
.out(spare3_inv_8x_unused));
cl_u1_aoi22_4x spare3_aoi22_4x (.in00(1'b1),
.out(spare3_aoi22_4x_unused));
cl_u1_buf_8x spare3_buf_8x (.in(1'b1),
.out(spare3_buf_8x_unused));
cl_u1_oai22_4x spare3_oai22_4x (.in00(1'b1),
.out(spare3_oai22_4x_unused));
cl_u1_inv_16x spare3_inv_16x (.in(1'b1),
.out(spare3_inv_16x_unused));
cl_u1_nand2_16x spare3_nand2_16x (.in0(1'b1),
.out(spare3_nand2_16x_unused));
cl_u1_nor3_4x spare3_nor3_4x (.in0(1'b0),
.out(spare3_nor3_4x_unused));
cl_u1_nand2_8x spare3_nand2_8x (.in0(1'b1),
.out(spare3_nand2_8x_unused));
cl_u1_buf_16x spare3_buf_16x (.in(1'b1),
.out(spare3_buf_16x_unused));
cl_u1_nor2_16x spare3_nor2_16x (.in0(1'b0),
.out(spare3_nor2_16x_unused));
cl_u1_inv_32x spare3_inv_32x (.in(1'b1),
.out(spare3_inv_32x_unused));
cl_u1_buf_32x spare4_buf_32x (.in(1'b1),
.out(spare4_buf_32x_unused));
cl_u1_nand3_8x spare4_nand3_8x (.in0(1'b1),
.out(spare4_nand3_8x_unused));
cl_u1_inv_8x spare4_inv_8x (.in(1'b1),
.out(spare4_inv_8x_unused));
cl_u1_aoi22_4x spare4_aoi22_4x (.in00(1'b1),
.out(spare4_aoi22_4x_unused));
cl_u1_buf_8x spare4_buf_8x (.in(1'b1),
.out(spare4_buf_8x_unused));
cl_u1_oai22_4x spare4_oai22_4x (.in00(1'b1),
.out(spare4_oai22_4x_unused));
cl_u1_inv_16x spare4_inv_16x (.in(1'b1),
.out(spare4_inv_16x_unused));
cl_u1_nand2_16x spare4_nand2_16x (.in0(1'b1),
.out(spare4_nand2_16x_unused));
cl_u1_nor3_4x spare4_nor3_4x (.in0(1'b0),
.out(spare4_nor3_4x_unused));
cl_u1_nand2_8x spare4_nand2_8x (.in0(1'b1),
.out(spare4_nand2_8x_unused));
cl_u1_buf_16x spare4_buf_16x (.in(1'b1),
.out(spare4_buf_16x_unused));
cl_u1_nor2_16x spare4_nor2_16x (.in0(1'b0),
.out(spare4_nor2_16x_unused));
cl_u1_inv_32x spare4_inv_32x (.in(1'b1),
.out(spare4_inv_32x_unused));
cl_u1_buf_32x spare5_buf_32x (.in(1'b1),
.out(spare5_buf_32x_unused));
cl_u1_nand3_8x spare5_nand3_8x (.in0(1'b1),
.out(spare5_nand3_8x_unused));
cl_u1_inv_8x spare5_inv_8x (.in(1'b1),
.out(spare5_inv_8x_unused));
cl_u1_aoi22_4x spare5_aoi22_4x (.in00(1'b1),
.out(spare5_aoi22_4x_unused));
cl_u1_buf_8x spare5_buf_8x (.in(1'b1),
.out(spare5_buf_8x_unused));
cl_u1_oai22_4x spare5_oai22_4x (.in00(1'b1),
.out(spare5_oai22_4x_unused));
cl_u1_inv_16x spare5_inv_16x (.in(1'b1),
.out(spare5_inv_16x_unused));
cl_u1_nand2_16x spare5_nand2_16x (.in0(1'b1),
.out(spare5_nand2_16x_unused));
cl_u1_nor3_4x spare5_nor3_4x (.in0(1'b0),
.out(spare5_nor3_4x_unused));
cl_u1_nand2_8x spare5_nand2_8x (.in0(1'b1),
.out(spare5_nand2_8x_unused));
cl_u1_buf_16x spare5_buf_16x (.in(1'b1),
.out(spare5_buf_16x_unused));
cl_u1_nor2_16x spare5_nor2_16x (.in0(1'b0),
.out(spare5_nor2_16x_unused));
cl_u1_inv_32x spare5_inv_32x (.in(1'b1),
.out(spare5_inv_32x_unused));
cl_u1_buf_32x spare6_buf_32x (.in(1'b1),
.out(spare6_buf_32x_unused));
cl_u1_nand3_8x spare6_nand3_8x (.in0(1'b1),
.out(spare6_nand3_8x_unused));
cl_u1_inv_8x spare6_inv_8x (.in(1'b1),
.out(spare6_inv_8x_unused));
cl_u1_aoi22_4x spare6_aoi22_4x (.in00(1'b1),
.out(spare6_aoi22_4x_unused));
cl_u1_buf_8x spare6_buf_8x (.in(1'b1),
.out(spare6_buf_8x_unused));
cl_u1_oai22_4x spare6_oai22_4x (.in00(1'b1),
.out(spare6_oai22_4x_unused));
cl_u1_inv_16x spare6_inv_16x (.in(1'b1),
.out(spare6_inv_16x_unused));
cl_u1_nand2_16x spare6_nand2_16x (.in0(1'b1),
.out(spare6_nand2_16x_unused));
cl_u1_nor3_4x spare6_nor3_4x (.in0(1'b0),
.out(spare6_nor3_4x_unused));
cl_u1_nand2_8x spare6_nand2_8x (.in0(1'b1),
.out(spare6_nand2_8x_unused));
cl_u1_buf_16x spare6_buf_16x (.in(1'b1),
.out(spare6_buf_16x_unused));
cl_u1_nor2_16x spare6_nor2_16x (.in0(1'b0),
.out(spare6_nor2_16x_unused));
cl_u1_inv_32x spare6_inv_32x (.in(1'b1),
.out(spare6_inv_32x_unused));
cl_u1_buf_32x spare7_buf_32x (.in(1'b1),
.out(spare7_buf_32x_unused));
cl_u1_nand3_8x spare7_nand3_8x (.in0(1'b1),
.out(spare7_nand3_8x_unused));
cl_u1_inv_8x spare7_inv_8x (.in(1'b1),
.out(spare7_inv_8x_unused));
cl_u1_aoi22_4x spare7_aoi22_4x (.in00(1'b1),
.out(spare7_aoi22_4x_unused));
cl_u1_buf_8x spare7_buf_8x (.in(1'b1),
.out(spare7_buf_8x_unused));
cl_u1_oai22_4x spare7_oai22_4x (.in00(1'b1),
.out(spare7_oai22_4x_unused));
cl_u1_inv_16x spare7_inv_16x (.in(1'b1),
.out(spare7_inv_16x_unused));
cl_u1_nand2_16x spare7_nand2_16x (.in0(1'b1),
.out(spare7_nand2_16x_unused));
cl_u1_nor3_4x spare7_nor3_4x (.in0(1'b0),
.out(spare7_nor3_4x_unused));
cl_u1_nand2_8x spare7_nand2_8x (.in0(1'b1),
.out(spare7_nand2_8x_unused));
cl_u1_buf_16x spare7_buf_16x (.in(1'b1),
.out(spare7_buf_16x_unused));
cl_u1_nor2_16x spare7_nor2_16x (.in0(1'b0),
.out(spare7_nor2_16x_unused));
cl_u1_inv_32x spare7_inv_32x (.in(1'b1),
.out(spare7_inv_32x_unused));
cl_u1_buf_32x spare8_buf_32x (.in(1'b1),
.out(spare8_buf_32x_unused));
cl_u1_nand3_8x spare8_nand3_8x (.in0(1'b1),
.out(spare8_nand3_8x_unused));
cl_u1_inv_8x spare8_inv_8x (.in(1'b1),
.out(spare8_inv_8x_unused));
cl_u1_aoi22_4x spare8_aoi22_4x (.in00(1'b1),
.out(spare8_aoi22_4x_unused));
cl_u1_buf_8x spare8_buf_8x (.in(1'b1),
.out(spare8_buf_8x_unused));
cl_u1_oai22_4x spare8_oai22_4x (.in00(1'b1),
.out(spare8_oai22_4x_unused));
cl_u1_inv_16x spare8_inv_16x (.in(1'b1),
.out(spare8_inv_16x_unused));
cl_u1_nand2_16x spare8_nand2_16x (.in0(1'b1),
.out(spare8_nand2_16x_unused));
cl_u1_nor3_4x spare8_nor3_4x (.in0(1'b0),
.out(spare8_nor3_4x_unused));
cl_u1_nand2_8x spare8_nand2_8x (.in0(1'b1),
.out(spare8_nand2_8x_unused));
cl_u1_buf_16x spare8_buf_16x (.in(1'b1),
.out(spare8_buf_16x_unused));
cl_u1_nor2_16x spare8_nor2_16x (.in0(1'b0),
.out(spare8_nor2_16x_unused));
cl_u1_inv_32x spare8_inv_32x (.in(1'b1),
.out(spare8_inv_32x_unused));
cl_u1_buf_32x spare9_buf_32x (.in(1'b1),
.out(spare9_buf_32x_unused));
cl_u1_nand3_8x spare9_nand3_8x (.in0(1'b1),
.out(spare9_nand3_8x_unused));
cl_u1_inv_8x spare9_inv_8x (.in(1'b1),
.out(spare9_inv_8x_unused));
cl_u1_aoi22_4x spare9_aoi22_4x (.in00(1'b1),
.out(spare9_aoi22_4x_unused));
cl_u1_buf_8x spare9_buf_8x (.in(1'b1),
.out(spare9_buf_8x_unused));
cl_u1_oai22_4x spare9_oai22_4x (.in00(1'b1),
.out(spare9_oai22_4x_unused));
cl_u1_inv_16x spare9_inv_16x (.in(1'b1),
.out(spare9_inv_16x_unused));
cl_u1_nand2_16x spare9_nand2_16x (.in0(1'b1),
.out(spare9_nand2_16x_unused));
cl_u1_nor3_4x spare9_nor3_4x (.in0(1'b0),
.out(spare9_nor3_4x_unused));
cl_u1_nand2_8x spare9_nand2_8x (.in0(1'b1),
.out(spare9_nand2_8x_unused));
cl_u1_buf_16x spare9_buf_16x (.in(1'b1),
.out(spare9_buf_16x_unused));
cl_u1_nor2_16x spare9_nor2_16x (.in0(1'b0),
.out(spare9_nor2_16x_unused));
cl_u1_inv_32x spare9_inv_32x (.in(1'b1),
.out(spare9_inv_32x_unused));
cl_u1_buf_32x spare10_buf_32x (.in(1'b1),
.out(spare10_buf_32x_unused));
cl_u1_nand3_8x spare10_nand3_8x (.in0(1'b1),
.out(spare10_nand3_8x_unused));
cl_u1_inv_8x spare10_inv_8x (.in(1'b1),
.out(spare10_inv_8x_unused));
cl_u1_aoi22_4x spare10_aoi22_4x (.in00(1'b1),
.out(spare10_aoi22_4x_unused));
cl_u1_buf_8x spare10_buf_8x (.in(1'b1),
.out(spare10_buf_8x_unused));
cl_u1_oai22_4x spare10_oai22_4x (.in00(1'b1),
.out(spare10_oai22_4x_unused));
cl_u1_inv_16x spare10_inv_16x (.in(1'b1),
.out(spare10_inv_16x_unused));
cl_u1_nand2_16x spare10_nand2_16x (.in0(1'b1),
.out(spare10_nand2_16x_unused));
cl_u1_nor3_4x spare10_nor3_4x (.in0(1'b0),
.out(spare10_nor3_4x_unused));
cl_u1_nand2_8x spare10_nand2_8x (.in0(1'b1),
.out(spare10_nand2_8x_unused));
cl_u1_buf_16x spare10_buf_16x (.in(1'b1),
.out(spare10_buf_16x_unused));
cl_u1_nor2_16x spare10_nor2_16x (.in0(1'b0),
.out(spare10_nor2_16x_unused));
cl_u1_inv_32x spare10_inv_32x (.in(1'b1),
.out(spare10_inv_32x_unused));
cl_u1_buf_32x spare11_buf_32x (.in(1'b1),
.out(spare11_buf_32x_unused));
cl_u1_nand3_8x spare11_nand3_8x (.in0(1'b1),
.out(spare11_nand3_8x_unused));
cl_u1_inv_8x spare11_inv_8x (.in(1'b1),
.out(spare11_inv_8x_unused));
cl_u1_aoi22_4x spare11_aoi22_4x (.in00(1'b1),
.out(spare11_aoi22_4x_unused));
cl_u1_buf_8x spare11_buf_8x (.in(1'b1),
.out(spare11_buf_8x_unused));
cl_u1_oai22_4x spare11_oai22_4x (.in00(1'b1),
.out(spare11_oai22_4x_unused));
cl_u1_inv_16x spare11_inv_16x (.in(1'b1),
.out(spare11_inv_16x_unused));
cl_u1_nand2_16x spare11_nand2_16x (.in0(1'b1),
.out(spare11_nand2_16x_unused));
cl_u1_nor3_4x spare11_nor3_4x (.in0(1'b0),
.out(spare11_nor3_4x_unused));
cl_u1_nand2_8x spare11_nand2_8x (.in0(1'b1),
.out(spare11_nand2_8x_unused));
cl_u1_buf_16x spare11_buf_16x (.in(1'b1),
.out(spare11_buf_16x_unused));
cl_u1_nor2_16x spare11_nor2_16x (.in0(1'b0),
.out(spare11_nor2_16x_unused));
cl_u1_inv_32x spare11_inv_32x (.in(1'b1),
.out(spare11_inv_32x_unused));
// any PARAMS parms go into naming of macro
module tcu_mbist_ctl_msff_ctl_macro__scanreverse_1__width_12 (
assign fdin[11:0] = din[11:0];
.so({scan_out,so[0:10]}),