// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: lsu_tlc_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 ============================================
tld_use_secondary_context0,
lsu_asi_error_inject_b31,
lsu_asi_error_inject_b27,
lsu_asi_error_inject_b26,
tlc_use_primary_context_c0,
tlc_use_secondary_context_c0,
wire reload0_latch_scanin;
wire reload0_latch_scanout;
wire reload1_latch_scanin;
wire reload1_latch_scanout;
wire sel_wr_dm_bist_next;
wire wr_vld_latch_scanin;
wire wr_vld_latch_scanout;
wire error_inj_latch_scanin;
wire error_inj_latch_scanout;
// The following signals indicate the
// first cycle of TTE transfer as well
// as the operation (write or demap)
input [2:0] tld_demap_control0; // Demap and context controls
input [3:0] tld_demap_control1; // Demap and context controls
input tld_use_secondary_context0;
input tld_index_valid; // Write with index
input lsu_lsu_pmen_; // Power management enable
input lsu_asi_error_inject_b31;
input lsu_asi_error_inject_b27;
input lsu_asi_error_inject_b26;
input dcc_tlb_rw_index_e;
input [1:0] mbi_demap_type;
output tlc_wr_u_en; // Write enable for tlb
output tlc_rw_index_vld; // Use index for read or write
output tlc_demap; // Any demap
output tlc_demap_context; // Demap context
output tlc_demap_all; // Demap all
output tlc_demap_real; // Demap real
output tlc_sel_demap_tag_c0;
output tlc_sel_demap_tag_c1;
output tlc_sel_write_tag;
output tlc_sel_wr_dm_bist;
output tlc_use_primary_context_c0;// Control context muxes
output tlc_use_secondary_context_c0;
output tlc_wr_or_demap; // Tells LSU to use the demap/write tid for context selection
output tlc_tag_error_inj;
output tlc_data_error_inj;
output lsu_sel_lsu_addr_e;
//////////////////////////////////////////////////////////////////////////////
assign pce_ov = tcu_pce_ov;
lsu_tlc_ctl_l1clkhdr_ctl_macro clkgen (
////////////////////////////////////////////////////////////////////////////////
lsu_tlc_ctl_msff_ctl_macro__width_1 reload0_latch (
.scan_in(reload0_latch_scanin),
.scan_out(reload0_latch_scanout),
lsu_tlc_ctl_msff_ctl_macro__width_1 reload1_latch (
.scan_in(reload1_latch_scanin),
.scan_out(reload1_latch_scanout),
// demap_control[3]: use secondary context for demap/write
// demap_control[2]: 1 means demap, 0 means write
// demap_control[1:0] (if demap_control[2] is 1)
// 10 Demap all (to be consistent with Niagara 1)
// demap_control[1:0] (if demap_control[2] is 0)
// 00 Demap and write with supplied context
// 01 Demap and write with context_0
// 10 Demap and write with context_1
// 11 Illegal (but demap and write with context_0)
reload1 & ~demap_c1[2] & ~tlc_mbi_run;
assign tlc_write_next = wr_vld_in;
assign sel_wr_dm_bist_next = wr_vld_in | reload0 | tlc_mbi_run;
assign dm_tag_in = ~(wr_vld_in | tlc_mbi_run);
lsu_tlc_ctl_msff_ctl_macro__width_3 wr_vld_latch (
.scan_in(wr_vld_latch_scanin),
.scan_out(wr_vld_latch_scanout),
.din ({wr_vld_in, dm_tag_in, sel_wr_dm_bist_next}),
.dout ({wr_vld, tlc_sel_dm_tag,tlc_sel_wr_dm_bist}),
assign lsu_sel_lsu_addr_e = tlc_sel_wr_dm_bist;
reload1 & demap_c1[2] & ~demap_c1[1] & demap_c1[0];
reload1 & demap_c1[2] & demap_c1[1] & ~demap_c1[0];
reload1 & demap_c1[2] & demap_c1[1] & demap_c1[0];
// demap default context if:
// a write with the use_context_[0,1] bits off OR
// a demap with use_seconday off
(reload1 & demap_c1[2] & ~demap_c1[3]) |
(reload1 & ~demap_c1[2] & ~demap_c1[1] & ~demap_c1[0]) ;
// a demap with use_secondary OR
// a write with use_context_0 on
assign tlc_sel_demap_tag_c0 =
(reload1 & demap_c1[2] & demap_c1[3]) |
(reload1 & ~demap_c1[2] & demap_c1[0]) ;
// demap context 1 if a write with use_context_1 on
assign tlc_sel_demap_tag_c1 =
(reload1 & ~demap_c1[2] & demap_c1[1] & ~demap_c1[0]) ;
assign tlc_sel_write_tag = wr_vld;
assign tlc_sel_tte_tag = wr_vld | sel_demap_tag_d | tlc_mbi_run;
assign override_context0 =
reload0 & ~demap_c0[2] & (demap_c0[1] | demap_c0[0]);
assign tlc_use_primary_context_c0 =
(override_context0 & ~tld_use_secondary_context0) |
(reload0 & demap_c0[2] & ~tld_use_secondary_context0) ;
assign tlc_use_secondary_context_c0 =
(override_context0 & tld_use_secondary_context0) |
(reload0 & demap_c0[2] & tld_use_secondary_context0) ;
assign tlc_demap = tlc_mbi_run ? (mbi_cambist_run & mbi_dtb_demap_en) : reload1;
assign tlc_demap_context = tlc_mbi_run ? (mbi_cambist_run & mbi_dtb_demap_en & (mbi_demap_type[1:0] == 2'b10)) : demap_context;
assign tlc_demap_all = tlc_mbi_run ? (mbi_cambist_run & mbi_dtb_demap_en & (mbi_demap_type[1:0] == 2'b11)) : demap_all;
assign tlc_demap_real = tlc_mbi_run ? (mbi_cambist_run & mbi_dtb_demap_en & (mbi_demap_type[1:0] == 2'b01)) : demap_real;
assign tlc_wr_u_en = tlc_mbi_run ? mbi_dtb_write_en : wr_vld;
assign tlc_rw_index_vld = (tlc_mbi_run ? ~mbi_repl_write : (dcc_tlb_rw_index_e | (wr_vld & tld_index_valid))) | lbist_run;
// This needs to be a cycle earlier than the tlb controls for timing
assign tlc_wr_or_demap = reload0 | wr_vld_in;
//////////////////////////////////
// Power mgmt for the datapath
assign tlc_tte0_clken = mmu_dtlb_reload | reload0 | lsu_lsu_pmen_;
assign tlc_tte1_clken = reload0 | reload1 | lsu_lsu_pmen_;
///////////////////////////////////
assign tag_error_inj = lsu_asi_error_inject_b31 & lsu_asi_error_inject_b26 & wr_vld_in;
assign data_error_inj = lsu_asi_error_inject_b31 & lsu_asi_error_inject_b27 & wr_vld_in;
lsu_tlc_ctl_msff_ctl_macro__width_2 error_inj_latch (
.scan_in(error_inj_latch_scanin),
.scan_out(error_inj_latch_scanout),
.din ({ tag_error_inj, data_error_inj }),
.dout ({tlc_tag_error_inj,tlc_data_error_inj }),
///////////////////////////////////
lsu_tlc_ctl_msff_ctl_macro__width_1 bist_latch (
.scan_in(bist_latch_scanin),
.scan_out(bist_latch_scanout),
assign tlc_dis_clr_ubit = tlc_mbi_run & mbi_dis_clr_ubit;
lsu_tlc_ctl_spare_ctl_macro__num_1 spares (
.scan_out(spares_scanout),
assign reload0_latch_scanin = scan_in ;
assign reload1_latch_scanin = reload0_latch_scanout ;
assign wr_vld_latch_scanin = reload1_latch_scanout ;
assign error_inj_latch_scanin = wr_vld_latch_scanout ;
assign bist_latch_scanin = error_inj_latch_scanout ;
assign spares_scanin = bist_latch_scanout ;
assign scan_out = spares_scanout ;
// any PARAMS parms go into naming of macro
module lsu_tlc_ctl_l1clkhdr_ctl_macro (
// any PARAMS parms go into naming of macro
module lsu_tlc_ctl_msff_ctl_macro__width_1 (
assign fdin[0:0] = din[0:0];
// any PARAMS parms go into naming of macro
module lsu_tlc_ctl_msff_ctl_macro__width_3 (
assign fdin[2:0] = din[2:0];
// any PARAMS parms go into naming of macro
module lsu_tlc_ctl_msff_ctl_macro__width_2 (
assign fdin[1:0] = din[1:0];
// 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_tlc_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));