Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / fnx / vlib / XactorFmwork / src / XactorBaseManager.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: XactorBaseManager.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 "XactorBaseExpectDataStruct.vrh"
37#include "XactorBasePacket.vrh"
38#include "XactorDefines.vri"
39
40#include "cReport.vrh"
41
42virtual class XactorBaseManager {
43
44 // Expect Data Structure handles
45 // This handle is used for expected values without undefined
46 // bits ('z' or 'x')
47 protected XactorBaseExpectDataStruct ExpectDataStruct;
48 // This handle is used for expected values with undefined
49 // bits ('z' or 'x')
50 protected XactorBaseExpectDataStruct XExpectDataStruct;
51
52 // Report handle.
53 ReportClass MyReport;
54
55 task new () {}
56
57 // --------------------------------------------------------------------------
58 // Expect and Drive Manager methods
59 // --------------------------------------------------------------------------
60 // Prints out pending expects. A packet has to be passed, since data structures
61 // store values in a "compressed way" and packets know how to decode that
62 // information
63 virtual task DumpExpects();
64
65 // Returns 1 if an expect with the value ExpectedPacket is pending and 0 otherwise
66 virtual function bit ExpectPending(XactorBasePacket ExpectedPacket);
67
68 // Returns 1 if the expect with the value in ExpectedPacket is removed successfully
69 // and 0 otherwise
70 virtual function bit Remove(XactorBasePacket ExpectedPacket);
71
72 // Returns the number of pending expects in all the data structures of
73 // the transactor
74 virtual function integer NumExpects();
75
76 // Removes Packet from ExpectDataStruct. Success is 1 if
77 // Packet is removed without problems and 0 otherwise
78 virtual protected task RemoveExpect(XactorBasePacket Packet,
79 var bit Success
80 );
81
82 // Same as RemoveExpect, but it will remove Packet from the XExpectDataStruct
83 virtual protected task RemoveXExpect(XactorBasePacket Packet,
84 var bit Success
85 );
86
87 // Removes Packet from ExpectDataStruct using Packet's reference. Success is 1 if
88 // Packet is removed without problems and 0 otherwise
89 virtual protected task RemoveRefExpect(XactorBasePacket Packet,
90 var bit Success
91 );
92
93 // Same as RemoveRefExpect, but it will remove Packet from the XExpectDataStruct
94 virtual protected task RemoveRefXExpect(XactorBasePacket Packet,
95 var bit Success
96 );
97
98
99 // This task will wait for a maximum of Window cycles for the ExpectedPkt to be removed from
100 // the data structures. Removed is an event variable that is triggered when ExpectedPkt is
101 // removed. TransactionRemoved will be 1 if ExpectedPkt was removed and 0 otherwise. Id is the
102 // id number of the expect transaction.
103 virtual task ExpectPkt(XactorBasePacket ExpectedPkt,
104 integer Window,
105 var bit [1:0] Status
106 );
107
108 // This task will wait for the next transaction driven by the DUT, it will then sample it and
109 // will return the values through Pkt. Window is the number of cycles that the transactor will
110 // wait before it times out.
111 virtual task SamplePkt(XactorBasePacket Pkt,
112 integer Window
113 );
114
115 // This task will be waiting for transactions coming from the DUT
116 // and match them with the pending list of expects (stored in the data structures)
117 virtual protected task ExpectConsumer();
118
119 // This task will receive DrivenPkt and will wait D clock cycles before DrivenPkt is
120 // scheduled for driving
121 virtual task DrivePkt(XactorBasePacket DrivenPkt, integer D);
122
123 // This task will disable the transactor
124 virtual task DisableManager();
125
126 // This task will enable the transactor
127 virtual task EnableManager();
128
129 // This task will empty the contents of the Drive Fifo
130 virtual protected task FlushDriveFifo();
131
132 // This task will reset the transactor
133 virtual task ResetManager();
134}
135
136
137
138