Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / fnx / vlib / XactorFmwork / src / XactorBaseManager.vr
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T2 Processor File: XactorBaseManager.vr
// Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved
// 4150 Network Circle, Santa Clara, California 95054, U.S.A.
//
// * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// For the avoidance of doubt, and except that if any non-GPL license
// choice is available it will apply instead, Sun elects to use only
// the General Public License version 2 (GPLv2) at this time for any
// software where a choice of GPL license versions is made
// available with the language indicating that GPLv2 or any later version
// may be used, or where a choice of which version of the GPL is applied is
// otherwise unspecified.
//
// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
// CA 95054 USA or visit www.sun.com if you need additional information or
// have any questions.
//
// ========== Copyright Header End ============================================
#include <vera_defines.vrh>
#include "XactorBaseExpectDataStruct.vrh"
#include "XactorBasePacket.vrh"
#include "XactorDefines.vri"
#include "cReport.vrh"
virtual class XactorBaseManager {
// Expect Data Structure handles
// This handle is used for expected values without undefined
// bits ('z' or 'x')
protected XactorBaseExpectDataStruct ExpectDataStruct;
// This handle is used for expected values with undefined
// bits ('z' or 'x')
protected XactorBaseExpectDataStruct XExpectDataStruct;
// Report handle.
ReportClass MyReport;
task new () {}
// --------------------------------------------------------------------------
// Expect and Drive Manager methods
// --------------------------------------------------------------------------
// Prints out pending expects. A packet has to be passed, since data structures
// store values in a "compressed way" and packets know how to decode that
// information
virtual task DumpExpects();
// Returns 1 if an expect with the value ExpectedPacket is pending and 0 otherwise
virtual function bit ExpectPending(XactorBasePacket ExpectedPacket);
// Returns 1 if the expect with the value in ExpectedPacket is removed successfully
// and 0 otherwise
virtual function bit Remove(XactorBasePacket ExpectedPacket);
// Returns the number of pending expects in all the data structures of
// the transactor
virtual function integer NumExpects();
// Removes Packet from ExpectDataStruct. Success is 1 if
// Packet is removed without problems and 0 otherwise
virtual protected task RemoveExpect(XactorBasePacket Packet,
var bit Success
);
// Same as RemoveExpect, but it will remove Packet from the XExpectDataStruct
virtual protected task RemoveXExpect(XactorBasePacket Packet,
var bit Success
);
// Removes Packet from ExpectDataStruct using Packet's reference. Success is 1 if
// Packet is removed without problems and 0 otherwise
virtual protected task RemoveRefExpect(XactorBasePacket Packet,
var bit Success
);
// Same as RemoveRefExpect, but it will remove Packet from the XExpectDataStruct
virtual protected task RemoveRefXExpect(XactorBasePacket Packet,
var bit Success
);
// This task will wait for a maximum of Window cycles for the ExpectedPkt to be removed from
// the data structures. Removed is an event variable that is triggered when ExpectedPkt is
// removed. TransactionRemoved will be 1 if ExpectedPkt was removed and 0 otherwise. Id is the
// id number of the expect transaction.
virtual task ExpectPkt(XactorBasePacket ExpectedPkt,
integer Window,
var bit [1:0] Status
);
// This task will wait for the next transaction driven by the DUT, it will then sample it and
// will return the values through Pkt. Window is the number of cycles that the transactor will
// wait before it times out.
virtual task SamplePkt(XactorBasePacket Pkt,
integer Window
);
// This task will be waiting for transactions coming from the DUT
// and match them with the pending list of expects (stored in the data structures)
virtual protected task ExpectConsumer();
// This task will receive DrivenPkt and will wait D clock cycles before DrivenPkt is
// scheduled for driving
virtual task DrivePkt(XactorBasePacket DrivenPkt, integer D);
// This task will disable the transactor
virtual task DisableManager();
// This task will enable the transactor
virtual task EnableManager();
// This task will empty the contents of the Drive Fifo
virtual protected task FlushDriveFifo();
// This task will reset the transactor
virtual task ResetManager();
}