Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / fnx / vlib / FNXPCIEXactor / src / FNXPCIEXactorDenaliDevice.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: FNXPCIEXactorDenaliDevice.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 "DenaliPCIE.vri"
36
37// report library
38#include "cReport.vrh"
39#include "report_macros.vri"
40#include "FNXPCIEXactorReportMacros.vri"
41
42class FNXPCIEXactorDenaliDevice extends denaliPcieDevice {
43
44 local ReportClass Report;
45
46 // Mailboxes Enqueue Packet and Register Callbacks From Denali Xactor
47 local integer mRegCb;
48 local integer mPktCb;
49
50 local string InstanceName;
51
52 // constructor
53 task new ( ReportClass _Report,
54 string instName,
55 string cbTaskName );
56
57 // public methods
58 function ReportClass CreateReport();
59 task PushPktCbRecord( FNXPCIEXactorPktCbRecord pktCbRecord );
60 function FNXPCIEXactorPktCbRecord PopPktCbRecord();
61 task PushRegCbRecord( FNXPCIEXactorRegCbRecord regCbRecord );
62 function FNXPCIEXactorRegCbRecord PopRegCbRecord();
63 function string GetInstanceName();
64}
65
66task FNXPCIEXactorDenaliDevice::new ( ReportClass _Report,
67 string instName,
68 string cbTaskName )
69{
70 super.new( instName,
71 cbTaskName );
72 Report = _Report;
73
74 InstanceName = instName;
75
76 mPktCb = alloc( MAILBOX, 0, 1 );
77 mRegCb = alloc( MAILBOX, 0, 1 );
78}
79
80// enqueues a packet callback record
81task FNXPCIEXactorDenaliDevice::PushPktCbRecord( FNXPCIEXactorPktCbRecord pktCbRecord )
82{
83 mailbox_put( mPktCb, pktCbRecord );
84}
85
86// waits for packet callback record, dequeues and returns it
87function FNXPCIEXactorPktCbRecord FNXPCIEXactorDenaliDevice::PopPktCbRecord()
88{
89 mailbox_get( WAIT, mPktCb, PopPktCbRecord );
90}
91
92// enqueues a register callback record
93task FNXPCIEXactorDenaliDevice::PushRegCbRecord( FNXPCIEXactorRegCbRecord regCbRecord )
94{
95 mailbox_put( mRegCb, regCbRecord );
96}
97
98// waits for register callback record, dequeues and returns it
99function FNXPCIEXactorRegCbRecord FNXPCIEXactorDenaliDevice::PopRegCbRecord()
100{
101 mailbox_get( WAIT, mRegCb, PopRegCbRecord );
102}
103
104// used in exported callback processor
105function ReportClass FNXPCIEXactorDenaliDevice::CreateReport()
106{
107 CreateReport = Report;
108}
109
110// return verilog wrapper module instance name i.e. fnx_top.pcieA
111function string FNXPCIEXactorDenaliDevice::GetInstanceName()
112{
113 GetInstanceName = InstanceName;
114}