Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / env / niu / vera / niu_utils / mbox_class.vr
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: mbox_class.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
37
38
39//
40// The following are mbox_id variables to be used by either a driver module
41// or a checker. These modules will SEND appropriate tokens to this mailbox.
42// For example the mac_ipp_chkr will get its token from the system mailbox.
43// After processing the packet, this checker will send the token to the
44// mac_ipp_chkr[my_port], where my_port is the port that this checker is
45// residing on.
46class mbox_class {
47
48 integer pg_mb[16]; // Packet Generator Outgoing mailbox
49
50 integer mac_ipp[4]; // MAC-IPP checker
51
52 integer mac_opp[4]; // MAC-OPP checker
53
54 integer chk_ntx_mac[4]; // NTX-MAC checker
55
56 integer chk_opp_mac[4]; // Allocated by OPP_MAC_DRIVER
57
58 integer mac_loopback[4];
59
60 integer niu_tx_cb[4];
61 integer niu_txdrr[4];
62
63
64 integer niu_rxpath_mb [4];
65 integer niu_rxpath_sb [4];
66 integer niu_rxpath_cr;
67 integer niu_rxpath_rcr_update[32];
68
69 integer niu_pktcfglp [4]; // to be used for loopbacks through pktcfg
70
71 integer niu_rxpacket_memchk_mb;
72
73
74 // add mail box for tx dmas txc path for drr
75
76 integer tx_dma_mb[32];
77 integer rx_dma_mb[32];
78
79 // four mailboxes for the control fifo checker
80
81 integer cntl_chkr_mbox[4];
82 // mail box for checking function number in neptune
83 integer funcChk;
84
85 // adding a member global tx semaphore for random kicks
86
87 integer semphore_txpktgen_id;
88
89// The indexes to the mailboxes are set to -1. This allows driver and/or
90// checkers to determine if the mailboxes are active prior to use.
91 task new() {
92 integer n;
93
94 for(n=0;n<16;n++) {
95 pg_mb[n] = -1;
96 }
97 for(n=0;n<4;n++) {
98 niu_rxpath_mb[n] = -1;
99 niu_rxpath_sb[n] = -1;
100 niu_tx_cb[n] = -1;
101 niu_txdrr[n] = -1;
102 niu_pktcfglp[n] = -1;
103 mac_ipp[n] = -1;
104 mac_opp[n] = -1;
105 chk_ntx_mac[n] = -1;
106 chk_opp_mac[n] = -1;
107 mac_loopback[n] = -1;
108 cntl_chkr_mbox[n] = -1;
109 }
110 niu_rxpacket_memchk_mb = -1;
111 niu_rxpath_cr = -1;
112 funcChk = alloc(MAILBOX,0,1);
113 semphore_txpktgen_id = alloc(MAILBOX,0,1);
114
115
116 for(n=0;n<32;n++) {
117 tx_dma_mb[n]= - 1;
118 rx_dma_mb[n]= - 1;
119 niu_rxpath_rcr_update[n] = -1;
120 }
121
122 } // end of task
123
124}// end of class