Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / common / vera / include / errorCountTasks.if.vrh
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: errorCountTasks.if.vrh
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#ifndef INC_ERRORCOUNTTASKS_IF_VRH
36#define INC_ERRORCOUNTTASKS_IF_VRH
37
38interface errorCount_if {
39
40// input clk CLOCK hdl_node "tb_top.clk";
41 input errorCount NSAMPLE #-3 hdl_node "tb_top.error_count";
42 input warnCount NSAMPLE #-3 hdl_node "tb_top.warning_count";
43}
44
45
46//////////////////////////////////////////////////////////////////
47// See errorCountTasks.v, dispmonDefines.vh,
48// std_display_class.vr & .vri, errorCountTasks.if.vrh
49//////////////////////////////////////////////////////////////////
50
51
52// you can do something like this to watch for excessive counts in Vera
53// task CLASSNAME::wait4termination () {
54//
55// integer myErrors = 0, myWarns = 0;
56//
57// fork // too many errors
58// {
59// integer previousCountE = 0;
60// integer previousCountW = 0;
61// while (1) {
62// @(errorCount_if.errorCount or errorCount_if.warnCount); // watch verilog errors
63// myErrors += (errorCount_if.errorCount - previousCountE);
64// previousCountE = errorCount_if.errorCount;
65// myWarns += (errorCount_if.warnCount - previousCountW);
66// previousCountW = errorCount_if.warnCount;
67// }
68// }
69// {
70// while (1) {
71// wait_var(gDbg.errorCount); // watch vera errors
72// myErrors++;
73// }
74// }
75// {
76// while (1) {
77// wait_var(gDbg.warnCount); // watch vera warns
78// myWarns++;
79// }
80// }
81// {
82// while (myErrors < gDbg.maxerror && myWarns < gDbg.maxwarning) wait_var(myErrors,myWarns);
83// // We now have too many errors, do whatever...
84// PR_ALWAYS (CLASSNAMEQ, ALWAYS,
85// sprintf("Diag Ending with ERRORs. Errors=%0d, Warns=%0d (Vera)",myErrors,myWarns));
86//
87// repeat (gDbg.wait_cycle_to_kill) @(posedge CLOCK);
88// exit(1);
89// }
90//
91// // too many clocks
92// {
93// while (1) {
94// // Please to not check every clock!
95// // delay is measurably better than repeat (x) @(posedge CLOCK).
96// // I asked Synopsys to measure it, really.
97// delay(gClkPeriod*500);
98// if (get_cycle() >= gParam.maxCycle) {
99// PR_ALWAYS (CLASSNAMEQ, ALWAYS,
100// sprintf("Max cycles of %0d exceeded! Exiting with ERRORs...",gParam.maxCycle));
101// }
102// }
103// }
104// join none
105// }
106
107
108#endif