// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: dmu_ilu_eil_xfrfsm.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_eil_xfrfsm (
only_one_rd_and_can_move,
ilu_diagnos_ehi_trig_hw_clr,
ilu_diagnos_ehi_trig_hw_read,
ilu_diagnos_ehi_par_hw_read,
// synopsys sync_set_reset "rst_l"
// >>>>>>>>>>>>>>>>>>>>>>>>> Parameter Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
parameter // summit enum xfr_enum
WFH = 3; // wait for EHB header space
// >>>>>>>>>>>>>>>>>>>>>>>>> Port Declarations <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
//---------------------------------------------------------------------
// Clock and Reset Signals
//---------------------------------------------------------------------
input clk; // input clock
input rst_l; // input reset
//---------------------------------------------------------------------
//---------------------------------------------------------------------
input rcd_empty; // from *_rcdbldr.v
output rcd_deq; // to *_rcdbldr.v
//---------------------------------------------------------------------
//---------------------------------------------------------------------
output d2p_ehb_we; // EHB write stroke
output n_d2p_ehb_we; // drives d2p_ehb_we, to *_bufmgr.v
//---------------------------------------------------------------------
//---------------------------------------------------------------------
output data_start; // to *_datafsm.v
input data_done; // from *_datafsm.v
input only_one_rd_and_can_move; // num_rds == 1 to DOU
//---------------------------------------------------------------------
//---------------------------------------------------------------------
input ehb_full; // from *_bufmgr.v
//---------------------------------------------------------------------
//---------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
input cib2eil_drain; // drain signal from CIB
//---------------------------------------------------------------------
//---------------------------------------------------------------------
output [STATE_NUM-1:0] xfr_state;
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// SV 04/06/05 (EHB) Header Parity invert logic
input [`FIRE_DLC_ILU_CIB_CSR_ILU_DIAGNOS_EHI_PAR_INT_SLC] ilu_diagnos_ehi_par_hw_read;
// This signal provides the current value of ilu_diagnos_ehi_par.
output ilu_diagnos_ehi_trig_hw_clr; // Hardware clear signal for
// ilu_diagnos_ehi_trig. When set
// ilu_diagnos will be set to zero.
input ilu_diagnos_ehi_trig_hw_read; // This signal provides the current value
// of ilu_diagnos_ehi_trig.
input [3:0] d2p_ehb_dpar_0 ;
output [3:0] d2p_ehb_dpar ;
// >>>>>>>>>>>>>>>>>>>>>>>>> Data Type Declarations <<<<<<<<<<<<<<<<<<<<<<<<<
// ~~~~~~~~~~~~~~~~~~~~~~~~~ REGISTER - FLOPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
reg [STATE_NUM-1:0] xfr_state;
// ~~~~~~~~~~~~~~~~~~~~~~~~~ REGISTER - NON-FLOPS ~~~~~~~~~~~~~~~~~~~~~~~~
reg [STATE_NUM-1:0] n_xfr_state;
// ~~~~~~~~~~~~~~~~~~~~~~~~~ NETS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// >>>>>>>>>>>>>>>>>>>>>>>>> Zero In Checkers <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// 0in one_hot -var xfr_state
// 0in known_driven -var ehb_full
/* 0in state -var xfr_state -val (4'b1 << IDLE) -next
/* 0in state -var xfr_state -val (4'b1 << DEQ) -next
/* 0in state -var xfr_state -val (4'b1 << DATA) -next
/* 0in state -var xfr_state -val (4'b1 << WFH) -next
// >>>>>>>>>>>>>>>>>>>>>>>>> RTL/Behavioral Model <<<<<<<<<<<<<<<<<<<<<<<<<<<
//---------------------------------------------------------------------
//---------------------------------------------------------------------
// summit state_vector xfr_state enum xfr_enum
xfr_state <= {STATE_NUM{1'b0}};
xfr_state <= n_xfr_state;
always @ (xfr_state or data_done or ehb_full or
rcd_empty or has_payld or only_one_rd_and_can_move)
n_xfr_state = {STATE_NUM{1'b0}};
case (1'b1) // 0in < case -full // synopsys parallel_case
casez ({rcd_empty, ehb_full, has_payld, only_one_rd_and_can_move}) // 0in < case -parallel -full
4'b1zzz: n_xfr_state[IDLE] = 1'b1;
4'b010z: n_xfr_state[WFH] = 1'b1;
4'b000z: n_xfr_state[DEQ] = 1'b1;
n_xfr_state[DATA] = 1'b1;
endcase // casez({rcd_empty, ehb_full, has_payld, only_one_rd_and_can_move})
casez ({data_done, ehb_full})
2'b10: n_xfr_state[DEQ] = 1'b1;
2'b11: n_xfr_state[WFH] = 1'b1;
2'b0z: n_xfr_state[DATA] = 1'b1;
endcase // casez({data_done, ehb_full})
else n_xfr_state[DEQ] = 1'b1;
end // always @ (xfr_state or data_done or ehb_full
//---------------------------------------------------------------------
//---------------------------------------------------------------------
assign n_d2p_ehb_we = n_xfr_state[DEQ] & (!cib2eil_drain);
assign rcd_deq = n_xfr_state[DEQ];
assign y2k_rcd_deq = xfr_state[DEQ];
assign xfrfsm_is_wfh = xfr_state[WFH];
d2p_ehb_we <= n_d2p_ehb_we;
//---------------------------------------------------------------------
//---------------------------------------------------------------------
assign xfrfsm_is_idle = xfr_state[IDLE];
assign d2p_ehb_dpar = (d2p_ehb_dpar_0 ^ ({4{ilu_diagnos_ehi_trig_hw_read}} & ilu_diagnos_ehi_par_hw_read &
assign ilu_diagnos_ehi_trig_hw_clr = ilu_diagnos_ehi_trig_hw_read & d2p_ehb_we ;
endmodule // dmu_ilu_eil_xfrfsm