Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / vera / niu_utils / niu_cbclass.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: niu_cbclass.vr
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#include <vera_defines.vrh>
36#include <ListMacros.vrh>
37
38#include "niu_cb_events.vri"
39#include "niu_error_dfn.vri"
40
41/* A generic call back class to be used for Memory */
42
43
44class CcbMem {
45
46 integer eventdfn;
47 integer semId;
48 integer callId;
49
50 bit [63:0] attr;
51
52 task new( ( integer i = -1)) {
53 semId = i;
54 }
55 task set ( bit [63:0] a, ( integer e = -1)) {
56 attr = a;
57 eventdfn = e;
58 }
59}
60
61// class for error callbacks
62
63
64class CcbErrDfn {
65 bit [63:0] address;
66 integer error_code;
67}
68
69MakeVeraList(CcbErrDfn) //
70
71class CcbErrArray {
72 VeraList_CcbErrDfn cbs;
73 task new() {
74 cbs = new();
75 }
76 task add_front(CcbErrDfn cb){
77 cbs.push_front(cb);
78 }
79 task add(CcbErrDfn cb){
80 // printf("CcbErrArray::add Address - %x error_code - %d \n",cb.address,cb.error_code);
81 cbs.push_back(cb);
82 // printf("CcbErrArray::add Size - %d \n",cbs.size());
83 }
84 function integer get(var CcbErrDfn cb){
85 if(cbs.empty()){
86 get = -1;
87 } else {
88 cb= cbs.front();
89 // printf("CcbErrArray::get Address - %x error_code - %d \n",cb.address,cb.error_code);
90 cbs.pop_front();
91 if(cbs.empty()){
92 get = 0;
93 } else get = 1;
94 }
95 // printf("CcbErrArray::get status - %d size - %d \n",get,cbs.size());
96 }
97}
98
99
100class CfuncCheck {
101 bit[63:0] address;
102 integer func;
103 task new(){}
104}
105
106
107