Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / fnx / vlib / XactorComponents / src / XactorListDupExpect.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: XactorListDupExpect.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 "XactorList.vrh"
36
37class XactorListDupExpect extends XactorList {
38
39 // Deletes all nodes that match i
40 virtual protected task DeleteDup (XactorBasePacket i,
41 var ListNode NodePtr,
42 var bit Success
43 );
44
45 // Deletes the node with the specified value
46 virtual task Delete (XactorBasePacket i,
47 var bit Success
48 );
49
50 // Deletes all nodes that match i
51 virtual protected task WCDeleteDup (XactorBasePacket i,
52 var ListNode NodePtr,
53 var bit Success
54 );
55
56 // Deletes multiple nodes with the specified value
57 // Accepts wildcards
58 virtual task WildCardDelete1 (XactorBasePacket i,
59 var bit Success
60 );
61}
62
63 ////////////////
64 // Definitions
65////////////////
66
67// Deletes all nodes that match i
68task XactorListDupExpect::DeleteDup (XactorBasePacket i,
69 var ListNode NodePtr,
70 var bit Success
71 ) {
72
73 if (i.PktCompare("===", NodePtr.Item)) {
74 i.SetID(NodePtr.Item.GetID());
75
76 if(Success == 1'b1) // check if this is not the first node deleted.
77 NodePtr.Item.PktDisplay(RTYP_XACTOR_FMWORK_DUP_WILDCARD_EXPECT_WARN,
78 "Sampled Transaction satisfies duplicated Expect"
79 );
80 trigger(ON, NodePtr.RemoveEvents[XACT_COMP_EXPECT_REMOVED_EVENT]); // Remove event
81 trigger(ON, NodePtr.RemoveEvents[XACT_COMP_EXPECT_REMOVED_BY_XACTOR_EVENT]); // Removed by xactor
82 NodePtr = NodePtr.Next;
83 Success = 1'b1;
84 if(NodePtr != null) {
85 DeleteDup(i,
86 NodePtr,
87 Success
88 );
89 }
90 }
91 else {
92 if(NodePtr.Next != null) {
93 DeleteDup(i,
94 NodePtr.Next,
95 Success
96 );
97 }
98 }
99}
100
101// Deletes multiple nodes with the specified value
102// Accepts wildcards
103task XactorListDupExpect::Delete (XactorBasePacket i,
104 var bit Success
105 ) {
106 Success = 1'b0;
107
108 if (Head == null) {
109 Success = 1'b0;
110 }
111 else {
112 DeleteDup(i,
113 Head,
114 Success
115 );
116 }
117}
118
119// Deletes all nodes that match i
120task XactorListDupExpect::WCDeleteDup (XactorBasePacket i,
121 var ListNode NodePtr,
122 var bit Success
123 ) {
124
125 if (i.PktCompare("=?=", NodePtr.Item)) {
126 i.SetID(NodePtr.Item.GetID());
127 NodePtr.Item.PktCopy(i); // Copy sampled packet to expected packet
128
129 if(Success == 1'b1) // check if this is not the first node deleted.
130 NodePtr.Item.PktDisplay(RTYP_XACTOR_FMWORK_DUP_WILDCARD_EXPECT_WARN,
131 "Sampled Transaction satisfies duplicated Expect"
132 );
133 trigger(ON, NodePtr.RemoveEvents[XACT_COMP_EXPECT_REMOVED_EVENT]); // Remove event
134 trigger(ON, NodePtr.RemoveEvents[XACT_COMP_EXPECT_REMOVED_BY_XACTOR_EVENT]); // Removed by xactor
135 NodePtr = NodePtr.Next;
136 Success = 1'b1;
137 if(NodePtr != null) {
138 WCDeleteDup(i,
139 NodePtr,
140 Success
141 );
142 }
143 }
144 else {
145 if(NodePtr.Next != null) {
146 WCDeleteDup(i,
147 NodePtr.Next,
148 Success
149 );
150 }
151 }
152}
153
154// Deletes multiple nodes with the specified value
155// Accepts wildcards
156task XactorListDupExpect::WildCardDelete1 (XactorBasePacket i,
157 var bit Success
158 ) {
159 Success = 1'b0;
160
161 if (Head == null) {
162 Success = 1'b0;
163 }
164 else {
165 WCDeleteDup(i,
166 Head,
167 Success
168 );
169 }
170}
171
172