// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: lsu_tld_dp.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,
wire [12:0] context_to_write;
wire [2:0] partition_id1;
wire [51:0] tte2_lat_out;
wire [2:0] partition_id2;
wire [68:0] access_tag_m;
wire [68:0] tag_to_demap_d;
wire [68:0] tag_to_write;
wire test_data_mux_scanin;
wire test_data_mux_scanout;
wire tld_mbi_cambist_run;
wire [51:0] tag_for_parity;
wire tag_parity_unmasked;
wire tag_parity_unmasked_;
input tcu_se_scancollar_in;
input [47:0] exu_lsu_address_e; // E->M flop is in this dp
input [55:13] default_tag;
// The following signals indicate the
// first cycle of TTE transfer as well
// as the operation (write or demap)
input tlc_sel_wr_dm_bist;
input tlc_data_error_inj;
// First cycle of transfer
// (part of tag, data, controls)
// 46 Demap / repl sec. cxt
// 44:43 Demap / context type
// Second cycle of transfer
input [1:0] mbi_demap_type;
output tld_mbi_dtb_write_en;
output tld_mbi_repl_write;
output tld_mbi_dis_clr_ubit;
output tld_mbi_dtb_demap_en;
output [1:0] tld_mbi_demap_type;
output [2:0] tld_tag_pid;
output [12:0] tld_tag_c0;
output [12:0] tld_tag_c1;
output [2:0] tld_tag_mask;
output [2:0] tld_demap_control0;
output [3:0] tld_demap_control1;
output tld_use_secondary_context0;
output [6:0] tld_rw_index;
output [47:0] lsu_mmu_va_m;
output [47:13] lsu_exu_address_e;
lsu_tld_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_4 test_rep0 (
.din ({tcu_scan_en,tcu_pce_ov,spc_aclk,spc_bclk}),
.dout({se,pce_ov,siclk,soclk})
///////////////////////////////////////////////////////////////////////////////
lsu_tld_dp_msff_macro__stack_70c__width_55 tte0_lat (
.scan_in(tte0_lat_scanin),
.scan_out(tte0_lat_scanout),
// Mux context for write tag
lsu_tld_dp_mux_macro__mux_aope__ports_2__stack_70c__width_13 context_to_write_mux (
.din0 (tgd_tag_c0 [12:0] ),
.dout (context_to_write [12:0] )
assign tld_use_secondary_context0 =
lsu_tld_dp_msff_macro__stack_70c__width_55 tte1_lat (
.scan_in(tte1_lat_scanin),
.scan_out(tte1_lat_scanout),
.din ({tte0 [54:13], context_to_write[12:0]}),
// If a write will happen next cycle, flop the tte tag for write.
// Otherwise, flop the tag that was just used for lookup.
lsu_tld_dp_msff_macro__mux_aope__ports_2__stack_70c__width_52 tte2_lat (
.scan_in(tte2_lat_scanin),
.scan_out(tte2_lat_scanout),
.din0 ({tte1[54:47],partition_id1[2:0],tte1[42:38],1'b1,1'b0,tte1[34:7],tte1[5:0]}),
.din1 ({tld_tag_pid[2:0],tld_tag_real,12'b0,1'b0,1'b1,7'b0,tgd_tag_c1[12:0],tgd_tag_c0[12:0],1'b0}),
.dout (tte2_lat_out[51:0]),
assign {tte2[54:47],partition_id2[2:0],tte2[42:38],wrdata_sel,wrdata_sel_,tte2[34:7],tte2[5:0]} = tte2_lat_out[51:0];
assign {access_tag_m[68:56], access_tag_m[12:0]} = tte2_lat_out[26:1];
assign access_tag_m[55:52] = tte2_lat_out[51:48];
///////////////////////////TTE tag///////////////////////////////////////////////
assign partition_id1[2:0] = default_tag[55:53];
// Now build tag for the two cycles
// Demap with specified context
assign tag_to_demap_d[68:0] =
partition_id1 [2:0], // PID
tte0 [47:28], // VA[47:28]
tte0 [27:22], // VA[27:22]
tte0 [18:13], // VA[21:16]
tte1 [41:39], // VA[15:13]
tte0 [12:0]}; // Context[12:00]
// Write with muxed context
assign tag_to_write[68:0] =
partition_id2 [2:0], // PID
tte1 [47:28], // VA[47:28]
tte1 [27:22], // VA[27:22]
tte1 [18:13], // VA[21:16]
tte2 [41:39], // VA[15:13]
tte1 [12:0] // Context[12:00]
lsu_tld_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_8 buf_mbi_wdata (
// Page mask and real bits must be zero for bist to avoid masking lower address and context bits.
assign mbist_wdata[69:0] = { bist_data_0[0], // U
bist_data_0[7:0],bist_data_0[7:3], // [68:56]
bist_data_0[4:2], // [55:53]
bist_data_0[0],{3{bist_data_0[7:0]}},bist_data_0[7], // [51:26]
bist_data_0[6:0], // [24:18]
bist_data_0[7:5], // [16:14]
bist_data_0[4:0],bist_data_0[7:0]}; // [12:0]
// Key to CAMBIST match/write data
// [0] = other [4] = Valid
// [2] = Context1 [6] = Used
lsu_tld_dp_msff_macro__mux_aope__ports_4__stack_70c__width_70 test_data_mux (
.scan_in(test_data_mux_scanin),
.scan_out(test_data_mux_scanout),
.din0 ({13'b0,1'b1,55'b0,1'b1}),
bist_wdata[54:26],bist_wdata[23],
bist_wdata[22:18],bist_wdata[16],
bist_wdata[15:14],bist_wdata[12],
bist_wdata[11:0],1'b0}), // CAMBIST shift data
.din2 ({bist_data_0[6],{13{bist_data_0[2]}},{3{bist_data_0[1]}},bist_data_0[5],
{26{bist_data_0[0]}},1'b0,bist_data_0[4],{6{bist_data_0[0]}},
1'b0,{3{bist_data_0[0]}},1'b0,{13{bist_data_0[3]}}}
), // CAMBIST match/write data
.din3 (mbist_wdata[69:0]), // MEMBIST data
.sel0 (mbi_init_to_zero),
.sel1 (mbi_cambist_shift),
.sel2 (tld_mbi_cambist_run),
.dout (bist_wdata[69:0]),
// tte_tag pin ordering is, from left of CAM to right of CAM
// Used Valid Context0[12:0] Context1[12:0] Real VA[27:13] VA[47:28] PID[2:0]
// Valid and context are muxed one way. The context result of this mux will be muxed later
// with the stored context values. This mux sits above the tlb, that mux sits below in
lsu_tld_dp_mux_macro__mux_aonpe__ports_3__stack_28l__width_28 mx_tag0_d (
.din0 ({bist_wdata[69], bist_wdata [24],bist_wdata [12:0],bist_wdata [68:56] }),
.din1 ({ 1'b1, tag_to_write [24],tag_to_write [12:0],tag_to_write [68:56] }),
.din2 ({ 1'b1, tag_to_demap_d[24],tag_to_demap_d[12:0],tag_to_demap_d[68:56] }),
.sel1 (tlc_sel_write_tag ),
lsu_tld_dp_buff_macro__width_28 tag0_buf (
.dout ({tld_ubit, tld_tag_valid,tld_tag_c0 [12:0],tld_tag_c1 [12:0] })
// VA/PID/Real bit are muxed differently. I use two levels of muxing to keep
// the delay for the exu address path to a minimum.
lsu_tld_dp_mux_macro__mux_aonpe__ports_3__stack_42l__width_42 mx_tag1_d (
.din0 ({bist_wdata [52],bist_wdata [31:25],bist_wdata [23:13],bist_wdata [51:32],bist_wdata [55:53] }),
.din1 ({tag_to_write [52],tag_to_write [31:25],tag_to_write [23:13],tag_to_write [51:32],tag_to_write [55:53] }),
.din2 ({tag_to_demap_d[52],tag_to_demap_d[31:25],tag_to_demap_d[23:13],tag_to_demap_d[51:32],tag_to_demap_d[55:53] }),
.sel1 (tlc_sel_write_tag ),
.dout ({tld_tag_0 [52],tld_tag_0 [31:25],tld_tag_0 [23:13],tld_tag_0 [51:32],tld_tag_0 [55:53] })
lsu_tld_dp_buff_macro__dbuff_32x__stack_none__width_35 exu_addr_buf (
.din ({tld_tag_0[51:26],tld_tag_0[23:18],tld_tag_0[16:14]}),
.dout (lsu_exu_address_e[47:13])
// R 27_22_V 21_16_V 15_13_V PID
lsu_tld_dp_mux_macro__mux_pgpe__ports_2__stack_42r__width_7 mx_tag2_d (
.din0 ({tld_tag_0 [52],tld_tag_0 [25],tld_tag_0 [17],tld_tag_0 [13],tld_tag_0 [55:53] }),
.din1 ({default_tag [52],default_tag[25],default_tag[17],default_tag[13],default_tag[55:53] }),
.sel0 (tlc_sel_wr_dm_bist ),
.dout ({tld_tag_real ,tld_tag_mask[2],tld_tag_mask[1],tld_tag_mask[0],tld_tag_pid[2:0] })
assign default_unused=default_tag[24];
lsu_tld_dp_mux_macro__mux_aope__ports_3__stack_8l__width_7 mx_index (
.din0 (tld_mbi_addr[6:0] ),
.din2 (exu_lsu_address_e[9:3] ),
.sel1 (tlc_sel_write_tag ),
.dout (tld_rw_index[6:0] )
///////////////////////////////////////////////
// Parity generation for tte_tag
///////////////////////////////////////////////
// Mask the appropriate address/context bits based on page size and RA or VA trans type.
lsu_tld_dp_inv_macro__width_3 pg_mask_va (
.din ({tag_to_write[25],tag_to_write[17],tag_to_write[13]}),
.dout ({mask_va_27_22_, mask_va_21_16_, mask_va_15_13_})
lsu_tld_dp_inv_macro__width_1 pg_mask_ctxt (
lsu_tld_dp_and_macro__ports_2__stack_28l__width_28 mask_tag (
.din0 ({tag_to_write[31:26],
.din1 ({{6{mask_va_27_22_}},
.dout ({masked_va[27:22],
lsu_tld_dp_mux_macro__left_6__mux_aonpe__ports_2__stack_70c__width_52 parity_mux (
.din0 ({tag_to_write[55:53],
.din1 ({access_tag_m[55:53],
.dout ({tag_for_parity[51:0]})
lsu_tld_dp_prty_macro__width_32 tag_pgen0 (
.din ({tlc_tag_error_inj,1'b0,tag_for_parity[51:28],6'b0}),
.dout (tag_parity_unmasked)
lsu_tld_dp_prty_macro__width_32 tag_pgen1 (
.din ({2'b0,tag_for_parity[27:0],2'b0}),
.dout (tag_parity_masked)
lsu_tld_dp_inv_macro__width_2 inv_tag_par (
.din ({tag_parity_unmasked ,tag_parity_masked}),
.dout ({tag_parity_unmasked_,tag_parity_masked_})
lsu_tld_dp_xor_macro__ports_2__width_1 pgen_tag (
.din0 (tag_parity_unmasked_),
.din1 (tag_parity_masked_),
// Additional logic needed to complete parity detection.
// tag_parity_unmasked is valid for all page sizes (it's complete for 256m)
// tag_parity_masked represents the addtional parity for 8k pages
lsu_tld_dp_inv_macro__width_2 pgen_256m (
.din ({tag_parity_unmasked_,tag_parity_masked_}),
.dout ({prty_256m, prty_8k_lower})
lsu_tld_dp_prty_macro__width_8 pgen_va_27_22 (
.din ({va_m[27:22],2'b00}),
lsu_tld_dp_xor_macro__ports_2__width_1 pgen_4m (
lsu_tld_dp_prty_macro__width_16 pgen_va_27_16 (
.din ({va_m[27:22],4'b0000,va_m[21:16]}),
lsu_tld_dp_xor_macro__ports_2__width_1 pgen_64k (
lsu_tld_dp_xor_macro__ports_2__width_1 pgen_8k (
lsu_tld_dp_prty_macro__width_16 pgen_ctxt0 (
.din ({access_tag_m[12:0],3'b000}),
lsu_tld_dp_prty_macro__width_16 pgen_ctxt1 (
.din ({3'b000,access_tag_m[68:56]}),
lsu_tld_dp_buff_macro__width_6 prty_buf (
.din ({ prty_256m, prty_4m, prty_64k, prty_8k, prty_ctxt1, prty_ctxt0}),
.dout ({tld_prty_256m,tld_prty_4m,tld_prty_64k,tld_prty_8k,tld_prty_ctxt1,tld_prty_ctxt0})
///////////////////////////TTE data////////////////////////////////////////////
// Data is only needed for write, so only need a mux for bist
{data_parity , // Data Parity
tte2 [33:22], // PA[39:28]
tte2 [21:16], // PA[27:22]
tte1 [21 ], // 27_22_V, PS_EQ_256M
tte2 [15:10], // PA[21:16]
tte2 [42 ], // 21_16_V, PS_GT_64K
tte2 [38 ], // 15_13_V, PS_GT_8K
tte2 [5:0] // NFO, IE, CP, E, P, W
lsu_tld_dp_mux_macro__mux_aope__ports_3__stack_20r__width_19 mx_data_odd (
.din0 ({16'b0,tld_mbi_addr[5],tld_mbi_addr[3],tld_mbi_addr[1]}),
.din1 ({bist_data_1[5],bist_data_1[3],bist_data_1[1],{4{bist_data_1[7],bist_data_1[5],bist_data_1[3],bist_data_1[1]}}}),
.din2 ({ tag_parity ,wr_data[35],wr_data[33],wr_data[31],
wr_data[29],wr_data[27],wr_data[25],wr_data[23],wr_data[21],
wr_data[19],wr_data[17],wr_data[15],wr_data[13],wr_data[11],
wr_data[9],wr_data[7],wr_data[5],wr_data[3],wr_data[1]}),
.sel0 (tld_mbi_cambist_run),
.dout ({ tld_data[37],tld_data[35],tld_data[33],tld_data[31],
tld_data[29],tld_data[27],tld_data[25],tld_data[23],tld_data[21],
tld_data[19],tld_data[17],tld_data[15],tld_data[13],tld_data[11],
tld_data[9],tld_data[7],tld_data[5],tld_data[3],tld_data[1]})
lsu_tld_dp_mux_macro__mux_aope__ports_3__stack_20r__width_19 mx_data_even (
.din0 ({15'b0,tld_mbi_addr[6],tld_mbi_addr[4],tld_mbi_addr[2],tld_mbi_addr[0]}),
.din1 ({bist_data_1[4],bist_data_1[2],bist_data_1[0],{4{bist_data_1[6],bist_data_1[4],bist_data_1[2],bist_data_1[0]}}}),
.din2 ({ wr_data[36],wr_data[34],wr_data[32],wr_data[30],
wr_data[28],wr_data[26],wr_data[24],wr_data[22],wr_data[20],
wr_data[18],wr_data[16],wr_data[14],wr_data[12],wr_data[10],
wr_data[8],wr_data[6],wr_data[4],wr_data[2],wr_data[0]}),
.sel0 (tld_mbi_cambist_run),
.dout ({ tld_data[36],tld_data[34],tld_data[32],tld_data[30],
tld_data[28],tld_data[26],tld_data[24],tld_data[22],tld_data[20],
tld_data[18],tld_data[16],tld_data[14],tld_data[12],tld_data[10],
tld_data[8],tld_data[6],tld_data[4],tld_data[2],tld_data[0]})
lsu_tld_dp_prty_macro__width_16 dprty0 (
.din ({tlc_data_error_inj,wr_data[10],wr_data[7:6],1'b0,wr_data[35:25]}),
lsu_tld_dp_prty_macro__width_16 dprty1 (
.din ({wr_data[24],wr_data[17],wr_data[23:18],wr_data[16:11],wr_data[9:8]}),
lsu_tld_dp_prty_macro__width_8 dprty2 (
.din ({wr_data[5:0],data_parity_0,data_parity_1}),
assign tld_demap_control0[2:0] =
assign tld_demap_control1[3:0] =
////////////////////////////////////////////////////////////////////
// VA staging from E to M - it's located here for floorplan reasons
lsu_tld_dp_msff_macro__stack_48c__width_48 va_m_lat (
.scan_in(va_m_lat_scanin),
.scan_out(va_m_lat_scanout),
.se (tcu_se_scancollar_in),
.din (exu_lsu_address_e[47:0]),
lsu_tld_dp_zero_macro__width_32 va_m_zdt (
lsu_tld_dp_buff_macro__rep_1__stack_48c__width_48 lsu_va_m_buf (
lsu_tld_dp_buff_macro__rep_1__stack_48c__width_48 lsu_mmu_va_m_buf (
.dout (lsu_mmu_va_m[47:0])
lsu_tld_dp_msff_macro__stack_22r__width_22 bist_lat (
.scan_in(bist_lat_scanin),
.scan_out(bist_lat_scanout),
.din ({bist_data_0[7:0], mbi_addr[6:0], mbi_dtb_write_en, mbi_cambist_run,
mbi_repl_write, mbi_dis_clr_ubit,
mbi_dtb_demap_en, mbi_demap_type[1:0]}),
.dout ({bist_data_1[7:0], tld_mbi_addr[6:0], tld_mbi_dtb_write_en, tld_mbi_cambist_run,
tld_mbi_repl_write, tld_mbi_dis_clr_ubit,
tld_mbi_dtb_demap_en,tld_mbi_demap_type[1:0]}),
assign tte0_lat_scanin = scan_in ;
assign tte1_lat_scanin = tte0_lat_scanout ;
assign tte2_lat_scanin = tte1_lat_scanout ;
assign test_data_mux_scanin = tte2_lat_scanout ;
assign va_m_lat_scanin = test_data_mux_scanout ;
assign bist_lat_scanin = va_m_lat_scanout ;
assign scan_out = bist_lat_scanout ;
module lsu_tld_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_4 (
// any PARAMS parms go into naming of macro
module lsu_tld_dp_msff_macro__stack_70c__width_55 (
.so({so[53:0],scan_out}),
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_aope__ports_2__stack_70c__width_13 (
// any PARAMS parms go into naming of macro
module lsu_tld_dp_msff_macro__mux_aope__ports_2__stack_70c__width_52 (
.so({so[50:0],scan_out}),
module lsu_tld_dp_buff_macro__dbuff_32x__rep_1__stack_none__width_8 (
// any PARAMS parms go into naming of macro
module lsu_tld_dp_msff_macro__mux_aope__ports_4__stack_70c__width_70 (
.so({so[68:0],scan_out}),
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_aonpe__ports_3__stack_28l__width_28 (
cl_dp1_muxbuff3_8x c0_0 (
module lsu_tld_dp_buff_macro__width_28 (
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_aonpe__ports_3__stack_42l__width_42 (
cl_dp1_muxbuff3_8x c0_0 (
module lsu_tld_dp_buff_macro__dbuff_32x__stack_none__width_35 (
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_pgpe__ports_2__stack_42r__width_7 (
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_aope__ports_3__stack_8l__width_7 (
module lsu_tld_dp_inv_macro__width_3 (
module lsu_tld_dp_inv_macro__width_1 (
// and macro for ports = 2,3,4
module lsu_tld_dp_and_macro__ports_2__stack_28l__width_28 (
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__left_6__mux_aonpe__ports_2__stack_70c__width_52 (
cl_dp1_muxbuff2_8x c0_0 (
// parity macro (even parity)
module lsu_tld_dp_prty_macro__width_32 (
module lsu_tld_dp_inv_macro__width_2 (
// xor macro for ports = 2,3
module lsu_tld_dp_xor_macro__ports_2__width_1 (
// parity macro (even parity)
module lsu_tld_dp_prty_macro__width_8 (
// parity macro (even parity)
module lsu_tld_dp_prty_macro__width_16 (
module lsu_tld_dp_buff_macro__width_6 (
// general mux macro for pass-gate and and-or muxes with/wout priority encoders
// also for pass-gate with decoder
// any PARAMS parms go into naming of macro
module lsu_tld_dp_mux_macro__mux_aope__ports_3__stack_20r__width_19 (
// any PARAMS parms go into naming of macro
module lsu_tld_dp_msff_macro__stack_48c__width_48 (
.so({so[46:0],scan_out}),
// comparator macro (output is 1 if both inputs are equal; 0 otherwise)
module lsu_tld_dp_zero_macro__width_32 (
module lsu_tld_dp_buff_macro__rep_1__stack_48c__width_48 (
// any PARAMS parms go into naming of macro
module lsu_tld_dp_msff_macro__stack_22r__width_22 (
.so({so[20:0],scan_out}),