// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: mcu_otq_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 ============================================
output [`WIDTH_M1:0] otq_dout;
output next_otq_dout_9; // address parity for 2nd entry
input [`WIDTH_M1:0] otq_din;
// 0in fifo -enq otq_enq -deq otq_deq -depth 16 -enq_data otq_din[19:0] -deq_data otq_dout[19:0]
assign wptr_in[4:0] = wptr[4:0] + {4'h0, otq_enq};
mcu_otq_ctl_msff_ctl_macro__width_5 ff_wptr (
.scan_in(ff_wptr_scanin),
.scan_out(ff_wptr_scanout),
assign rptr_in[4:0] = rptr[4:0] + {4'h0, otq_deq};
mcu_otq_ctl_msff_ctl_macro__width_5 ff_rptr (
.scan_in(ff_rptr_scanin),
.scan_out(ff_rptr_scanout),
assign otq_full = rptr[4:0] == {~wptr[4],wptr[3:0]};
assign otq_empty = rptr[4:0] == wptr[4:0];
assign ent0_en = (wptr[3:0] == 4'd0) & otq_enq;
assign ent1_en = (wptr[3:0] == 4'd1) & otq_enq;
assign ent2_en = (wptr[3:0] == 4'd2) & otq_enq;
assign ent3_en = (wptr[3:0] == 4'd3) & otq_enq;
assign ent4_en = (wptr[3:0] == 4'd4) & otq_enq;
assign ent5_en = (wptr[3:0] == 4'd5) & otq_enq;
assign ent6_en = (wptr[3:0] == 4'd6) & otq_enq;
assign ent7_en = (wptr[3:0] == 4'd7) & otq_enq;
assign ent8_en = (wptr[3:0] == 4'd8) & otq_enq;
assign ent9_en = (wptr[3:0] == 4'd9) & otq_enq;
assign ent10_en = (wptr[3:0] == 4'd10) & otq_enq;
assign ent11_en = (wptr[3:0] == 4'd11) & otq_enq;
assign ent12_en = (wptr[3:0] == 4'd12) & otq_enq;
assign ent13_en = (wptr[3:0] == 4'd13) & otq_enq;
assign ent14_en = (wptr[3:0] == 4'd14) & otq_enq;
assign ent15_en = (wptr[3:0] == 4'd15) & otq_enq;
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent0 (
.scan_in(ff_ent0_scanin),
.scan_out(ff_ent0_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent0[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent1 (
.scan_in(ff_ent1_scanin),
.scan_out(ff_ent1_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent1[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent2 (
.scan_in(ff_ent2_scanin),
.scan_out(ff_ent2_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent2[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent3 (
.scan_in(ff_ent3_scanin),
.scan_out(ff_ent3_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent3[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent4 (
.scan_in(ff_ent4_scanin),
.scan_out(ff_ent4_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent4[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent5 (
.scan_in(ff_ent5_scanin),
.scan_out(ff_ent5_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent5[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent6 (
.scan_in(ff_ent6_scanin),
.scan_out(ff_ent6_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent6[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent7 (
.scan_in(ff_ent7_scanin),
.scan_out(ff_ent7_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent7[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent8 (
.scan_in(ff_ent8_scanin),
.scan_out(ff_ent8_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent8[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent9 (
.scan_in(ff_ent9_scanin),
.scan_out(ff_ent9_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent9[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent10 (
.scan_in(ff_ent10_scanin),
.scan_out(ff_ent10_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent10[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent11 (
.scan_in(ff_ent11_scanin),
.scan_out(ff_ent11_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent11[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent12 (
.scan_in(ff_ent12_scanin),
.scan_out(ff_ent12_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent12[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent13 (
.scan_in(ff_ent13_scanin),
.scan_out(ff_ent13_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent13[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent14 (
.scan_in(ff_ent14_scanin),
.scan_out(ff_ent14_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent14[`WIDTH_M1:0]),
mcu_otq_ctl_msff_ctl_macro__en_1__width_20 ff_ent15 (
.scan_in(ff_ent15_scanin),
.scan_out(ff_ent15_scanout),
.din(otq_din[`WIDTH_M1:0]),
.dout(ent15[`WIDTH_M1:0]),
assign {otq_dout[`WIDTH_M1:0], next_otq_dout_9} =
{`WIDTH_P1{rptr[3:0] == 4'd0}} & {ent0[`WIDTH_M1:0], ent1[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd1}} & {ent1[`WIDTH_M1:0], ent2[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd2}} & {ent2[`WIDTH_M1:0], ent3[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd3}} & {ent3[`WIDTH_M1:0], ent4[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd4}} & {ent4[`WIDTH_M1:0], ent5[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd5}} & {ent5[`WIDTH_M1:0], ent6[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd6}} & {ent6[`WIDTH_M1:0], ent7[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd7}} & {ent7[`WIDTH_M1:0], ent8[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd8}} & {ent8[`WIDTH_M1:0], ent9[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd9}} & {ent9[`WIDTH_M1:0], ent10[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd10}} & {ent10[`WIDTH_M1:0], ent11[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd11}} & {ent11[`WIDTH_M1:0], ent12[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd12}} & {ent12[`WIDTH_M1:0], ent13[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd13}} & {ent13[`WIDTH_M1:0], ent14[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd14}} & {ent14[`WIDTH_M1:0], ent15[9]} |
{`WIDTH_P1{rptr[3:0] == 4'd15}} & {ent15[`WIDTH_M1:0], ent0[9]};
assign ff_wptr_scanin = scan_in ;
assign ff_rptr_scanin = ff_wptr_scanout ;
assign ff_ent0_scanin = ff_rptr_scanout ;
assign ff_ent1_scanin = ff_ent0_scanout ;
assign ff_ent2_scanin = ff_ent1_scanout ;
assign ff_ent3_scanin = ff_ent2_scanout ;
assign ff_ent4_scanin = ff_ent3_scanout ;
assign ff_ent5_scanin = ff_ent4_scanout ;
assign ff_ent6_scanin = ff_ent5_scanout ;
assign ff_ent7_scanin = ff_ent6_scanout ;
assign ff_ent8_scanin = ff_ent7_scanout ;
assign ff_ent9_scanin = ff_ent8_scanout ;
assign ff_ent10_scanin = ff_ent9_scanout ;
assign ff_ent11_scanin = ff_ent10_scanout ;
assign ff_ent12_scanin = ff_ent11_scanout ;
assign ff_ent13_scanin = ff_ent12_scanout ;
assign ff_ent14_scanin = ff_ent13_scanout ;
assign ff_ent15_scanin = ff_ent14_scanout ;
assign scan_out = ff_ent15_scanout ;
// any PARAMS parms go into naming of macro
module mcu_otq_ctl_msff_ctl_macro__width_5 (
assign fdin[4:0] = din[4:0];
// any PARAMS parms go into naming of macro
module mcu_otq_ctl_msff_ctl_macro__en_1__width_20 (
assign fdin[19:0] = (din[19:0] & {20{en}}) | (dout[19:0] & ~{20{en}});
.so({so[18:0],scan_out}),