// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: gkt_pqm_ctl.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 ============================================
////////////////////////////////////////////////////////
// keep track of ccx fifo
// l15 can send 2 requests followed by a 3rd speculative req.
// If a grant is not seen in the cycle when 3rd req is launched,
// then it is dropped by ccx, and l15 has to resend it.
assign qcnt_inc[1:0] = qcnt[1:0] + 2'b01;
assign qcnt_dec[1:0] = (qcnt[1:0] == 2'b00)? 2'b00: (qcnt[1:0] - 2'b01);
assign pqm_empty = ~qcnt[1] & ~qcnt[0];
// do not increment if qfull, the req is going to get dropped.
assign incr = spc_pcx_req_pq & ~qfull & ~pcx_grant;
assign decr = ~spc_pcx_req_pq & pcx_grant;
assign hold = ~incr & ~decr;
//assign qcnt_next[1:0] = incr? qcnt_inc[1:0]: decr ? qcnt_dec[1:0] : qcnt[1:0];
assign qcnt_next[1:0] = ({2{incr}} & qcnt_inc[1:0]) |
({2{decr}} & qcnt_dec[1:0]) |
// pcx_grant is a very late signal.
// 0in overflow -var qcnt_next[1:0] -min 0 -max 2
assign pqm_req_drop = qcnt[1] & spc_pcx_req_pq & ~pcx_grant;
gkt_pqm_ctl_msff_ctl_macro__width_2 dff_qcnt
.scan_in(dff_qcnt_scanin),
.scan_out(dff_qcnt_scanout),
assign dff_qcnt_scanin = scan_in ;
assign scan_out = dff_qcnt_scanout ;
// any PARAMS parms go into naming of macro
module gkt_pqm_ctl_msff_ctl_macro__width_2 (
assign fdin[1:0] = din[1:0];