// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: dmu_imu_eqs_fsm.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 ============================================
// Over Flow Error Signal Inputs
// SW CSR State Update Access Interface
//############################################################################
//############################################################################
//------------------------------------------------------------------------
// Clock and Reset Signals
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// Over Flow Error Signal Inputs
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// SW CSR State Update Access Interface
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// EQ State Status Signal
//------------------------------------------------------------------------
//############################################################################
//############################################################################
//------------------------------------------------------------------------
// Parameters for the Value of the FSM States
//------------------------------------------------------------------------
parameter ACTIVE = 3'b010;
parameter ERROR = 3'b100;
//############################################################################
//############################################################################
//------------------------
//------------------------
//-------------------------
// Regs that are NOT flops
//-------------------------
//------------------------
//------------------------
//############################################################################
//############################################################################
//---------------------------------------------------------------------
// State Machine Checkers
//---------------------------------------------------------------------
//0in state_transition -var state -val IDLE -next ACTIVE
//0in state_transition -var state -val ACTIVE -next ERROR IDLE
//0in state_transition -var state -val ERROR -next IDLE
//############################################################################
//############################################################################
//---------------------------------------------------------------------
// The signals for SW PIOs
//---------------------------------------------------------------------
//------------------------
//------------------------
assign go_sw_en_eq = sw_set_addr_sel & sw_wr & sw_wr_data[0];
//------------------------
//------------------------
assign go_sw_dis_eq = sw_clr_addr_sel & sw_wr & sw_wr_data[0];
//------------------------
// Take from Error to Idle
//------------------------
assign go_sw_e2i_eq = sw_clr_addr_sel & sw_wr & sw_wr_data[1];
//------------------------
//------------------------
//############################################################################
//############################################################################
//-----------------------------------------------------------------------
// Next State Logic, Assign next state to current state
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
always @ (state or go_sw_en_eq or go_sw_e2i_eq or go_sw_dis_eq or set_over_err)
case (state) // synopsys parallel_case
//********************************************************
// - Wait here until the SW has enabled the EQ
//********************************************************
if (go_sw_en_eq) // SW PIO Enables event queue
//********************************************************
// - Receive a HW or SW overflow error
//********************************************************
if (set_over_err) // Overflow Error
else if (go_sw_dis_eq) // SW PIO disables event queue
//********************************************************
// - Wait here until the SW has puts the EQ back to IDLE
//********************************************************
if (go_sw_e2i_eq) // SW Puts back into IDLE
//********************************************************
//********************************************************
n_state = IDLE; //0in < fire -message "Illegal State Reached in module fire_dlc_imu_eqs_fsm.v"