Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / common / verilog / checkers / niusiu / niu_siu_chkr.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_siu_chkr.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`ifdef FC_BENCH
36 `define TOP_DESIGN cpu
37 `define SII_REF_CLK tb_top.cpu.sii.iol2clk
38 `define SIO_REF_CLK tb_top.cpu.sio.iol2clk
39`else
40`ifdef IOS
41 `define TOP_DESIGN cpu
42 `define SII_REF_CLK sii.iol2clk
43 `define SIO_REF_CLK sio.iol2clk
44`else
45 `ifdef SIU
46 `define TOP_DESIGN cpu
47 `define TB_TOP siu_top.cpu
48 `define SII_REF_CLK sii.iol2clk
49 `define SIO_REF_CLK sio.iol2clk
50 `else
51 `ifdef N2_NIU
52 `define TOP_DESIGN cpu
53 `define TB_TOP tb_top.cpu
54 `define SII_REF_CLK ccu_io_out
55 `define SIO_REF_CLK ccu_io_out
56 `endif
57 `endif
58`endif
59`endif
60
61module niu_siu_chkr();
62
63`ifdef FC_BENCH
64reg bid_chk_off;
65initial begin // {
66 @(posedge `SII_REF_CLK) ;
67 if ($test$plusargs("niusiu_bid_chk_off"))
68 bid_chk_off <= 1;
69 else
70 bid_chk_off <= 0;
71end //}
72
73// 0in disable_checker bid_chk_off -name *niu_bus_id*
74`endif
75
76// set this to -constraint to constrain input signals to SIU
77`define SIU_CONSTRAINT
78// set this to -constraint to constrain input signals to NIU
79`define NIU_CONSTRAINT
80
81
82///////////////////////////////////////////////////////////////////////////////
83// Check that all interface signals are not X or Z. This check can be disabled
84// by not including the +define+X_GUARD arg on the command line.
85///////////////////////////////////////////////////////////////////////////////
86`ifdef X_GUARD
87 // 0in known_driven -var niu_sii_hdr_vld -name niu_sii_hdr_vld_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
88 // 0in known_driven -var niu_sii_reqbypass -name niu_sii_reqbypass_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
89 // 0in known_driven -var niu_sii_datareq -name niu_sii_datareq_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
90 // 0in known_driven -var niu_sii_data -name niu_sii_data_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
91 // 0in known_driven -var niu_sii_parity -name niu_sii_parity_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
92 // x0in known_driven -var niu_sii_be -name niu_sii_be_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
93 // x0in known_driven -var sii_niu_wrack_vld -name sii_niu_wrack_vld_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
94 // x0in known_driven -var sii_niu_wrack_tag -name sii_niu_wrack_tag_x_guard -clock `SII_REF_CLK -module `TOP_DESIGN
95
96 // 0in known_driven -var sio_niu_hdr_vld -name sio_niu_hdr_vld_x_guard -clock `SIO_REF_CLK -module `TOP_DESIGN
97 // 0in known_driven -var sio_niu_datareq -name sio_niu_datareq_x_guard -clock `SIO_REF_CLK -module `TOP_DESIGN
98 // 0in known_driven -var sio_niu_data -name sio_niu_data_x_guard -clock `SIO_REF_CLK -module `TOP_DESIGN
99 // 0in known_driven -var sio_niu_parity -name sio_niu_parity_x_guard -clock `SIO_REF_CLK -module `TOP_DESIGN
100`endif
101
102
103///////////////////////////////////////////////////////////////////////////////
104// These signals can be used to disable certain 0-In checkers at runtime,
105// so that testcases forcing interface errors don't die with checker firings.
106///////////////////////////////////////////////////////////////////////////////
107reg disable_hdr_checks;
108reg disable_niu_sii_parity_checks;
109reg disable_sio_niu_parity_checks;
110
111initial begin
112 disable_hdr_checks = 1'b0;
113 disable_niu_sii_parity_checks = 1'b0;
114 disable_sio_niu_parity_checks = 1'b0;
115end
116
117`define NIU_SII_COMMAND {niu_sii_data[127:122], niu_sii_reqbypass}
118`define NIU_SII_NIU_ID niu_sii_data[79:64]
119
120`define SIO_NIU_COMMAND sio_niu_data[127:122]
121`define SIO_NIU_NIU_ID sio_niu_data[79:64]
122
123///////////////////////////////////////////////////////////////////////////////
124// Check for valid commands from NIU to SIU
125///////////////////////////////////////////////////////////////////////////////
126
127 // valid Transactions : RDD_npt_ord RDD_npt_byp WRI_pst_ord WRI_pst_byp WRI_npt_ord WRI_npt_byp
128 /* 0in value -var `NIU_SII_COMMAND -casex
129 -val 7'b0010_100 7'b0010_101 7'b0100_100 7'b0100_101 7'b0000_100 7'b0000_101
130 -active niu_sii_hdr_vld -module `TOP_DESIGN -name niu_sii_hdr_cmd_vld
131 -message "Bad value for niu_siu header"
132 -areset disable_hdr_checks `SIU_CONSTRAINT
133 -clock `SII_REF_CLK
134 */
135
136
137 // check for reserved bits of header
138 /* 0in assert -var ( |{niu_sii_data[121:85], niu_sii_data[63], niu_sii_data[55:40], niu_sii_data[5:0]} == 1'b0)
139 -active niu_sii_hdr_vld -module `TOP_DESIGN -name niu_sii_hdr_rsrvd_bits
140 -message "reserved bits in header are not all zero"
141 -areset disable_hdr_checks `SIU_CONSTRAINT
142 -clock `SII_REF_CLK
143 */
144
145
146///////////////////////////////////////////////////////////////////////////////
147// Check for no overlap of transactions:
148// After niu_sii_hdr_vld & niu_sii_datareq
149// niu_sii_hdr_vld is 0 for 4 cycle.
150///////////////////////////////////////////////////////////////////////////////
151
152 /* 0in
153 assert_window -start (niu_sii_hdr_vld & niu_sii_datareq)
154 -start_count 0 -stop_count 4
155 -not_in niu_sii_hdr_vld
156 -module `TOP_DESIGN -name niu_siu_no_overlap_chk1 `SIU_CONSTRAINT
157 -clock `SII_REF_CLK
158 */
159
160///////////////////////////////////////////////////////////////////////////////
161// Check for outstanding bus_id
162// max_ids set to 65536 otherwise it counts -req_id -ret_id as 4bit
163///////////////////////////////////////////////////////////////////////////////
164
165 /* 0in
166 bus_id
167 -req (niu_sii_hdr_vld & ~niu_sii_data[126])
168 -req_id niu_sii_data[79:64]
169 -ret sio_niu_hdr_vld
170 -ret_id sio_niu_data[79:64]
171 -max_ids 65536 -max_ids_check off
172 -module `TOP_DESIGN
173 -clock `SII_REF_CLK
174 -name niu_bus_id
175 */
176
177
178///////////////////////////////////////////////////////////////////////////////
179// sii-to-niu
180// sii_niu_oqdq & sii_niu_bqdq cannot be asserted in the same cycle
181///////////////////////////////////////////////////////////////////////////////
182
183 /* 0in
184 assert -var (~(sii_niu_oqdq & sii_niu_bqdq))
185 -module `TOP_DESIGN
186 -name sii_niu_dq
187 -clock `SII_REF_CLK
188 */
189
190 /* 0in assert_follower
191 -leader (niu_sii_hdr_vld & ~niu_sii_reqbypass)
192 -follower sii_niu_oqdq
193 -min 2
194 -max 3000
195 -max_leader 16
196 -module `TOP_DESIGN
197 -name niu_sii_oq_assert_follower
198 -clock `SII_REF_CLK
199 */
200
201 /* 0in assert_follower
202 -leader (niu_sii_hdr_vld & niu_sii_reqbypass)
203 -follower sii_niu_bqdq
204 -min 2
205 -max 3000
206 -max_leader 16
207 -module `TOP_DESIGN
208 -clock `SII_REF_CLK
209 -name niu_sii_bq_assert_follower
210 */
211
212 /* 0in assert_leader
213 -leader (niu_sii_hdr_vld & ~niu_sii_reqbypass)
214 -follower sii_niu_oqdq
215 -min 2
216 -max 3000
217 -max_leader 16
218 -module `TOP_DESIGN
219 -name niu_sii_oq_assert_leader
220 -clock `SII_REF_CLK
221 */
222
223 /* 0in assert_leader
224 -leader (niu_sii_hdr_vld & niu_sii_reqbypass)
225 -follower sii_niu_bqdq
226 -min 2
227 -max 3000
228 -max_leader 16
229 -module `TOP_DESIGN
230 -name niu_sii_bq_assert_leader
231 -clock `SII_REF_CLK
232 */
233
234 // RDD
235 /* 0in assert_together
236 -leader ((niu_sii_data[127:122]==6'b001010) & niu_sii_hdr_vld)
237 -follower (niu_sii_hdr_vld & ~niu_sii_datareq)
238 -module `TOP_DESIGN
239 -clock `SII_REF_CLK
240 -name niu_sii_cmd_rdd
241 */
242
243 // WRI
244 /* 0in assert_together
245 -leader ((niu_sii_data[127:122]==6'b0x0010) & niu_sii_hdr_vld)
246 -follower (niu_sii_hdr_vld & niu_sii_datareq)
247 -module `TOP_DESIGN
248 -name niu_sii_cmd_wri
249 -clock `SII_REF_CLK
250 */
251
252
253///////////////////////////////////////////////////////////////////////////////
254// Check for no overlap of transactions from sio to niu:
255// After sio_niu_datareq
256// sio_niu_hdr_vld is 0 for 4 cycles.
257///////////////////////////////////////////////////////////////////////////////
258
259 /* 0in
260 assert_window
261 -start (sio_niu_hdr_vld & sio_niu_datareq)
262 -start_count 0
263 -stop_count 4
264 -not_in sio_niu_hdr_vld
265 -module `TOP_DESIGN
266 -clock `SIO_REF_CLK
267 -name sio_niu_pkt_no_overlap
268 */
269
270 //valid transaction check
271 /* 0in value
272 -var `SIO_NIU_COMMAND
273 -casex
274 -val 6'b100010 6'b101010
275 -active sio_niu_hdr_vld
276 -module `TOP_DESIGN
277 -name sio_niu_hdr_cmd_vld
278 -message "Bad value for sio_niu_header"
279 -areset disable_hdr_checks
280 -clock `SIO_REF_CLK
281 */
282
283 // check for reserved bits of header
284 /* 0in assert
285 -var ( |{sio_niu_data[121:83],sio_niu_data[63:62],sio_niu_data[55:40]} == 1'b0)
286 -active sio_niu_hdr_vld
287 -module `TOP_DESIGN
288 -name sio_niu_hdr_rsrvd_bits
289 -message "reserved bits in header are not all zero"
290 -areset disable_hdr_checks
291 -clock `SIO_REF_CLK
292 */
293
294 // RDD
295 /* 0in assert_together
296 -leader ((`SIO_NIU_COMMAND==6'b101010) & sio_niu_hdr_vld)
297 -follower (sio_niu_hdr_vld & sio_niu_datareq)
298 -module `TOP_DESIGN
299 -name sio_niu_cmd_rdd
300 -clock `SIO_REF_CLK
301 */
302
303 //WRI
304 /* 0in assert_together
305 -leader ((`SIO_NIU_COMMAND==6'b100010) & sio_niu_hdr_vld)
306 -follower (sio_niu_hdr_vld & ~sio_niu_datareq)
307 -module `TOP_DESIGN
308 -name sio_niu_cmd_rwri
309 -clock `SIO_REF_CLK
310 */
311
312/* NIU to sio credit check */
313
314/* 0in fifo
315 -enq sio_niu_hdr_vld
316 -deq niu_sio_dq
317 -depth 4
318 -clock `SIO_REF_CLK
319 -module `TOP_DESIGN
320 -name niu_credit_check
321*/
322
323///////////////////////////////////////////////////////////////////////////////
324// sii-to-niu
325// sii_niu_oqdq & sii_niu_bqdq cannot be asserted in the same cycle
326///////////////////////////////////////////////////////////////////////////////
327
328endmodule // niu_siu_chkr