// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: lsu_sec_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 ============================================
sec_st_sz_dw_le_not_ie_b,
sec_st_sz_dw_be_not_ie_b,
sec_st_sz_word_le_not_ie_b,
sec_st_sz_word_be_not_ie_b,
sec_st_sz_hw_le_not_ie_b,
sec_st_sz_hw_be_not_ie_b,
sec_st_sz_word_le_if_ie_b,
sec_st_sz_word_be_if_ie_b,
wire dff_cparity_scanout;
wire st_sz_dw_le_not_ie_m;
wire st_sz_dw_be_not_ie_m;
wire st_sz_word_le_not_ie_m;
wire st_sz_word_be_not_ie_m;
wire st_sz_hw_le_not_ie_m;
wire st_sz_hw_be_not_ie_m;
wire st_sz_dw_le_if_ie_m;
wire st_sz_dw_be_if_ie_m;
wire st_sz_word_le_if_ie_m;
wire st_sz_word_be_if_ie_m;
wire st_sz_hw_le_if_ie_m;
wire st_sz_hw_be_if_ie_m;
input sbc_twocycle_inst_w;
input sbc_st_le_not_ie_m;
output sec_st_sz_dw_std_le_b;
output sec_st_sz_dw_le_not_ie_b;
output sec_st_sz_dw_be_not_ie_b;
output sec_st_sz_word_le_not_ie_b;
output sec_st_sz_word_be_not_ie_b;
output sec_st_sz_hw_le_not_ie_b;
output sec_st_sz_hw_be_not_ie_b;
output sec_st_sz_dw_le_if_ie_b;
output sec_st_sz_dw_be_if_ie_b;
output sec_st_sz_word_le_if_ie_b;
output sec_st_sz_word_be_if_ie_b;
output sec_st_sz_hw_le_if_ie_b;
output sec_st_sz_hw_be_if_ie_b;
input tcu_pce_ov; // scan signals
assign pce_ov = tcu_pce_ov;
assign corr_bit[63:0] = {err_bith[31:0],err_bitl[31:0]};
//////////////////////////////
//////////////////////////////
lsu_sec_ctl_l1clkhdr_ctl_macro clkgen (
///////////////////////////////////////////////////////////////////////
// Flop check bits, determine error, and generate correction vector
assign parityl = sed_cf_lo[2] ^ sed_cf_lo[1] ^ sed_cf_lo[0];
assign c32l = sed_c32_lo;
assign c16l = sed_c16_lo[1] ^ sed_c16_lo[0];
assign c8l = sed_c8_lo[1] ^ sed_c8_lo[0];
assign c4l = sed_c4_lo[1] ^ sed_c4_lo[0];
assign c2l = sed_c2_lo[1] ^ sed_c2_lo[0];
assign c1l = sed_c1_lo[1] ^ sed_c1_lo[0];
assign cecc_errl = |({c1l,c2l,c4l,c8l,c16l,c32l}) & parityl;
assign uecc_errl = |({c1l,c2l,c4l,c8l,c16l,c32l}) & ~parityl;
assign err_bitl[0] = ~c32l & ~c16l & ~c8l & ~c4l & c2l & c1l;
assign err_bitl[1] = ~c32l & ~c16l & ~c8l & c4l & ~c2l & c1l;
assign err_bitl[2] = ~c32l & ~c16l & ~c8l & c4l & c2l & ~c1l;
assign err_bitl[3] = ~c32l & ~c16l & ~c8l & c4l & c2l & c1l;
assign err_bitl[4] = ~c32l & ~c16l & c8l & ~c4l & ~c2l & c1l;
assign err_bitl[5] = ~c32l & ~c16l & c8l & ~c4l & c2l & ~c1l;
assign err_bitl[6] = ~c32l & ~c16l & c8l & ~c4l & c2l & c1l;
assign err_bitl[7] = ~c32l & ~c16l & c8l & c4l & ~c2l & ~c1l;
assign err_bitl[8] = ~c32l & ~c16l & c8l & c4l & ~c2l & c1l;
assign err_bitl[9] = ~c32l & ~c16l & c8l & c4l & c2l & ~c1l;
assign err_bitl[10] = ~c32l & ~c16l & c8l & c4l & c2l & c1l;
assign err_bitl[11] = ~c32l & c16l & ~c8l & ~c4l & ~c2l & c1l;
assign err_bitl[12] = ~c32l & c16l & ~c8l & ~c4l & c2l & ~c1l;
assign err_bitl[13] = ~c32l & c16l & ~c8l & ~c4l & c2l & c1l;
assign err_bitl[14] = ~c32l & c16l & ~c8l & c4l & ~c2l & ~c1l;
assign err_bitl[15] = ~c32l & c16l & ~c8l & c4l & ~c2l & c1l;
assign err_bitl[16] = ~c32l & c16l & ~c8l & c4l & c2l & ~c1l;
assign err_bitl[17] = ~c32l & c16l & ~c8l & c4l & c2l & c1l;
assign err_bitl[18] = ~c32l & c16l & c8l & ~c4l & ~c2l & ~c1l;
assign err_bitl[19] = ~c32l & c16l & c8l & ~c4l & ~c2l & c1l;
assign err_bitl[20] = ~c32l & c16l & c8l & ~c4l & c2l & ~c1l;
assign err_bitl[21] = ~c32l & c16l & c8l & ~c4l & c2l & c1l;
assign err_bitl[22] = ~c32l & c16l & c8l & c4l & ~c2l & ~c1l;
assign err_bitl[23] = ~c32l & c16l & c8l & c4l & ~c2l & c1l;
assign err_bitl[24] = ~c32l & c16l & c8l & c4l & c2l & ~c1l;
assign err_bitl[25] = ~c32l & c16l & c8l & c4l & c2l & c1l;
assign err_bitl[26] = c32l & ~c16l & ~c8l & ~c4l & ~c2l & c1l;
assign err_bitl[27] = c32l & ~c16l & ~c8l & ~c4l & c2l & ~c1l;
assign err_bitl[28] = c32l & ~c16l & ~c8l & ~c4l & c2l & c1l;
assign err_bitl[29] = c32l & ~c16l & ~c8l & c4l & ~c2l & ~c1l;
assign err_bitl[30] = c32l & ~c16l & ~c8l & c4l & ~c2l & c1l;
assign err_bitl[31] = c32l & ~c16l & ~c8l & c4l & c2l & ~c1l;
assign parityh = sed_cf_hi[2] ^ sed_cf_hi[1] ^ sed_cf_hi[0];
assign c32h = sed_c32_hi;
assign c16h = sed_c16_hi[1] ^ sed_c16_hi[0];
assign c8h = sed_c8_hi[1] ^ sed_c8_hi[0];
assign c4h = sed_c4_hi[1] ^ sed_c4_hi[0];
assign c2h = sed_c2_hi[1] ^ sed_c2_hi[0];
assign c1h = sed_c1_hi[1] ^ sed_c1_hi[0];
assign cecc_errh = |({c1h,c2h,c4h,c8h,c16h,c32h}) & parityh;
assign uecc_errh = |({c1h,c2h,c4h,c8h,c16h,c32h}) & ~parityh;
assign err_bith[0] = ~c32h & ~c16h & ~c8h & ~c4h & c2h & c1h;
assign err_bith[1] = ~c32h & ~c16h & ~c8h & c4h & ~c2h & c1h;
assign err_bith[2] = ~c32h & ~c16h & ~c8h & c4h & c2h & ~c1h;
assign err_bith[3] = ~c32h & ~c16h & ~c8h & c4h & c2h & c1h;
assign err_bith[4] = ~c32h & ~c16h & c8h & ~c4h & ~c2h & c1h;
assign err_bith[5] = ~c32h & ~c16h & c8h & ~c4h & c2h & ~c1h;
assign err_bith[6] = ~c32h & ~c16h & c8h & ~c4h & c2h & c1h;
assign err_bith[7] = ~c32h & ~c16h & c8h & c4h & ~c2h & ~c1h;
assign err_bith[8] = ~c32h & ~c16h & c8h & c4h & ~c2h & c1h;
assign err_bith[9] = ~c32h & ~c16h & c8h & c4h & c2h & ~c1h;
assign err_bith[10] = ~c32h & ~c16h & c8h & c4h & c2h & c1h;
assign err_bith[11] = ~c32h & c16h & ~c8h & ~c4h & ~c2h & c1h;
assign err_bith[12] = ~c32h & c16h & ~c8h & ~c4h & c2h & ~c1h;
assign err_bith[13] = ~c32h & c16h & ~c8h & ~c4h & c2h & c1h;
assign err_bith[14] = ~c32h & c16h & ~c8h & c4h & ~c2h & ~c1h;
assign err_bith[15] = ~c32h & c16h & ~c8h & c4h & ~c2h & c1h;
assign err_bith[16] = ~c32h & c16h & ~c8h & c4h & c2h & ~c1h;
assign err_bith[17] = ~c32h & c16h & ~c8h & c4h & c2h & c1h;
assign err_bith[18] = ~c32h & c16h & c8h & ~c4h & ~c2h & ~c1h;
assign err_bith[19] = ~c32h & c16h & c8h & ~c4h & ~c2h & c1h;
assign err_bith[20] = ~c32h & c16h & c8h & ~c4h & c2h & ~c1h;
assign err_bith[21] = ~c32h & c16h & c8h & ~c4h & c2h & c1h;
assign err_bith[22] = ~c32h & c16h & c8h & c4h & ~c2h & ~c1h;
assign err_bith[23] = ~c32h & c16h & c8h & c4h & ~c2h & c1h;
assign err_bith[24] = ~c32h & c16h & c8h & c4h & c2h & ~c1h;
assign err_bith[25] = ~c32h & c16h & c8h & c4h & c2h & c1h;
assign err_bith[26] = c32h & ~c16h & ~c8h & ~c4h & ~c2h & c1h;
assign err_bith[27] = c32h & ~c16h & ~c8h & ~c4h & c2h & ~c1h;
assign err_bith[28] = c32h & ~c16h & ~c8h & ~c4h & c2h & c1h;
assign err_bith[29] = c32h & ~c16h & ~c8h & c4h & ~c2h & ~c1h;
assign err_bith[30] = c32h & ~c16h & ~c8h & c4h & ~c2h & c1h;
assign err_bith[31] = c32h & ~c16h & ~c8h & c4h & c2h & ~c1h;
assign cecc_err = cecc_errl | cecc_errh;
assign uecc_err = uecc_errl | uecc_errh;
assign stb_cparity = mbi_run ? mbi_wdata_b3 : (sbc_twocycle_inst_w ? stb_cparity_w : stb_cparity_calc);
// Store cam parity for a cycle for the STD case
lsu_sec_ctl_msff_ctl_macro__width_1 dff_cparity (
.scan_in(dff_cparity_scanin),
.scan_out(dff_cparity_scanout),
assign st_sz_dw_m = sbc_st_sz_m[1] & sbc_st_sz_m[0];
assign st_sz_word_m = sbc_st_sz_m[1] & ~sbc_st_sz_m[0];
assign st_sz_hw_m = ~sbc_st_sz_m[1] & sbc_st_sz_m[0];
assign st_sz_byte_m = ~sbc_st_sz_m[1] & ~sbc_st_sz_m[0];
assign st_sz_dw_std_le_m = st_sz_dw_m & sbc_std_le_m;
assign st_sz_dw_le_not_ie_m = st_sz_dw_m & ~sbc_std_le_m & sbc_st_le_not_ie_m;
assign st_sz_dw_be_not_ie_m = st_sz_dw_m & ~sbc_std_le_m & ~sbc_st_le_not_ie_m;
assign st_sz_word_le_not_ie_m = st_sz_word_m & sbc_st_le_not_ie_m;
assign st_sz_word_be_not_ie_m = st_sz_word_m & ~sbc_st_le_not_ie_m;
assign st_sz_hw_le_not_ie_m = st_sz_hw_m & sbc_st_le_not_ie_m;
assign st_sz_hw_be_not_ie_m = st_sz_hw_m & ~sbc_st_le_not_ie_m;
assign st_sz_dw_le_if_ie_m = st_sz_dw_m & ~sbc_std_le_m & sbc_st_le_if_ie_m;
assign st_sz_dw_be_if_ie_m = st_sz_dw_m & ~sbc_std_le_m & ~sbc_st_le_if_ie_m;
assign st_sz_word_le_if_ie_m = st_sz_word_m & sbc_st_le_if_ie_m;
assign st_sz_word_be_if_ie_m = st_sz_word_m & ~sbc_st_le_if_ie_m;
assign st_sz_hw_le_if_ie_m = st_sz_hw_m & sbc_st_le_if_ie_m;
assign st_sz_hw_be_if_ie_m = st_sz_hw_m & ~sbc_st_le_if_ie_m;
lsu_sec_ctl_msff_ctl_macro__width_14 dff_st_sz (
.scan_in(dff_st_sz_scanin),
.scan_out(dff_st_sz_scanout),
.din ({ st_sz_dw_std_le_m, st_sz_dw_le_not_ie_m, st_sz_dw_be_not_ie_m,
st_sz_word_le_not_ie_m, st_sz_word_be_not_ie_m, st_sz_hw_le_not_ie_m,
st_sz_hw_be_not_ie_m, st_sz_dw_le_if_ie_m, st_sz_dw_be_if_ie_m,
st_sz_word_le_if_ie_m, st_sz_word_be_if_ie_m, st_sz_hw_le_if_ie_m,
st_sz_hw_be_if_ie_m, st_sz_byte_m}),
.dout ({sec_st_sz_dw_std_le_b, sec_st_sz_dw_le_not_ie_b, sec_st_sz_dw_be_not_ie_b,
sec_st_sz_word_le_not_ie_b,sec_st_sz_word_be_not_ie_b,sec_st_sz_hw_le_not_ie_b,
sec_st_sz_hw_be_not_ie_b, sec_st_sz_dw_le_if_ie_b, sec_st_sz_dw_be_if_ie_b,
sec_st_sz_word_le_if_ie_b, sec_st_sz_word_be_if_ie_b, sec_st_sz_hw_le_if_ie_b,
sec_st_sz_hw_be_if_ie_b, sec_st_sz_byte_b}),
lsu_sec_ctl_spare_ctl_macro__num_1 spares (
.scan_out(spares_scanout),
assign dff_cparity_scanin = scan_in ;
assign dff_st_sz_scanin = dff_cparity_scanout ;
assign spares_scanin = dff_st_sz_scanout ;
assign scan_out = spares_scanout ;
// any PARAMS parms go into naming of macro
module lsu_sec_ctl_l1clkhdr_ctl_macro (
// any PARAMS parms go into naming of macro
module lsu_sec_ctl_msff_ctl_macro__width_1 (
assign fdin[0:0] = din[0:0];
// any PARAMS parms go into naming of macro
module lsu_sec_ctl_msff_ctl_macro__width_14 (
assign fdin[13:0] = din[13:0];
.so({so[12:0],scan_out}),
// 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 lsu_sec_ctl_spare_ctl_macro__num_1 (
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;
cl_sc1_msff_8x spare0_flop (.l1clk(l1clk),
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));