Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / niu / rtl / niu_txc_tdmc_error.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_txc_tdmc_error.v
4// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
5// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
6//
7// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8//
9// This program is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; version 2 of the License.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21//
22// For the avoidance of doubt, and except that if any non-GPL license
23// choice is available it will apply instead, Sun elects to use only
24// the General Public License version 2 (GPLv2) at this time for any
25// software where a choice of GPL license versions is made
26// available with the language indicating that GPLv2 or any later version
27// may be used, or where a choice of which version of the GPL is applied is
28// otherwise unspecified.
29//
30// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
31// CA 95054 USA or visit www.sun.com if you need additional information or
32// have any questions.
33//
34// ========== Copyright Header End ============================================
35/*********************************************************************
36 *
37 * niu_txc_tdmc_error.v
38 *
39 * NIU TXC To TDMC Error Interface
40 *
41 * Orignal Author(s): Rahoul Puri
42 * Modifier(s):
43 * Project(s): Neptune
44 *
45 * Copyright (c) 2005 Sun Microsystems, Inc.
46 *
47 * All Rights Reserved.
48 *
49 * This verilog model is the confidential and proprietary property of
50 * Sun Microsystems, Inc., and the possession or use of this model
51 * requires a written license from Sun Microsystems, Inc.
52 *
53 **********************************************************************/
54
55`include "timescale.v"
56
57module niu_txc_tdmc_error (
58 SysClk,
59 Reset_L,
60 Port0_Nack_Pkt_Rd,
61 Port0_DMA_Nack_Pkt_Rd,
62 Port0_Nack_Pkt_Rd_Addr,
63 Port1_Nack_Pkt_Rd,
64 Port1_DMA_Nack_Pkt_Rd,
65 Port1_Nack_Pkt_Rd_Addr,
66 Port2_Nack_Pkt_Rd,
67 Port2_DMA_Nack_Pkt_Rd,
68 Port2_Nack_Pkt_Rd_Addr,
69 Port3_Nack_Pkt_Rd,
70 Port3_DMA_Nack_Pkt_Rd,
71 Port3_Nack_Pkt_Rd_Addr,
72 TXC_DMC_Nack_Pkt_Rd,
73 TXC_DMC_DMA_Nack_Pkt_Rd,
74 TXC_DMC_Nack_Pkt_Rd_Addr
75 );
76
77`include "txc_defines.h"
78
79// Global Signals
80input SysClk;
81input Reset_L;
82
83// Port 0 Error Signals
84input Port0_Nack_Pkt_Rd;
85input [23:0] Port0_DMA_Nack_Pkt_Rd;
86input [43:0] Port0_Nack_Pkt_Rd_Addr;
87
88// Port 1 Error Signals
89input Port1_Nack_Pkt_Rd;
90input [23:0] Port1_DMA_Nack_Pkt_Rd;
91input [43:0] Port1_Nack_Pkt_Rd_Addr;
92
93// Port 2 Error Signals
94input Port2_Nack_Pkt_Rd;
95input [23:0] Port2_DMA_Nack_Pkt_Rd;
96input [43:0] Port2_Nack_Pkt_Rd_Addr;
97
98// Port 3 Error Signals
99input Port3_Nack_Pkt_Rd;
100input [23:0] Port3_DMA_Nack_Pkt_Rd;
101input [43:0] Port3_Nack_Pkt_Rd_Addr;
102
103// TXC To TDMC Error Interface Signals
104output TXC_DMC_Nack_Pkt_Rd;
105output [23:0] TXC_DMC_DMA_Nack_Pkt_Rd;
106output [43:0] TXC_DMC_Nack_Pkt_Rd_Addr;
107
108reg TXC_DMC_Nack_Pkt_Rd;
109reg [23:0] TXC_DMC_DMA_Nack_Pkt_Rd;
110reg [43:0] TXC_DMC_Nack_Pkt_Rd_Addr;
111
112/*--------------------------------------------------------------*/
113// Wires & Registers
114/*--------------------------------------------------------------*/
115wire [3:0] portSelect;
116wire transactionTimeout;
117
118reg [23:0] dmaNackPktRd;
119reg [43:0] dmaNackPktRdAddr;
120
121/*--------------------------------------------------------------*/
122// Transaction Timeout Size Error Logic
123/*--------------------------------------------------------------*/
124assign portSelect = {Port3_Nack_Pkt_Rd, Port2_Nack_Pkt_Rd,
125 Port1_Nack_Pkt_Rd, Port0_Nack_Pkt_Rd
126 };
127
128assign transactionTimeout = (Port3_Nack_Pkt_Rd | Port2_Nack_Pkt_Rd
129 |
130 Port1_Nack_Pkt_Rd | Port0_Nack_Pkt_Rd
131 );
132
133always @(portSelect
134 or Port3_DMA_Nack_Pkt_Rd or Port2_DMA_Nack_Pkt_Rd
135 or Port1_DMA_Nack_Pkt_Rd or Port0_DMA_Nack_Pkt_Rd
136 )
137 begin
138 casex(portSelect) // Synopsys full_case parallel_case
139 4'bxxx1: dmaNackPktRd = Port0_DMA_Nack_Pkt_Rd;
140 4'bxx10: dmaNackPktRd = Port1_DMA_Nack_Pkt_Rd;
141 4'bx100: dmaNackPktRd = Port2_DMA_Nack_Pkt_Rd;
142 4'b1000: dmaNackPktRd = Port3_DMA_Nack_Pkt_Rd;
143 default: dmaNackPktRd = 24'hx;
144 endcase
145end
146
147always @(portSelect
148 or Port3_Nack_Pkt_Rd_Addr or Port2_Nack_Pkt_Rd_Addr
149 or Port1_Nack_Pkt_Rd_Addr or Port0_Nack_Pkt_Rd_Addr
150 )
151 begin
152 casex(portSelect) // Synopsys full_case parallel_case
153 4'bxxx1: dmaNackPktRdAddr = Port0_Nack_Pkt_Rd_Addr;
154 4'bxx10: dmaNackPktRdAddr = Port1_Nack_Pkt_Rd_Addr;
155 4'bx100: dmaNackPktRdAddr = Port2_Nack_Pkt_Rd_Addr;
156 4'b1000: dmaNackPktRdAddr = Port3_Nack_Pkt_Rd_Addr;
157 default: dmaNackPktRdAddr = 44'hx;
158 endcase
159end
160
161always @ (posedge SysClk)
162 if (!Reset_L)
163 begin
164 TXC_DMC_Nack_Pkt_Rd <= 1'b0;
165 TXC_DMC_DMA_Nack_Pkt_Rd <= 24'h0;
166 TXC_DMC_Nack_Pkt_Rd_Addr <= 44'h0;
167 end
168 else if (transactionTimeout)
169 begin
170 TXC_DMC_Nack_Pkt_Rd <= #`SD 1'b1;
171 TXC_DMC_DMA_Nack_Pkt_Rd <= #`SD dmaNackPktRd;
172 TXC_DMC_Nack_Pkt_Rd_Addr <= #`SD dmaNackPktRdAddr;
173 end
174 else
175 TXC_DMC_Nack_Pkt_Rd <= #`SD 1'b0;
176
177endmodule