// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: dmu_ilu_iil_parchk.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 dmu_ilu_iil_parchk (
// >>>>>>>>>>>>>>>>>>>>>>>>> Port Declarations <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//---------------------------------------------------------------------
// Clock and Reset Signals
//---------------------------------------------------------------------
input clk; // input clock
input rst_l; // synchronous reset
//---------------------------------------------------------------------
//---------------------------------------------------------------------
input [3:0] p2d_ihb_dpar; // TLP header record parity
//---------------------------------------------------------------------
//---------------------------------------------------------------------
input [`FIRE_IHB_REC_WDTH-1:0] in_ihb_rcd;
//---------------------------------------------------------------------
// IIL internal interface
//---------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> Data Type Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
// ~~~~~~~~~~~~~~~~~~~~~~~~~ REGISTER - FLOPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
reg [3:0] in_ihb_dpar; // flop input p2d_ihb_dpar
// ~~~~~~~~~~~~~~~~~~~~~~~~~ NETS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wire [3:0] calc_ihb_dpar; // calulated parity from p2d_ihb_data
// >>>>>>>>>>>>>>>>>>>>>>>>> Zero In Checkers <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
/* #0in odd_parity -var {in_ihb_rcd[127:96], in_ihb_dpar[3]}
-name ilu_iil_odd_parchk_3
/* #0in odd_parity -var {in_ihb_rcd[95:64], in_ihb_dpar[2]}
-name ilu_iil_odd_parchk_2
/* #0in odd_parity -var {in_ihb_rcd[63:32], in_ihb_dpar[1]}
-name ilu_iil_odd_parchk_1
/* #0in odd_parity -var {in_ihb_rcd[31:0], in_ihb_dpar[0]}
-name ilu_iil_odd_parchk_0
// >>>>>>>>>>>>>>>>>>>>>>>>> Function Declarations <<<<<<<<<<<<<<<<<<<<<<<<<<
function [3:0] calc_parity; // odd parity
calc_parity[3] = ~(^data[127:96]);
calc_parity[2] = ~(^data[95:64]);
calc_parity[1] = ~(^data[63:32]);
calc_parity[0] = ~(^data[31:0]);
endfunction // calc_parity
// >>>>>>>>>>>>>>>>>>>>>>>>> RTL/Behavioral Model <<<<<<<<<<<<<<<<<<<<<<<<<<<
assign iil2cib_ihb_pe = is_ihb_rcd & (|(in_ihb_dpar ^ calc_ihb_dpar)); // odd parity
assign calc_ihb_dpar = calc_parity(in_ihb_rcd);
in_ihb_dpar <= {4{1'b0}};
in_ihb_dpar <= p2d_ihb_dpar;
endmodule // dmu_ilu_iil_parchk