// ========== Copyright Header Begin ==========================================
// OpenSPARC T2 Processor File: niu_smx_sm_req_dv.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 niu_smx_sm_req_dv(
ff_wr, ff_wdata, pcmd_ff_wr, pcmd_ff_wdata, lnen_ff_rd,
clk, reset_l, dv, data, data_status, xfer_comp, lnen_ff_rdata,
input [3:0] data_status; // ???
output [3:0] pcmd_ff_wdata; // ??? not sure what to write yet
input [4:0] lnen_ff_rdata; // {eop, line_en[3:0]}
wire [127:0] ff_wdata_n= (dv)? data : 128'h0;
wire [127:0] ff_wdata= ff_wdata_n;
wire lnen_ff_rd= lnen_ff_rd_n;
wire [3:0] data_status_or_status_n= (data_status | status);
wire pcmd_ff_wr= pcmd_ff_wr_n;
wire [3:0] pcmd_ff_wdata_n= (or_status_n)? status :
// sample at s3; need to look at data_status if dv
wire [3:0] pcmd_ff_wdata= pcmd_ff_wdata_n;
wire dv_pad_done= ~(&lnen_ff_rdata[3:0]) & eop_n;
// lnen_ff (line enable) added to match expected dv;
// this is incase client dv comes back as non-contiguous 64B;
// client must "space out" per datareq in order to pad
always @ (/*AUTOSENSE*/comp0 or comp1 or comp2 or dv or dv_cs
or lnen_ff_empty or lnen_ff_rdata or xfer_comp) begin
// lnen_ff_rdata[3:0] check if 0; handle spc???
if(lnen_ff_rdata[1]) begin
if(lnen_ff_rdata[2]) begin
if(lnen_ff_rdata[3]) begin
pcmd_ff_wr_n= dv; // move data comp to the 4th line
eop_n= dv & (xfer_comp | comp2 | comp1 | comp0 | lnen_ff_rdata[4]);
eop_n= (dv&xfer_comp) | comp2 | comp1 | comp0 | lnen_ff_rdata[4];
always @(posedge clk) begin
always @(posedge clk) begin
if(ld_status_n) status<= `SMX_PD data_status;
if(or_status_n) status<= `SMX_PD data_status_or_status_n;