// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: fsr_lib.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 ============================================
module wiz6c2a8n6d2t ( amux, fdo, rd0, rd1, rd2, rd3, rd4, rd5,
rdll0, rdll1, rdll2, rdll3, rdll4, rdll5,
rxbclk, rxbclklln, rxbclkllp,
stsrx0, stsrx1, stsrx2, stsrx3, stsrx4, stsrx5,
ststx0, ststx1, // STSTX2, STSTX3,
txn0, txn1, // TXN2, TXN3,
txp0, txp1, // TXP2, TXP3,
cfgrx0, cfgrx1, cfgrx2, cfgrx3, cfgrx4, cfgrx5,
cfgtx0, cfgtx1, // CFGTX2, CFGTX3,
fclk, fclrz, fdi, refclkn, refclkp, rxbclkin,
rxn0, rxn1, rxn2, rxn3, rxn4, rxn5,
rxp0, rxp1, rxp2, rxp3, rxp4, rxp5,
testcfg, testclkr, testclkt, txbclkin,
atpgmd, atpgmq, atpgrd, atpgrq, atpgtd, atpgtq,
vdd, vdda, vddd, vddr, vddt, vss, vssa );
txn0, txn1, // TXN2, TXN3,
txp0, txp1 //, TXP2, TXP3
input bsinitclk, fclk, fclrz, fdi, refclkn, refclkp,
rxn0, rxn1, rxn2, rxn3, rxn4, rxn5,
rxp0, rxp1, rxp2, rxp3, rxp4, rxp5,
stciclk, stcid, testclkr, testclkt,
vdd, vdda, vddd, vddr, vddt, vss, vssa;
output [11:0] rd4; // added
output [11:0] rd5; // added
output [1:0] rdll4; // added
output [1:0] rdll5; // added
output [7:0] stsrx4; // added
output [7:0] stsrx5; // added
output [5:0] rxbclk; // added 5:4
output [1:0] txbclk; // deleted 3:2
output [5:0] rxbclklln; // added 5:4
output [5:0] rxbclkllp; // added 5:4
input [27:0] cfgrx4; // added
input [27:0] cfgrx5; // added
input [1:0] txbclkin; // deleted 3:2
input [5:0] rxbclkin; // added 5:4
wire [7:0] pll_lock_cnt_in, pll_lock_cnt;
assign stspll = {3'b000, pll_lock};
assign siclk = `CPU.tcu_aclk & `CPU.tcu_mcu_testmode;
assign soclk = `CPU.tcu_bclk & `CPU.tcu_mcu_testmode;
assign pce_ov = `CPU.tcu_pce_ov;
assign se = `CPU.tcu_scan_en & `CPU.tcu_mcu_testmode;
assign atpgrq[5:0] = atpgrd[5:0];
assign atpgtq[1:0] = atpgtd[1:0];
assign pll_lock = pll_lock_cnt[7:0] == 8'hff;
assign pll_lock_cnt_in[7:0] = pll_lock & cfgpll[0] ? 8'hff : cfgpll[0] ? pll_lock_cnt[7:0] + 8'h1 : 8'h0;
dff #(8) ff_pll_lock_cnt (
.d(pll_lock_cnt_in[7:0]),
.rxbclklln (rxbclklln[0]),
.rxbclkllp (rxbclkllp[0]),
.rxbclklln (rxbclklln[1]),
.rxbclkllp (rxbclkllp[1]),
.rxbclklln (rxbclklln[2]),
.rxbclkllp (rxbclkllp[2]),
.rxbclklln (rxbclklln[3]),
.rxbclkllp (rxbclkllp[3]),
.rxbclklln (rxbclklln[4]),
.rxbclkllp (rxbclkllp[4]),
.rxbclklln (rxbclklln[5]),
.rxbclkllp (rxbclkllp[5]),
// Created from the WIZ6C2B8N6DX schematic view,
// NETLIST TIME: Nov 22 14:38:43 2004
module wiz6c2b8n6d2t ( amux, fdo, rd0, rd1, rd2, rd3, rdll0, rdll1, rdll2, rdll3, rxbclk, rxbclklln,
rxbclkllp, stciq, stspll, stsrx0, stsrx1, stsrx2, stsrx3, ststx0, ststx1,
txn0, txn1, txn2, txn3, txp0, txp1, txp2, txp3, bsinitclk, cfgpll, cfgrx0,
cfgrx1, cfgrx2, cfgrx3, cfgtx0, cfgtx1, cfgtx2, cfgtx3, fclk, fclrz, fdi,
refclkn, refclkp, rxbclkin, rxn0, rxn1, rxn2,
rxn3, rxp0, rxp1, rxp2, rxp3, stcicfg, stciclk, stcid, td0, td1, td2, td3,
testcfg, testclkr, testclkt, txbclkin,
atpgmd, atpgmq, atpgrd, atpgrq, atpgtd, atpgtq,
vdd, vdda, vddd, vddr, vddt, vss, vssa );
output amux, fdo, stciq, txn0, txn1, txn2, txn3, txp0, txp1, txp2, txp3;
input bsinitclk, fclk, fclrz, fdi, refclkn, refclkp, rxn0, rxn1, rxn2, rxn3, rxp0, rxp1, rxp2, rxp3, stciclk, stcid, testclkr, testclkt, vdd, vdda, vddd, vddr, vddt, vss, vssa;
wire [7:0] pll_lock_cnt_in, pll_lock_cnt;
assign stspll = {3'b000,pll_lock};
assign siclk = `CPU.tcu_aclk & `CPU.tcu_mcu_testmode;
assign soclk = `CPU.tcu_bclk & `CPU.tcu_mcu_testmode;
assign pce_ov = `CPU.tcu_pce_ov;
assign se = `CPU.tcu_scan_en & `CPU.tcu_mcu_testmode;
assign atpgrq[3:0] = atpgrd[3:0];
assign atpgtq[3:0] = atpgtd[3:0];
assign pll_lock = pll_lock_cnt[7:0] == 8'hff;
assign pll_lock_cnt_in[7:0] = pll_lock & cfgpll[0] ? 8'hff : cfgpll[0] ? pll_lock_cnt[7:0] + 8'h1 : 8'h0;
dff #(8) ff_pll_lock_cnt (
.d(pll_lock_cnt_in[7:0]),
.rxbclklln (rxbclklln[0]),
.rxbclkllp (rxbclkllp[0]),
.rxbclklln (rxbclklln[1]),
.rxbclkllp (rxbclkllp[1]),
.rxbclklln (rxbclklln[2]),
.rxbclkllp (rxbclkllp[2]),
.rxbclklln (rxbclklln[3]),
.rxbclkllp (rxbclkllp[3]),
wire ff_match_ptr_scanin;
wire ff_match_ptr_scanout;
wire [2:0] match_ptr_plus_4;
wire [2:0] match_ptr_plus_1;
assign stsrx[7:0] = {4'h0, elect_idle, 1'b0, sync & cfgrx[0], 1'b0};
assign elect_idle = ~rxp & ~rxn & cfgrx[0];
assign pll_ck_l = ~pll_ck;
l1clkhdr_ctl_macro clkgen0 (
l1clkhdr_ctl_macro clkgen1 (
//assign l1clk_l = ~l1clk;
.scan_out(ff_sn0_scanout),
.scan_out(ff_sn1_scanout),
assign match_in = (match_even | match_odd) & (cfgrx[13:12] == 2'h1) ? match_odd & ~match_even : match;
msff_ctl_macro ff_match (
.scan_in(ff_match_scanin),
.scan_out(ff_match_scanout),
assign match_ptr_en = (match_even | match_odd) & (cfgrx[13:12] == 2'h1);
msff_ctl_macro__en_1__width_3 ff_match_ptr (
.scan_in(ff_match_ptr_scanin),
.scan_out(ff_match_ptr_scanout),
assign rd_in[11:0] = {12{cfgrx[0]}} & (match ? nb_data[11:0] : nb_data[12:1]);
assign rd_en = cnt[2:0] == match_ptr[2:0];
msff_ctl_macro__en_1__width_12 ff_rd (
.scan_out(ff_rd_scanout),
assign rd[11:0] = {rd_rev[0],rd_rev[1],rd_rev[2],rd_rev[3],rd_rev[4],rd_rev[5],
rd_rev[6],rd_rev[7],rd_rev[8],rd_rev[9],rd_rev[10],rd_rev[11]};
assign nb_data_in[12:0] = {sn0,sn1,nb_data[12:2]};
msff_ctl_macro__width_13 ff_nb_data (
.scan_in(ff_nb_data_scanin),
.scan_out(ff_nb_data_scanout),
assign match_odd = nb_data[11:0] == 12'hbfe;
assign match_even = nb_data[12:1] == 12'hbfe;
assign cnt_in[2:0] = cnt[2:0] == 3'h5 ? 3'h0 : cnt[2:0] + 3'h1;
msff_ctl_macro__width_3 ff_cnt (
.scan_out(ff_cnt_scanout),
assign rxbclk_in = cfgrx[0] & ((cnt[2:0] == match_ptr_plus_4[2:0]) ? 1'b0 : (cnt[2:0] == match_ptr_plus_1[2:0]) ? 1'b1 : rxbclk);
msff_ctl_macro ff_rxbclk (
.scan_in(ff_rxbclk_scanin),
.scan_out(ff_rxbclk_scanout),
assign match_ptr_plus_4[2:0] = match_ptr[2:0] == 3'h0 ? 3'h4 :
match_ptr[2:0] == 3'h1 ? 3'h5 :
match_ptr[2:0] == 3'h2 ? 3'h0 :
match_ptr[2:0] == 3'h3 ? 3'h1 :
match_ptr[2:0] == 3'h4 ? 3'h2 :
match_ptr[2:0] == 3'h5 ? 3'h3 : 3'h0;
assign match_ptr_plus_1[2:0] = match_ptr[2:0] == 3'h0 ? 3'h1 :
match_ptr[2:0] == 3'h1 ? 3'h2 :
match_ptr[2:0] == 3'h2 ? 3'h3 :
match_ptr[2:0] == 3'h3 ? 3'h4 :
match_ptr[2:0] == 3'h4 ? 3'h5 :
match_ptr[2:0] == 3'h5 ? 3'h0 : 3'h0;
assign sync_en = (match_ptr[2:0] == cnt[2:0]) & (cfgrx[13:12] == 2'h1);
msff_ctl_macro__en_1 ff_sync (
.scan_in(ff_sync_scanin),
.scan_out(ff_sync_scanout),
assign ff_sn0_scanin = scan_in ;
assign ff_sn1_scanin = ff_sn0_scanout ;
assign ff_match_scanin = ff_sn1_scanout ;
assign ff_match_ptr_scanin = ff_match_scanout ;
assign ff_rd_scanin = ff_match_ptr_scanout ;
assign ff_nb_data_scanin = ff_rd_scanout ;
assign ff_cnt_scanin = ff_nb_data_scanout ;
assign ff_rxbclk_scanin = ff_cnt_scanout ;
assign ff_sync_scanin = ff_rxbclk_scanout ;
assign scan_out = ff_sync_scanout ;
wire ff_td_sync_in_scanin;
wire ff_td_sync_in_scanout;
assign ststx[3:0] = 4'h0;
l1clkhdr_ctl_macro clkgen (
assign td_rev[11:0] = {td[0],td[1],td[2],td[3],td[4],td[5],td[6],td[7],td[8],td[9],td[10],td[11]};
msff_ctl_macro__width_12 ff_td_reg (
.scan_in(ff_td_reg_scanin),
.scan_out(ff_td_reg_scanout),
assign td_sync_en = cnt[2:0] == 3'h4;
msff_ctl_macro__en_1__width_12 ff_td_sync_in (
.scan_in(ff_td_sync_in_scanin),
.scan_out(ff_td_sync_in_scanout),
msff_ctl_macro__width_12 ff_td_sync (
.scan_in(ff_td_sync_scanin),
.scan_out(ff_td_sync_scanout),
assign cnt_in[2:0] = cnt[2:0] == 3'h5 ? 3'h0 : cnt[2:0] + 3'h1;
msff_ctl_macro__width_3 ff_cnt (
.scan_out(ff_cnt_scanout),
assign txp_out = cnt[2:0] == 3'h0 ? td_sync[0] & pll_ck | td_sync[1] & ~pll_ck :
cnt[2:0] == 3'h1 ? td_sync[2] & pll_ck | td_sync[3] & ~pll_ck :
cnt[2:0] == 3'h2 ? td_sync[4] & pll_ck | td_sync[5] & ~pll_ck :
cnt[2:0] == 3'h3 ? td_sync[6] & pll_ck | td_sync[7] & ~pll_ck :
cnt[2:0] == 3'h4 ? td_sync[8] & pll_ck | td_sync[9] & ~pll_ck :
cnt[2:0] == 3'h5 ? td_sync[10] & pll_ck | td_sync[11] & ~pll_ck : 1'b0;
assign txp = ~cfgtx[18] & cfgtx[0] & txp_out;
assign txn = ~cfgtx[18] & cfgtx[0] & ~txp_out;
assign ff_td_reg_scanin = scan_in ;
assign ff_td_sync_in_scanin = ff_td_reg_scanout ;
assign ff_td_sync_scanin = ff_td_sync_in_scanout ;
assign ff_cnt_scanin = ff_td_sync_scanout ;
assign scan_out = ff_cnt_scanout ;
module l1clkhdr_ctl_macro (
// any PARAMS parms go into naming of macro
assign fdin[0:0] = din[0:0];
// any PARAMS parms go into naming of macro
module msff_ctl_macro__en_1__width_3 (
assign fdin[2:0] = (din[2:0] & {3{en}}) | (dout[2:0] & ~{3{en}});
// any PARAMS parms go into naming of macro
module msff_ctl_macro__width_13 (
assign fdin[12:0] = din[12:0];
.so({so[11:0],scan_out}),
// any PARAMS parms go into naming of macro
module msff_ctl_macro__en_1 (
assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}});
// any PARAMS parms go into naming of macro
module msff_ctl_macro__width_12 (
assign fdin[11:0] = din[11:0];
.so({so[10:0],scan_out}),
// any PARAMS parms go into naming of macro
module msff_ctl_macro__en_1__width_12 (
assign fdin[11:0] = (din[11:0] & {12{en}}) | (dout[11:0] & ~{12{en}});
.so({so[10:0],scan_out}),
// any PARAMS parms go into naming of macro
module msff_ctl_macro__width_3 (
assign fdin[2:0] = din[2:0];